/* ==========================================================================
   THE RIVER'S CHILD — stylesheet
   A journal of literature and lifestyle.

   Palette
     --ink        #12151a   base background, river at night
     --silt       #1b2029   panel / card surface
     --silt-2     #232a35   raised surface (hover, inputs)
     --parchment  #ece7db   primary text, aged paper
     --fog        #92969f   secondary text, river mist
     --current    #5b8a8f   cool accent, moving water
     --lantern    #c98f3f   warm accent, dusk light on the water

   Type
     display   "Fraunces"   headlines, wordmark, pull-quotes
     body      "Newsreader" long-form reading text
     ui        "Inter"      nav, labels, buttons, forms, captions
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&family=Inter:wght@400;500;600&display=swap');

:root{
  --ink: #12151a;
  --ink-rgb: 18,21,26;
  --silt: #1b2029;
  --silt-2: #242b36;
  --parchment: #ece7db;
  --parchment-rgb: 236,231,219;
  --fog: #92969f;
  --fog-dim: #5c606a;
  --current: #5b8a8f;
  --current-light: #8fb9bd;
  --lantern: #c98f3f;
  --lantern-light: #e0ac5e;
  --line: rgba(236,231,219,0.12);

  --display: 'Fraunces', serif;
  --body-font: 'Newsreader', serif;
  --ui: 'Inter', sans-serif;

  --measure: 66ch;
  --container: 1180px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: 5rem;
  --space-6: 8rem;

  --radius: 3px;
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ---------- reset ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--body-font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
h1,h2,h3,h4{ font-family: var(--display); font-weight: 500; margin: 0; }
p{ margin: 0 0 1.1em; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family: var(--ui); cursor: pointer; }
input, textarea, select{ font-family: var(--ui); }
::selection{ background: var(--lantern); color: var(--ink); }
:focus-visible{ outline: 2px solid var(--lantern-light); outline-offset: 3px; }

.container{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-3);
}
.eyebrow{
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--current-light);
  font-weight: 600;
}
.visually-hidden{
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* ---------- signature element: the river line ----------
   A hand-drawn wavy rule used everywhere a section/divider is needed.
   Reads as "the river" running through the whole site. */
.river-rule{ width: 100%; overflow: hidden; line-height: 0; }
.river-rule svg{ width: 200%; height: 20px; display:block; }
.river-rule path{
  fill: none;
  stroke: var(--line);
  stroke-width: 1.4;
}
.river-rule.animate path{
  animation: river-drift 18s linear infinite;
}
@keyframes river-drift{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}
.river-rule.accent path{ stroke: var(--current); opacity: .55; }

/* ---------- header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 40;
  background: rgba(var(--ink-rgb), 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container{
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.wordmark{ display: flex; align-items: center; gap: 0.65rem; }
.wordmark img{ height: 30px; width: auto; opacity: .95; }
.wordmark span{
  font-family: var(--display); font-size: 1.28rem; letter-spacing: 0.01em;
  font-weight: 500;
}
.wordmark small{
  display:block; font-family: var(--ui); font-size: 0.58rem; letter-spacing: 0.18em;
  color: var(--fog); text-transform: uppercase; margin-top: 1px;
}

.main-nav{ display: flex; align-items: center; gap: var(--space-4); }
.main-nav ul{ display: flex; gap: var(--space-3); }
.main-nav a{
  font-family: var(--ui); font-size: 0.86rem; font-weight: 500;
  color: var(--fog); padding: 0.4rem 0; position: relative;
  transition: color .2s var(--ease);
}
.main-nav a:hover, .main-nav a.active{ color: var(--parchment); }
.main-nav a.active::after{
  content:""; position:absolute; left:0; right:0; bottom:-4px; height:2px;
  background: var(--lantern);
}
.btn-submit{
  font-family: var(--ui); font-size: 0.82rem; font-weight: 600;
  color: var(--ink) !important; background: var(--lantern);
  padding: 0.55rem 1.15rem; border-radius: var(--radius);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn-submit:hover{ background: var(--lantern-light); transform: translateY(-1px); }

.nav-toggle{
  display:none; background:none; border:none; color: var(--parchment);
  width: 34px; height: 34px; position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after{
  content:""; position:absolute; left: 6px; right: 6px; height: 2px; background: currentColor;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.nav-toggle span{ top: 16px; }
.nav-toggle span::before{ top: -8px; }
.nav-toggle span::after{ top: 8px; }
.nav-toggle[aria-expanded="true"] span{ background: transparent; }
.nav-toggle[aria-expanded="true"] span::before{ transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after{ transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 860px){
  .main-nav{
    position: fixed; inset: 76px 0 0 0; background: var(--ink);
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--space-3);
    transform: translateX(100%); transition: transform .3s var(--ease);
    overflow-y: auto;
  }
  .main-nav[data-open="true"]{ transform: translateX(0); }
  .main-nav ul{ flex-direction: column; gap: 0; }
  .main-nav ul li{ border-bottom: 1px solid var(--line); }
  .main-nav a{ display:block; padding: 1rem 0.25rem; font-size: 1rem; }
  .main-nav .btn-submit{ margin-top: var(--space-2); text-align:center; }
  .nav-toggle{ display:block; }
}

/* ---------- hero ---------- */
.hero{
  position: relative; padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
}
.hero::before{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(60% 50% at 85% 0%, rgba(91,138,143,0.18), transparent 60%),
    radial-gradient(50% 40% at 10% 100%, rgba(201,143,63,0.10), transparent 60%);
  pointer-events: none;
}
.hero .container{ position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-5); align-items: center; }
.hero-eyebrow{ margin-bottom: var(--space-2); }
.hero h1{
  font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1.03; letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}
