/* Header and footer layouts and section tones (wave 6). Loaded after every theme.
   Only layout and tone live here: fonts, colours and link styles stay with each theme.
   HEX colours only (the L0 gate cannot parse modern colour functions). */

/* ---------- header ---------- */
/* classic = the theme's own header (no class). */
.site .site-header.header-centered{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;gap:16px;text-align:center;grid-template-columns:none}
.site .site-header.header-centered .wordmark{margin:0;justify-content:center}
.site .site-header.header-centered .site-nav{justify-content:center;flex-wrap:wrap;margin:0;width:auto}
.site .site-header.header-simple{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:24px;grid-template-columns:none}
.site .site-header.header-simple .wordmark{margin:0;max-width:100%}
.site .site-header.header-simple .brand-symbol{display:none}
.site .site-header .header-cta{display:inline-flex;align-items:center;justify-content:center;gap:8px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
/* Designs with a side rail (fable-atlas, opus-vesper): a chosen layout turns the rail into a top bar. */
.site:is(.theme-fable-atlas,.theme-opus-vesper):has(>.site-header:is(.header-centered,.header-simple)){display:block;background:var(--paper)}
.site:is(.theme-fable-atlas,.theme-opus-vesper)>.site-header:is(.header-centered,.header-simple){position:relative;top:auto;height:auto;min-height:0;grid-row:auto;align-self:auto;border-right:0;border-bottom:1px solid var(--line);padding:22px clamp(20px,5vw,64px)}
.theme-opus-vesper.site>.site-header:is(.header-centered,.header-simple){background:var(--v-deep,var(--ink))}
.theme-opus-vesper.site>.site-header:is(.header-centered,.header-simple)::after{display:none}
.site:is(.theme-fable-atlas,.theme-opus-vesper)>.site-header:is(.header-centered,.header-simple) .wordmark{flex-direction:row;align-items:center;gap:12px;font-size:clamp(20px,2vw,26px)}
.site:is(.theme-fable-atlas,.theme-opus-vesper)>.site-header.header-centered .site-nav{flex-direction:row;flex-wrap:wrap;justify-content:center;margin:0;gap:4px 18px}
.site:is(.theme-fable-atlas,.theme-opus-vesper)>.site-header.header-centered .site-nav a{min-height:36px;padding:6px 8px;font-size:15px}
.site:is(.theme-fable-atlas,.theme-opus-vesper)>.site-header.header-centered .site-nav a::before{display:none}
.site:is(.theme-fable-atlas,.theme-opus-vesper)>.site-header:is(.header-centered,.header-simple) .atlas-rail-note{display:none}
/* Simple: the menu sits behind one Menu button at every width (the phone menu, shared from styles.css/astra.css). */
@media(min-width:761px){
 .site .site-header.header-simple .site-nav{display:none!important}
 .site .site-header.header-simple .site-menu-toggle{display:inline-flex!important;align-items:center;justify-content:center;gap:10px;flex:none;min-height:44px;min-width:44px;margin:0 0 0 auto;padding:0 18px;border:1px solid var(--line,#d6d0c6);border-radius:999px;background:transparent;color:inherit;font:600 15px/1 var(--body,'Figtree'),sans-serif;letter-spacing:0;text-transform:none;cursor:pointer}
 .site .site-header.header-simple .site-menu-icon{position:relative;display:block;width:16px;height:2px;background:currentColor;border-radius:2px}
 .site .site-header.header-simple .site-menu-icon::before,.site .site-header.header-simple .site-menu-icon::after{content:'';position:absolute;left:0;width:16px;height:2px;background:currentColor;border-radius:2px;transition:transform .2s cubic-bezier(.22,1,.36,1)}
 .site .site-header.header-simple .site-menu-icon::before{top:-5px}
 .site .site-header.header-simple .site-menu-icon::after{top:5px}
 .site .site-header.header-simple .site-menu-toggle.is-open .site-menu-icon{background:transparent}
 .site .site-header.header-simple .site-menu-toggle.is-open .site-menu-icon::before{transform:translateY(5px) rotate(45deg)}
 .site .site-header.header-simple .site-menu-toggle.is-open .site-menu-icon::after{transform:translateY(-5px) rotate(-45deg)}
 .site .site-header.header-simple .site-nav.is-open{display:flex!important;position:fixed!important;inset:0!important;z-index:60!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;flex-wrap:nowrap!important;gap:0!important;width:auto!important;height:auto!important;max-width:none!important;margin:0!important;padding:24px max(32px,calc(50vw - 380px)) 48px!important;background:var(--paper,#fff)!important;border:0!important;border-radius:0!important;box-shadow:none!important;transform:none!important;overflow-y:auto!important;opacity:1!important;visibility:visible!important}
 .site .site-header.header-simple .site-nav.is-open::before{content:attr(data-menu-title);display:block;min-height:48px;margin:0 0 12px;padding:0 140px 14px 4px;border-bottom:1px solid var(--line,#e4dfd6);color:var(--ink,#15171a);font:600 22px/48px var(--display,inherit);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .site .site-header.header-simple .site-nav.is-open a{display:flex!important;align-items:center;min-height:64px;width:auto!important;margin:0!important;padding:0 4px!important;border:0!important;border-bottom:1px solid var(--line,#e4dfd6)!important;border-radius:0!important;background:none!important;color:var(--ink,#15171a)!important;font:500 30px/1.2 var(--display,inherit)!important;letter-spacing:-.01em!important;text-transform:none!important;text-decoration:none!important;opacity:1!important}
 .site .site-header.header-simple .site-nav.is-open a.current{text-decoration:underline!important;text-decoration-thickness:2px!important;text-underline-offset:8px!important}
 .site .site-header.header-simple .site-menu-toggle.is-open{position:fixed!important;top:24px!important;right:max(32px,calc(50vw - 380px))!important;z-index:61!important;color:var(--ink,#15171a);border-color:var(--line,#d6d0c6)}
 html.site-menu-locked .site .site-header.header-simple{z-index:70!important}
}

/* ---------- footer ---------- */
/* Shared parts for every footer: link rows never stretch, so themes' underlines stay under their words. */
.site .site-footer .footer-pages,.site .site-footer .footer-socials{display:flex;flex-wrap:wrap;align-items:center;gap:10px 22px;margin:0;padding:0}
.site .site-footer .footer-pages a,.site .site-footer .footer-socials a{flex:none;align-self:center;margin:0}
.site .site-footer .footer-socials a{display:inline-flex;align-items:center;gap:8px}
.site .site-footer>div{min-width:0}
.site .site-footer .footer-blurb{margin:8px 0 0}
.site .site-footer .footer-note{display:block;margin:0;padding-top:20px;border-top:1px solid var(--line)}

/* Simple (also the default when nothing is chosen): who you are on the left, links on the right, small print below. */
.site .site-footer:not(.footer-centered):not(.footer-columns){display:grid;grid-template-columns:minmax(min(100%,260px),1fr) minmax(0,auto);grid-template-areas:"id pages" "id socials" "note note";column-gap:56px;row-gap:14px;align-items:start;text-align:left}
.site .site-footer:not(.footer-centered):not(.footer-columns)>div{grid-area:id;text-align:left}
.site .site-footer:not(.footer-centered):not(.footer-columns) .footer-pages{grid-area:pages;justify-content:flex-end;padding-top:6px}
.site .site-footer:not(.footer-centered):not(.footer-columns) .footer-socials{grid-area:socials;justify-content:flex-end}
.site .site-footer:not(.footer-centered):not(.footer-columns) .footer-note{grid-area:note;margin-top:18px}

/* Centred: everything stacked on one axis. */
.site .site-footer.footer-centered{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;text-align:center}
.site .site-footer.footer-centered>div{text-align:center}
.site .site-footer.footer-centered .footer-pages,.site .site-footer.footer-centered .footer-socials{justify-content:center}
.site .site-footer.footer-centered .footer-note{align-self:stretch;margin-top:10px;text-align:center}

/* Columns: about | pages | socials. */
.site .site-footer.footer-columns{display:grid;grid-template-columns:minmax(min(100%,240px),1.5fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:"id pages socials" "note note note";align-items:start;column-gap:48px;row-gap:28px;text-align:left}
.site .site-footer.footer-columns>div{grid-area:id;text-align:left}
.site .site-footer.footer-columns .footer-pages{grid-area:pages;display:grid;grid-template-columns:repeat(2,max-content);justify-content:start;align-items:start;gap:12px 36px}
.site .site-footer.footer-columns .footer-pages a{justify-self:start;align-self:start}
.site .site-footer.footer-columns .footer-socials{grid-area:socials;flex-direction:column;align-items:flex-start;gap:12px}
.site .site-footer.footer-columns .footer-socials a{align-self:flex-start}
.site .site-footer.footer-columns .footer-note{grid-area:note}

@media(max-width:760px){
 /* Every header on a phone: name on the left, Menu on the right, one row. */
 .site .site-header:not(.dz-none){display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:12px}
 .site .site-header:not(.dz-none) .wordmark{min-width:0;flex:0 1 auto}
 .site .site-header:not(.dz-none) .site-menu-toggle{margin-left:auto}
 .site .site-header.header-centered{gap:12px}
 .site .site-header.header-centered .site-nav,.site .site-header.header-simple .site-nav{margin:0}
 .site .site-header.header-centered,.site .site-header.header-simple{flex-direction:row;justify-content:space-between;text-align:left;gap:12px}
 .site .site-header .header-cta{font-size:14px;padding:10px 14px}
 .site .site-footer:not(.footer-centered):not(.footer-columns),.site .site-footer.footer-columns{grid-template-columns:minmax(0,1fr);grid-template-areas:"id" "pages" "socials" "note";row-gap:20px}
 .site .site-footer:not(.footer-centered):not(.footer-columns) .footer-pages,.site .site-footer:not(.footer-centered):not(.footer-columns) .footer-socials{justify-content:flex-start;padding-top:0}
 .site .site-footer .footer-note{margin-top:4px}
 .site .site-footer{overflow-wrap:anywhere}
}

/* ---------- tones (header, footer and sections) ---------- */
/* Dark and accent swap the theme's own tokens inside the block, so theme text and lines follow. */
/* Designs whose page is already dark keep "Dark" dark instead of inverting to their light text colour. */
.site:is(.theme-astra-evergreen,.theme-astra-voices,.theme-opus-signal,.theme-opus-vesper,.theme-grok-ember){--tone-dark-bg:#0c0e10;--tone-dark-fg:var(--ink)}
.site :is(.site-header,.site-footer,.block).tone-dark{--tone-bg:var(--tone-dark-bg,var(--ink));--tone-fg:var(--tone-dark-fg,var(--paper));background:var(--tone-bg);color:var(--tone-fg)}
.site .block.tone-accent{--tone-bg:var(--accent);--tone-fg:#ffffff;background:var(--tone-bg);color:var(--tone-fg)}
.site :is(.site-header,.site-footer,.block):is(.tone-dark,.tone-accent)>*{--ink:var(--tone-fg);--paper:var(--tone-bg);--muted:var(--tone-fg);--line:#ffffff40}
.site .block:is(.tone-dark,.tone-accent)>*{--accent:var(--tone-fg)}
.site :is(.site-header,.site-footer,.block):is(.tone-dark,.tone-accent) :is(h1,h2,h3,h4,p,li,small,strong,span,blockquote,figcaption,.eyebrow,.hero-kicker,.wordmark,.text-link,.quiet-link,.site-nav a,.footer-pages a,.footer-socials a,.prose,.contact-detail,.verse-controls button){color:inherit}
.site :is(.site-header,.site-footer,.block):is(.tone-dark,.tone-accent) :is(.text-link,.quiet-link,.footer-pages a,.site-nav a){border-color:currentColor}
.site :is(.site-header,.site-footer,.block):is(.tone-dark,.tone-accent) .verse-controls button{border-color:#ffffff66;background:transparent}
.site :is(.site-header,.site-footer,.block):is(.tone-dark,.tone-accent) :is(.button,.header-cta){background:var(--tone-fg)!important;border-color:var(--tone-fg)!important;color:var(--tone-bg)!important}
.site .site-header.tone-dark .site-menu-toggle{border-color:#ffffff66;color:inherit;background:transparent}
.site :is(.site-header,.site-footer,.block).tone-soft{position:relative;isolation:isolate;background:var(--paper);color:var(--ink)}
.site :is(.site-header,.site-footer).tone-soft :is(h1,h2,h3,h4,p,li,small,strong,span,blockquote,figcaption,.eyebrow,.wordmark,.site-nav a,.footer-pages a,.footer-socials a){color:var(--ink)}
.site :is(.site-header,.site-footer).tone-soft .site-nav a.current{background:transparent;text-decoration:underline;text-underline-offset:6px}
.site :is(.site-header,.site-footer,.block).tone-soft::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:var(--line);opacity:.35}

/* A coloured section gets breathing room so its words never touch the coloured edge. */
.site .block:is(.tone-dark,.tone-accent,.tone-soft){padding-left:clamp(20px,4vw,56px);padding-right:clamp(20px,4vw,56px)}

/* ---------- small shared pieces ---------- */
.site .ext-icon,.site .social-icon{flex:none;vertical-align:middle}

/* ---------- channels (wave 7): latest videos, episodes, writing, social embeds, follow along ---------- */
/* Built from each theme's own tokens (--ink, --muted, --line, --accent, --display, --body), so tones and designs carry through. */
.site .pn-ch{margin-top:clamp(20px,3vw,32px);min-width:0}
.site .pn-ch :is(h3,p){overflow-wrap:anywhere}
.site .pn-ch-meta{margin:0 0 6px;font:500 14px/1.4 var(--body,inherit);color:var(--muted,currentColor);letter-spacing:0;text-transform:none}
.site .pn-ch h3{margin:0;font-size:clamp(17px,1.35vw,20px);line-height:1.3;text-wrap:balance}
.site .pn-ch-title{color:inherit;text-decoration:none;border:0;background:none;padding:0}
.site .pn-ch-title:hover{text-decoration:underline;text-underline-offset:3px}
.site .pn-ch-title .ext-icon{opacity:.55;margin-left:2px}
.site .pn-ch :is(a,button):focus-visible{outline:2px solid var(--accent,currentColor);outline-offset:3px}
.site .pn-ch-links,.site .pn-ch-more{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px}
.site .pn-ch-more{margin:clamp(20px,3vw,28px) 0 0}

/* Columns follow the section's own width (designs with side rails are narrower): 1, 2, then 3 so six videos fill whole rows. */
.site .pn-ch--videos{container-type:inline-size}
.site .pn-ch-videos{display:grid;grid-template-columns:minmax(0,1fr);gap:32px 24px}
@container (min-width:560px){.site .pn-ch-videos{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container (min-width:860px){.site .pn-ch-videos{grid-template-columns:repeat(3,minmax(0,1fr))}}
.site .pn-ch-video{display:flex;flex-direction:column;gap:14px;min-width:0}
.site .pn-ch-frame{position:relative;aspect-ratio:16/9;overflow:hidden;border-radius:var(--radius,10px);background:#15171a}
.site .pn-ch-frame img,.site .pn-ch-frame iframe{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;margin:0;border:0;object-fit:cover}
.site .pn-ch-play{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:flex-start;width:100%;height:100%;margin:0;padding:12px;border:0;border-radius:0;background:transparent;color:#15171a;cursor:pointer;box-shadow:none}
.site .pn-ch-pill{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 16px 0 14px;border-radius:999px;background:#ffffff;color:#15171a;font:600 15px/1 var(--body,inherit);letter-spacing:0;text-transform:none;box-shadow:0 2px 10px #15171a40}
.site .pn-ch-play:is(:hover,:focus-visible) .pn-ch-pill{background:#15171a;color:#ffffff}
.site .pn-ch-play:focus-visible{outline-offset:-4px}
.site .pn-ch-videos.is-featured .pn-ch-video:first-child h3{font-size:clamp(20px,2vw,28px)}
@container (min-width:860px){
 .site .pn-ch-videos.is-featured .pn-ch-video:first-child{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);align-items:end;gap:32px}
}

.site .pn-ch-episodes,.site .pn-ch-posts{list-style:none;margin:0;padding:0;max-width:900px}
.site .pn-ch-episode{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start;padding:22px 0;border-top:1px solid var(--line,#e4dfd6)}
.site .pn-ch-episode:has(>.pn-ch-art){grid-template-columns:88px minmax(0,1fr)}
.site .pn-ch-episode:last-child,.site .pn-ch-posts:not(.is-grid) .pn-ch-post:last-child{border-bottom:1px solid var(--line,#e4dfd6)}
.site .pn-ch-art{display:block;width:88px;height:88px;margin:0;border-radius:var(--radius,8px);object-fit:cover}
.site .pn-ch-listen{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin:14px 0 0;padding:0 18px 0 14px;border:1px solid currentColor;border-radius:999px;background:transparent;color:inherit;font:600 15px/1 var(--body,inherit);letter-spacing:0;text-transform:none;cursor:pointer}
.site .pn-ch-listen:hover{background:var(--ink,#15171a);border-color:var(--ink,#15171a);color:var(--paper,#ffffff)}
.site .pn-ch-audio{display:block;width:100%;max-width:520px;margin:14px 0 0}
.site .pn-ch-post{padding:22px 0;border-top:1px solid var(--line,#e4dfd6)}
.site .pn-ch-excerpt{margin:10px 0 0;max-width:65ch;font-size:16px;line-height:1.6;text-wrap:pretty}
.site .pn-ch-posts.is-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:36px 28px;max-width:none}
.site .pn-ch-posts.is-grid .pn-ch-post{padding:0;border:0}
.site .pn-ch-cover{display:block;width:100%;aspect-ratio:3/2;margin:0 0 16px;border-radius:var(--radius,10px);object-fit:cover}

.site .pn-ch-social{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:24px;align-items:start}
.site .pn-embed{min-width:0;max-width:540px}
.site .pn-embed :is(blockquote,.fb-page,.fb-post){max-width:100%;margin:0!important;padding:0;border:0;background:none;font:inherit;quotes:none}
.site .pn-embed blockquote::before,.site .pn-embed blockquote::after{content:none}
.site .pn-embed iframe{max-width:100%}
.site .pn-embed-link{display:flex;align-items:center;gap:14px;min-height:72px;padding:16px 18px;border:1px solid var(--line,#e4dfd6);border-radius:var(--radius,12px);background:transparent;color:inherit;text-decoration:none;font:inherit}
.site .pn-embed-link:hover{border-color:currentColor}
.site .pn-embed-link .social-icon{width:22px;height:22px}
.site .pn-embed-link strong{display:block;font-size:16px;line-height:1.3}
.site .pn-embed-link small{display:block;margin-top:2px;font-size:14px;line-height:1.4;color:var(--muted,currentColor)}

.site .pn-ch-follow-row{display:flex;flex-wrap:wrap;align-items:center;gap:14px 28px}
.site .pn-ch-follow-row .pn-ch{margin:0}
.site .pn-ch-follow-title{margin:0;font:600 clamp(18px,1.6vw,22px)/1.25 var(--display,inherit);color:var(--ink,inherit);letter-spacing:-.01em}
.site .pn-ch-follow{list-style:none;display:flex;flex-wrap:wrap;gap:10px;margin:0;padding:0}
.site .pn-ch-follow li{margin:0;padding:0}
.site .pn-ch-follow li::before{content:none}
.site .pn-ch-chip{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px 0 14px;border:1px solid var(--line,#e4dfd6);border-radius:999px;background:transparent;color:inherit;font:600 15px/1 var(--body,inherit);text-decoration:none;letter-spacing:0;text-transform:none}
.site .pn-ch-chip:hover{border-color:currentColor}
@media(prefers-reduced-motion:no-preference){.site :is(.pn-ch-pill,.pn-ch-listen,.pn-ch-chip,.pn-embed-link){transition:background-color .18s cubic-bezier(.22,1,.36,1),border-color .18s cubic-bezier(.22,1,.36,1),color .18s cubic-bezier(.22,1,.36,1)}}
@media(max-width:760px){
 .site .pn-ch-episode:has(>.pn-ch-art){grid-template-columns:64px minmax(0,1fr);gap:16px}
 .site .pn-ch-art{width:64px;height:64px}
 .site .pn-ch-follow-row{flex-direction:column;align-items:flex-start}
 /* A phone shows the newest three videos; "More on YouTube" follows them. */
 .site .pn-ch-videos>.pn-ch-video:nth-child(n+4){display:none}
}

/* ---------- editing only (the designer canvas) ---------- */
.site .dz-hidden-section{padding:24px;margin:16px 0;border:1px dashed var(--muted);background:var(--paper);color:var(--ink);font:16px/1.5 var(--body);cursor:pointer}
.site [data-field][data-empty]::before{content:attr(data-placeholder);opacity:.6}
.site [data-field][data-empty]{min-width:1ch;min-height:1em}
.site [data-region]{cursor:pointer}
.site [contenteditable]:focus{outline:2px solid var(--accent);outline-offset:4px}
@media(prefers-reduced-motion:reduce){.site .site-header.header-simple .site-menu-icon::before,.site .site-header.header-simple .site-menu-icon::after{transition:none}}
