/* ============================================================
   PADI Open Water Diver – Mini Web – Main Stylesheet
   ============================================================ */

:root {
  --c-primary:        #0077b6;
  --c-primary-dark:   #023e8a;
  --c-primary-light:  #caf0f8;
  --c-accent:         #00b4d8;
  --c-accent-dark:    #0096c7;
  --c-bg:             #f0f6ff;
  --c-surface:        #ffffff;
  --c-text:           #1a2433;
  --c-text-muted:     #55687a;
  --c-border:         #d8e6f0;
  --c-success:        #1e8449;
  --c-success-bg:     #eafaf2;
  --c-success-border: #82e0aa;
  --c-error:          #c0392b;
  --c-error-bg:       #fdf3f2;
  --c-error-border:   #f1948a;
  --c-warning:        #b7770d;
  --c-warning-bg:     #fef9ec;
  --c-warning-border: #f9ca66;
  --c-locked:         #aabfce;

  --font:             -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --radius:           8px;
  --radius-lg:        12px;
  --shadow-sm:        0 1px 4px rgba(0,30,70,.08);
  --shadow-md:        0 4px 14px rgba(0,30,70,.12);
  --shadow-lg:        0 8px 28px rgba(0,30,70,.16);
  --max-w:            1200px;
  --sidebar-w:        272px;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.65;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .45em; }

/* ── Typography scale ── */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem);  line-height: 1.15; }
h2 { font-size: clamp(1.3rem,  3vw, 1.7rem);   line-height: 1.25; }
h3 { font-size: 1.2rem;  line-height: 1.35; }
h4 { font-size: 1rem;    line-height: 1.4;  font-weight: 600; }

/* ── Utility ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }


/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--c-primary-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; color: var(--c-accent); }
.logo-badge {
  background: var(--c-accent);
  color: var(--c-primary-dark);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  overflow: hidden;
}
.header-breadcrumb a { color: rgba(255,255,255,.8); }
.header-breadcrumb a:hover { color: #fff; text-decoration: none; }
.header-breadcrumb .sep { opacity: .5; }
.header-breadcrumb .current { color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ============================================================
   INDEX PAGE – HERO
   ============================================================ */
.hero {
  background: linear-gradient(155deg, #012a6e 0%, #0066a8 55%, #00a8d0 100%);
  color: #fff;
  padding: 72px 24px 96px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Ccircle cx='80%25' cy='30%25' r='280' fill='rgba(0,180,216,.12)'/%3E%3Ccircle cx='10%25' cy='70%25' r='180' fill='rgba(0,150,200,.1)'/%3E%3C/svg%3E") no-repeat center/cover;
}
.hero__wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
}
.hero__wave svg { display: block; width: 100%; }
.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 { font-weight: 800; margin-bottom: 14px; max-width: 640px; }
.hero__subtitle { font-size: 1.1rem; opacity: .88; max-width: 560px; margin-bottom: 32px; line-height: 1.6; }
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--c-primary-dark);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: all .2s;
}
.hero__cta:hover {
  background: var(--c-accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.hero__stats {
  display: flex;
  gap: 36px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero__stat { opacity: .88; }
.hero__stat-num { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.hero__stat-label { font-size: .8rem; opacity: .75; margin-top: 2px; }


/* ============================================================
   INDEX PAGE – COURSE NAVIGATION
   ============================================================ */
.course-nav { padding: 52px 0 72px; }
.course-nav__title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-text-muted);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.course-nav__title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--c-border);
  display: none; /* already have border-bottom */
}

.chapter-block {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow .2s;
}
.chapter-block:hover { box-shadow: var(--shadow-md); }

.chapter-block__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 22px;
  background: linear-gradient(90deg, #f4f8ff, #f9fbff);
  border-bottom: 1px solid var(--c-border);
}
.chapter-block__num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chapter-block__header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
}
.chapter-block__header .ch-badge {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 600;
  color: var(--c-text-muted);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.chapter-items { list-style: none; padding: 0; }
.chapter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  border-bottom: 1px solid #f2f7fb;
  transition: background .15s;
}
.chapter-item:last-child { border-bottom: none; }