.hero h1 em{ font-style: italic; color: var(--current-light); }
.hero p.lede{ font-family: var(--body-font); font-size: 1.2rem; color: var(--fog); max-width: 46ch; margin-bottom: var(--space-3); }
.hero-actions{ display:flex; gap: var(--space-2); flex-wrap: wrap; }
.btn{
  display:inline-flex; align-items:center; gap:.5rem; font-family: var(--ui); font-weight: 600; font-size: 0.88rem;
  padding: 0.85rem 1.4rem; border-radius: var(--radius); border: 1px solid var(--line);
  transition: all .2s var(--ease);
}
.btn-primary{ background: var(--lantern); color: var(--ink); border-color: var(--lantern); }
.btn-primary:hover{ background: var(--lantern-light); }
.btn-ghost:hover{ border-color: var(--parchment); }

.hero-cover{ position: relative; }
.hero-cover .frame{
  position: relative; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6);
  transform: rotate(1.5deg);
}
.hero-cover img{ width: 100%; }
.hero-cover .tag{
  position:absolute; bottom: -14px; left: -14px; background: var(--current); color: var(--ink);
  font-family: var(--ui); font-weight:600; font-size:.72rem; letter-spacing:.06em; text-transform:uppercase;
  padding: .5rem .8rem; border-radius: var(--radius); transform: rotate(-2deg);
}
@media (max-width: 900px){
  .hero .container{ grid-template-columns: 1fr; }
  .hero-cover{ max-width: 340px; }
}

