/* ==========================================================================
   1. DESIGN TOKENS
   Palette comes from the coffee plant rather than the usual cafe browns:
   unroasted bean (sage) carries structure, roast carries text,
   crema gold does emphasis, coffee cherry red appears once per page.
   ========================================================================== */

:root {
  /* Surfaces and text */
  --paper:      #FBF7F0;
  --paper-2:    #F2EBDF;
  --paper-3:    #EDE4D4;
  --ink:        #241C18;
  --ink-2:      #5F5249;
  --rule:       #DDD3C3;

  /* Accents */
  --bean:       #5E7050;
  --bean-deep:  #3D4A34;
  --bean-tint:  #E8EBE0;
  --crema:      #E9B04B;
  --crema-deep: #C98F2A;
  --cherry:     #A8332C;

  /* Type */
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ui: "Familjen Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --t-micro: 0.8125rem;
  --t-small: 0.9375rem;
  --t-body:  1.0625rem;
  --t-lead:  1.1875rem;
  --t-h3:    1.3125rem;
  --t-h2:    1.75rem;
  --t-h1:    clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);

  /* Space */
  --s1: 0.375rem;
  --s2: 0.75rem;
  --s3: 1.25rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4.5rem;

  --measure: 66ch;
  --page: 78rem;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #1A1512;
    --paper-2:    #241D18;
    --paper-3:    #2C241D;
    --ink:        #F3EADD;
    --ink-2:      #B7A796;
    --rule:       #3B3027;
    --bean:       #93A97F;
    --bean-deep:  #B6C7A2;
    --bean-tint:  #232B1E;
    --crema:      #EDBB60;
    --crema-deep: #EDBB60;
    --cherry:     #E27268;
  }
}

/* ==========================================================================
   2. RESET AND BASE
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

:focus-visible {
  outline: 3px solid var(--cherry);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3,
h4 {
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}

p,
ul,
ol {
  margin: 0 0 var(--s3);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s2) var(--s3);
  z-index: 100;
}

.skip:focus {
  left: 0;
}

.wrap {
  width: min(100% - 2.5rem, var(--page));
  margin-inline: auto;
}

.prose {
  max-width: var(--measure);
}

.prose h2 {
  font-family: var(--display);
  font-size: var(--t-h2);
  line-height: 1.15;
  margin: var(--s5) 0 var(--s2);
}

.prose h3 {
  font-size: var(--t-h3);
  font-weight: 600;
  margin: var(--s4) 0 var(--s1);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--bean);
}

.prose a:hover {
  text-decoration-color: var(--cherry);
}

.section-h {
  font-family: var(--display);
  font-size: var(--t-h2);
  line-height: 1.15;
  margin-bottom: var(--s3);
}

/* ==========================================================================
   3. MASTHEAD
   ========================================================================== */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  padding: var(--s3) 0;
}

.logo {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.logo span {
  color: var(--bean);
}

.nav {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-left: auto;
  font-size: var(--t-small);
}

.nav a {
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  border-bottom-color: var(--crema);
}

/* ==========================================================================
   4. BREADCRUMB AND RECIPE HEADER
   ========================================================================== */

.crumbs {
  font-size: var(--t-micro);
  color: var(--ink-2);
  padding: var(--s3) 0 0;
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--rule);
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.recipe-head {
  padding: var(--s4) 0 var(--s3);
}

.kicker {
  font-size: var(--t-micro);
  color: var(--bean);
  margin-bottom: var(--s2);
}

.kicker a {
  color: inherit;
}

h1 {
  font-family: var(--display);
  font-size: var(--t-h1);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 20ch;
}

.native-name {
  font-family: var(--display);
  font-style: italic;
  font-size: var(--t-lead);
  color: var(--bean);
  margin-top: var(--s1);
}

.standfirst {
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 54ch;
  margin-top: var(--s3);
}

.byline {
  font-size: var(--t-micro);
  color: var(--ink-2);
  margin-top: var(--s3);
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  align-items: center;
}

.byline time {
  font-variant-numeric: tabular-nums;
}

.byline .sep {
  color: var(--rule);
}

/* --- Rating summary shown in the byline ---------------------------------- */

.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--crema-deep);
  line-height: 1;
}

.stars svg {
  width: 15px;
  height: 15px;
  display: block;
}

.rating-summary a {
  color: inherit;
}

