/*
 * Wisest Friends — main stylesheet
 * Light theme in faded pastel tones: sage, powder blue, sand, muted teal.
 * No inline styles are used anywhere in the site; the Content-Security-Policy
 * forbids them. Keep all presentation in this file.
 */

/* ---------- Design tokens ---------- */

:root {
  --paper: #f7f4ed;
  --surface: #fffefb;
  --surface-tint: #f1ede2;
  --ink: #33475a;
  --ink-soft: #5d7080;
  --ink-faint: #8a97a3;
  --line: #e5e0d2;
  --line-strong: #d0c9b8;

  --navy: #2f4d66;
  --navy-deep: #263f55;

  --teal: #679a8c;
  --teal-deep: #4d7d70;
  --teal-tint: #e2eee7;

  --sage: #b9cfc0;
  --sage-tint: #eaf1ea;

  --sky: #a9c4d8;
  --sky-deep: #7d9cb5;
  --sky-tint: #e8eff5;

  --sand: #e3d3ae;
  --sand-deep: #c2975c;
  --sand-tint: #f5eeda;

  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;

  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 18px;
  --shadow-card: 0 1px 2px rgba(47, 77, 102, 0.05), 0 10px 28px -14px rgba(47, 77, 102, 0.16);
  --shadow-card-hover: 0 2px 4px rgba(47, 77, 102, 0.07), 0 18px 36px -14px rgba(47, 77, 102, 0.22);

  --measure: 44.5rem;
  --wrap: 72rem;
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--teal-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-deep);
  margin: 0;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Utility ---------- */

.wrap {
  width: min(var(--wrap), 100% - 3rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-s);
  transition: top 120ms ease;
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  background: rgba(255, 254, 251, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--navy-deep);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--navy-deep);
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.9rem;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 500;
  padding-block: 0.3rem;
  border-bottom: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.site-nav a:hover {
  color: var(--navy-deep);
  border-bottom-color: var(--sage);
  text-decoration: none;
}

/* ---------- Lead story ---------- */

.lead {
  background:
    radial-gradient(44rem 26rem at 92% -10%, rgba(169, 196, 216, 0.26), transparent 62%),
    radial-gradient(36rem 22rem at 2% 110%, rgba(185, 207, 192, 0.28), transparent 60%),
    radial-gradient(28rem 18rem at 55% 125%, rgba(227, 211, 174, 0.2), transparent 65%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.lead .wrap {
  padding-block: 3.25rem 3.75rem;
}

.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 3.25rem;
  align-items: center;
}

.lead-kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-deep);
  border-bottom: 2px solid var(--sand);
  padding-bottom: 0.35rem;
  margin-bottom: 1.2rem;
}

.lead-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.lead-title a {
  color: var(--navy-deep);
}

.lead-title a:hover {
  color: var(--teal-deep);
  text-decoration: none;
}

.lead-excerpt {
  margin-top: 1.2rem;
  max-width: 54ch;
  font-size: 1.06rem;
  color: var(--ink-soft);
}

.lead-byline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.4rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

.lead-byline .author {
  color: var(--navy-deep);
  font-weight: 600;
}

.lead-actions {
  margin-top: 1.9rem;
}

.lead-media {
  display: block;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  background: var(--surface);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.lead-media:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.lead-media img,
.lead-media svg {
  width: 100%;
  aspect-ratio: 15 / 8;
  object-fit: cover;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.72rem 1.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button-primary {
  background: var(--navy);
  color: #fdfcf8;
}

.button-primary:hover {
  background: var(--navy-deep);
}

.button-secondary {
  background: var(--surface);
  color: var(--navy-deep);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  border-color: var(--teal);
  background: var(--teal-tint);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Section scaffolding ---------- */

.section {
  padding-block: 3.5rem 4rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.2rem;
}

.section-head h2,
.about-band h2 {
  font-size: 1.7rem;
  letter-spacing: -0.01em;
}

.section-head h2::after,
.about-band h2::after {
  content: "";
  display: block;
  width: 3.4rem;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--teal) 0 40%, var(--sky) 40% 70%, var(--sand) 70%);
  margin-top: 0.7rem;
}

/* ---------- Post cards ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.6rem;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 1.8rem 1.7rem 1.5rem;
  box-shadow: var(--shadow-card);
  color: inherit;
  overflow: hidden;
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--teal);
}

.post-card.accent-sky::before {
  background: var(--sky);
}

.post-card.accent-sand::before {
  background: var(--sand);
}

.post-card.accent-sage::before {
  background: var(--sage);
}

.post-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--line-strong);
}

.post-card-media {
  margin: calc(-1.8rem + 5px) -1.7rem 1.3rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-tint);
}

.post-card-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card-date {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.post-card h3 {
  font-size: 1.28rem;
  margin-top: 0.65rem;
}

.post-card-excerpt {
  margin-top: 0.8rem;
  font-size: 0.94rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  margin-top: auto;
  padding-top: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.post-card-read {
  font-weight: 600;
  color: var(--teal-deep);
}

.post-card:hover .post-card-read {
  color: var(--teal);
}

/* ---------- Principles strip ---------- */

.principles {
  background:
    radial-gradient(34rem 18rem at 12% 0%, rgba(169, 196, 216, 0.16), transparent 60%),
    radial-gradient(30rem 18rem at 92% 100%, rgba(227, 211, 174, 0.18), transparent 60%),
    var(--surface);
  border-block: 1px solid var(--line);
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2.5rem;
}

.principle .icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.2rem;
}

.principle h3 {
  font-size: 1.12rem;
}

.principle p {
  margin-top: 0.6rem;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

/* ---------- About band ---------- */

.about-band .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
}

.about-copy p {
  color: var(--ink-soft);
  margin-top: 1.1rem;
}