/* ---------- section scaffolding ---------- */
section{ padding: var(--space-5) 0; }
.section-head{ display:flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.section-head h2{ font-size: clamp(1.8rem, 3vw, 2.6rem); }
.section-head .see-all{ font-family: var(--ui); font-size:.85rem; font-weight:600; color: var(--current-light); white-space:nowrap; }
.section-head .see-all:hover{ color: var(--parchment); }

/* ---------- table of contents / works list ---------- */
.toc-list li{ border-bottom: 1px solid var(--line); }
.toc-item{
  display:grid; grid-template-columns: 2.4fr 1fr auto; gap: var(--space-3); align-items:center;
  padding: 1.35rem 0.25rem; transition: background .2s var(--ease);
}
.toc-item:hover{ background: rgba(236,231,219,0.03); }
.toc-item .title{ font-family: var(--display); font-style: italic; font-size: 1.28rem; }
.toc-item .byline{ font-family: var(--ui); font-size: .82rem; color: var(--fog); text-transform: uppercase; letter-spacing: .04em; }
.toc-item .go{ font-family: var(--ui); font-size:.8rem; color: var(--current-light); white-space:nowrap; }
@media (max-width: 640px){
  .toc-item{ grid-template-columns: 1fr; gap: .35rem; padding: 1.1rem 0; }
}

/* ---------- editor quote ---------- */
.quote-block{
  border-left: 2px solid var(--lantern); padding: 0.2rem 0 0.2rem var(--space-3);
  max-width: 62ch;
}
.quote-block p{ font-family: var(--display); font-style: italic; font-size: 1.5rem; line-height:1.35; color: var(--parchment); }
.quote-block cite{ display:block; margin-top: var(--space-2); font-family: var(--ui); font-style:normal; font-size:.82rem; color: var(--fog); text-transform: uppercase; letter-spacing:.05em; }

/* ---------- cards (lifestyle / issues grid) ---------- */
.grid{ display:grid; gap: var(--space-3); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px){ .grid-3{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px){ .grid-3, .grid-2{ grid-template-columns: 1fr; } }

.card{
  background: var(--silt); border: 1px solid var(--line); border-radius: 6px; overflow:hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.card:hover{ transform: translateY(-4px); border-color: var(--fog-dim); }
.card .media{ aspect-ratio: 4/3; overflow:hidden; }
.card .media img{ width:100%; height:100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .media img{ transform: scale(1.045); }
.card .body{ padding: var(--space-2) var(--space-3) var(--space-3); }
.card h3{ font-size: 1.15rem; margin-bottom: .35rem; }
.card p{ color: var(--fog); font-size: .95rem; margin-bottom: 0; }

/* ---------- issue cover strip ---------- */
.issue-card{
  display:grid; grid-template-columns: 200px 1fr; gap: var(--space-4); align-items:center;
  background: var(--silt); border:1px solid var(--line); border-radius: 8px; padding: var(--space-3);
}
.issue-card img{ border-radius: 4px; }
.issue-card .eyebrow{ margin-bottom:.5rem; }
.issue-card h3{ font-size: 1.6rem; margin-bottom: .5rem; }
.issue-card p{ color: var(--fog); margin-bottom: var(--space-2); }
@media (max-width: 640px){ .issue-card{ grid-template-columns: 1fr; } .issue-card img{ max-width: 160px; } }

/* ---------- article / work reading page ---------- */
.work-header{ padding: var(--space-5) 0 var(--space-4); }
.work-header .eyebrow{ margin-bottom: var(--space-2); }
.work-header h1{ font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-style: italic; line-height:1.08; margin-bottom: var(--space-2); }
.work-byline{ display:flex; align-items:center; gap: .6rem; font-family: var(--ui); font-size:.92rem; color: var(--fog); }
.work-byline a{ color: var(--current-light); font-weight:600; }
.work-byline a:hover{ color: var(--parchment); }

.work-body{ max-width: var(--measure); font-size: 1.14rem; line-height: 1.8; }
.work-body p{ margin-bottom: 1.3em; }
.work-body p:first-of-type::first-letter{
  font-family: var(--display); font-size: 3.6rem; float:left; line-height: .8;
  padding: .1em .12em 0 0; color: var(--lantern-light); font-weight: 500;
}
.work-body em, .work-body i{ font-style: italic; }

.work-foot{ max-width: var(--measure); margin-top: var(--space-4); }
.share-row{ display:flex; align-items:center; gap: .75rem; flex-wrap: wrap; margin-top: var(--space-3); }
.share-row span.label{ font-family: var(--ui); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color: var(--fog); margin-right:.35rem; }
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px;
  border:1px solid var(--line); border-radius:50%; color: var(--parchment);
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.icon-btn:hover{ border-color: var(--lantern); color: var(--lantern-light); }
.icon-btn svg{ width:16px; height:16px; }
.copy-link-btn{ position:relative; }
.copy-link-btn .toast{
  position:absolute; bottom: 48px; left:50%; transform: translateX(-50%);
  background: var(--parchment); color: var(--ink); font-family: var(--ui); font-size:.72rem; font-weight:600;
  padding: .3rem .6rem; border-radius: 4px; white-space:nowrap; opacity:0; pointer-events:none;
  transition: opacity .2s var(--ease);
}
.copy-link-btn.copied .toast{ opacity:1; }

.work-nav{ display:flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); padding-top: var(--space-4); border-top:1px solid var(--line); max-width: var(--measure); }
.work-nav a{ font-family: var(--ui); font-size:.85rem; color: var(--fog); max-width: 45%; }
.work-nav a:hover{ color: var(--parchment); }
.work-nav .dir{ display:block; color: var(--current-light); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; margin-bottom:.3rem; }
.work-nav .next{ text-align:right; margin-left:auto; }

/* ---------- author profile ---------- */
.author-header{ display:flex; gap: var(--space-4); align-items:flex-start; flex-wrap: wrap; }
.author-avatar{
  width: 128px; height:128px; border-radius:50%; overflow:hidden; flex-shrink:0;
  background: var(--silt-2); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
}
.author-avatar img{ width:100%; height:100%; object-fit:cover; }
.author-avatar .initials{ font-family: var(--display); font-size:2.4rem; color: var(--fog); }
.author-name{ font-size: 2.1rem; margin-bottom:.25rem; }
.author-role{ font-family: var(--ui); font-size:.85rem; color: var(--current-light); text-transform:uppercase; letter-spacing:.06em; margin-bottom: var(--space-2); }
.author-bio{ max-width: 62ch; color: var(--fog); }
.author-bio p{ margin-bottom: 1em; }
.author-works{ margin-top: var(--space-5); }

/* ---------- forms (submit / contact) ---------- */
.form-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); max-width: 760px; }
.form-grid .full{ grid-column: 1 / -1; }
@media (max-width: 640px){ .form-grid{ grid-template-columns: 1fr; } }
.field label{ display:block; font-family: var(--ui); font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; color: var(--fog); margin-bottom: .5rem; }
.field input, .field select, .field textarea{
  width:100%; background: var(--silt); border:1px solid var(--line); color: var(--parchment);
  border-radius: var(--radius); padding: .8rem .9rem; font-size: .96rem; transition: border-color .2s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color: var(--current); }
.field textarea{ resize: vertical; min-height: 130px; }
.field .hint{ font-family: var(--ui); font-size:.76rem; color: var(--fog-dim); margin-top:.4rem; }
.form-note{ max-width: 760px; background: var(--silt); border:1px solid var(--line); border-radius:6px; padding: var(--space-3); margin-bottom: var(--space-4); font-family: var(--ui); font-size:.88rem; color: var(--fog); }
.form-note strong{ color: var(--parchment); }

.guideline-list{ max-width: 62ch; margin-bottom: var(--space-4); }
.guideline-list li{ padding: .9rem 0; border-bottom:1px solid var(--line); display:flex; gap:.9rem; }
.guideline-list li .n{ font-family: var(--display); font-style:italic; color: var(--current-light); flex-shrink:0; }

/* ---------- footer ---------- */
.site-footer{ border-top: 1px solid var(--line); padding: var(--space-5) 0 var(--space-4); }
.footer-grid{ display:grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-4); margin-bottom: var(--space-4); }
@media (max-width: 760px){ .footer-grid{ grid-template-columns: 1fr; } }
.footer-grid h4{ font-family: var(--ui); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color: var(--fog); margin-bottom: var(--space-2); }
.footer-grid ul li{ margin-bottom: .55rem; }
.footer-grid a:hover{ color: var(--current-light); }
.footer-motto{ font-family: var(--display); font-style: italic; font-size: 1.3rem; max-width: 40ch; color: var(--parchment); }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; gap: var(--space-2); flex-wrap:wrap; font-family: var(--ui); font-size:.78rem; color: var(--fog-dim); padding-top: var(--space-3); border-top:1px solid var(--line); }
.footer-social{ display:flex; gap:.6rem; }