/* ==========================================================================
   5. HERO IMAGE
   [ADMIN] Featured image, uploaded in the content editor.
   ========================================================================== */

.hero-figure {
  margin: var(--s3) 0 var(--s5);
}

.hero-figure img {
  width: 100%;
  border-radius: var(--radius);
}

.hero-figure figcaption {
  font-size: var(--t-micro);
  color: var(--ink-2);
  margin-top: var(--s2);
  max-width: var(--measure);
}

/* ==========================================================================
   6. SPEC PANEL — the one loud element on the page
   ========================================================================== */

.spec {
  background: var(--bean-deep);
  color: #F6F2E8;
  border-radius: var(--radius);
  padding: var(--s4);
  margin: 0 0 var(--s5);
}

@media (prefers-color-scheme: dark) {
  .spec {
    background: var(--bean-tint);
    color: var(--ink);
    border: 1px solid var(--rule);
  }
}

.spec-title {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: var(--s3);
  color: var(--crema);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--s3);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: var(--s3);
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  .spec-grid {
    border-top-color: var(--rule);
  }
}

.spec-grid dt {
  font-size: var(--t-micro);
  opacity: 0.75;
  margin-bottom: 0.15rem;
}

.spec-grid dd {
  margin: 0;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.spec-grid dd small {
  font-size: 0.8125rem;
  opacity: 0.7;
}

.spec-grid .sm dd {
  font-size: 1.0625rem;
}

.spec-ratio dd {
  color: var(--crema);
}

/* ==========================================================================
   7. TWO-COLUMN: INGREDIENTS + SHOPPING LIST
   ========================================================================== */

.make-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--s5);
  align-items: start;
  margin-bottom: var(--s5);
}

@media (max-width: 54rem) {
  .make-grid {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }
}

/* --- Serving scaler ------------------------------------------------------ */

.scaler {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-bottom: var(--s3);
  font-size: var(--t-small);
}

.scaler-label {
  color: var(--ink-2);
}

.scaler-btns {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.scaler-btns button {
  font: inherit;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-right: 1px solid var(--rule);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.scaler-btns button:last-child {
  border-right: 0;
}

.scaler-btns button:hover {
  background: var(--paper-2);
}

.scaler-btns button[aria-pressed="true"] {
  background: var(--bean);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .scaler-btns button[aria-pressed="true"] {
    color: #1A1512;
  }
}

.chip {
  font: inherit;
  font-size: var(--t-small);
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--bean);
}

/* --- Ingredient list ----------------------------------------------------- */

.ing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ing-list li {
  border-bottom: 1px dotted var(--rule);
}

.ing-list label {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  padding: 0.6rem 0.25rem;
  cursor: pointer;
}

.ing-list input {
  margin-top: 0.42rem;
  accent-color: var(--bean);
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

.ing-list input:checked + .ing-text {
  color: var(--ink-2);
  text-decoration: line-through;
  text-decoration-color: var(--bean);
}

.qty {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ing-note {
  font-size: var(--t-micro);
  color: var(--ink-2);
  display: block;
}

/* --- Shopping list ------------------------------------------------------- */
/* Deliberately a different object to the ingredient list: this is the
   "what you need to buy" panel, it never lists water or ice, and every
   row is an affiliate slot managed centrally from the dashboard. */

.shop {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--crema);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: var(--s3);
  position: sticky;
  top: 5.5rem;
}

@media (max-width: 54rem) {
  .shop {
    position: static;
  }
}

.shop h2 {
  font-family: var(--display);
  font-size: 1.375rem;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.shop-intro {
  font-size: var(--t-micro);
  color: var(--ink-2);
  margin-bottom: var(--s3);
}

.shop-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s3);
}

.shop-list li {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: var(--s2);
  align-items: baseline;
  justify-content: space-between;
}

.shop-list li:last-child {
  border-bottom: 0;
}

.shop-item__name {
  font-weight: 600;
  text-decoration: none;
  text-decoration-color: var(--crema-deep);
}

.shop-item__name:hover {
  text-decoration: underline;
}

.shop-item__why {
  display: block;
  font-weight: 400;
  font-size: var(--t-micro);
  color: var(--ink-2);
  margin-top: 0.1rem;
}

.shop-item__go {
  flex: none;
  font-size: var(--t-micro);
  color: var(--bean);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.2rem 0.7rem;
}

.shop-item__go:hover {
  background: var(--bean);
  border-color: var(--bean);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .shop-item__go:hover {
    color: #1A1512;
  }
}

/* Affiliate disclaimer.
   [ADMIN] Dashboard → Shopping list → Disclaimer. Ships pre-filled with the
   Amazon Associates wording, editable as rich text, and can be switched off
   for a page that has no affiliate links on it. */
.shop-disclaimer {
  margin: 0;
  padding-top: var(--s3);
  border-top: 1px dotted var(--rule);
}

.shop-disclaimer p {
  font-size: var(--t-micro);
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
}

.shop-disclaimer p + p {
  margin-top: var(--s1);
}

/* Little "have it already" state, kept client-side only. */
.shop-list input {
  display: none;
}

/* ==========================================================================
   8. METHOD STEPS WITH IMAGES
   ========================================================================== */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

/* Default shape: step number + text, nothing else.
   A step carries no image column until a photo is uploaded for it. */
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: var(--s3);
  padding: var(--s4) 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}

