/* Curso de tiro deportivo · estilos */
@font-face { font-family: Montserrat; src: url(../fonts/Montserrat-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Montserrat; src: url(../fonts/Montserrat-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: Montserrat; src: url(../fonts/Montserrat-Italic.ttf); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #f4f6fb; --surface: #ffffff; --text: #1b2440; --muted: #5e6e96; --band: #162c5c; --band-text: #ffffff;
  --gold: #e8a420; --gold-text: #a86f00; --link: #955f00; --link-hover: #7a4d00; --on-link: #ffffff; --line: #d5ddee; --soft: #eef2fa; --cream: #fff5dc; --figbg: #ffffff;
  --shadow: 0 6px 24px rgba(22, 44, 92, .10); --top: #162c5c;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a1836; --surface: #10224b; --text: #e8edf8; --muted: #a3b3d6; --band: #1b3a72; --band-text: #ffffff;
  --gold: #f4b84a; --gold-text: #f4b84a; --link: #f4b84a; --link-hover: #ffc865; --on-link: #0c1d42; --line: #263f78; --soft: #152b59; --cream: rgba(244, 184, 74, .13); --figbg: #0e1e42;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35); --top: #0c1d42;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 Montserrat, "Segoe UI", system-ui, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #162c5c; padding: 10px 16px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; top: 8px; }

/* barra superior */
.top { position: sticky; top: 0; z-index: 40; background: var(--top); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 64px; box-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.2; min-width: 0; }
.brand .dot { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #162c5c; display: grid; place-items: center; font-size: 13px; }
.brand span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .grow { flex: 1; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; font-size: 19px; }
.icon-btn:hover { background: rgba(255, 255, 255, .18); }
#menu-btn { display: none; }
.search { position: relative; flex: 0 1 340px; }
.search input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; padding: 0 14px; font: inherit; font-size: 15px; }
.search input::placeholder { color: rgba(255, 255, 255, .7); }
.results { position: absolute; right: 0; left: 0; top: 52px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; display: none; }
.results.open { display: block; }
.results a { display: block; padding: 11px 14px; text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a:focus { background: var(--soft); }
.results b { color: var(--gold-text); }
.results .w { display: block; color: var(--muted); font-size: 12.5px; }
.results .none { padding: 14px; color: var(--muted); font-size: 14px; }

/* estructura */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.side { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow: auto; padding: 22px 14px 40px 18px; border-right: 1px solid var(--line); }
.side h2 { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); margin: 0 0 10px 8px; }
.side a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; text-decoration: none; font-size: 14px; line-height: 1.35; color: var(--text); }
.side a:hover { background: var(--soft); }
.side a.on { background: var(--band); color: #fff; font-weight: 700; }
.side .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.side a.on .n { background: var(--gold); color: #162c5c; }
.side a.done .n { background: var(--gold); color: #162c5c; }
.side a.done .n::before { content: "✓"; }
.side a.done .n span { display: none; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 12px 6px; }
main { padding: 26px clamp(16px, 4vw, 48px) 70px; min-width: 0; }
.wrap { max-width: 860px; margin: 0 auto; }

/* cabecera de capitulo */
.band { background: var(--band); color: var(--band-text); border-radius: 16px; padding: 24px 26px 26px 34px; position: relative; box-shadow: var(--shadow); }
.band::before { content: ""; position: absolute; left: 18px; top: 22px; bottom: 22px; width: 5px; border-radius: 3px; background: var(--gold); }
.band .tag { color: var(--gold); font-weight: 700; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; }
.band h1 { margin: 6px 0 0; font-size: clamp(24px, 4.2vw, 36px); line-height: 1.18; }
.hero { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; margin: 24px 0 8px; align-items: start; }
.hero img { border-radius: 12px; box-shadow: var(--shadow); width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 700; font-size: 14.5px; }
.btn:hover { border-color: var(--gold); }
a.btn, .btn.gold { background: var(--link); border-color: var(--link); color: var(--on-link); }
a.btn:hover, .btn.gold:hover { background: var(--link-hover); border-color: var(--link-hover); }
.btn.action { background: var(--gold); border-color: var(--gold); color: #162c5c; }
.btn.action:hover { filter: brightness(1.06); }
.btn.done { background: var(--band); border-color: var(--band); color: #fff; }

/* contenido */
section.sec { padding-top: 14px; }
h2.st { font-size: clamp(20px, 3vw, 25px); line-height: 1.25; margin: 30px 0 10px; }
h2.st .num { color: var(--gold-text); margin-right: 10px; }
h3 { font-size: 18px; margin: 30px 0 10px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin-bottom: 7px; }
li::marker { color: var(--gold-text); font-weight: 700; }
figure { margin: 22px 0 26px; }
.figbox { background: var(--figbg); border: 1px solid var(--line); border-radius: 14px; padding: 16px; cursor: zoom-in; display: block; width: 100%; }
.figbox img { margin: 0 auto; max-height: 460px; width: auto; }
figcaption { text-align: center; color: var(--muted); font-size: 13.5px; font-style: italic; margin-top: 9px; }
figcaption b { font-style: italic; }
.f-dark { display: none !important; }
:root[data-theme="dark"] .f-dark { display: block !important; }
:root[data-theme="dark"] .f-light { display: none !important; }
.box { border-radius: 14px; padding: 20px 22px 16px; margin: 30px 0 0; border-left: 6px solid var(--gold); background: var(--cream); }
.box.ej { border-left-color: var(--band); background: var(--soft); }
:root[data-theme="dark"] .box.ej { border-left-color: #6f8fd0; }
.box h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.box ul { margin-bottom: 4px; }
.box p:last-child { margin-bottom: 4px; }
details.q { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; margin: 0 0 10px; }
details.q summary { list-style: none; cursor: pointer; padding: 14px 46px 14px 16px; font-weight: 700; position: relative; min-height: 48px; }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--gold-text); display: grid; place-items: center; font-size: 18px; line-height: 1; }
details.q[open] summary::after { content: "–"; }
details.q .a { padding: 0 16px 14px; color: var(--text); border-top: 1px dashed var(--line); padding-top: 12px; margin: 0 0 0; }
details.q .a span { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; margin-bottom: 3px; }
.pager { display: flex; align-items: stretch; gap: 12px; margin-top: 38px; }
.pager > * { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--link); background: var(--link); color: var(--on-link); text-decoration: none; font: inherit; font-weight: 700; font-size: 14.5px; line-height: 1.3; white-space: normal; }
.pager > *:hover { background: var(--link-hover); border-color: var(--link-hover); }
.pager .btn, .pager .btn.action, .pager .btn.done { background: var(--link); border-color: var(--link); color: var(--on-link); margin: 0; }
.pager .btn:hover, .pager .btn.action:hover, .pager .btn.done:hover { background: var(--link-hover); border-color: var(--link-hover); filter: none; }

/* portada */
.cover { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 300px); gap: 34px; align-items: center; background: var(--band); color: #fff; border-radius: 20px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); }
.cover .tag { color: var(--gold); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: 12.5px; }
.cover h1 { font-size: clamp(27px, 4.6vw, 44px); line-height: 1.12; margin: 10px 0 12px; }
.cover p { color: #d6def0; margin-bottom: 18px; }
.cover img { border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.cover .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); color: #fff; }
.cover .btn.gold, .cover a.btn { background: var(--link); border-color: var(--link); color: var(--on-link); }
.progress { margin: 26px 0 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.progress .row { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14.5px; margin-bottom: 9px; }
.bar { height: 12px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 6px; transition: width .4s; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0 6px; }
.pillars div { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--gold); border-radius: 14px; padding: 16px 18px; }
.pillars b { display: block; font-size: 17px; margin-bottom: 4px; }
.pillars span { color: var(--muted); font-size: 14.5px; line-height: 1.5; display: block; }
.videobox { background: #000; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
video { display: block; width: 100%; height: auto; background: #000; aspect-ratio: 16 / 9; }
.vchap { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 6px; list-style: none; margin: 0; }
.vchap button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 700; min-height: 40px; }
.vchap button:hover { border-color: var(--gold); }
.vsel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 14px; }
.vsel label { font-weight: 700; font-size: 14.5px; }
.vsel select { flex: 1 1 260px; max-width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 12px; font: inherit; font-size: 15px; cursor: pointer; }
.vsel select:hover, .vsel select:focus { border-color: var(--gold); }
.videobox iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; background: #000; }
.ytlink { margin: 8px 2px 0; font-size: 14px; }
.ytlink a { color: var(--gold-text); font-weight: 700; }
.ytposter { position: relative; display: block; aspect-ratio: 16 / 9; }
.ytposter img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ytposter .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; background: var(--link); color: var(--on-link); display: grid; place-items: center; font-size: 30px; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
.ytposter:hover .play { filter: brightness(1.08); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.modal .inner.dl { width: min(480px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-top: 5px solid var(--gold); border-radius: 14px; padding: 22px 22px 20px; box-shadow: var(--shadow); }
.modal .inner.dl h2 { margin: 0 50px 10px 0; font-size: 21px; line-height: 1.25; }
.modal .inner.dl p { margin: 0 0 10px; }
.modal .inner.dl .actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.modal .inner.dl .x { top: 10px; right: 10px; }
.modal .inner.dl .btn:not(.gold) { background: var(--link); border-color: var(--link); color: var(--on-link); }
.modal .inner.dl .btn:not(.gold):hover { background: var(--link-hover); border-color: var(--link-hover); }
.modal p.cap a { color: var(--gold); font-weight: 700; }
.vchap button small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 0; list-style: none; margin: 14px 0 0; }
.card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; height: 100%; position: relative; }
.card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.card img { border-radius: 8px; width: 92px; height: 130px; object-fit: cover; object-position: top; }
.card .k { color: var(--gold-text); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.card b { display: block; font-size: 15.5px; line-height: 1.3; margin-top: 3px; }
.card .ok { display: none; position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #162c5c; place-items: center; font-weight: 700; font-size: 14px; }
.card.done .ok { display: grid; }
.gloss input { width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 14px; font: inherit; margin: 20px 0 14px; }
dl.terms { margin: 0; }
dl.terms div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin-bottom: 10px; }
dl.terms dt { font-weight: 700; color: var(--gold-text); }
dl.terms dd { margin: 2px 0 0; }
footer { border-top: 1px solid var(--line); margin-top: 50px; padding-top: 18px; color: var(--muted); font-size: 13.5px; }

/* ventanas: video y ampliacion de figura */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(5, 12, 30, .88); display: none; align-items: center; justify-content: center; padding: 14px; }
.modal.open { display: flex; }
.modal .inner { width: min(1100px, 100%); max-height: 100%; position: relative; }
.modal img { max-height: calc(100vh - 90px); margin: 0 auto; border-radius: 12px; background: var(--figbg); padding: 12px; width: auto; }
.modal .x { position: absolute; right: 0; top: -52px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--gold); color: #162c5c; font-size: 20px; font-weight: 700; }
.modal .inner.v { padding-top: 52px; }
.modal .inner.v .x { top: 0; }
.modal p.cap { color: #d6def0; text-align: center; font-size: 14px; margin: 10px 0 0; }
.scrim { display: none; }

/* movil y tableta */
@media (max-width: 1000px) {
  #menu-btn { display: grid; }
  .layout { display: block; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 88vw); height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 60px; background: var(--bg); z-index: 60; transform: translateX(-105%); transition: transform .25s; border-right: 1px solid var(--line); box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5, 12, 30, .55); z-index: 55; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .brand span.t { display: none; }
  .search { flex: 1 1 auto; }
  .hero { grid-template-columns: 1fr; gap: 16px; }
  .hero img { max-width: 250px; margin: 0 auto; }
  .cover { grid-template-columns: 1fr; }
  .cover img { max-width: 230px; margin: 0 auto; order: -1; }
  .pillars { grid-template-columns: 1fr; }
  .band { padding: 20px 18px 22px 30px; }
  .band::before { left: 14px; }
  .figbox { padding: 10px; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .side, .bar i { transition: none; } }
@media print { .top, .side, .actions, .pager, .complete, .modal { display: none !important; } .layout { display: block; } }
