/* ==========================================================================
   Odisha Learning Guide — institutional stylesheet
   No external fonts or CDNs: the site must render identically on a school
   LAN with no internet access.
   ========================================================================== */

:root {
  /* Canvas */
  --canvas:        #f7f7f7;
  --surface:       #ffffff;
  --surface-sunk:  #f1f1f0;

  /* Ink */
  --ink:           #131a26;
  --ink-2:         #3d4757;
  --ink-3:         #6b7585;
  --ink-inverse:   #ffffff;

  /* Institutional palette */
  --navy:          #12243f;
  --navy-2:        #1b3760;
  --navy-deep:     #0c1829;
  --saffron:       #c76a16;
  --green:         #1f6f5c;

  /* Lines */
  --line:          rgba(19, 26, 38, 0.12);
  --line-soft:     rgba(19, 26, 38, 0.07);
  --line-strong:   rgba(19, 26, 38, 0.22);

  /* Elevation — restrained, print-like */
  --shadow-sm: 0 1px 2px rgba(19, 26, 38, 0.05);
  --shadow-md: 0 1px 2px rgba(19, 26, 38, 0.04), 0 8px 24px -12px rgba(19, 26, 38, 0.18);
  --shadow-lg: 0 1px 2px rgba(19, 26, 38, 0.04), 0 24px 56px -28px rgba(19, 26, 38, 0.28);

  /* Type */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Metrics */
  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --gutter:    24px;
  --maxw:      1140px;
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.17;
  letter-spacing: -0.018em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }
a { color: inherit; }

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

