/* final.css — polished & colorful edition (updated)
   - Tweaks and small fixes to perfectly match the generated HTML article
   - Improves image sizing, video fallback, inline-figure rules, accessibility tweaks
   - Drop-in replacement for your previous file
*/

:root {
  --bg-top: #eaf6fb;
  --bg-bottom: #ffffff;
  --brand-blue: #0b61b2;
  --brand-teal: #0ea5a3;
  --accent-purple: #7c5cff;
  --muted: #505b66;
  --card: #ffffff;
  --soft: #f6fbff;
  --btn-radius: 12px;
  --max-width: 1200px;
  --text: #0f172a;
  --shadow-1: 0 8px 28px rgba(10, 25, 45, 0.06);
  --focus-ring: rgba(14, 165, 163, 0.18);
  --glass: rgba(255, 255, 255, 0.6);
}

/* === GLOBAL RESET === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html,
body {
  height: 100%
}

/* === BASE === */
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* === CONTAINER === */
.container {
  max-width: var(--max-width);
  margin: 2.25rem auto;
  padding: 2.25rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.99));
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(10, 25, 45, 0.03);
}

/* ---------------------------
   Top nav (sticky)
   --------------------------- */
.compound-top-nav {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .6rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
  border-radius: 10px;
  border: 1px solid rgba(8, 24, 48, 0.04);
  position: sticky;
  top: 18px;
  z-index: 1200;
  backdrop-filter: blur(6px)
}

.compound-top-nav .btn {
  padding: .5rem .95rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.045);
  background: #fff
}

.compound-top-nav .btn-back-section {
  background: #eef7ff;
  color: #083a66
}

.compound-top-nav .btn-home {
  background: #fff7ed;
  color: #6a4300
}

/* === LINKS === */
a {
  color: var(--brand-blue);
  text-decoration: none
}

a:hover,
a:focus {
  text-decoration: underline;
  outline: none
}

/* === HEADER / HERO === */
.site-header {
  text-align: center;
  padding: 2.1rem 1.25rem;
  background: linear-gradient(180deg, rgba(242, 251, 255, 0.75), rgba(255, 255, 255, 0.95));
  border-radius: 12px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(11, 75, 120, 0.03)
}

.site-header h1 {
  margin: 0 auto .45rem;
  max-width: 980px;
  font-weight: 800;
  line-height: 1.02;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  letter-spacing: -0.02em;
  display: inline-block;
  padding: 8px 14px;
  background: linear-gradient(90deg, var(--accent-purple), var(--brand-blue) 55%, var(--brand-teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 28px rgba(12, 34, 56, 0.06);
  border-radius: 8px
}

.site-header h1::after {
  content: "";
  display: block;
  height: 6px;
  width: 96px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.9), rgba(14, 165, 163, 0.9));
  border-radius: 6px;
  margin: 12px auto 0;
  box-shadow: 0 8px 18px rgba(11, 75, 120, 0.05)
}

.site-header .subtitle {
  margin-top: .6rem;
  color: #334155;
  font-size: clamp(.95rem, 1.6vw, 1.05rem);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  opacity: .96
}

.site-header .lead {
  margin-top: .6rem;
  color: var(--muted);
  font-size: .95rem
}

/* === LAYOUT helpers === */
.layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start
}

.content {
  flex: 1
}

.sidebar {
  width: 300px
}

.sidebar img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 8px 28px rgba(10, 25, 45, 0.06)
}

/* HERO IMAGE */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem
}

.hero-img {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 12px 34px rgba(10, 25, 45, 0.06)
}

/* === SECTION STYLES === */
.section {
  margin-bottom: 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid rgba(13, 31, 55, 0.04)
}

.section:last-of-type {
  border-bottom: none
}

.section h2,
.section h3 {
  font-family: "Merriweather", Georgia, serif;
  font-weight: 700;
  font-size: 1.45rem;
  margin-bottom: .9rem;
  position: relative;
  padding-bottom: .4rem;
  color: #07243a
}

.section h2::after,
.section h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
  border-radius: 3px
}

.section p,
.section ul,
.section ol,
.section table {
  margin-top: 1rem;
  color: #334155
}

