/* Footer component — signup band, link columns, wordmark, bottom bar and the
   information/policy links, plus the home-page footer variant (.footer-preview:
   footer-home.html) with its viewport-fill and mobile layouts. Moved verbatim from
   the former monolithic style.css (Phase 1: structure only, no rule was edited). */

  /* on the accent-orange footer-signup band an accent-colored em
     would vanish into the background, so it swaps to a light tint
     there instead of losing the italic treatment altogether. */
  .footer-signup .section-title em{color:var(--surface);}

  /* footer — scoped to .site-footer (homepage only) so it can't collide
     with the plain footer{} rule article pages use further down. Dark
     background gives the page a proper close instead of fading out on
     the same cream tone everything above it already used. */
  .site-footer{background:var(--panel-dark);color:rgba(255,255,255,.85);border-top:2px solid var(--accent);overflow:hidden;}

  /* The one section on the page that uses the brand accent as a full
     background rather than a small detail — reserved for this because
     it's the site's clearest call-to-action (subscribe), so the bold
     treatment reads as deliberate rather than decorative. */
  .footer-signup{background:var(--accent);padding:56px 0;}
  /* Capped max-width so the label and the form stay visually related on
     wide screens — without this, space-between across the full 1400px
     .wrap pushes the form far to the right, disconnected from the label
     it belongs with. */
  .footer-signup-inner{display:flex;justify-content:space-between;align-items:center;gap:32px;flex-wrap:wrap;}
  .footer-signup .section-label{color:#FCFAF7;margin-bottom:14px;}
  .footer-signup .section-label::before{background:var(--panel-dark);}
  .footer-signup .section-title{color:var(--panel-dark);font-size:clamp(20px,2.4vw,28px);max-width:22ch;}
  .signup-form{display:flex;border:1px solid var(--panel-dark);flex-shrink:0;background:#FCFAF7;}
  .signup-form input{background:transparent;border:none;padding:14px 18px;color:var(--panel-dark);font-family:var(--sans);font-size:14px;min-width:220px;}
  .signup-form input::placeholder{color:rgba(36,36,36,.45);}
  .signup-form input:focus{outline:none;}
  .signup-form .btn{border:none;border-left:1px solid var(--panel-dark);padding:14px 24px;background:var(--panel-dark);color:#FCFAF7;}
  .signup-form .btn:hover{background:#3a3a3a;}

  .footer-top{padding-top:64px;padding-bottom:64px;display:grid;grid-template-columns:1.4fr 1fr 1fr 1fr;gap:48px;border-bottom:1px solid rgba(255,255,255,.12);}
  .site-footer .logo{margin-bottom:22px;}
  /* The uploaded logo is drawn mostly in dark charcoal (only one small
     accent path is orange), so on the dark footer it would have almost
     no contrast. brightness(0) invert(1) renders it as a white
     silhouette instead — the trade-off is it loses the orange accent
     detail here; a dedicated light/reversed logo file would preserve
     that if one becomes available. */
  .footer-logo .logo-mark{height:58px;filter:brightness(0) invert(1);opacity:.95;}
  .footer-brand p{font-family:var(--serif);font-size:15px;line-height:1.65;color:rgba(255,255,255,.55);max-width:34ch;}
  .footer-col h5{font-family:var(--sans);font-size:13px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:rgba(255,255,255,.9);margin-bottom:20px;}
  .footer-col ul{list-style:none;display:flex;flex-direction:column;gap:12px;}
  .footer-col a{font-size:14.5px;color:rgba(255,255,255,.55);transition:color .2s ease;}
  .footer-col a:hover{color:var(--accent);}

  /* giant low-opacity wordmark — a quiet closing flourish rather than
     decoration for its own sake; common in editorial mastheads as a
     "back cover" moment. Kept faint so it reads as texture, not noise. */
  /* overflow:hidden is a hard guarantee this can never bleed past the
     same 48px inset every other row in the footer respects — unlike
     small text elsewhere, this is large fluid type with nowrap, so
     it's the one element that could actually overflow its own .wrap
     padding on some viewport widths without this. */
  .footer-word{overflow:hidden;font-family:var(--sans);font-weight:700;font-size:clamp(56px,12vw,160px);line-height:1;color:rgba(255,255,255,.05);letter-spacing:-0.03em;text-align:center;padding-top:8px;white-space:nowrap;user-select:none;}

  .footer-bottom{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:rgba(255,255,255,.45);flex-wrap:wrap;gap:12px;padding-top:28px;padding-bottom:40px;}

  @media (max-width:980px){
    /* Tablet footer: previously split into a full-width logo row above
       an even 3-column row of links — technically balanced, but it
       made the top row read as mostly empty space (a small logo alone
       against the full row width) sitting above a much busier row.
       At 912px there's still room to run it as a single row like
       desktop, just with narrower columns — one cohesive band instead
       of two mismatched-weight rows stacked on each other. */
    .footer-signup-inner{flex-direction:column;align-items:flex-start;}
    .signup-form{width:100%;}
    .signup-form input{min-width:0;flex:1;}
  }

  @media (max-width:560px){
    /* Mobile footer: a single stacked column made every link list run
       the full screen height, and left-aligning everything under a
       centered hero above it read as unfinished. Two columns side by
       side (Explore/Follow) roughly halves that height, the logo and
       Journal list are centered as their own full-width rows, and
       link text is centered within each column so the whole block
       reads as one composed unit rather than a left-hung list dump. */
    .footer-top{grid-template-columns:1fr 1fr;gap:36px 20px;text-align:center;}
    .footer-brand{grid-column:1/-1;display:flex;justify-content:center;}
    .footer-top .footer-col:last-child{grid-column:1/-1;}
    .footer-col ul{align-items:center;}
    .footer-bottom{justify-content:center;text-align:center;}
  }

  footer{padding:64px 0 40px;}

/* Footer bottom bar — copyright on the left, information & policy
   links on the right, separated by thin pipes.
   A <div> (not <nav>) on purpose: the bare `nav` rule above styles the
   header drawer and would leak into the footer. */
.footer-bottom .footer-legal{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;}
.footer-legal a{font-size:inherit;line-height:1;padding:2px 14px;border-left:1px solid rgba(255,255,255,.28);color:rgba(255,255,255,.45);transition:color .2s ease;}
.footer-legal a:first-child{border-left:none;padding-left:0;}
.footer-legal a:last-child{padding-right:0;}
.footer-legal a:hover{color:var(--accent);}

@media (max-width:900px){
  /* Not enough room for both sides on one line — centre the stack:
     copyright first, links on their own row beneath. */
  .footer-bottom:has(.footer-legal){justify-content:center;text-align:center;}
  .footer-bottom .footer-legal{flex-basis:100%;justify-content:center;}
}
@media (max-width:700px){
  .footer-bottom .footer-legal{gap:12px 22px;}
  .footer-legal a{padding:0;border-left:none;}
}

/* ===== Footer layout — PREVIEW (home page only) =====
   Upper footer: logo | Subjects | Forms | Explore.
   Bottom bar (desktop, >=1280px): a three-column grid, 1fr | 3fr | 1fr —
   the outer columns are equal so the middle stays truly centred:
     left   = copyright
     middle = information links (flex, centred)
     right  = social icons (flex, pushed to the right edge)
   Below 1280px the three stack, centred: copyright, links, icons. */
.footer-preview .footer-brand{display:flex;align-items:flex-start;}
.footer-preview .footer-social{display:flex;align-items:center;gap:16px;}
.footer-preview .footer-social a{display:inline-flex;color:rgba(255,255,255,.55);transition:color .2s ease;}
.footer-preview .footer-social a:hover{color:var(--accent);}
.footer-preview .footer-social svg{width:22px;height:22px;}

@media (min-width:1280px){
  .footer-preview .footer-bottom{display:grid;grid-template-columns:1fr 3fr 1fr;align-items:center;gap:24px;}
  .footer-preview .footer-bottom .footer-legal{justify-content:center;}
  .footer-preview .footer-social{justify-content:flex-end;}
}
@media (max-width:1279px){
  .footer-preview .footer-bottom{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:18px;}
  .footer-preview .footer-bottom .footer-legal{flex-basis:auto;justify-content:center;}
  .footer-preview .footer-social{justify-content:center;}
}

/* Tablets & narrow desktops (701–1180px): logo and the three columns stay
   on one row (the brand area is just the logo now), with slimmer padding
   so the whole footer still fits one screen on an iPad-size display. */
@media (min-width:701px) and (max-width:1180px){
  .footer-preview .footer-top{grid-template-columns:.9fr 1fr 1fr 1fr;gap:32px;padding-top:48px;padding-bottom:48px;}
}
/* Small tablets (561–700px): logo gets a row of its own above the columns. */
@media (min-width:561px) and (max-width:700px){
  .footer-preview .footer-top{grid-template-columns:repeat(3,1fr);gap:36px 24px;}
  .footer-preview .footer-brand{grid-column:1/-1;}
}
@media (max-width:560px){
  .footer-preview .footer-top{grid-template-columns:repeat(3,1fr);gap:36px 12px;}
  .footer-preview .footer-brand{grid-column:1/-1;flex-direction:column;flex-wrap:nowrap;align-items:center;align-content:normal;justify-content:center;gap:24px;}
  .footer-preview .footer-social{justify-content:center;gap:20px;}
  /* the base rule stretches the last column across the row */
  .footer-preview .footer-top .footer-col:last-child{grid-column:auto;}
  .footer-preview .footer-col a{font-size:13.5px;}
}


/* ===== Footer fill (home page only) =====
   1) The bare `footer{padding:64px 0 40px}` rule (article pages) also hit
      .site-footer, painting a 64px dark strip above the orange signup band
      and 40px of extra dark below the bottom bar. Reset to 0 here.
   2) DESKTOP: only the dark footer (.footer-dark) fills the screen — exactly
      the visible area below the fixed header (100vh minus the 63px header), with its
      content spread over it. The orange band sits above it.
   3) TABLET: the whole footer — orange signup band + dark part — is one
      screen (100vh) counting from the bottom of the fixed header (~63px),
      so at the end of the page the two sections together fill it edge to
      edge; spare height is shared between them, and a gentle proximity
      scroll-snap lands it there. "Tablet" = any screen up to 980px wide,
      plus portrait screens up to 1180px (iPad Pro 13" portrait is 1032px
      wide). Landscape screens over 980px wide and anything over 1180px
      count as desktop. Phones already have a footer taller than the screen.
   Both fills start 1px UNDER the header (63px header, footer top at 62px)
   so sub-pixel rounding on scaled displays (125% etc.) can never leave a
   1px sliver of the orange band showing beneath it. */
.footer-preview{
  /* Height of the fixed header once scrolled (it is always in this compact
     state at the end of the page — main.js sets data-compact when
     scrollY > 40): padding 12px + logo 38px + padding 12px + 1px border
     (see `header` and `header[data-compact]` rules above) = 63px. */
  --footer-hdr:63px;
}
.footer-preview .site-footer{padding:0;}

@media (min-width:1181px), (min-width:981px) and (orientation:landscape){
  /* Exactly the visible screen below the fixed header (~63px when
     scrolled): at the end of the page the dark footer fills it edge to
     edge — no part hidden under the header, nothing running past the
     bottom. Spacing and the wordmark scale with the screen height so the
     content still fits on short laptop screens. */
  .footer-preview .footer-dark{display:flex;flex-direction:column;min-height:calc(100vh - var(--footer-hdr) + 1px);min-height:calc(100dvh - var(--footer-hdr) + 1px);}
  /* .wrap centres itself with auto margins, which in a flex column would
     shrink it to its content — keep every row full width. */
  .footer-preview .footer-dark > *{width:100%;}
  .footer-preview .footer-dark .footer-top{flex:1;align-content:center;padding-top:clamp(20px,4vh,48px);padding-bottom:clamp(20px,4vh,48px);}
  .footer-preview .footer-dark .footer-word{font-size:clamp(56px,min(12vw,18vh),160px);}
}

@media (min-width:561px) and (max-width:980px), (min-width:981px) and (max-width:1180px) and (orientation:portrait){
  html:has(body.footer-preview){scroll-snap-type:y proximity;scroll-padding-top:calc(var(--footer-hdr) - 1px);}
  .footer-preview .site-footer{display:flex;flex-direction:column;min-height:calc(100vh - var(--footer-hdr) + 1px);min-height:calc(100dvh - var(--footer-hdr) + 1px);scroll-snap-align:start;}
  .footer-preview .footer-signup{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;}
  .footer-preview .footer-signup > *{width:100%;}
  .footer-preview .footer-dark{flex:1 1 auto;display:flex;flex-direction:column;}
  .footer-preview .footer-dark > *{width:100%;}
  .footer-preview .footer-dark .footer-top{flex:1;align-content:center;}
}


/* ===== Mobile footer (<=560px, home page preview only) =====
   A minimal, centred stack, in this order:
     logo → social icons → © line → five small utility links
   Hidden on mobile: the large faint "ghumanta" wordmark and the
   Subjects / Forms / Explore columns. The existing orange signup band
   above the footer is a separate section and is left untouched.
   .footer-top and .footer-bottom become display:contents so their
   children can be re-ordered as direct flex items of .footer-dark. */
.footer-preview .footer-legal-break{display:none;}
@media (max-width:560px){
  .footer-preview .footer-dark{display:flex;flex-direction:column;align-items:center;text-align:center;padding:48px 24px 36px;}
  .footer-preview .footer-word,
  .footer-preview .footer-col{display:none;}
  .footer-preview .footer-top,
  .footer-preview .footer-bottom{display:contents;}

  /* Fill the screen together with the orange band above: from the bottom
     of the fixed header (63px) to the bottom of the screen, spare height
     shared between the two sections. Padding scales with the screen
     height so it still fits on short phones. Gentle snap lands it there. */
  html:has(body.footer-preview){scroll-snap-type:y proximity;scroll-padding-top:calc(var(--footer-hdr) - 1px);}
  .footer-preview .site-footer{display:flex;flex-direction:column;min-height:calc(100vh - var(--footer-hdr) + 1px);min-height:calc(100dvh - var(--footer-hdr) + 1px);scroll-snap-align:start;}
  .footer-preview .footer-signup{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;padding-top:clamp(28px,6vh,56px);padding-bottom:clamp(28px,6vh,56px);}
  .footer-preview .footer-signup > *{width:100%;}
  .footer-preview .footer-dark{flex:1 1 auto;justify-content:center;padding-top:clamp(28px,6vh,48px);padding-bottom:clamp(28px,6vh,48px);}

  /* 1 — logo */
  .footer-preview .footer-brand{order:1;display:flex;justify-content:center;}
  .footer-preview .footer-logo .logo-mark{height:50px;}
  /* 2 — social icons */
  .footer-preview .footer-social{order:2;margin-top:26px;gap:24px;justify-content:center;}
  /* 3 — copyright */
  .footer-preview .footer-bottom > span{order:3;margin-top:34px;font-size:13px;line-height:1.5;color:rgba(255,255,255,.55);}
  /* 4 — utility links: small, secondary, wrapping 2 + 3 with "·" between */
  .footer-preview .footer-bottom .footer-legal{order:4;margin-top:14px;flex-basis:auto;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:0;font-size:12px;line-height:1.4;}
  .footer-preview .footer-legal a{font-size:12px;line-height:1.4;padding:4px 0;border-left:none;color:rgba(255,255,255,.42);}
  .footer-preview .footer-legal a:hover{color:var(--accent);}
  .footer-preview .footer-legal-break{display:block;flex-basis:100%;height:0;}
  /* the break span is child 3, so links 1, 3 and 4 (children 1, 4, 5) get a dot */
  .footer-preview .footer-legal a:nth-child(1)::after,
  .footer-preview .footer-legal a:nth-child(4)::after,
  .footer-preview .footer-legal a:nth-child(5)::after{content:"·";margin:0 9px;color:rgba(255,255,255,.3);}
}
@media (max-width:340px){
  .footer-preview .footer-legal a,.footer-preview .footer-legal a::after{font-size:11.5px;}
  .footer-preview .footer-legal a:nth-child(1)::after,
  .footer-preview .footer-legal a:nth-child(4)::after,
  .footer-preview .footer-legal a:nth-child(5)::after{margin:0 6px;}
}

/* Very short phones (<=600px tall, e.g. iPhone SE 1st gen at 320x568):
   tighten the spacing a little more so the orange band and the footer
   still fit the screen together instead of running under the header. */
@media (max-width:560px) and (max-height:600px){
  .footer-preview .footer-signup{padding-top:20px;padding-bottom:20px;}
  .footer-preview .footer-signup .section-label{margin-bottom:10px;}
  .footer-preview .footer-signup-inner{gap:18px;}
  .footer-preview .footer-dark{padding-top:20px;padding-bottom:20px;}
  .footer-preview .footer-logo .logo-mark{height:44px;}
  .footer-preview .footer-social{margin-top:18px;}
  .footer-preview .footer-bottom > span{margin-top:22px;}
  .footer-preview .footer-bottom .footer-legal{margin-top:8px;}
}
