/* Shared layout adjustments for the product and marketing pages. */
:root {
  --page-gutter: clamp(16px, 4vw, 56px);
}

.container {
  width: min(1280px, calc(100% - var(--page-gutter) - var(--page-gutter)));
}

:where(.hero-grid, .essence-grid, .health-slide, .garden-header,
  .garden-gallery, .planting-head, .garden-product-story, .product-grid,
  .poster-grid, .craft-head, .lifestyle-grid, .about-grid, .journal-grid,
  .marketing-teaser-grid, .faq-grid, .footer-main, .plan-hero-grid,
  .plan-document-grid) > * {
  min-width: 0;
}

:where(h1, h2, h3, h4, p, li, dd, figcaption, .text-link) {
  overflow-wrap: anywhere;
}

.button {
  max-width: 100%;
  text-align: center;
}

.button > span, .plan-topic-toggle > span {
  min-width: 0;
}

.site-dialog {
  max-width: calc(100% - 24px);
}

/* Switch navigation before the desktop links become crowded. */
@media (max-width: 1100px) {
  :root {
    --header: calc(88px + env(safe-area-inset-top, 0px));
  }

  .container {
    width: auto;
    margin-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
    margin-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
  }

  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .header-inner {
    height: calc(var(--header) - env(safe-area-inset-top, 0px));
    gap: 16px;
  }

  .brand-link { width: 80px; }
  .brand-link img { height: 70px; }
  .header-actions { margin-left: auto; gap: 12px; }
  .header-login { min-height: 44px; font-size: 13px; }
  .header-login .login-secondary { display: none; }
  .language-switch { gap: 2px; font-size: 12px; }
  .language-switch button { min-width: 44px; min-height: 44px; padding: 10px 6px; }
  .menu-toggle { display: flex; width: 44px; height: 44px; flex-shrink: 0; }

  .site-header .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--header) - 1px);
    margin: 0;
    padding: 16px max(var(--page-gutter), env(safe-area-inset-right, 0px))
      22px max(var(--page-gutter), env(safe-area-inset-left, 0px));
    max-height: calc(100vh - var(--header) - 16px);
    max-height: calc(100dvh - var(--header) - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #000;
    border-bottom: 1px solid var(--gold);
    box-shadow: 0 24px 40px rgba(0, 0, 0, .8);
  }

  .site-header .nav-links.is-open { display: flex; }
  .site-header .nav-links > a { min-height: 48px; padding: 12px 0; font-size: 15px; white-space: normal; }
  .plan-topic-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablet layouts retain generous reading width. */
