/* ==========================================================================
   freestylelibrediabetes.com — site stylesheet
   Palette derived from Medically Modern brand (deep petrol #093E52 + teal)
   ========================================================================== */

:root {
  --navy: #093e52;
  --navy-deep: #06293733;
  --navy-dark: #062c3b;
  --teal: #0f7f8b;
  --teal-dark: #0b5f68;
  --teal-tint: #e9f4f3;
  --teal-tint-2: #d5e9e7;
  --amber: #f6a83c;
  --amber-dark: #e8912a;
  --ink: #122f3d;
  --body-color: #3c5460;
  --muted: #5f7a85;
  --line: #dde9eb;
  --bg-soft: #f5faf9;
  --green: #1d7a4d;
  --green-tint: #e9f5ee;
  --red: #b3402f;
  --red-tint: #faeeec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(9, 62, 82, 0.08);
  --shadow-lg: 0 10px 30px rgba(9, 62, 82, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body-color);
  background: #fff;
  overflow-x: clip;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.85rem, 4.2vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.22rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.1rem; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }

ul, ol { margin: 0 0 1.1rem 1.35rem; }
li { margin-bottom: 0.45rem; }

strong { color: var(--ink); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 1.25rem; }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.6rem;
}

.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.section { padding: 3.5rem 0; }
.section-soft { background: var(--bg-soft); }
.section-tint { background: var(--teal-tint); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.85rem 1.9rem;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--amber);
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(232, 145, 42, 0.35);
}
.btn-primary:hover {
  background: var(--amber-dark);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 145, 42, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: #fff; }

.btn-light {
  background: #fff;
  color: var(--navy);
}
.btn-light:hover { background: var(--teal-tint); color: var(--navy-dark); }

.btn-lg { font-size: 1.12rem; padding: 1rem 2.4rem; }

/* --------------------------------------------------------------------------
   Header / navigation (no-JS mobile menu via checkbox)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(9, 62, 82, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  max-width: 1160px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  min-width: 0;
}
.logo svg { flex: 0 0 34px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo-title {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--navy);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo-sub {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 440px) {
  .logo-title { font-size: 0.92rem; }
  .logo-sub { font-size: 0.62rem; }
}

.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

.site-nav { display: flex; align-items: center; gap: 1.15rem; }
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--teal); }
.site-nav a[aria-current="page"] {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.site-nav .btn { margin-left: 0.35rem; padding: 0.6rem 1.3rem; font-size: 0.94rem; }

@media (max-width: 920px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 1.25rem 1.1rem;
  }
  .nav-toggle-input:checked ~ .site-nav { display: flex; }
  .site-nav a {
    padding: 0.75rem 0.25rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line); }
  .site-nav .btn { margin: 0.9rem 0 0; border-bottom: none; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, #0c4d63 55%, var(--teal-dark) 100%);
  color: #e8f2f4;
  padding: 3.75rem 0 3.25rem;
}
.hero .eyebrow { color: var(--amber); }
.hero h1 { color: #fff; margin-bottom: 1rem; max-width: 21ch; }
.hero p { font-size: 1.14rem; max-width: 58ch; color: #d3e4e8; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin: 1.6rem 0 1.1rem; }
.hero-note { font-size: 0.88rem; color: #b8d2d8; }
.hero-note a { color: #b8d2d8; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #dcebee;
}
.badge svg { flex: 0 0 20px; color: var(--amber); }

/* Page hero (interior pages) */
.page-hero {
  background: linear-gradient(160deg, var(--navy) 0%, #0c4d63 70%, var(--teal-dark) 100%);
  color: #d3e4e8;
  padding: 2.75rem 0 2.5rem;
}
.page-hero h1 { color: #fff; margin-bottom: 0.75rem; }
.page-hero .lede { font-size: 1.12rem; max-width: 62ch; margin-bottom: 0; }
.breadcrumbs {
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
  color: #a7c6cd;
}
.breadcrumbs a { color: #cfe2e6; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span[aria-current] { color: #fff; }

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.card h3 { display: flex; align-items: center; gap: 0.55rem; }
.card h3 svg { flex: 0 0 24px; color: var(--teal); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Checklists / eligibility lists
   -------------------------------------------------------------------------- */
.check-list { list-style: none; margin-left: 0; }
.check-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.7rem;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d7a4d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 62% no-repeat;
}

.x-list { list-style: none; margin-left: 0; }
.x-list li { position: relative; padding-left: 2rem; margin-bottom: 0.7rem; }
.x-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--red-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3402f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center / 55% no-repeat;
}

/* --------------------------------------------------------------------------
   Numbered steps
   -------------------------------------------------------------------------- */
.steps { list-style: none; margin-left: 0; counter-reset: step; }
.steps > li {
  position: relative;
  padding: 0 0 1.6rem 3.4rem;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.15rem;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.13rem;
  top: 2.5rem;
  bottom: 0.2rem;
  width: 2px;
  background: var(--teal-tint-2);
}
.steps h3 { margin-bottom: 0.35rem; }
.steps p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.96rem; min-width: 560px; background: #fff; }
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--bg-soft); }
td strong { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Callouts
   -------------------------------------------------------------------------- */
.note, .warn, .tip {
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  margin: 1.4rem 0;
  font-size: 0.97rem;
}
.note { background: var(--teal-tint); border-left: 4px solid var(--teal); }
.warn { background: #fdf3e4; border-left: 4px solid var(--amber-dark); }
.tip { background: var(--green-tint); border-left: 4px solid var(--green); }
.note p:last-child, .warn p:last-child, .tip p:last-child { margin-bottom: 0; }
.note strong:first-child, .warn strong:first-child, .tip strong:first-child { color: var(--ink); }

/* --------------------------------------------------------------------------
   FAQ accordions
   -------------------------------------------------------------------------- */
.faq-list { margin: 0; }
.faq-list details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 0.8rem;
  overflow: hidden;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  padding: 1.05rem 3rem 1.05rem 1.3rem;
  position: relative;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  top: 50%;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: -0.55rem;
  border-right: 2.5px solid var(--teal);
  border-bottom: 2.5px solid var(--teal);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: rotate(225deg); margin-top: -0.1rem; }
.faq-list details[open] summary { border-bottom: 1px solid var(--line); }
.faq-body { padding: 1.05rem 1.3rem; }
.faq-body p:last-child, .faq-body ul:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(150deg, var(--navy) 0%, var(--teal-dark) 100%);
  border-radius: var(--radius);
  color: #d9e8ec;
  padding: 2.4rem 2.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-lg);
}
.cta-band h2, .cta-band h3 { color: #fff; margin-bottom: 0.4rem; }
.cta-band p { margin: 0; max-width: 48ch; }
.cta-band-text { flex: 1 1 320px; }
.cta-band-actions { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.cta-band-actions .small { color: #b8d2d8; }

.cta-final {
  background: linear-gradient(160deg, var(--navy) 0%, #0c4d63 60%, var(--teal-dark) 100%);
  color: #d3e4e8;
  padding: 3.5rem 0;
  text-align: center;
}
.cta-final h2 { color: #fff; }
.cta-final p { max-width: 60ch; margin: 0.6rem auto 1.6rem; }
.cta-final .small { margin-top: 1rem; color: #b8d2d8; }
.cta-final .small a { color: #cfe2e6; }

/* --------------------------------------------------------------------------
   Article prose
   -------------------------------------------------------------------------- */
.prose h2 { margin-top: 2.6rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.9rem; }
.prose .sources { font-size: 0.85rem; color: var(--muted); }
.prose .sources a { color: var(--muted); }

.updated-line {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.6rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-dark);
  color: #a9c3cb;
  font-size: 0.92rem;
  padding: 3rem 0 2rem;
}
.site-footer a { color: #cfe2e6; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.9rem;
}
.footer-grid ul { list-style: none; margin: 0; }
.footer-grid li { margin-bottom: 0.55rem; }
.footer-about p { margin-bottom: 0.8rem; }

.footer-legal {
  padding-top: 1.6rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #7fa0aa;
}
.footer-legal p { margin-bottom: 0.7rem; }
.footer-legal a { color: #9dbcc4; }

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.2rem; }
.pill {
  display: inline-block;
  background: var(--teal-tint);
  color: var(--teal-dark);
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 0.32rem 0.9rem;
  text-decoration: none;
}
.pill:hover { background: var(--teal-tint-2); color: var(--navy); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: var(--navy);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

@media (max-width: 560px) {
  .section { padding: 2.5rem 0; }
  .hero { padding: 2.75rem 0 2.5rem; }
  .cta-band { padding: 1.8rem 1.4rem; }
  body { font-size: 1rem; }
}

@media print {
  .site-header, .site-footer, .cta-band, .cta-final, .hero-cta { display: none; }
}