/* aside note */
.aside-note {
  background: linear-gradient(180deg, #f6fbff, #ffffff);
  border-left: 4px solid #7dd3fc;
  padding: 12px;
  color: #0f172a;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(11, 75, 120, 0.03)
}

/* === IMAGE / GALLERY === */
.image-gallery {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1rem;
  align-items: stretch
}

.image-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  box-shadow: 0 10px 30px rgba(12, 34, 56, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease
}

@media(min-width:980px) {
  .image-gallery img:first-child {
    grid-column: span 2;
    grid-row: span 2;
    height: auto;
    min-height: 240px
  }
}

.image-gallery img:hover,
.image-gallery img:focus {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 22px 60px rgba(12, 34, 56, 0.14);
  filter: saturate(1.04);
  outline: none
}

@media(max-width:899px) {
  .image-gallery {
    grid-template-columns: 1fr
  }

  .image-gallery img:first-child {
    grid-column: auto;
    grid-row: auto
  }

  .image-gallery img {
    aspect-ratio: 16/9;
    border-radius: 10px
  }
}

/* inline / article images — keep controlled width */
.inline-img,
figure img,
img.inline-img {
  display: block;
  margin: 1.2rem auto;
  width: 100%;
  max-width: 820px;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(12, 34, 56, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform .18s ease
}

/* figure & captions */
figure {
  margin: 1rem auto;
  max-width: 760px;
  text-align: center
}

figcaption {
  font-size: .95rem;
  color: var(--muted);
  margin-top: .45rem
}

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 1rem
}

table th,
table td {
  border: 1px solid rgba(13, 31, 55, 0.05);
  padding: .75rem 1rem;
  text-align: left
}

table th {
  background: #fbfcff;
  font-weight: 700
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0
}

.mini-table td {
  padding: 9px;
  border: 1px solid rgba(13, 31, 55, 0.04)
}

/* study list box */
.study-list {
  background: linear-gradient(180deg, rgba(250, 250, 255, 0.9), rgba(255, 255, 255, 0.96));
  border-left: 4px solid rgba(124, 92, 255, 0.18);
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--muted);
  box-shadow: 0 6px 20px rgba(11, 75, 120, 0.03);
  margin-top: 10px
}

.study-list ol {
  padding-left: 1.05rem
}

.study-list li {
  margin: 6px 0;
  line-height: 1.45;
  color: #243b4c
}

/* === VIDEO WRAPPER === */
.video,
.video-wrapper {
  width: 100%;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 44px rgba(10, 25, 45, 0.06);
  background: #000
}

.video iframe,
.video-wrapper iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0
}

/* make sure videos scale nicely on small screens */
@media(max-width:480px) {

  .video,
  .video-wrapper {
    border-radius: 8px
  }
}

/* === CTA / SHOP BUTTONS === */
.btn-shop {
  display: inline-block;
  padding: .6rem .95rem;
  background: #fff;
  color: #083a66;
  border: 1px solid rgba(11, 75, 120, 0.08);
  font-weight: 800;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(11, 75, 120, 0.06);
  text-decoration: none;
  margin-right: .6rem;
  margin-top: .5rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease
}

.btn-shop:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 46px rgba(11, 75, 120, 0.12);
  background: #f5fbff
}

.btn-buy-now {
  display: inline-block;
  padding: .7rem 1.05rem;
  background: linear-gradient(180deg, var(--brand-blue), #004a91);
  color: #fff !important;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(4, 63, 120, 0.18);
  text-decoration: none;
  font-weight: 800;
  transition: transform .12s ease, box-shadow .12s ease
}

.btn-buy-now:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 72px rgba(4, 63, 120, 0.22)
}

.btn-buy-now:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 12px
}