.chapter-item__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.chapter-item.available .chapter-item__dot { background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 700; }
.chapter-item.locked   .chapter-item__dot { background: #eaf0f5; color: var(--c-locked); }
.chapter-item.optional .chapter-item__dot { background: #fff8e1; color: #b7770d; }

.chapter-item__label { flex: 1; font-size: .92rem; }
.chapter-item.available .chapter-item__label { color: var(--c-text); font-weight: 500; }
.chapter-item.locked   .chapter-item__label { color: var(--c-text-muted); }
.chapter-item.optional .chapter-item__label { color: var(--c-text-muted); font-style: italic; }

.chapter-item.available { cursor: pointer; }
.chapter-item.available:hover { background: #f4f9ff; }
.chapter-item.available a { color: var(--c-text); display: contents; }
.chapter-item.available:hover .chapter-item__label { color: var(--c-primary); }

.chapter-item__arrow { color: var(--c-primary); opacity: 0; font-size: .9rem; transition: opacity .15s, transform .15s; }
.chapter-item.available:hover .chapter-item__arrow { opacity: 1; transform: translateX(4px); }

/* Optional / RDP section */
.chapter-block.optional .chapter-block__num { background: #b7770d; }
.chapter-block.optional .chapter-block__header { background: linear-gradient(90deg, #fefaed, #fffef8); }


/* ============================================================
   CHAPTER PAGE LAYOUT
   ============================================================ */
.chapter-page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

/* Sidebar */
.chapter-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sidebar-card__title {
  padding: 12px 18px;
  background: var(--c-primary-dark);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.sidebar-nav { list-style: none; padding: 6px 0; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: .86rem;
  color: var(--c-text-muted);
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar-nav li a:hover,
.sidebar-nav li.active a {
  color: var(--c-primary);
  background: #f0f8ff;
  border-left-color: var(--c-primary);
  text-decoration: none;
}
.sidebar-nav__num {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--c-bg);
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--c-border);
}
.sidebar-nav li.active .sidebar-nav__num {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: .86rem;
  color: var(--c-text-muted);
  transition: all .15s;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
.back-link:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
  text-decoration: none;
  background: #f0f8ff;
}

/* Main content column */
.chapter-content { flex: 1; min-width: 0; }

/* Content section cards */
.content-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}
.content-card__header {
  padding: 22px 30px 18px;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(135deg, #f6faff 0%, #fff 60%);
}
.content-card__tag {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-accent-dark);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.content-card__header h2 { color: var(--c-primary-dark); }
.content-card__body {
  padding: 26px 30px 30px;
}
.content-card__body p { margin-bottom: 15px; line-height: 1.75; }
.content-card__body p:last-child { margin-bottom: 0; }
.content-card__body h3 {
  color: var(--c-primary-dark);
  margin: 28px 0 10px;
  font-size: 1.15rem;
}
.content-card__body h4 {
  color: var(--c-text);
  margin: 20px 0 8px;
}
.content-card__body ul,
.content-card__body ol { margin: 10px 0 16px; }
.content-card__body li { margin-bottom: 8px; line-height: 1.7; }

/* Learning goals box */
.learning-goals {
  background: #f0f8ff;
  border-left: 4px solid var(--c-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 0 0 24px;
}
.learning-goals__title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-accent-dark);
  margin-bottom: 10px;
}
.learning-goals ol { margin: 0; }
.learning-goals li { font-size: .9rem; color: var(--c-text-muted); margin-bottom: 7px; }

/* Info / safety callout */
.callout {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: .9rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout--info    { background: #e8f4fd; border-left: 4px solid var(--c-accent); }
.callout--safety  { background: #fff8e1; border-left: 4px solid #ffd54f; }
.callout--warning { background: var(--c-warning-bg); border-left: 4px solid #f39c12; }
.callout__icon { font-size: 1.2rem; flex-shrink: 0; }
.callout__text { line-height: 1.6; }

/* Qualification comparison box */
.qual-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.qual-box {
  background: linear-gradient(135deg, #e8f4fd, #f5f9ff);
  border: 1px solid #b3d9f0;
  border-radius: var(--radius);
  padding: 18px;
}
.qual-box h4 { color: var(--c-primary-dark); margin-bottom: 10px; font-size: .95rem; }
.qual-box ul { font-size: .88rem; }
.qual-box li { margin-bottom: 7px; }

/* Image wrapper */
.img-wrap {
  margin: 20px 0;
  text-align: center;
}
.img-wrap img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  max-height: 320px;
  width: auto;
  max-width: 100%;
}
.img-wrap.img-wrap--sm img { max-height: 200px; }
.img-wrap.img-wrap--full { display: block; }
.img-wrap.img-wrap--full img { max-height: none; width: 100%; object-fit: cover; max-width: 600px; margin: 0 auto; }

/* 4E philosophy */
.four-e-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.four-e-item {
  background: #f4f8ff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.four-e-item .e-letter {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--c-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.four-e-item h4 { margin: 0 0 6px; font-size: .9rem; color: var(--c-primary-dark); }
.four-e-item p { font-size: .85rem; color: var(--c-text-muted); margin: 0; }

/* Reasons to dive grid */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.reason-card {
  background: #f7fbff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.reason-card__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.reason-card__text { font-size: .88rem; color: var(--c-text); line-height: 1.55; }
.reason-card__text strong { display: block; color: var(--c-primary-dark); margin-bottom: 3px; font-size: .9rem; }

/* Lifestyle tips */
.lifestyle-steps { list-style: none; padding: 0; margin: 16px 0; }
.lifestyle-steps li {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f5fa;
}
.lifestyle-steps li:last-child { border-bottom: none; }
.lifestyle-step__num {
  width: 28px;
  height: 28px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.lifestyle-step__text { font-size: .92rem; line-height: 1.65; }

/* Learning tips accordion-style list */
.learning-tips { list-style: none; padding: 0; margin: 16px 0; }
.learning-tip {
  padding: 16px 18px;
  background: #f8fbff;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  margin-bottom: 10px;
}
.learning-tip__title {
  font-weight: 700;
  color: var(--c-primary-dark);
  margin-bottom: 6px;
  font-size: .95rem;
}
.learning-tip__why {
  font-size: .84rem;
  color: var(--c-text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--c-border);
  font-style: italic;
}


/* ============================================================
   QUIZ COMPONENT
   ============================================================ */
.quiz-section {
  margin-top: 32px;
  background: #f5f9ff;
  border: 2px solid var(--c-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.quiz-section__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: var(--c-primary);
  color: #fff;
}
.quiz-section__header .quiz-icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.quiz-section__header h3 { font-size: 1.05rem; color: #fff; }
.quiz-section__body { padding: 22px 24px 24px; }

.quiz-question {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.question-num {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-accent-dark);
  margin-bottom: 8px;
}
.question-text {
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.55;
  margin-bottom: 14px;
}
.quiz-options { list-style: none; padding: 0; margin: 0; }
.quiz-option {
  border-radius: 6px;
  margin-bottom: 7px;
  transition: background .12s;
}
.quiz-option label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1.5;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  transition: all .15s;
  user-select: none;
}
.quiz-option label:hover { background: #eef5ff; border-color: var(--c-primary-light); }
.quiz-option input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--c-primary);
  width: 15px;
  height: 15px;
}
.quiz-option.correct label {
  background: var(--c-success-bg);
  border-color: var(--c-success-border);
  color: var(--c-success);
  font-weight: 600;
}
.quiz-option.incorrect label {
  background: var(--c-error-bg);
  border-color: var(--c-error-border);
  color: var(--c-error);
}
.question-feedback {
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: 5px;
  font-size: .84rem;
  font-weight: 600;
  display: none;
}
.question-feedback.success { display: block; color: var(--c-success); background: var(--c-success-bg); border: 1px solid var(--c-success-border); }
.question-feedback.error   { display: block; color: var(--c-error);   background: var(--c-error-bg);   border: 1px solid var(--c-error-border);   }
.question-feedback.warning { display: block; color: var(--c-warning); background: var(--c-warning-bg); border: 1px solid var(--c-warning-border); }

.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.quiz-result {
  margin-top: 14px;
  padding: 13px 18px;
  border-radius: var(--radius);
  font-size: .9rem;
  display: none;
}
.quiz-result.success { display: block; background: var(--c-success-bg); color: var(--c-success); border: 1px solid var(--c-success-border); }
.quiz-result.error   { display: block; background: var(--c-error-bg);   color: var(--c-error);   border: 1px solid var(--c-error-border);   }
.quiz-result.warning { display: block; background: var(--c-warning-bg); color: var(--c-warning); border: 1px solid var(--c-warning-border); }


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .18s;
  line-height: 1.4;
}
.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.btn-primary:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn-outline:hover {
  background: #f0f8ff;
  text-decoration: none;
}
.btn-ghost {
  background: var(--c-surface);
  color: var(--c-text-muted);
  border-color: var(--c-border);
}
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }


.header-logout {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.3);
  white-space: nowrap;
  transition: all .15s;
  text-decoration: none;
}
.header-logout:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}
.header-user {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
  display: none;
}
@media (min-width: 540px) { .header-user { display: block; } }


/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-primary-dark);
  color: rgba(255,255,255,.65);
  text-align: center;
  padding: 36px 24px;
  font-size: .88rem;
  margin-top: 48px;
}
.site-footer a { color: var(--c-accent); }
.site-footer strong { color: rgba(255,255,255,.85); }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .qual-compare { grid-template-columns: 1fr; }
  .four-e-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .chapter-page-wrap { flex-direction: column; padding: 16px 16px 48px; gap: 0; }
  .chapter-sidebar { width: 100%; position: static; }
  .sidebar-card { margin-bottom: 12px; }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding: 8px; gap: 6px; }
  .sidebar-nav li a {
    border-left: none;
    border-radius: 20px;
    padding: 5px 12px;
    border: 1px solid var(--c-border);
    font-size: .8rem;
  }
  .sidebar-nav li a:hover, .sidebar-nav li.active a {
    border-left: none;
    border-color: var(--c-primary);
  }
  .back-link { width: auto; display: inline-flex; margin-bottom: 16px; }
  .content-card__header { padding: 18px 20px 14px; }
  .content-card__body { padding: 18px 20px 22px; }
  .quiz-section__body { padding: 16px 18px 20px; }
  .reasons-grid { grid-template-columns: 1fr; }
  .four-e-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 20px 76px; }
}

@media (max-width: 480px) {
  .hero__stats { gap: 24px; }
  .header-breadcrumb { display: none; }
  .qual-compare { grid-template-columns: 1fr; }
}

/* ============================================================
   PROGRESS / LOCKED STATE (index navigation)
   ============================================================ */
/* Status pill shown at the end of a chapter item (right side). */
.chapter-item__tag {
  margin-left: auto;
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 12px;
  white-space: nowrap;
}
.chapter-item__tag--soon   { background: #fff4e0; color: #b7770d; border: 1px solid #f3d9a8; }
.chapter-item__tag--locked { background: #eef1f5; color: var(--c-locked); border: 1px solid #dde3ea; }
.chapter-item__tag--done   { background: #e4f7ec; color: #1f8a4c; border: 1px solid #bfe9cf; }

/* A locked item is not a link – dim it and block the pointer. */
.chapter-item.locked { cursor: not-allowed; }
.chapter-item.locked .chapter-item__label { color: var(--c-text-muted); }
.chapter-item.locked .chapter-item__arrow { display: none; }

/* A whole chapter that is still locked: dim the header + lock icon. */
.chapter-block.is-locked { opacity: .82; }
.chapter-block.is-locked .chapter-block__header { background: linear-gradient(90deg, #eef1f5, #f6f8fb); }
.chapter-block.is-locked .chapter-block__num { background: var(--c-locked); }
.chapter-block.is-locked:hover { box-shadow: var(--shadow-sm); }

.chapter-block__lock {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--c-locked);
  background: #eef1f5;
  border: 1px solid #dde3ea;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.chapter-block.is-locked .ch-badge { display: none; }

/* "You need to finish chapter X first" banner on the overview page. */
.locked-banner {
  max-width: var(--max-w);
  margin: 18px auto 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff4e0;
  border: 1px solid #f3d9a8;
  border-radius: var(--radius);
  color: #8a5a06;
  font-size: .92rem;
}
.locked-banner__icon { font-size: 1.2rem; }

/* Unlock confirmation line inside a quiz result. */
.quiz-unlock {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: #1f8a4c;
}

/* ============================================================
   IMAGE LIGHTBOX (clickable image preview)
   ============================================================ */
/* Make content images obviously interactive. */
.img-wrap img,
img.zoomable {
  cursor: zoom-in;
  transition: transform .15s, box-shadow .15s;
}
.img-wrap img:hover,
img.zoomable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(4, 22, 44, .82);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 95vw;
  max-height: 82vh;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  background: #fff;
  cursor: zoom-out;
  transform: scale(.96);
  transition: transform .2s;
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__caption {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  text-align: center;
  color: #eaf4ff;
  font-size: .9rem;
  line-height: 1.4;
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .3); }

/* ============================================================
   IMAGE + TEXT SIDE BY SIDE
   ============================================================ */
.media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: center;
  margin: 22px 0;
}
.media-row--narrow { grid-template-columns: 0.9fr 1.1fr; }
.media-row--wide   { grid-template-columns: 1.1fr 0.9fr; }
.media-row .media-row__img { margin: 0; }
.media-row .media-row__img img { max-height: 280px; }
.media-row .media-row__text > :first-child { margin-top: 0; }
.media-row .media-row__text > :last-child { margin-bottom: 0; }
/* Image on the right instead of the left. */
.media-row--reverse .media-row__img { order: 2; }

@media (max-width: 720px) {
  .media-row,
  .media-row--narrow,
  .media-row--wide { grid-template-columns: 1fr; }
  .media-row--reverse .media-row__img { order: 0; }
}