/* PHP adds .has-image to a step only when that step has an uploaded photo,
   which opens the third column. Steps without one keep the shape above, so
   a half-photographed recipe still looks deliberate. */
.steps > li.has-image {
  grid-template-columns: 2.4rem minmax(0, 1fr) 14rem;
}

@media (max-width: 54rem) {
  .steps > li.has-image {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .steps .step-figure {
    grid-column: 2;
  }
}

.steps > li::before {
  content: counter(step);
  font-family: var(--display);
  font-size: 1.875rem;
  line-height: 1;
  color: var(--bean);
}

.steps h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.steps p {
  margin: 0 0 var(--s2);
  max-width: 52ch;
}

.steps p:last-child {
  margin-bottom: 0;
}

.step-figure {
  margin: 0;
}

.step-figure img {
  border-radius: var(--radius);
  width: 100%;
}

.step-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--t-micro);
  color: var(--bean);
  border: 1px dashed var(--bean);
  border-radius: 100px;
  padding: 0.15rem 0.6rem;
  margin-top: var(--s1);
}

/* ==========================================================================
   9. CALLOUT NOTE
   ========================================================================== */

.note {
  border-left: 3px solid var(--crema);
  background: var(--paper-2);
  padding: var(--s3);
  margin: var(--s4) 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: var(--measure);
}

.note p:last-child {
  margin-bottom: 0;
}

.note--warn {
  border-left-color: var(--cherry);
}

/* ==========================================================================
   10. RATE THIS RECIPE
   ========================================================================== */

.rate {
  background: var(--bean-tint);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s4);
  margin: var(--s5) 0;
  text-align: center;
}

.rate h2 {
  font-family: var(--display);
  font-size: var(--t-h2);
  margin-bottom: 0.25rem;
}

.rate p {
  color: var(--ink-2);
  font-size: var(--t-small);
  max-width: 40ch;
  margin-inline: auto;
}

.rate-stars {
  display: inline-flex;
  gap: 0.25rem;
  margin: var(--s2) 0 var(--s1);
}

.rate-stars button {
  background: none;
  border: 0;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--rule);
  line-height: 0;
  transition: transform 0.12s ease;
}

.rate-stars button svg {
  width: 34px;
  height: 34px;
  display: block;
}

.rate-stars button:hover {
  transform: scale(1.12);
}

.rate-stars button.is-lit {
  color: var(--crema-deep);
}

.rate-result {
  font-size: var(--t-small);
  color: var(--ink-2);
  min-height: 1.5em;
}

/* ==========================================================================
   11. FAQ
   ========================================================================== */

.faq {
  max-width: var(--measure);
}

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: var(--s2) 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--s1) 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--bean);
  font-size: 1.3rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: var(--s1) 0 var(--s2);
  color: var(--ink-2);
}

/* ==========================================================================
   12. RELATED CARDS
   ========================================================================== */

.related {
  margin: var(--s6) 0 0;
}

