/* =========================================================
   NeckWell Guide — shared design system
   Dependency-free, hand-written CSS.
   ========================================================= */

:root {
  --color-bg: #f7fafc;
  --color-bg-alt: #eef4f9;
  --color-surface: #ffffff;
  --color-text: #1a2733;
  --color-text-muted: #52616f;
  --color-primary: #2b6cb0;
  --color-primary-dark: #1e4e80;
  --color-primary-light: #63b3ed;
  --color-accent: #2f9e94;
  --color-accent-light: #d9f2ef;
  --color-border: #dbe4ec;
  --color-warning-bg: #fff7e6;
  --color-warning-border: #f0c36d;
  --color-good: #2f9e56;
  --color-bad: #c0503e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(24, 55, 82, 0.08);
  --shadow-lg: 0 8px 30px rgba(24, 55, 82, 0.12);
  --max-width: 1120px;
  --font-body: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(43, 108, 176, 0.35);
  text-underline-offset: 2px;
}
a:hover { color: var(--color-primary-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  color: #14232f;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.5em; }

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- Header / Nav ---------------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: #14232f;
}
.brand:hover { color: var(--color-primary-dark); }
.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.brand-tagline {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.nav-toggle {
  display: none;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--color-text);
  margin-left: auto;
}

.main-nav { margin-left: auto; }

.header-cta {
  padding: 9px 18px;
  font-size: 0.88rem;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .header-cta { padding: 8px 14px; font-size: 0.82rem; }
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 500;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--color-accent-light);
  color: var(--color-primary-dark);
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .header-inner { flex-wrap: wrap; }
}

/* ---------------- Buttons / CTAs ---------------- */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.btn-outline:hover { background: var(--color-accent-light); }
.btn-large { padding: 16px 32px; font-size: 1.08rem; }

.cta-note {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(160deg, var(--color-bg-alt) 0%, var(--color-bg) 60%);
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--color-border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 10px;
}

/* ---------------- Page header (non-home) ---------------- */
.page-header {
  background: var(--color-bg-alt);
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--color-border);
}

/* ---------------- Breadcrumbs ---------------- */
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--color-border);
}
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ---------------- Sections ---------------- */
main section {
  padding: 40px 0;
}
main section.tight { padding: 20px 0; }
.section-alt {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* ---------------- Cards / grids ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }

/* ---------------- Pros/Cons ---------------- */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}
@media (max-width: 700px) { .pros-cons { grid-template-columns: 1fr; } }
.pros, .cons {
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--color-border);
}
.pros { background: #f1faf4; border-color: #cdeeda; }
.cons { background: #fdf3f1; border-color: #f3d3cb; }
.pros h3 { color: var(--color-good); margin-top: 0; }
.cons h3 { color: var(--color-bad); margin-top: 0; }
.pros ul, .cons ul { list-style: none; padding: 0; }
.pros li::before { content: "\2713  "; color: var(--color-good); font-weight: 700; }
.cons li::before { content: "\2715  "; color: var(--color-bad); font-weight: 700; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  min-width: 560px;
}
caption { text-align: left; font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 8px; }
th, td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.94rem;
}
th { background: var(--color-bg-alt); font-weight: 700; }

/* ---------------- FAQ (details/summary) ---------------- */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  margin-bottom: 12px;
  padding: 4px 18px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 1.3rem;
  color: var(--color-primary);
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { padding-bottom: 14px; color: var(--color-text-muted); }

/* ---------------- Checklist ---------------- */
.checklist {
  list-style: none;
  padding: 0;
}
.checklist li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.checklist input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

/* ---------------- Callouts ---------------- */
.callout {
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-alt);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
}
.callout-warning {
  border-left-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}
.callout h3 { margin-top: 0; }

.disclosure-banner {
  background: var(--color-accent-light);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 7px 16px;
}
.disclosure-banner a { color: var(--color-primary-dark); }

/* ---------------- Image placeholders ---------------- */
.img-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #dceefc 0%, #eaf6f3 50%, #f4f0e3 100%);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.img-placeholder.square { aspect-ratio: 1 / 1; }
.img-placeholder.wide { aspect-ratio: 16 / 9; }
.img-placeholder-inner {
  text-align: center;
  padding: 18px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.img-placeholder-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--color-primary);
  opacity: 0.6;
}
.img-caption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  text-align: center;
}
.img-real {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-block {
  margin: 22px 0;
}
.img-block img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  display: block;
}
.img-block.img-narrow img {
  max-width: 480px;
  margin: 0 auto;
}
.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.img-gallery figure {
  margin: 0;
}
.img-gallery img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  display: block;
  background: #f4f8fb;
}
.img-gallery figcaption {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  text-align: center;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: #14232f;
  color: #c6d3dd;
  margin-top: 40px;
}
.footer-inner {
  padding: 44px 0 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.site-footer h2, .site-footer h3 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-footer a { color: #c6d3dd; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-disclosure {
  font-size: 0.85rem;
  color: #9fb1bf;
  line-height: 1.6;
}
.footer-bottom {
  border-top: 1px solid #263844;
  padding: 18px 0;
  font-size: 0.8rem;
  color: #8fa1af;
  text-align: center;
}

/* ---------------- Misc ---------------- */
.text-muted { color: var(--color-text-muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.source-list li { margin-bottom: 14px; }
.badge {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
