/* Give Up Drinking — 50 Ways To Leave Your Lager
   Hand-built stylesheet. No framework. */

:root {
  --paper: #f6f7f3;
  --paper-2: #ffffff;
  --ink: #1e2b2f;
  --ink-soft: #4a5a5e;
  --spruce: #1f5e58;
  --spruce-dark: #154540;
  --mist: #e2ece8;
  --line: #cbd7d3;
  --dawn: #f3c24f;
  --dawn-soft: #fbf0cc;
  --warn: #8a2d3b;
  --warn-bg: #f9eceb;
  --focus: #1f5e58;

  --font-head: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;

  --measure: 40rem;
  --wide: 68rem;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem;          /* 19px */
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--spruce); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--spruce-dark); text-decoration-thickness: 2.5px; }
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 3px solid var(--dawn);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2rem); font-weight: 650; margin-top: 2.2em; }
h3 { font-size: 1.3rem; font-weight: 650; margin-top: 1.8em; }

p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: .35em; }
strong { font-weight: 700; }

.lede { font-size: 1.3rem; line-height: 1.5; color: var(--ink-soft); max-width: 36rem; }

/* ---------- Layout ---------- */

.wrap { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }
.prose { max-width: var(--measure); }

main { padding-bottom: 4rem; }

/* ---------- Header ---------- */

.site-header {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 0;
}
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: .7rem; }
.brand:hover { color: var(--ink); }
.brand-mark {
  flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--dawn); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
}
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; line-height: 1.1; display: block; }
.brand-strap { font-size: .85rem; color: var(--ink-soft); display: block; }

.help-now {
  flex: none;
  background: var(--warn); color: #fff; text-decoration: none;
  font-weight: 700; font-size: .95rem;
  padding: .5rem .9rem; border-radius: 999px;
}
.help-now:hover { background: #6f2230; color: #fff; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; }
.site-nav li { margin: 0; }
.site-nav a {
  display: inline-block; padding: .55rem 0; color: var(--ink); text-decoration: none;
  font-size: 1rem; border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--dawn); font-weight: 700; }

.nav-desktop { border-top: 1px solid var(--mist); }
.nav-mobile { display: none; }

@media (max-width: 760px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; border-top: 1px solid var(--mist); }
  .nav-mobile summary {
    cursor: pointer; padding: .7rem 0; font-weight: 700; list-style: none;
  }
  .nav-mobile summary::-webkit-details-marker { display: none; }
  .nav-mobile summary::before { content: "+ "; color: var(--spruce); }
  .nav-mobile[open] summary::before { content: "– "; }
  .nav-mobile ul { flex-direction: column; gap: 0; padding-bottom: .8rem; }
  .brand-strap { display: none; }
  .help-now { font-size: .85rem; padding: .45rem .75rem; }
}

/* ---------- Page head ---------- */

.page-head { padding: 2.2rem 0 1.4rem; }
.breadcrumb { font-size: .95rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--ink-soft); }

.byline {
  display: flex; flex-wrap: wrap; gap: .3rem 1.2rem;
  font-size: .95rem; color: var(--ink-soft);
  border-top: 1px solid var(--line); padding-top: .8rem; margin-top: 1.5rem; max-width: var(--measure);
}

/* ---------- Ways on this page ---------- */

.toc {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: 1.5rem 0 1rem; max-width: var(--measure);
}
.toc h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { display: flex; gap: .6rem; align-items: baseline; margin-bottom: .25rem; }
.toc .n {
  flex: none; min-width: 1.9rem; text-align: center;
  font-family: var(--font-head); font-weight: 700; font-size: .85rem;
  background: var(--dawn-soft); border-radius: 999px; padding: 0 .35rem;
}

/* ---------- A way (one of the 50) ---------- */

.way {
  display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 0 1.1rem;
  max-width: calc(var(--measure) + 4.7rem);
  margin-top: 2.6rem; margin-left: -4.7rem;
  scroll-margin-top: 1rem;
}
.way-mark {
  width: 3.6rem; height: 3.6rem; border-radius: 50%;
  background: var(--dawn); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.35rem;
  box-shadow: inset 0 0 0 3px var(--paper), 0 0 0 2px var(--dawn);
  position: sticky; top: 1rem;
}
.way h2 { margin-top: .5rem; }
.way-label { display: block; font-size: .9rem; font-family: var(--font-body); font-weight: 400; color: var(--ink-soft); letter-spacing: 0; margin-bottom: .1rem; }

@media (max-width: 1100px) {
  .way { margin-left: 0; max-width: var(--measure); grid-template-columns: 2.8rem minmax(0, 1fr); gap: 0 .8rem; }
  .way-mark { width: 2.8rem; height: 2.8rem; font-size: 1.05rem; position: static; }
}

.try-this {
  border-left: 4px solid var(--dawn); background: var(--dawn-soft);
  padding: .8rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.2rem 0;
}
.try-this strong { display: block; font-family: var(--font-head); }

/* ---------- Callouts ---------- */

.callout {
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1.6rem 0;
  max-width: var(--measure);
}
.callout > :last-child { margin-bottom: 0; }
.callout h2, .callout h3 { margin-top: 0; font-size: 1.2rem; }

.callout.warn { background: var(--warn-bg); border: 2px solid var(--warn); }
.callout.warn h2, .callout.warn h3 { color: var(--warn); }

.callout.gp { background: var(--mist); border-left: 6px solid var(--spruce); }

.callout.note { background: var(--paper-2); border: 1px solid var(--line); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; max-width: var(--measure); margin: 1.2rem 0 1.6rem; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; background: var(--paper-2); }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-head); font-weight: 650; background: var(--mist); }