.card-grid {
  display: grid;
  /* auto-fit, not auto-fill: empty tracks would otherwise show the
     container's rule colour as a stray filled block when a row has
     fewer cards than columns. */
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.card {
  background: var(--paper);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  text-decoration: none;
}

.card:hover {
  background: var(--paper-2);
}

.card h3 {
  font-family: var(--display);
  font-size: 1.3125rem;
  line-height: 1.1;
}

.card p {
  font-size: var(--t-small);
  color: var(--ink-2);
  margin: 0;
}

.card-meta {
  margin-top: auto;
  padding-top: var(--s2);
  font-size: var(--t-micro);
  color: var(--bean);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   13. STICKY JUMP (mobile)
   ========================================================================== */

.jump {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 50;
  background: var(--cherry);
  color: #fff;
  border: 0;
  border-radius: 100px;
  font: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  box-shadow: 0 4px 14px rgba(36, 28, 24, 0.28);
  cursor: pointer;
  text-decoration: none;
}

.jump[hidden] {
  display: none;
}

@media (min-width: 54rem) {
  .jump {
    display: none;
  }
}

/* ==========================================================================
   14. FOOTER
   ========================================================================== */

.site-footer {
  margin-top: var(--s6);
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  padding: var(--s5) 0 var(--s4);
  font-size: var(--t-small);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--s4);
}

.footer-cols h2 {
  font-size: var(--t-micro);
  color: var(--ink-2);
  margin-bottom: var(--s2);
  font-weight: 600;
}

.footer-cols ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-cols li {
  margin-bottom: var(--s1);
}

.footer-cols a {
  text-decoration: none;
}

.footer-cols a:hover {
  text-decoration: underline;
}

.colophon {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: var(--t-micro);
}

/* ==========================================================================
   15. PRINT
   ========================================================================== */

@media print {
  .masthead,
  .site-footer,
  .jump,
  .scaler,
  .crumbs,
  .related,
  .rate,
  .shop-item__go {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .spec {
    background: #fff !important;
    color: #000 !important;
    border: 1.5pt solid #000;
  }

  .spec-title,
  .spec-ratio dd {
    color: #000;
  }

  .steps > li::before {
    color: #000;
  }

  .steps > li {
    grid-template-columns: 2.4rem 1fr;
    break-inside: avoid;
  }

  .step-figure {
    display: none;
  }

  .make-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   16. LISTING PAGES
   Hub, country and all-recipes views, plus the draft preview banner.
   ========================================================================== */

.hero {
  padding: var(--s6) 0 var(--s5);
  border-bottom: 1px solid var(--rule);
}

.hero h1 {
  font-size: clamp(3rem, 1.2rem + 7.5vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  max-width: 14ch;
}

.hero .standfirst {
  font-size: var(--t-lead);
  max-width: 46ch;
}

.band {
  padding: var(--s5) 0 0;
}

.band-more {
  margin-top: var(--s3);
}

.filters {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--s3);
}

.filters input[type="search"] {
  font: inherit;
  font-size: var(--t-small);
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  min-width: 15rem;
  flex: 1 1 15rem;
}

.chip[aria-pressed="true"] {
  background: var(--bean);
  border-color: var(--bean);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .chip[aria-pressed="true"] {
    color: #1A1512;
  }
}

.result-count {
  font-size: var(--t-micro);
  color: var(--ink-2);
  margin-bottom: var(--s2);
}

.make-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: var(--measure);
}

.pronounce {
  font-style: normal;
  font-family: var(--ui);
  font-size: var(--t-small);
  color: var(--ink-2);
  margin-left: 0.5rem;
}

.pronounce::before {
  content: "/";
  margin-right: 0.15rem;
}

.pronounce::after {
  content: "/";
  margin-left: 0.15rem;
}

.stars--inline {
  display: inline-flex;
  color: var(--crema-deep);
  vertical-align: -1px;
}

.card-meta .sep {
  color: var(--rule);
}

.preview-bar {
  background: var(--cherry);
  color: #fff;
  padding: var(--s2) var(--s3);
  font-size: var(--t-small);
  text-align: center;
}

.preview-bar a {
  color: #fff;
  margin-left: var(--s2);
}

/* ==========================================================================
   17. NARROW SCREENS
   The masthead is sticky, so a nav that wraps to two lines would eat a
   permanent strip of a phone screen. Scroll it sideways instead.
   ========================================================================== */

@media (max-width: 46rem) {
  .masthead-inner {
    gap: var(--s2);
    padding: var(--s2) 0;
  }

  .nav {
    margin-left: 0;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    white-space: nowrap;
  }

  /* Keep the floating button clear of the panel it points at. */
  .spec {
    scroll-margin-top: 4rem;
  }
}
