/* AWNA blog — long-form reading in storybook style.
   Pairs with the readings/ pages — same palette, typography, ornament. */

:root {
  --paper: #f3e8d1;
  --paper-deep: #ead9b8;
  --ink: #2d3a2e;
  --ink-soft: #44544a;
  --ink-mute: #5e6a5d;
  --sage: #7a8b6f;
  --sage-deep: #4f6553;
  --rose: #c47e6b;
  --rose-deep: #a85e4d;
  --gold: #c4a35a;
  --gold-deep: #7a6228;
  --rule: rgba(74, 90, 75, 0.22);
  --rule-soft: rgba(74, 90, 75, 0.12);
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --serif-body: 'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

::selection { background: rgba(196, 163, 90, 0.45); color: var(--ink); }
::-moz-selection { background: rgba(196, 163, 90, 0.45); color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: rgba(122,139,111,0.5) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(122,139,111,0.55), rgba(79,101,83,0.65)); border-radius: 10px; border: 2px solid var(--paper); }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(168,94,77,0.65), rgba(122,139,111,0.75)); }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(196, 163, 90, 0.14), transparent 55%),
    radial-gradient(ellipse at 88% 100%, rgba(122, 139, 111, 0.14), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 19px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.22  0 0 0 0 0.17  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.4;
  mix-blend-mode: multiply;
}

a { color: var(--rose-deep); text-underline-offset: 0.18em; }

.serif { font-family: var(--serif); font-weight: 500; }
.mono  { font-family: var(--mono); letter-spacing: 0.22em; text-transform: uppercase; font-weight: 300; font-size: 0.7rem; }
em     { font-style: italic; font-family: var(--serif); }

/* Header bar */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  /* respect notch / Dynamic Island on iOS; cap content to a 1280px column
     on wide screens so brand and back-link don't sit at the viewport edges. */
  padding-top: max(18px, calc(env(safe-area-inset-top) + 10px));
  padding-bottom: 18px;
  padding-left: max(clamp(20px, 4vw, 56px), env(safe-area-inset-left), calc((100vw - 1280px) / 2));
  padding-right: max(clamp(20px, 4vw, 56px), env(safe-area-inset-right), calc((100vw - 1280px) / 2));
  background: rgba(243, 232, 209, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-soft);
}

.site-bar a { text-decoration: none; color: var(--ink); }

.site-bar-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.18em;
}

.site-bar-mid {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.site-bar-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.2vw, 28px);
}

.site-bar-nav a {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-bar-nav a:hover { color: var(--rose-deep); }

.site-bar-back {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-bar-back:hover { color: var(--rose-deep); }

@media (max-width: 720px) {
  .site-bar-mid,
  .site-bar-nav { display: none; }
}

/* Article container */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px clamp(22px, 5vw, 56px) 96px;
}

.article-header {
  text-align: center;
  margin-bottom: 56px;
}

.article-kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 18px;
  display: inline-flex;
  gap: 14px;
  align-items: center;
}
.article-kicker::before,
.article-kicker::after {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--gold-deep);
  opacity: 0.6;
}

.article-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.6vw, 3.8rem);
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.005em;
}
.article-title em { color: var(--rose-deep); font-weight: 500; }

.article-sub {
  margin: 18px auto 0;
  max-width: 580px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.28rem;
  line-height: 1.45;
  color: var(--sage-deep);
}

.article-meta {
  margin: 28px 0 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Header scene image */
.article-scene {
  display: block;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 48px;
  aspect-ratio: 16 / 5;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 30px 60px -30px rgba(60, 50, 25, 0.4);
}

/* Body prose */
.article-body p { margin: 0 0 1.4em; }

.article-body p.lede {
  font-size: 1.22rem;
  color: var(--ink);
}
.article-body p.lede::first-letter {
  font-family: var(--serif);
  font-size: 4rem;
  font-weight: 600;
  float: left;
  line-height: 0.9;
  margin: 0.08em 0.14em 0 0;
  color: var(--rose-deep);
}

.article-body h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.85rem;
  margin: 2.6em 0 0.6em;
  color: var(--ink);
  line-height: 1.1;
}
.article-body h2 em { color: var(--rose-deep); }

.article-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin: 2em 0 0.4em;
  color: var(--ink);
}

.article-body ul,
.article-body ol {
  margin: 0.4em 0 1.6em;
  padding-left: 1.4em;
}
.article-body li { margin: 0.2em 0; }
.article-body li::marker { color: var(--rose-deep); }