.btn-depot {
  background: linear-gradient(90deg, #10b981, #0ea5a3);
  color: #fff !important
}

.btn-amazon {
  background: linear-gradient(90deg, #ff9900, #ff7f00);
  color: #fff !important
}

.btn-iherb {
  background: linear-gradient(90deg, #2f855a, #276749);
  color: #fff !important
}

/* base .btn */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border-radius: var(--btn-radius);
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 34px rgba(12, 34, 56, 0.06);
  transition: transform .12s ease
}

.btn:hover {
  transform: translateY(-3px)
}

/* badge */
.badge {
  display: inline-block;
  padding: .25rem .5rem;
  background: linear-gradient(90deg, rgba(14, 165, 163, 0.12), rgba(11, 75, 120, 0.06));
  color: var(--brand-blue);
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
  margin-left: .6rem
}

/* CTA row */
.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px
}

/* === CARD / COMPOUND === */
.compound {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--soft));
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(11, 75, 120, 0.04);
  margin-bottom: 18px;
  box-shadow: 0 8px 28px rgba(10, 25, 45, 0.03)
}

.compound h2 {
  margin-top: 0;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(14, 165, 163, 0.06), rgba(11, 75, 120, 0.02))
}

/* meta small */
.meta {
  color: var(--muted);
  font-size: .95rem
}

/* emphasized key callout */
.kicker {
  display: inline-block;
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: .5rem
}

/* === FOOTER === */
.site-footer {
  background: linear-gradient(180deg, #f6fbff, #ffffff);
  color: #222;
  text-align: center;
  padding: 1.25rem;
  font-weight: 300;
  margin-top: 2rem;
  font-size: .95rem;
  border-radius: 10px;
  border: 1px solid rgba(11, 75, 120, 0.03)
}

footer {
  border-top: 1px solid rgba(11, 75, 120, 0.03);
  padding-top: 14px;
  color: var(--muted);
  font-size: .95rem;
  margin-top: 20px
}

/* === NEXT / PREV Floating Buttons === */
.next-section-button,
.prev-section-button {
  position: fixed;
  bottom: 20px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 36px rgba(7, 24, 40, 0.18);
  transition: transform .12s ease, box-shadow .12s ease;
  z-index: 1100
}

.next-section-button {
  right: 20px;
  background: linear-gradient(90deg, var(--brand-teal), #08a7a0)
}

.prev-section-button {
  left: 20px;
  background: linear-gradient(90deg, var(--brand-blue), #005b9a)
}

.next-section-button:hover,
.prev-section-button:hover {
  transform: scale(1.04)
}

@media(max-width:480px) {

  .next-section-button,
  .prev-section-button {
    bottom: 14px;
    padding: 8px 12px;
    font-size: .9rem;
    border-radius: 10px
  }
}

/* === RESPONSIVE RULES === */
@media(max-width:992px) {
  .layout {
    flex-direction: column
  }

  .sidebar {
    width: 100%;
    order: -1;
    margin-bottom: 1.25rem
  }

  .hero {
    grid-template-columns: 1fr
  }

  .site-header h1 {
    font-size: clamp(1.6rem, 6vw, 2.25rem)
  }

  .compound-top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: .45rem;
    padding: .6rem
  }

  .compound-top-nav .btn {
    width: 100%;
    justify-content: center
  }

  .image-gallery {
    grid-template-columns: 1fr;
    gap: .9rem
  }
}

@media(max-width:768px) {
  .image-gallery img[data-height-fallback] {
    height: 160px
  }

  .cta-row {
    flex-direction: column
  }
}

/* focus accessibility polish */
:focus {
  outline-offset: 3px
}

a:focus,
button:focus,
.btn:focus {
  outline: 3px solid var(--focus-ring);
  border-radius: 10px
}

/* utility spacing */
section {
  margin-bottom: 28px
}

ul {
  margin-top: 8px
}

/* PRINT RULES */
@media print {

  .compound-top-nav,
  .cta-row,
  .btn,
  .btn-buy-now,
  .next-section-button,
  .prev-section-button {
    display: none !important
  }

  .container {
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: 0
  }

  .site-header {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: .5rem
  }

  .site-header h1 {
    color: #000;
    -webkit-text-fill-color: #000;
    background: none;
    text-shadow: none
  }

  .image-gallery {
    display: none
  }

  .section {
    border: none;
    padding: 0;
    margin: 0 0 12px
  }

  .mini-table,
  table {
    page-break-inside: avoid;
    font-size: 12pt
  }
}

/* small nicety: make inline code blocks readable */
code {
  background: #f6f8fb;
  padding: .15rem .4rem;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace
}

/* end of file */