/* Magnivé landing — secondary pages (Journal, articles, Contact, legal).
   Tokens, header, footer, buttons and focus styles come from chrome.css.
   Loaded AFTER chrome.css and (on articles) after the legacy article CSS. */

*, *::before, *::after { box-sizing: border-box; }
/* Inner pages use a lighter, warmer ivory than the home page's cream sections (matches the approved page mockups). */
body.mg-page { --mg-page: #FAF3E7; --mg-text: #55503F; --mg-text-muted: #6B6450; margin: 0; background: #FAF3E7 linear-gradient(180deg, #FCF8EE 0%, #FAF3E7 40%, #F9F1E3 100%); background-attachment: scroll; color: var(--mg-emerald); font-family: var(--mg-sans); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
.mg-page h1, .mg-page h2, .mg-page h3, .mg-page p { margin: 0; }
.mg-page img { max-width: 100%; }

/* ---------- Shared layout ---------- */
.pg-wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4.5vw, 56px); }
.pg-eyebrow { font: 500 11.5px/1 var(--mg-sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--mg-bronze); margin-bottom: 20px; }
.pg-hero { position: relative; text-align: center; padding: clamp(56px, 8vw, 104px) 0 clamp(36px, 5vw, 64px); }
.pg-hero h1 { font: 400 clamp(40px, 5.4vw, 62px)/1.12 var(--mg-serif); letter-spacing: -0.005em; text-wrap: balance; }
.pg-hero .pg-lede { font: 400 17px/1.7 var(--mg-sans); color: var(--mg-ink-muted); max-width: 600px; margin: 22px auto 0; text-wrap: pretty; }
.pg-sprig { position: absolute; pointer-events: none; opacity: 0.55; }
a.pg-link { color: var(--mg-emerald); text-decoration: none; border-bottom: 1px solid var(--mg-bronze); padding-bottom: 2px; transition: color .2s ease; }
a.pg-link:hover { color: var(--mg-bronze); }
.mg-page :focus-visible { outline: 2px solid var(--mg-emerald); outline-offset: 3px; }

/* ---------- Journal ---------- */
.journal-hero { overflow: hidden; padding-bottom: 0; background: linear-gradient(180deg, #F8F1E4 0%, #FAF3E7 100%); }
.journal-hero .pg-hero-copy { max-width: 700px; margin: 0 auto; position: relative; z-index: 1; padding-bottom: clamp(32px, 4vw, 52px); }
.jh-floral { position: absolute; top: 0; right: 0; bottom: 0; width: min(26%, 380px); pointer-events: none; }
.jh-floral img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%;
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent 100%); mask-image: linear-gradient(to left, #000 35%, transparent 100%); opacity: .95; }
.jf-pills { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 14px; padding: 0 0 clamp(34px, 4vw, 48px); max-width: 1100px; margin: 0 auto; }
.jf-pill { font: 400 15px/1 var(--mg-sans); color: var(--mg-text); background: rgba(255,255,255,.5); border: 1px solid rgba(8,46,31,.14); padding: 16px 22px; cursor: pointer; border-radius: 0; transition: background .2s ease, border-color .2s ease; }
.jf-pill:hover { border-color: var(--mg-gold); }
.jf-pill[aria-pressed="true"] { background: var(--mg-cta); border-color: var(--mg-cta); color: var(--mg-emerald); }
.jf-empty { max-width: 1100px; margin: 0 auto; padding: 8px 0 72px; font: 400 17px/1.7 var(--mg-sans); color: var(--mg-text); }
.journal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px 32px; padding: 8px 0 clamp(72px, 9vw, 112px); max-width: 1100px; margin: 0 auto; }
.jcard { display: flex; flex-direction: column; }
.jcard[hidden] { display: none; }
.jcard-media { display: block; aspect-ratio: 1.22 / 1; overflow: hidden; background: var(--mg-ivory); margin-bottom: 24px; }
.jcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jcard-cat { font: 500 11px/1.3 var(--mg-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mg-bronze); margin-bottom: 12px; }
.jcard h2 { font: 400 clamp(25px, 2.3vw, 29px)/1.22 var(--mg-serif); margin-bottom: 14px; text-wrap: balance; }
.jcard h2 a { color: inherit; text-decoration: none; }
.jcard h2 a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.jcard-desc { font: 400 15px/1.65 var(--mg-sans); color: var(--mg-text); margin-bottom: 22px; }
.jcard-foot { margin-top: auto; display: flex; align-items: center; gap: 16px; }
.jcard-meta { display: none; }
.jcard-link { font: 500 11.5px/1 var(--mg-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mg-emerald); text-decoration: none; border-bottom: 1px solid var(--mg-gold); padding: 8px 0 9px; transition: color .2s ease; }
.jcard-link::after { content: " \2192"; }
.jcard-link:hover { color: var(--mg-bronze); }
@media (prefers-reduced-motion: no-preference) {
  .jcard-media img { transition: transform .6s ease; }
  .jcard:hover .jcard-media img { transform: scale(1.035); }
}
@media (max-width: 1000px) { .journal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .jh-floral { position: relative; width: 100%; height: 150px; margin-top: 4px; }
  .jh-floral img { -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); }
  .jf-pills { padding-top: 24px; }
}
@media (max-width: 620px) { .journal-grid { grid-template-columns: 1fr; gap: 48px; } .jf-pill { padding: 14px 16px; font-size: 14px; } }