/* ---------- Helplines ---------- */

.lines { list-style: none; padding: 0; max-width: var(--measure); }
.lines li {
  border-bottom: 1px solid var(--line); padding: .9rem 0; margin: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; align-items: baseline;
}
.lines .who { font-weight: 700; }
.lines .num { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.lines .num a { text-decoration: none; }
.lines .what { grid-column: 1 / -1; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Home ---------- */

.hero { padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.2rem); max-width: 14ch; margin-bottom: .4em; }
.hero .lede { font-size: clamp(1.2rem, 2.4vw, 1.45rem); }

.trail-block { margin: 2.2rem 0 1rem; }
.trail-block h2 { font-size: 1.25rem; margin: 0 0 .3rem; }
.trail-block p { color: var(--ink-soft); font-size: 1rem; margin-bottom: 1rem; }

.trail {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: .55rem .45rem; align-items: center;
}
.trail li { margin: 0; display: flex; align-items: center; }
.trail li + li::before {
  content: ""; width: .7rem; height: 2px; background: var(--line); margin-right: .45rem;
}
.trail a {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  text-decoration: none; color: var(--ink);
  background: var(--paper-2); border: 2px solid var(--spruce);
  transition: background .15s, transform .15s;
}
.trail a:hover, .trail a:focus-visible { background: var(--dawn); border-color: var(--dawn); transform: scale(1.12); }
.trail .g2 a { border-color: #3f7d63; }
.trail .g3 a { border-color: var(--warn); }
.trail .g4 a { border-color: #b08a2a; }
.trail .g5 a { border-color: #5a6f9a; }

.trail-key { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .9rem; color: var(--ink-soft); margin-top: 1rem; padding: 0; list-style: none; }
.trail-key li { display: flex; align-items: center; gap: .4rem; margin: 0; }
.trail-key span { width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--spruce); display: inline-block; }
.trail-key .k2 { border-color: #3f7d63; } .trail-key .k3 { border-color: var(--warn); }
.trail-key .k4 { border-color: #b08a2a; } .trail-key .k5 { border-color: #5a6f9a; }

@media (prefers-reduced-motion: reduce) {
  .trail a { transition: none; }
  .trail a:hover { transform: none; }
}

.paths { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0; max-width: 46rem; border-top: 1px solid var(--line); }
.paths li { margin: 0; border-bottom: 1px solid var(--line); }
.paths a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; align-items: center;
  padding: 1.1rem .2rem; text-decoration: none; color: var(--ink);
}
.paths a:hover { background: var(--paper-2); }
.paths .q { font-family: var(--font-head); font-weight: 650; font-size: 1.35rem; }
.paths .a { grid-column: 1; color: var(--ink-soft); font-size: 1rem; }
.paths .go { grid-row: 1 / span 2; grid-column: 2; font-size: 1.6rem; color: var(--spruce); }

.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 40rem) minmax(0, 22rem); gap: 4rem; } }

.author-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; align-self: start; }
.author-card img { width: 6rem; height: 6rem; border-radius: 50%; object-fit: cover; background: var(--mist); margin-bottom: .8rem; }
.author-card p { font-size: 1rem; }

/* ---------- Page end ---------- */

.related { margin-top: 3rem; max-width: var(--measure); border-top: 2px solid var(--ink); padding-top: 1rem; }
.related h2 { font-size: 1.2rem; margin-top: 0; }
.related ul { padding-left: 1.1rem; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; max-width: var(--measure); }
.pager a { display: block; text-decoration: none; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); max-width: 48%; }
.pager small { display: block; color: var(--ink-soft); }
.pager .next { margin-left: auto; text-align: right; }
@media (max-width: 600px) { .pager a { max-width: 100%; width: 100%; } .pager .next { text-align: left; } }

/* ---------- Checklist page ---------- */

.checklist { list-style: none; padding: 0; columns: 2 20rem; column-gap: 3rem; }
.checklist li { break-inside: avoid; display: grid; grid-template-columns: 1.4rem 2rem minmax(0, 1fr); gap: .4rem; align-items: baseline; margin-bottom: .55rem; }
.checklist .box { width: 1.05rem; height: 1.05rem; border: 2px solid var(--ink); border-radius: 3px; display: inline-block; transform: translateY(.15em); }
.checklist .n { font-family: var(--font-head); font-weight: 700; color: var(--spruce); }
.checklist h3 { grid-column: 1 / -1; }

.print-btn { font: inherit; font-weight: 700; background: var(--spruce); color: #fff; border: 0; border-radius: 999px; padding: .6rem 1.2rem; cursor: pointer; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: #e8eeec; padding: 2.5rem 0 2rem; font-size: 1rem; }
.site-footer a { color: #fff; }
.site-footer h2 { color: #fff; font-size: 1.2rem; margin: 0 0 .6rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .footer-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 4rem; } }

.crisis { border: 2px solid var(--dawn); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.crisis ul { list-style: none; padding: 0; margin: 0; }
.crisis li { margin-bottom: .45rem; }
.crisis strong { color: var(--dawn); }

.footer-links { list-style: none; padding: 0; margin: 0 0 1rem; columns: 2; }
.footer-small { color: #b9c6c3; font-size: .9rem; margin-top: 1.5rem; border-top: 1px solid #3a494d; padding-top: 1rem; }

/* ---------- Print ---------- */

@media print {
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .pager, .related, .print-btn, .breadcrumb, .help-now, .no-print { display: none !important; }
  a { color: #000; text-decoration: none; }
  .checklist { columns: 2; }
  .page-head { padding-top: 0; }
}

/* Hide alt text box until the photo is uploaded */
.author-card img, main img { color: transparent; font-size: 0; }