:focus-visible {
  outline: 2.5px solid var(--saffron);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* ----- Tricolour rule: the standard Indian government page marker --------- */
.tricolour {
  height: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.tricolour span:nth-child(1) { background: #e07b26; }
.tricolour span:nth-child(2) { background: #f4f4f4; }
.tricolour span:nth-child(3) { background: #16794c; }

/* ----- Utility bar -------------------------------------------------------- */
.utility {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}
.utility .wrap {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  align-items: center; justify-content: space-between;
  min-height: 38px; padding-block: 8px;
}
.utility strong { color: #fff; font-weight: 600; }
.utility .odia { font-size: 13px; }

/* ----- Masthead ----------------------------------------------------------- */
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(140%) blur(8px);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 78px; padding-block: 12px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand .mark {
  width: 44px; height: 44px; flex: none;
  border-radius: 11px;
  background: linear-gradient(180deg, #1c3458, var(--navy));
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--shadow-sm);
}
.brand .mark svg { width: 24px; height: 24px; }
.brand .name { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.2; }
.brand .dept { font-size: 11.5px; color: var(--ink-3); letter-spacing: .055em; text-transform: uppercase; font-weight: 600; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  padding: 9px 13px; border-radius: 8px;
}
.nav a:hover { background: var(--surface-sunk); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--navy); background: var(--surface-sunk); }

/* ----- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: inherit; font-size: 15px; font-weight: 550;
  padding: 12px 20px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #1b3760; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-sunk); border-color: var(--ink-3); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 8px; }

/* ----- Hero --------------------------------------------------------------- */
.hero { padding: 76px 0 56px; border-bottom: 1px solid var(--line-soft); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr); gap: 64px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--saffron); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.hero h1 { font-size: clamp(38px, 5.2vw, 59px); letter-spacing: -0.028em; }
.hero h1 em { font-style: normal; color: var(--navy); position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .22em;
  background: rgba(199, 106, 22, .17); border-radius: 2px; z-index: -1;
}
.lede { font-size: 18.5px; color: var(--ink-2); margin-top: 22px; max-width: 54ch; line-height: 1.62; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { margin-top: 22px; font-size: 13.5px; color: var(--ink-3); }

/* Scan panel */
.scan-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 30px; text-align: center;
}
.scan-panel .label { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.scan-panel .phone {
  margin: 20px auto 0; width: 176px; padding: 11px; border-radius: 22px;
  background: var(--navy-deep); box-shadow: var(--shadow-md);
}
.scan-panel .phone .screen { background: #fff; border-radius: 13px; padding: 13px; }
.scan-panel .phone img { width: 100%; }
.scan-panel .caption { margin-top: 20px; font-size: 14px; color: var(--ink-2); }

/* ----- Section furniture -------------------------------------------------- */
.section { padding: 72px 0; border-bottom: 1px solid var(--line-soft); }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(27px, 3.1vw, 35px); }
.section-head p { margin-top: 14px; color: var(--ink-2); font-size: 17px; }
.kicker {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 13px;
}

/* ----- Steps -------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--surface); padding: 30px 28px; }
.step .num {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 650;
  font-family: var(--mono); margin-bottom: 18px;
}
.step h3 { font-size: 19px; }
.step p { margin-top: 9px; color: var(--ink-2); font-size: 15px; }

/* ----- Lesson cards ------------------------------------------------------- */
.lessons { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 26px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
.card .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-sunk); border-bottom: 1px solid var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(12,24,41,.05), rgba(12,24,41,.42));
}
.card .thumb .play span {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.94);
  display: grid; place-items: center; box-shadow: var(--shadow-md);
}
.card .thumb .play svg { width: 20px; height: 20px; margin-left: 3px; fill: var(--navy); }
.card .body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent, var(--navy)) 10%, transparent);
  color: var(--accent, var(--navy));
  border: 1px solid color-mix(in srgb, var(--accent, var(--navy)) 22%, transparent);
}
.card h3 { font-size: 21px; }
.card .desc { color: var(--ink-2); font-size: 15px; }
.card .meta { display: flex; gap: 16px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card .foot {
  margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.card .qr-mini {
  flex: none; text-decoration: none; display: grid; gap: 5px; justify-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 7px; background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.card .qr-mini:hover { border-color: var(--ink-3); box-shadow: var(--shadow-sm); }
.card .qr-mini img { width: 84px; height: 84px; }
.card .qr-mini span {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ----- Subject page ------------------------------------------------------- */
.subject-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px;
  align-items: start; padding: 8px 0 56px;
}

/* ----- Lesson detail page ------------------------------------------------- */
.crumbs { font-size: 13.5px; color: var(--ink-3); padding: 22px 0; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { text-decoration: underline; }

.lesson-head { padding-bottom: 34px; }
.lesson-head h1 { font-size: clamp(30px, 4vw, 44px); margin-top: 16px; }
.lesson-head .sub { margin-top: 16px; font-size: 17.5px; color: var(--ink-2); max-width: 62ch; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 22px; font-size: 14px; color: var(--ink-3); }
.lesson-meta b { color: var(--ink-2); font-weight: 600; }

.player-shell {
  background: var(--navy-deep); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(0,0,0,.3);
}
.player-shell video { width: 100%; aspect-ratio: 16 / 9; background: #000; }

.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; padding: 36px 0 56px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 22px; }
.panel h2 { font-size: 20px; }
.panel h3 { font-size: 16px; }
.objectives { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.objectives li { display: flex; gap: 12px; font-size: 15.5px; color: var(--ink-2); }
.objectives svg { width: 19px; height: 19px; flex: none; margin-top: 2px; color: var(--green); }

.qr-card { text-align: center; }
.qr-card img { width: 100%; max-width: 216px; margin: 18px auto 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.qr-card .url {
  margin-top: 16px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  word-break: break-all; background: var(--surface-sunk); padding: 10px; border-radius: 8px;
}
.qr-actions { display: grid; gap: 9px; margin-top: 16px; }
.qr-actions .btn { justify-content: center; width: 100%; }

.sidelist { display: grid; gap: 2px; margin-top: 14px; }
.sidelist a {
  display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 9px;
  text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 500;
}
.sidelist a:hover { background: var(--surface-sunk); }
.sidelist .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sidelist small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }

/* ----- Notes / callouts --------------------------------------------------- */
.note {
  display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius-sm);
  background: #fbf6ef; border: 1px solid rgba(199, 106, 22, .26); font-size: 14.5px; color: #6a4414;
}
.note svg { width: 19px; height: 19px; flex: none; margin-top: 2px; }

/* ----- Info rows ---------------------------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fact { background: var(--surface); padding: 26px 24px; }
.fact .v { font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -.02em; }
.fact .k { font-size: 13.5px; color: var(--ink-3); margin-top: 5px; }

.prose { max-width: 68ch; }
.prose p + p { margin-top: 16px; }
.prose p { color: var(--ink-2); font-size: 16.5px; }
.prose h3 { font-size: 20px; margin-top: 32px; }

/* ----- Footer ------------------------------------------------------------- */
.footer { background: var(--navy-deep); color: rgba(255,255,255,.66); padding: 56px 0 30px; font-size: 14.5px; }
.footer a { color: rgba(255,255,255,.86); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 44px; }
.footer h4 { color: #fff; font-family: var(--sans); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 15px; font-weight: 650; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer .legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); font-size: 13px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer .brand .name { color: #fff; }
.footer .brand .dept { color: rgba(255,255,255,.52); }

/* ----- Print posters ------------------------------------------------------ */
.poster {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px; text-align: center; box-shadow: var(--shadow-sm); margin-bottom: 26px;
}
.poster h2 { font-size: 30px; margin-top: 10px; }
.poster .sub { color: var(--ink-2); margin-top: 10px; font-size: 16px; }
.poster img { width: 260px; margin: 26px auto; }
.poster .steps-line { display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.poster .url { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 18px; word-break: break-all; }

@media print {
  .utility, .masthead, .footer, .no-print, .tricolour { display: none !important; }
  body { background: #fff; }
  .poster { break-after: page; border: none; box-shadow: none; padding: 0; margin: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; }
  .section { padding: 0; border: none; }
}

/* ----- Responsive --------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .lesson-grid, .subject-grid { grid-template-columns: 1fr; gap: 30px; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav .hide-sm { display: none; }
}
@media (max-width: 640px) {
  :root { --gutter: 18px; }
  body { font-size: 16px; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 52px 0; }
  .masthead .wrap { min-height: 64px; gap: 10px; }
  .brand { gap: 10px; }
  .brand .mark { width: 36px; height: 36px; border-radius: 9px; }
  .brand .mark svg { width: 20px; height: 20px; }
  .brand .name { font-size: 15.5px; line-height: 1.25; }
  .brand .dept { display: none; }
  .nav { gap: 2px; }
  .nav a { padding: 7px 8px; font-size: 13px; }
  .card .qr-mini img { width: 72px; height: 72px; }
  .utility { font-size: 11.5px; }
  .utility .wrap { min-height: 0; padding-block: 7px; gap: 3px 14px; }
  .footer-grid { grid-template-columns: 1fr; }
  .utility .wrap { justify-content: center; text-align: center; }
}