/* ---------- Article pages (layered over the legacy article CSS) ---------- */
.article-hero { background: transparent !important; }
.article-hero::before, .article-hero::after { display: none !important; }
.article-back { display: inline-block; font: 500 11.5px/1 var(--mg-sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--mg-emerald) !important; text-decoration: none !important; border-bottom: 1px solid var(--mg-bronze); padding-bottom: 4px; margin-bottom: 28px; }
.article-back:hover { color: var(--mg-bronze) !important; }
.article-hero h1 { font-weight: 400 !important; }
.article-body p, .article-body li { font-weight: 400 !important; line-height: 1.8 !important; font-size: 17px !important; }
.article-wrap { max-width: 740px !important; }
.related { background: var(--mg-ivory) !important; }

/* ---------- Contact ---------- */
.contact-hero { padding: 0; overflow: visible; }
.contact-band { position: relative; background: linear-gradient(90deg, #DCC9B8 0%, #E6D8C8 28%, #F1E8D9 50%, #F7F0E3 70%, #F7F0E3 100%); padding: clamp(48px, 6vw, 76px) 0 clamp(150px, 15vw, 190px); }
.contact-band::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 46%; background: url("/images/leaf-shadow.svg") left top / 460px auto no-repeat; opacity: .5; transform: scaleX(-1) translateX(52%); pointer-events: none; mix-blend-mode: multiply; }
.contact-band .pg-lede { color: var(--mg-text); max-width: 760px; }
.contact-floral { position: absolute; top: 0; right: 0; bottom: 0; width: min(24%, 330px); pointer-events: none; }
.contact-floral img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 30%; -webkit-mask-image: linear-gradient(to left, #000 40%, transparent 100%); mask-image: linear-gradient(to left, #000 40%, transparent 100%); }
.contact-band .pg-wrap { position: relative; z-index: 1; }
.cc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 760px; margin: calc(-1 * clamp(104px, 11vw, 140px)) auto 0; position: relative; z-index: 2; }
.cc-card { background: #fff; border: 1px solid rgba(8,46,31,.08); box-shadow: 0 10px 30px rgba(8,46,31,.06); padding: 32px 24px 30px; text-align: center; }
.cc-icon { width: 30px; height: 30px; margin: 0 auto 16px; color: var(--mg-bronze); }
.cc-label { font: 500 23px/1.2 var(--mg-serif); letter-spacing: 0; text-transform: none; color: var(--mg-emerald); margin-bottom: 10px; }
.cc-value { font: 400 15.5px/1.4 var(--mg-sans); }
.cc-value a { color: var(--mg-bronze); text-decoration: none; border-bottom: 1px solid var(--mg-gold); }
.cc-value a:hover { color: var(--mg-emerald); }
.cc-note { font: 400 13px/1.5 var(--mg-sans); color: var(--mg-text-muted); margin-top: 14px; }
.pg-divider { display: flex; align-items: center; gap: 18px; max-width: 1100px; margin: clamp(44px, 6vw, 72px) auto; }
.pg-divider::before, .pg-divider::after { content: ""; flex: 1; height: 1px; background: rgba(8,46,31,.16); }
.pg-divider img { width: 26px; height: 26px; opacity: .85; }
.cf-split { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: stretch; padding-bottom: clamp(72px, 9vw, 112px); max-width: 1100px; margin: 0 auto; }
.cf-panel { background: rgba(255,255,255,.35); border: 1px solid rgba(8,46,31,.12); padding: clamp(26px, 4vw, 40px); }
.cf-panel h2 { font: 400 clamp(32px, 3.4vw, 42px)/1.15 var(--mg-serif); margin-bottom: 12px; }
.cf-panel > p { font: 400 15.5px/1.65 var(--mg-sans); color: var(--mg-text); margin-bottom: 28px; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cf-field { margin-bottom: 20px; }
.cf-field label { display: block; font: 600 18px/1.2 var(--mg-serif); letter-spacing: 0; text-transform: none; color: var(--mg-emerald); margin-bottom: 8px; }
.cf-field input, .cf-field select, .cf-field textarea { width: 100%; padding: 14px 16px; border: 1px solid rgba(8,46,31,.14); border-radius: 0; background: #F3ECDC; color: var(--mg-emerald); font: 400 16px/1.4 var(--mg-sans); appearance: none; -webkit-appearance: none; }
.cf-field ::placeholder { color: var(--mg-text-muted); opacity: 1; }
.cf-field textarea { min-height: 150px; resize: vertical; }
.cf-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23082E1F' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.cf-field input:focus-visible, .cf-field select:focus-visible, .cf-field textarea:focus-visible { outline: 2px solid var(--mg-emerald); outline-offset: 1px; border-color: var(--mg-emerald); }
.cf-field [aria-invalid="true"] { border-color: var(--mg-error); }
.cf-error { display: none; font: 500 13.5px/1.4 var(--mg-sans); color: var(--mg-error); margin-top: 6px; }
.cf-field [aria-invalid="true"] ~ .cf-error { display: block; }
.cf-honey { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cf-sent { background: var(--mg-white); border: 1px solid var(--mg-emerald); padding: 18px 20px; margin-bottom: 24px; font: 400 15.5px/1.6 var(--mg-sans); }
.cf-sent[hidden] { display: none; }
.cf-panel .mg-btn { width: 100%; justify-content: center; background: var(--mg-velvet), var(--mg-emerald); color: var(--mg-ivory); border-color: var(--mg-emerald); }
.cf-panel .mg-btn:hover { filter: brightness(1.18); }
.cf-photo { position: relative; min-height: 360px; overflow: hidden; background: var(--mg-ivory); }
.cf-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 18% 50%; }
@media (max-width: 860px) {
  .cf-split { grid-template-columns: 1fr; }
  .cf-photo { min-height: 0; aspect-ratio: 4 / 3; }
  .contact-floral { width: 38%; opacity: .8; }
}
@media (max-width: 640px) { .cc-grid { grid-template-columns: 1fr; } .cf-row { grid-template-columns: 1fr; gap: 0; } .contact-floral { display: none; } .contact-band::before { width: 70%; } }

/* ---------- Legal pages ---------- */
.legal-hero { position: relative; overflow: hidden; padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(28px, 4vw, 44px); }
.legal-hero::before { content: ""; position: absolute; left: 0; top: 0; width: min(44%, 520px); height: min(100%, 520px); background: url("/images/leaf-shadow.svg") left top / contain no-repeat; opacity: .8; pointer-events: none; mix-blend-mode: multiply; -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%), linear-gradient(to right, #000 45%, transparent 100%); -webkit-mask-composite: source-in; mask-image: linear-gradient(to bottom, #000 45%, transparent 100%), linear-gradient(to right, #000 45%, transparent 100%); mask-composite: intersect; }
.legal-hero .pg-wrap { position: relative; }
.legal-hero h1 { font-size: clamp(38px, 4.8vw, 58px); }
.legal-date { font: 400 14px/1.5 var(--mg-sans); color: var(--mg-emerald); letter-spacing: 0; margin-top: 20px; }
.legal-summary { max-width: 900px; margin: 34px auto 0; text-align: left; background: rgba(255,255,255,.4); border: 1px solid rgba(8,46,31,.12); padding: 26px clamp(24px, 8%, 80px); }
.legal-summary p { font: 400 17px/1.7 var(--mg-sans); color: var(--mg-text); }
.legal-summary strong { color: var(--mg-emerald); font-weight: 500; }
.legal-layout { display: grid; grid-template-columns: 250px minmax(0, 640px); gap: clamp(40px, 5vw, 72px); justify-content: center; padding: 24px 0 clamp(72px, 9vw, 112px); max-width: 1000px; margin: 0 auto; }
.legal-toc { position: sticky; top: calc(var(--mg-header-h) + 24px); align-self: start; max-height: calc(100vh - var(--mg-header-h) - 48px); overflow: auto; padding-top: 6px; }
.legal-toc summary { list-style: none; font: 500 11px/1 var(--mg-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--mg-bronze); cursor: default; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; }
.legal-toc li { margin: 0; }
.legal-toc a { display: block; padding: 8px 0 8px 18px; border-left: 3px solid transparent; font: 400 15px/1.4 var(--mg-sans); color: var(--mg-text-muted); text-decoration: none; }
.legal-toc a:hover { color: var(--mg-emerald); }
.legal-toc a[aria-current="true"] { border-left-color: var(--mg-gold); color: var(--mg-emerald); font-weight: 500; }
.legal-toc a:focus-visible { outline: 2px solid var(--mg-emerald); outline-offset: 2px; }
.legal-body { min-width: 0; font: 400 16.5px/1.78 var(--mg-sans); color: var(--mg-text); }
.legal-body h2 { font: 400 clamp(28px, 2.8vw, 34px)/1.2 var(--mg-serif); color: var(--mg-emerald); margin: 0 0 18px; padding: 0 0 12px; border-bottom: 1px solid rgba(8,46,31,.12); scroll-margin-top: calc(var(--mg-header-h) + 24px); }
.legal-divider { display: flex; align-items: center; gap: 18px; margin: 44px 0 40px; }
.legal-divider::before, .legal-divider::after { content: ""; flex: 1; height: 1px; background: rgba(8,46,31,.14); }
.legal-divider img { width: 24px; height: 24px; opacity: .85; }
.legal-body h3 { font: 500 16px/1.4 var(--mg-sans); color: var(--mg-emerald); margin: 26px 0 8px; }
.legal-body p { margin: 0 0 16px; }
.legal-body strong { color: var(--mg-emerald); font-weight: 500; }
.legal-body ul, .legal-body ol { margin: 0 0 18px; padding-left: 22px; }
.legal-body li { margin-bottom: 8px; }
.legal-body li::marker { color: var(--mg-emerald); }
.legal-body a { color: var(--mg-bronze); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal-body a:hover { color: var(--mg-emerald); }
.legal-body :is(.highlight-box, .ca-box, .gdpr-box, .disclaimer-box, .warn-box, .scope-box, .status-box, .gap-box, .contact-box, .commit-box) { background: #F4ECDA; border: 0; padding: 22px 30px; margin: 24px 0; }
.legal-body :is(.highlight-box, .ca-box, .gdpr-box, .disclaimer-box, .warn-box, .scope-box, .status-box, .gap-box, .contact-box, .commit-box) p { margin: 0 0 10px; font-size: 15.5px; color: var(--mg-text); }
.legal-body :is(.highlight-box, .ca-box, .gdpr-box, .disclaimer-box, .warn-box, .scope-box, .status-box, .gap-box, .contact-box, .commit-box) > :last-child { margin-bottom: 0; }
.legal-table { overflow-x: auto; margin: 18px 0 26px; border: 1px solid rgba(8,46,31,.12); background: rgba(255,255,255,.4); }
.legal-table table { width: 100%; border-collapse: collapse; min-width: 440px; }
.legal-table th { text-align: left; font: 500 11.5px/1.3 var(--mg-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mg-emerald); padding: 12px 16px; border-bottom: 1px solid var(--mg-emerald); }
.legal-table td { padding: 12px 16px; font-size: 15px; line-height: 1.55; border-bottom: 1px solid rgba(8,46,31,.1); vertical-align: top; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-note { margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(8,46,31,.12); font-size: 14px; font-style: normal; }
@media (max-width: 960px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .legal-toc { position: static; max-height: none; overflow: visible; border: 1px solid rgba(8,46,31,.12); background: rgba(255,255,255,.4); padding: 14px 18px; }
  .legal-toc summary { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: flex; justify-content: space-between; align-items: center; cursor: pointer; color: var(--mg-emerald); }
  .legal-toc summary::after { content: "+"; font-size: 18px; letter-spacing: 0; }
  .legal-toc[open] summary::after { content: "\2212"; }
  .legal-toc[open] summary { margin-bottom: 10px; }
  .legal-hero::before { width: 70%; opacity: .6; }
}
@media (max-width: 640px) { .legal-body { font-size: 16px; } .legal-summary { padding: 22px 22px; } }