.article-body blockquote {
  margin: 2em 0;
  padding: 6px 0 6px 28px;
  border-left: 1px solid var(--rose);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--sage-deep);
}

.callout {
  margin: 2.4em 0;
  padding: 28px 32px;
  background: rgba(255, 248, 230, 0.75);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.55;
  text-align: center;
  position: relative;
}
.callout::before {
  content: '✦';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  padding: 0 10px;
  color: var(--gold);
  font-size: 0.9rem;
}

/* Section divider */
.divider {
  display: block;
  width: 200px;
  height: 36px;
  margin: 56px auto;
  opacity: 0.85;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 36'><g fill='none' stroke='%234f6553' stroke-width='1.4' stroke-linecap='round'><path d='M20 18 Q 60 6 100 18 Q 140 30 180 18'/></g><circle cx='100' cy='18' r='4' fill='%23c47e6b'/><circle cx='100' cy='18' r='1.4' fill='%23a85e4d'/><circle cx='60' cy='14' r='2.4' fill='%23c4a35a'/><circle cx='140' cy='22' r='2.4' fill='%23c4a35a'/></svg>");
}

/* Related reading */
.related {
  margin: 64px auto 0;
  padding-top: 48px;
  border-top: 1px solid var(--rule-soft);
}

.related-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 22px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.related-card {
  display: block;
  padding: 22px 24px;
  background: rgba(255, 248, 230, 0.7);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--rose);
  box-shadow: 0 18px 36px -20px rgba(60, 50, 25, 0.32);
}

.related-card .k {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.related-card .t {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 4px 0 0;
  color: var(--ink);
}

/* Related block on the blog index — centered, padded as a hub section */
.blog-related {
  max-width: 1080px;
  margin: 24px auto 80px;
  padding: 48px clamp(22px, 5vw, 56px) 0;
}

/* Footer */
.site-foot {
  padding: 32px clamp(20px, 5vw, 56px) 48px;
  border-top: 1px solid var(--rule-soft);
  background: rgba(234, 217, 184, 0.5);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-align: center;
  text-transform: uppercase;
}

/* (Per-page crisis line removed — was noise. /safety/ page is sufficient.) */

/* Blog index */
.blog-hero {
  max-width: 880px;
  margin: 0 auto;
  padding: 80px clamp(22px, 5vw, 56px) 40px;
  text-align: center;
}

.blog-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.05;
  margin: 14px 0 22px;
  letter-spacing: 0.005em;
}
.blog-hero h1 em { color: var(--rose-deep); font-weight: 500; }

.blog-hero .sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.28rem;
  color: var(--sage-deep);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.45;
}

.blog-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px clamp(22px, 4vw, 56px) 100px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 248, 230, 0.85);
  border: 1px solid var(--rule-soft);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 20px 40px -24px rgba(60, 50, 25, 0.3);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--rose);
  box-shadow: 0 28px 50px -22px rgba(60, 50, 25, 0.4);
}

.blog-card-scene {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.blog-card-body {
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.blog-card-kicker {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.blog-card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}

.blog-card-blurb {
  font-family: var(--serif-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

.blog-card-more {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-deep);
  transition: letter-spacing 0.3s ease;
}
.blog-card:hover .blog-card-more { letter-spacing: 0.28em; }

@media (max-width: 720px) {
  /* tap targets on the sticky bar — 44px minimum */
  .site-bar-brand,
  .site-bar-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  body { font-size: 17.5px; }
  .article { padding: 40px 18px 64px; }
  /* the 16:5 painted banner becomes a thin strip on phones — bump to 16:9 */
  .article-scene {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    margin-bottom: 32px;
  }
  /* tighten the blog hub hero on mobile */
  .blog-hero { padding: 56px 22px 32px; }
}

/* honour user's motion preference everywhere on canonical/blog pages */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .related-card,
  .blog-card-more {
    transition: none !important;
  }
  .blog-card:hover,
  .related-card:hover {
    transform: none !important;
  }
}

@media print {
  body { background: white; color: black; font-size: 12pt; }
  body::before { display: none; }
  .site-bar, .site-foot, .related { display: none; }
  .article { padding: 0; max-width: 100%; }
  .article-scene { display: none; }
  .article-title { color: black; }
  .article-kicker { color: #888; }
  .callout { background: white; border: 1px solid #ccc; }
}