/* ---------- generic page header (about/contact/etc.) ---------- */
.page-header{ padding: var(--space-5) 0 var(--space-4); }
.page-header h1{ font-size: clamp(2.4rem,5vw,3.6rem); }
.page-header p.lede{ max-width: 56ch; color: var(--fog); font-size:1.1rem; margin-top: var(--space-2); }
.prose{ max-width: var(--measure); font-size: 1.08rem; }
.prose p{ margin-bottom: 1.2em; }

.editor-card{ display:flex; gap: var(--space-3); align-items:flex-start; padding: var(--space-4) 0; border-top:1px solid var(--line); }
.editor-card img{ width: 96px; height:96px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.editor-card .name{ font-size:1.3rem; margin-bottom:.2rem; }
.editor-card .role{ font-family: var(--ui); font-size:.78rem; color: var(--current-light); text-transform:uppercase; letter-spacing:.06em; margin-bottom: var(--space-2); }

/* ---------- lightbox (lifestyle gallery) ---------- */
.lightbox{
  position: fixed; inset:0; background: rgba(8,9,11,0.92); display:none; align-items:center; justify-content:center;
  z-index: 100; padding: var(--space-3);
}
.lightbox.open{ display:flex; }
.lightbox figure{ max-width: 900px; max-height: 86vh; margin:0; }
.lightbox img{ max-height: 78vh; width:auto; margin: 0 auto; border-radius: 4px; }
.lightbox figcaption{ font-family: var(--ui); font-size:.85rem; color: var(--fog); text-align:center; margin-top: var(--space-2); }
.lightbox-close{ position:absolute; top: var(--space-3); right: var(--space-3); color: var(--parchment); background:none; border:none; font-size:1.8rem; line-height:1; }

/* utility */
.mt-0{ margin-top:0 !important; }
.text-center{ text-align:center; }