@media (max-width: 960px) {
  .hero { min-height: 0; }
  .hero-grid, .essence-grid, .product-grid, .poster-grid, .lifestyle-grid,
  .about-grid, .faq-grid, .marketing-teaser-grid, .plan-hero-grid,
  .garden-header, .garden-gallery, .planting-head, .garden-product-story {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .hero-grid { display: grid; padding-block: 48px 64px; }
  .hero-copy { width: 100%; max-width: 700px; }
  .hero h1 { font-size: clamp(34px, 5.6vw, 52px); }
  .hero-description { max-width: 620px; font-size: 15px; }
  .hero-visual {
    width: 100%;
    max-width: 700px;
    min-height: 0;
    aspect-ratio: 3 / 2;
    margin: 0 auto;
    justify-self: center;
  }

  .hero-product { width: 100%; max-width: 100%; }
  .essence-head, .health-header, .journal-head { display: block; }
  .essence-head .body-copy, .health-header .body-copy, .journal-head .body-copy {
    width: 100%; max-width: 680px; margin-top: 20px; font-size: 15px;
  }

  .essence-image, .product-gallery, .poster-figure, .lifestyle-figure {
    width: 100%; max-width: 680px; margin-inline: auto;
  }
  .product-gallery { position: static; }
  .health-slide { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px; min-height: 0; }
  .health-visual { width: 100%; max-width: 640px; margin-inline: auto; }
  .health-copy { min-height: 0; }
  .health-body { font-size: 15px; }
  .health-limit { font-size: 12px; }
  .garden-figure-secondary { margin-top: 0; }
  .garden-product-story { margin-top: 48px; padding-top: 48px; }
  .cultivation-grid, .craft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { gap: 76px; }
  .plan-hero-grid { gap: 36px; }
  .plan-hero-description { max-width: 680px; font-size: 15px; }
  .plan-cover { width: 100%; max-width: 680px; justify-self: center; }
  .plan-document-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .plan-document-grid > div:last-child { align-items: flex-start; }
}

/* Phone reading sizes and touch controls, shared by both languages. */
@media (max-width: 780px) {
  html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .section { padding-block: 60px; }
  .display { font-size: clamp(28px, 7vw, 40px); }
  .eyebrow, .hero .eyebrow { font-size: 11px; }
  .body-copy, .hero-description, html[lang=en] .hero-description,
  .ingredient-row p, .health-body, .nature-copy p.body-copy,
  .garden-header .body-copy, .planting-head .body-copy,
  .cultivation-step p, .garden-product-copy .body-copy,
  .product-intro, .care-item p, .label-panel p, .poster-copy .body-copy,
  .craft-head p.body-copy, .craft-item p, .marketing-teaser .body-copy,
  .lifestyle-copy .body-copy, .about-copy .body-copy,
  .story-card p.story-summary, .member-copy, .faq-head .body-copy,
  .faq-item > p, .dialog-content p {
    font-size: 15px;
    line-height: 1.95;
  }

  .small-note, .hero-footnote, .gallery-caption, .weight-note,
  .ingredient-note, .health-limit, .health-scope, .health-illustration,
  .health-hint, .garden-image-note, .cultivation-source, .craft-source,
  .craft-scope, .poster-note, .poster-figure figcaption,
  .lifestyle-figure figcaption, .marketing-teaser .small-note,
  .product-actions > .small-note, .journal-note, .member-url,
  .member-external, .footer-disclaimer p, .sources-content,
  .image-dialog .dialog-content p {
    font-size: 12px;
    line-height: 1.85;
  }

  .hero-facts { gap: 12px; }
  .hero-fact { padding-left: 12px; }
  .hero-fact > span, html[lang=en] .hero-fact > span { font-size: 11px; }
  .hero-fact strong { font-size: 18px; }
  .text-link { min-height: 44px; font-size: 14px; }
  .hero .text-link, .hero-buttons .text-link { font-size: 14px; }
  .hero .button, .marketing-teaser-actions .button { min-height: 48px; font-size: 14px; }
  .ingredient-row h3, .craft-item h3, .cultivation-step h4 { font-size: 18px; }
  .health-copy, html[lang=en] .health-copy { min-height: 0; }
  .health-evidence, .health-compound-label, .health-references { font-size: 11px; }
  .health-compound-value { font-size: 14px; }
  .health-control-buttons { gap: 8px; }
  .health-controls .icon-button { width: 44px; height: 44px; }
  .health-rotation { min-height: 44px; font-size: 12px; }
  .garden-shortcuts { gap: 12px 24px; }
  .garden-shortcuts .text-link, .garden-figure figcaption,
  .garden-product-figure figcaption { font-size: 13px; }
  .product-heading { font-size: clamp(48px, 11vw, 76px); }
  .product-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .product-tabs > button { min-height: 48px; padding: 10px 4px; font-size: 13px; white-space: normal; }
  .spec-list > div { grid-template-columns: minmax(88px, .8fr) minmax(0, 1.2fr); gap: 16px; font-size: 14px; }
  .product-tabpanel { min-height: 0; }
  .product-actions .button { min-height: 52px; font-size: 15px; }
  .marketing-teaser-actions .text-link { font-size: 14px; }
  .journal-grid { grid-template-columns: minmax(0, 1fr); }
  .story-card .text-link { min-height: 44px; font-size: 14px; width: fit-content; }
  .story-tag { font-size: 11px; }
  .member .button { min-height: 52px; font-size: 15px; }
  .faq-item > summary, .sources-details > summary { min-height: 48px; font-size: 15px; }
  .footer-brand { flex-wrap: wrap; gap: 16px; }
  .footer-tagline { max-width: 240px; font-size: 13px; }
  .footer-col h3 { font-size: 13px; }
  .footer-col a, .footer-col button { min-height: 44px; font-size: 14px; }
  .site-footer { padding-bottom: 30px; }
  .footer-controls .icon-button, .dialog-close { width: 44px; height: 44px; }
  .copyright { font-size: 11px; }
  .mobile-bar {
    padding: 10px max(16px, env(safe-area-inset-right, 0px))
      max(10px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
    gap: 10px;
  }
  .mobile-bar .button { min-height: 48px; font-size: 13px; }

  .plan-hero { padding-block: 36px; }
  .plan-hero h1 { font-size: clamp(30px, 7vw, 42px); }
  .plan-hero-description, .plan-topic-description { font-size: 15px; line-height: 1.95; }
  .plan-hero-actions .button { min-height: 48px; font-size: 14px; }
  .plan-hero-actions .text-link, .plan-reader-heading .text-link { font-size: 14px; }
  .plan-source-note, .plan-source-note p + p { font-size: 12px; line-height: 1.9; }
  .plan-cover figcaption, .plan-cover-badge, .plan-cover-footer { font-size: 12px; }
  .plan-cover-footer { flex-wrap: wrap; gap: 6px 16px; }
  .plan-facts span { font-size: 12px; }
  .plan-facts > div { min-width: 0; }
  .plan-catalog-intro { font-size: 14px; }
  .plan-topic-toggle { min-height: 80px; font-size: 12px; padding: 16px; }
  .plan-topic-toggle strong { font-size: 16px; }
  .plan-topic-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-topic-tab { min-height: 124px; padding: 14px; }
  .plan-topic-tab > span:nth-child(2) { font-size: 14px; }
  .plan-topic-tab small { font-size: 12px; }
  .plan-topic-heading { flex-wrap: wrap; gap: 8px; }
  .plan-panel-index { font-size: 12px; }
  .plan-back-topics { min-height: 44px; margin-left: auto; font-size: 12px; }
  .plan-reading-area { padding: 24px 18px; }
  .plan-topic-title { font-size: clamp(24px, 6vw, 30px); }
  .plan-topic-note, .plan-metric p, .plan-monthly p,
  .plan-verification-note, .plan-document-grid p, .plan-document-grid .plan-footer-note {
    font-size: 13px; line-height: 1.95;
  }
  .plan-metric { padding: 22px; }
  .plan-metric > strong { font-size: clamp(44px, 10vw, 68px); }
  .plan-metric > strong span { font-size: .42em; }
  .plan-metric > span { font-size: 20px; }
  .plan-table-wrap { width: 100%; overscroll-behavior-x: contain; }
  .plan-table-wrap table { font-size: 15px; white-space: normal; }
  .plan-table-wrap th, .plan-table-wrap td { padding: 13px 14px; }
  .plan-table-wrap tbody th, .plan-table-wrap td { white-space: nowrap; }
  .plan-table-wrap thead th, .plan-table-wrap caption { font-size: 13px; }
  .plan-table-wrap[data-columns="3"] table { min-width: 380px; }
  .plan-table-wrap[data-columns="4"] table { min-width: 520px; }
  .plan-table-wrap[data-columns="5"] table { min-width: 600px; }
  .plan-table-hint { font-size: 12px; color: var(--gold); line-height: 1.8; }
  .plan-balance-points { grid-template-columns: minmax(0, 1fr); }
  .plan-balance-points > div {
    min-width: 0; font-size: 13px; padding: 16px;
    display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr);
    align-items: center; gap: 6px 12px;
  }
  .plan-balance-points strong { font-size: clamp(25px, 6vw, 32px); text-align: right; margin: 0; }
  .plan-balance-points p { grid-column: 1 / -1; font-size: 12px; margin-top: 0; }
  .plan-original-heading { flex-wrap: wrap; gap: 6px 12px; }
  .plan-original-heading h3, .plan-original-heading > span { font-size: 13px; }
  .plan-page-button { min-width: 48px; min-height: 48px; font-size: 13px; }
  .plan-image-actions .text-link { min-height: 44px; font-size: 13px; }
  .plan-document-grid .button { min-height: 50px; font-size: 14px; }
  .plan-document-grid .text-link, .plan-footer .text-link { font-size: 13px; }
  .plan-footer { padding-bottom: 28px; }
  .plan-footer p { font-size: 12px; }
}

@media (max-width: 600px) {
  :root {
    --page-gutter: 16px;
    --header: calc(76px + env(safe-area-inset-top, 0px));
  }

  .header-inner { gap: 8px; }
  .brand-link { width: 64px; }
  .brand-link img { height: 58px; }
  .header-actions { gap: 6px; }
  .header-login { padding-inline: 10px; gap: 7px; }
  .header-login svg { display: none; }
  .language-switch { gap: 0; }
  .hero-grid { gap: 20px; padding-top: 36px; }
  .hero h1 { font-size: clamp(30px, 7.8vw, 42px); }
  .hero-buttons, .marketing-teaser-actions, .plan-hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-buttons .button, .hero-buttons .text-link,
  .marketing-teaser-actions .button, .marketing-teaser-actions .text-link,
  .plan-hero-actions .button, .plan-hero-actions .text-link {
    justify-content: center; width: 100%;
  }
  .hero-visual-label { font-size: 9px; }
  .hero-side-note { font-size: 13px; }
  .hero-facts { gap: 10px; }
  .hero-fact { padding-left: 10px; }
  .hero-fact strong { font-size: 16px; }
  .health-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-tabs > button { flex-direction: row; gap: 8px; padding: 13px 8px; font-size: 13px; min-height: 52px; }
  .health-tabs > button:nth-child(2) { border-right: 0; }
  .health-tabs > button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .health-slide { padding: 22px 16px; }
  .health-controls { flex-wrap: wrap; justify-content: center; padding: 14px 12px; }
  .health-control-buttons { width: 100%; justify-content: space-between; }
  .health-rotation { min-width: 132px; }
  .cultivation-grid, .craft-grid { grid-template-columns: minmax(0, 1fr); }
  .cultivation-step { padding-top: 20px; }
  .story-card { display: flex; gap: 0; }
  .story-image { height: auto; max-height: none; aspect-ratio: 16 / 10; }
  .story-tag { margin-top: 18px; }
  .story-card h3 { font-size: 22px; }
  .gallery-thumbs { justify-content: center; }
  .product-subheading { font-size: 23px; }
  .member .button { width: 100%; gap: 16px; }
  .dialog-content { padding-inline: 20px; }
  .plan-cover { padding: 12px; }
  .plan-cover figcaption { flex-wrap: wrap; gap: 8px; }
  .plan-facts { gap: 12px; }
  .plan-facts > div { padding-left: 12px; }
  .plan-topic-tabs { padding: 10px; gap: 8px; }
  .plan-topic-tab { padding: 12px; }
  .plan-reading-area { padding: 20px 14px; }
  .plan-page-navigation { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 10px; }
  .plan-page-button { width: 48px; height: 48px; padding: 10px; }
  .plan-page-button > span { display: none; }
  #plan-page-indicator { text-align: center; font-size: 12px; }
  .plan-image-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .plan-image-actions .text-link { width: 100%; justify-content: space-between; margin: 0; }
  .plan-document-grid > div:last-child, .plan-document-grid .button { width: 100%; }
  .plan-footer .container { align-items: flex-start; gap: 12px; }
  html[lang=en] .hero h1 { font-size: clamp(42px, 11vw, 60px); }
  html[lang=en] .display { font-size: clamp(36px, 10vw, 50px); }
  html[lang=en] .nature-copy .display { font-size: clamp(42px, 12vw, 64px); }
  html[lang=en] .plan-hero h1 { font-size: clamp(42px, 11vw, 58px); }
  html[lang=en] .plan-topic-title { font-size: clamp(32px, 9vw, 42px); }
}

@media (max-width: 1100px) and (max-height: 500px) and (orientation: landscape) {
  :root { --header: calc(68px + env(safe-area-inset-top, 0px)); }
  .brand-link img { height: 56px; }
  .site-header .nav-links > a { min-height: 44px; padding-block: 8px; }
}

@media (hover: none) {
  .button:hover { transform: none; }
  .text-link:hover { gap: 14px; }
}
