/* ==========================================================
   SoftBridges.org — style.css
   Design tokens
   Display: Fraunces (serif, warm, editorial)
   Body: Source Sans 3
   Signature: the "bridge arc" — a single connecting curve used
   in the logo, section dividers and the rating dial.
   ========================================================== */

:root {
  --ink:        #12181f;
  --paper:      #f4f6f3;
  --paper-dim:  #e8ebe6;
  --teal:       #1f6f5c;
  --teal-dark:  #164f42;
  --gold:       #c98a2c;
  --coral:      #b8503a;
  --line:       rgba(18, 24, 31, 0.12);

  --bg:         var(--paper);
  --bg-raised:  #ffffff;
  --text:       #1c2430;
  --text-dim:   #56606b;
  --accent:     var(--teal);
  --accent-2:   var(--gold);
  --border:     var(--line);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 6px 24px rgba(18, 24, 31, 0.08);
  --max-width: 1120px;
  --content-width: 720px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg:        #12181f;
  --bg-raised: #1b232d;
  --text:      #eef1ee;
  --text-dim:  #a7b0b8;
  --border:    rgba(238, 241, 238, 0.12);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@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; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; margin: 0 0 0.5em; color: var(--text); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================
   HEADER / NAV
   ========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { color: var(--accent); display: inline-flex; }
.brand__text { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand__dot { color: var(--accent); font-weight: 500; }

.primary-nav ul { display: flex; gap: 4px; }
.primary-nav a {
  display: inline-block; padding: 10px 14px; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; border-radius: 999px; color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
}
.primary-nav a:hover { color: var(--text); background: var(--paper-dim); }
.primary-nav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.nav-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--text);
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
}
.icon-btn:hover { border-color: var(--accent); }
.mobile-only { display: none; }

.mobile-nav { border-top: 1px solid var(--border); background: var(--bg); }
.mobile-nav ul { padding: 8px 24px 16px; display: flex; flex-direction: column; }
.mobile-nav a { display: block; padding: 12px 4px; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--border); }

@media (max-width: 860px) {
  .primary-nav { display: none; }
  .mobile-only { display: inline-flex; }
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero__bridge {
  position: absolute; inset: auto 0 -40% 0; height: 340px;
  color: var(--accent); opacity: 0.08; pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  max-width: 14ch;
}
.hero p.lede { font-size: 1.15rem; color: var(--text-dim); max-width: 60ch; }
.hero-topics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-topics a {
  text-decoration: none; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); font-weight: 600; font-size: 0.9rem;
  background: var(--bg-raised);
}
.hero-topics a:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================
   ARTICLE GRID / CARDS
   ========================================================== */
.section-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 56px 0 20px; gap: 16px; flex-wrap: wrap;
}
.section-heading h2 { font-size: 1.6rem; margin: 0; }
.section-heading a { font-weight: 600; color: var(--accent); text-decoration: none; font-size: 0.95rem; }

.article-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding-bottom: 8px;
}
.card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__cover {
  aspect-ratio: 16/9; background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: #fff;
}
.card__cover--image {
  background-size: cover; background-position: center; font-size: 0;
}
.card__body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.card__title { font-family: var(--font-display); font-size: 1.2rem; margin: 0; }
.card__excerpt { color: var(--text-dim); font-size: 0.95rem; flex: 1; }
.card__meta { font-size: 0.82rem; color: var(--text-dim); display: flex; gap: 10px; }

/* ==========================================================
   CATEGORY PAGE
   ========================================================== */
.category-hero { padding: 48px 0 8px; }
.category-hero__icon { font-size: 2.4rem; }
.category-hero h1 { margin-top: 8px; }

/* ==========================================================
   ARTICLE PAGE
   ========================================================== */
.article-header { padding: 48px 0 0; }
.article-cover { max-width: var(--content-width); margin: 32px auto 0; padding: 0 24px; }
.article-cover img { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--radius-lg); }
.article-header .wrap { max-width: var(--content-width); }
.article-header .card__eyebrow { display: inline-block; margin-bottom: 14px; }
.article-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.article-meta { color: var(--text-dim); font-size: 0.92rem; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px;}

.article-body { max-width: var(--content-width); margin: 32px auto 0; padding: 0 24px; font-size: 1.08rem; }
.article-body h2 { font-size: 1.5rem; margin-top: 1.6em; }
.article-body p { margin-bottom: 1.2em; color: var(--text); }

.ad-slot {
  max-width: var(--content-width); margin: 32px auto; padding: 0 24px;
}
.ad-slot__label { text-align: center; font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }

/* ==========================================================
   ENGAGEMENT: RATING + COMMENTS
   ========================================================== */
.engagement { max-width: var(--content-width); margin: 40px auto 80px; padding: 0 24px; }

.rating-block {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 40px;
}
.rating-summary { display: flex; align-items: center; gap: 18px; }
.rating-average { font-family: var(--font-display); font-size: 2.6rem; color: var(--gold); }
.stars { display: flex; gap: 4px; }
.star {
  background: none; border: none; cursor: pointer; font-size: 1.5rem; line-height: 1;
  color: var(--border); padding: 2px; transition: color 0.12s ease, transform 0.12s ease;
}
.star:hover, .star:focus-visible { transform: scale(1.15); }
.star.is-filled, .star.is-hovered { color: var(--gold); }
.rating-count { color: var(--text-dim); font-size: 0.88rem; margin: 4px 0 0; }
.rating-status { min-height: 1.2em; font-size: 0.88rem; color: var(--teal); font-weight: 600; }

.comments-block h2 { font-size: 1.4rem; }
.comment-form {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; margin: 16px 0 32px; display: flex; flex-direction: column; gap: 14px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 600; font-size: 0.92rem; }
.form-row input, .form-row textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  background: var(--bg); color: var(--text); font: inherit; resize: vertical;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--accent); }
.honeypot { position: absolute; left: -9999px; top: -9999px; }
.form-note { font-size: 0.82rem; color: var(--text-dim); margin: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 12px 22px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; width: fit-content;
}
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-dark); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 14px; }
.comment__avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.comment__body { flex: 1; }
.comment__meta { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 4px; }
.comment__meta strong { color: var(--text); margin-right: 8px; }
.comment-empty { color: var(--text-dim); font-style: italic; }

/* ==========================================================
   FORMS (contact page etc.)
   ========================================================== */
.page-body { max-width: var(--content-width); margin: 48px auto 80px; padding: 0 24px; }
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; font-weight: 600; }
.alert--success { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal-dark); }
.alert--error { background: color-mix(in srgb, var(--coral) 15%, transparent); color: var(--coral); }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; background: var(--bg-raised); }
.footer__inner { display: flex; justify-content: space-between; gap: 40px; padding: 48px 24px; flex-wrap: wrap; }
.footer__brand p { color: var(--text-dim); margin-top: 6px; max-width: 32ch; }
.footer__links { display: flex; gap: 56px; }
.footer__links h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-family: var(--font-body); }
.footer__links li { margin-bottom: 8px; }
.footer__links a { text-decoration: none; font-size: 0.95rem; }
.footer__links a:hover { color: var(--accent); }
.footer__bottom { border-top: 1px solid var(--border); padding: 18px 24px; color: var(--text-dim); font-size: 0.85rem; }

/* ==========================================================
   Responsive tweaks
   ========================================================== */
@media (max-width: 600px) {
  .hero { padding: 40px 0 32px; }
  .rating-summary { flex-direction: column; align-items: flex-start; }
  .footer__links { gap: 32px; }
}