.about-art {
  justify-self: center;
  width: 100%;
  max-width: 24rem;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  background: linear-gradient(180deg, #2c4a63, var(--navy-deep));
  color: #ccd8de;
  margin-top: 3rem;
  overflow: hidden;
}

.footer-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-footer .wrap {
  position: relative;
  padding-block: 3.25rem 2.25rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-brand .brand-mark {
  width: 2.6rem;
  height: 2.6rem;
}

.footer-brand .brand-name {
  color: #fdfcf8;
}

.footer-brand .brand-tag {
  color: #a3c4b4;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #ccd8de;
  font-size: 0.92rem;
}

.footer-nav a:hover {
  color: #fdfcf8;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.6rem;
  font-size: 0.82rem;
  color: #93a6b3;
}

/* ---------- Article page ---------- */

.article-shell {
  position: relative;
  padding-block: 3rem 2rem;
  background:
    radial-gradient(38rem 20rem at 92% -6rem, rgba(169, 196, 216, 0.2), transparent 62%),
    radial-gradient(30rem 18rem at 2% 0%, rgba(185, 207, 192, 0.2), transparent 60%);
}

.article-ornament {
  width: 8.5rem;
  margin: 0 auto 2rem;
}

.article {
  width: min(var(--measure), 100% - 3rem);
  margin-inline: auto;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0;
  font-size: 0.88rem;
  color: var(--ink-faint);
  margin-top: 1.4rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

.article-meta .author {
  color: var(--navy-deep);
  font-weight: 600;
}

.article-meta .sep {
  margin-inline: 0.7rem;
  color: var(--line-strong);
}

.article h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.015em;
}

.article-body {
  padding-top: 2rem;
}

.article-body p {
  margin: 0 0 1.35rem;
  font-size: 1.04rem;
  color: var(--ink);
}

.article-body h2 {
  font-size: 1.5rem;
  margin: 2.4rem 0 1rem;
  padding-left: 0.9rem;
  border-left: 4px solid var(--sage);
}

.article-body ul {
  margin: 0 0 1.35rem;
  padding-left: 1.3rem;
  color: var(--ink);
}

.article-body li {
  margin-bottom: 0.45rem;
  font-size: 1.02rem;
}

.article-body li::marker {
  color: var(--teal);
}

.article-body blockquote {
  margin: 1.9rem 0;
  padding: 1.1rem 1.5rem;
  border-left: 4px solid var(--teal);
  background: linear-gradient(90deg, var(--teal-tint), var(--sky-tint));
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--navy-deep);
}

.article-body figure {
  margin: 2.2rem 0;
}

.article-body figure img {
  width: 100%;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--surface);
}

.article-body figcaption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-align: center;
}

.article-footer {
  margin-top: 2.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.92rem;
}

/* ---------- Status and error panels ---------- */

.status-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-m);
  padding: 2rem;
  text-align: center;
  color: var(--ink-soft);
}

.status-panel.error {
  border-color: #dcc3a8;
  background: #f9f1e6;
  color: #7d5a32;
}

/* ---------- Comments ---------- */

.comments-shell {
  width: min(var(--measure), 100% - 3rem);
  margin-inline: auto;
  padding-block: 1rem 4rem;
}

.comments-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 2rem 2rem 1.8rem;
  box-shadow: var(--shadow-card);
}

.comments-card > h2 {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.comments-note {
  margin-top: 0.8rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

#disqus_thread {
  margin-top: 1.2rem;
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 55vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 4rem;
}

.notfound h1 {
  font-size: 2.2rem;
  margin-top: 1.5rem;
}

.notfound p {
  margin-top: 0.8rem;
  color: var(--ink-soft);
}

.notfound .button {
  margin-top: 1.8rem;
}

.notfound-art {
  width: 7rem;
  margin-inline: auto;
}

/* ---------- Briefings index page ---------- */

.page-head {
  background:
    radial-gradient(40rem 22rem at 90% -10%, rgba(169, 196, 216, 0.24), transparent 62%),
    radial-gradient(32rem 20rem at 4% 115%, rgba(185, 207, 192, 0.26), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-head .wrap {
  padding-block: 3rem 2.5rem;
}

.page-head h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  letter-spacing: -0.015em;
}

.page-head h1::after {
  content: "";
  display: block;
  width: 3.4rem;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--teal) 0 40%, var(--sky) 40% 70%, var(--sand) 70%);
  margin-top: 0.7rem;
}

.page-head .page-lede {
  margin-top: 1rem;
  max-width: 56ch;
  color: var(--ink-soft);
}

.search-box {
  position: relative;
  max-width: 26rem;
  margin-top: 1.8rem;
}

.search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  width: 1.05rem;
  height: 1.05rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.7rem 1.2rem 0.7rem 2.6rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.search-box input::placeholder {
  color: var(--ink-faint);
}

.search-box input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(103, 154, 140, 0.2);
}

.search-meta {
  margin-top: 0.8rem;
  font-size: 0.86rem;
  color: var(--ink-faint);
  min-height: 1.2em;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 2.6rem;
}

.page-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  padding-inline: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.page-btn:hover:not(:disabled):not(.current) {
  border-color: var(--teal);
  background: var(--teal-tint);
  color: var(--navy-deep);
}

.page-btn.current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fdfcf8;
  cursor: default;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--ink-faint);
  padding-inline: 0.2rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .lead-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .lead .wrap {
    padding-block: 2.5rem 3rem;
  }

  .tagline-bar .dateline {
    display: none;
  }

  .about-band .wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-art {
    max-width: 20rem;
  }

  .site-nav {
    gap: 1.2rem;
  }
}

@media (max-width: 520px) {
  .brand-tag {
    display: none;
  }

  .comments-card {
    padding: 1.4rem 1.2rem;
  }
}
