/* ==========================================================
   Class 7 Math · Section 10 · সর্বসমতা ও সদৃশতা
   Theme: "ফটো-স্টুডিওর প্রিন্টঘর" — the book's own opening image of a
   photo shop. A same-size copy = সর্বসম, a bigger/smaller copy = সদৃশ.
   Darkroom hero and player (charcoal + red safelight glow); the page
   is warm photo-paper grey with a faint contact-sheet grid; cards are
   prints with a white border and black photo-corner mounts; the top
   bar is a film strip. Original print = fixer teal, tracing copy =
   safelight red (transparent), enlarger ratio k = amber.
   Band কৌতূহলী (12–13).
   ========================================================== */
:root {
  --bg: #ece7df;
  --card: #fffdf9;
  --ink: #221f1c;
  --ink-2: #5d564f;
  --red: #c2352b;
  --red-deep: #8f1f18;
  --red-soft: #f8dfdb;
  --teal: #167a74;
  --teal-deep: #0d524e;
  --teal-soft: #d8eeeb;
  --amber: #e0962a;
  --amber-deep: #9a5a07;
  --amber-soft: #fbecd2;
  --char: #1f1d1b;
  --char-2: #34302c;
  --line: #ddd5c9;
  --ok: #2c7a3f;
  --no: #b3302e;
}
* { box-sizing: border-box; }
body {
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(34, 31, 28, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 31, 28, .045) 1px, transparent 1px);
  background-size: 120px 90px;
}
::selection { background: rgba(224, 150, 42, .4); }
a { color: var(--red-deep); }
strong { color: var(--red-deep); }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 2000; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--content-w); margin-inline: auto; padding-inline: var(--gutter); }
main, .wrap, .lesson-part > *, .row-ctrl > *, .yf-grid > *, .rs-grid > *, .cond-grid > * { min-width: 0; }
.m { font-family: 'Cambria Math', 'STIX Two Math', Georgia, 'Noto Serif Bengali', serif; white-space: nowrap; }
.qa details p, .cq-parts details p, .def, .qa summary, .cq-parts summary, .cq-stem, .theorem p, .pj-step { overflow-wrap: anywhere; }
.qa .m, .cq .m, .theorem .m, .def .m, .pj-step .m, .lesson-part p .m { white-space: normal; }

/* film-strip top bar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; padding: .55rem var(--gutter) .55rem; background: var(--char); color: #f1ebe2; font-size: var(--fs-sm); }
.topbar::before, .topbar::after { content: ""; position: absolute; left: 0; right: 0; height: 6px; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(255, 255, 255, .55) 6px 14px, transparent 14px 22px); }
.topbar::before { top: 2px; } .topbar::after { bottom: 2px; }
.crumbs { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: #d8cfc3; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: #ffb4a8; font-weight: 700; }
.level { display: flex; align-items: center; gap: .4rem; font-weight: 800; color: var(--char); background: var(--amber); border-radius: 6px; padding: 0 .75rem; }
.level.pop { animation: flash .8s; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .9); background: #fff; } 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); } }

/* hero */
.hero { padding: clamp(2rem, 5vw, 4rem) 0 2rem; }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.eyebrow { display: inline-block; color: #fff; background: var(--red); font-weight: 700; padding: .1rem .9rem; border-radius: 4px; font-size: var(--fs-sm); }
h1 { font-size: var(--fs-3xl); line-height: 1.25; margin: .5rem 0 1rem; color: var(--ink); }
h1::after { content: ""; display: block; width: 8rem; height: 10px; margin-top: .5rem; border-radius: 2px; background: linear-gradient(90deg, var(--teal) 0 46%, transparent 46% 54%, var(--red) 54%); }
.lede { font-size: var(--fs-lg); line-height: 1.75; }
.hint { color: var(--ink-2); border-left: 4px solid var(--amber); padding-left: .8rem; }
.darkroom { margin: 0; border-radius: 8px; overflow: hidden; background: var(--char); box-shadow: 0 18px 36px rgba(31, 29, 27, .35); border: 10px solid #fff; outline: 1px solid var(--line); }
.darkroom > svg { display: block; width: 100%; height: auto; }

/* blocks */
.block { padding-block: clamp(1.6rem, 4vw, 3rem); }
.sec-title, .lesson-part h2, #video h2, #compare h2, #activity h2, #quiz h2 { font-size: var(--fs-2xl); line-height: 1.35; margin: .2rem 0 1rem; }
.sub-title { font-size: var(--fs-xl); margin: 2rem 0 .8rem; color: var(--teal-deep); }
.part-tag { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: 800; color: #fff; background: var(--char); padding: .05rem .9rem .05rem .45rem; border-radius: 3px; font-size: var(--fs-sm); }
.part-tag::before { content: ""; width: .85rem; height: .85rem; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px 2px rgba(194, 53, 43, .8); }
.goals { display: grid; gap: .6rem; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.goals li { background: var(--card); border-radius: 4px; padding: .7rem 1rem .7rem 2.6rem; border: 1px solid var(--line); position: relative; box-shadow: 0 3px 8px rgba(31, 29, 27, .06); }
.goals li::before { content: ""; position: absolute; left: .8rem; top: 1rem; width: 1.1rem; height: .8rem; border: 2px solid var(--teal); background: linear-gradient(135deg, transparent 50%, rgba(194, 53, 43, .55) 50%); }

/* print card with photo corners */
.card { position: relative; background: var(--card); border-radius: 3px; padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid var(--line); box-shadow: 0 10px 22px rgba(31, 29, 27, .09); }
.card::before, .card::after { content: ""; position: absolute; width: 22px; height: 22px; background: var(--char); pointer-events: none; }
.card::before { left: -1px; top: -1px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.card::after { right: -1px; bottom: -1px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.card h3, .card h2 { margin: 0 0 .5rem; font-size: var(--fs-lg); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.story h2 { font-size: var(--fs-xl); }
.widget { margin: 1.6rem 0; }
.def { margin: 1rem 0; background: var(--teal-soft); border-left: 6px solid var(--teal); border-radius: 4px; padding: .8rem 1rem; }
.def b:first-child { color: var(--teal-deep); }
.def.soft { background: #fff; border: 2px solid var(--teal); border-left-width: 6px; }
.def ul.tight { margin: .3rem 0 .5rem; padding-left: 1.4rem; }
.remember { margin: 1.4rem 0 .4rem; background: var(--amber-soft); border-radius: 4px; padding: .9rem 1rem; border: 2px dashed var(--amber); }
.remember > b:first-child { display: inline-block; background: var(--char); color: #fff; padding: 0 .6rem; border-radius: 3px; margin-right: .4rem; }
.note { background: var(--red-soft); border-radius: 4px; padding: .8rem 1rem; border-left: 6px solid var(--red); }
.theorem { margin: 1.6rem 0 .6rem; background: #fff; border: 2px solid var(--char); border-radius: 4px; padding: .9rem 1.1rem; box-shadow: 6px 6px 0 var(--teal-soft); }
.theorem p { margin: .4rem 0; }
.th-name { font-weight: 800; color: var(--red-deep); font-size: var(--fs-lg); }
.th-name span { color: var(--ink-2); font-weight: 700; font-size: var(--fs-base); }
.th-text { font-weight: 800; }
.fig { display: block; width: 100%; height: auto; }

.row-ctrl { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: .7rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .7rem; }
.chips button { border: 2px solid var(--char-2); background: #fff; color: var(--ink); border-radius: 4px; padding: .05rem .8rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--char); color: #fff; }
.inp { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; flex-wrap: wrap; max-width: 100%; }
.inp input:not([type=range]) { font: inherit; font-family: 'Cambria Math', Georgia, 'Noto Serif Bengali', serif; width: 7rem; max-width: 100%; padding: .1rem .5rem; border: 2px solid var(--ink-2); border-radius: 4px; background: #fff; color: var(--ink); }
.inp.sl input { accent-color: var(--red); width: 12rem; max-width: 55vw; }
.inp output { min-width: 2rem; font-size: 1.2rem; color: var(--red-deep); }
.btn { font: inherit; font-weight: 800; border: 0; background: var(--red); color: #fff; padding: .35rem 1.1rem; border-radius: 4px; cursor: pointer; box-shadow: 0 4px 0 var(--red-deep); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red-deep); }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink-2); box-shadow: none; }
.btn[disabled] { opacity: .45; cursor: default; }
.msg { min-height: 1.8em; font-weight: 700; margin: .5rem 0; }
.msg.ok { color: var(--ok); } .msg.no { color: var(--no); } .msg.info { color: var(--teal-deep); }
.chart-box { position: relative; height: 280px; margin: .6rem 0; }

/* widget figures */
.ov-svg, .tm-svg, .pj-svg, .fold-svg, .en-svg, .lm-svg, .st-svg, .qd-svg, .qp-svg, .sh-svg { max-width: 660px; margin-inline: auto; background: #fbf8f3; border: 1px solid var(--line); border-radius: 3px; }
.pj-step { min-height: 4.6em; background: var(--char); color: #f3ede4; border-radius: 4px; padding: .6rem .9rem; margin-top: .6rem; display: grid; gap: .3rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .pj-step { grid-template-columns: minmax(0, 1fr) minmax(0, 14rem); } }
.pj-step .why { color: #ffd39a; font-size: var(--fs-sm); border-left: 2px solid #6a6157; padding-left: .6rem; }
.pj-step .done { color: #9fe0c6; font-weight: 800; }
.tm-table td, .tm-table th { text-align: center; }
.tm-table { min-width: 0; }
.en-table, .lm-table { min-width: 0; }
.en-table td, .en-table th, .lm-table td, .lm-table th { text-align: center; }
.lm-table td.empty { color: #b9b0a5; }
.lm-table td.got { color: var(--teal-deep); font-weight: 800; animation: pop .4s; }
@keyframes pop { 50% { transform: scale(1.15); } }
#lm-svg .hit { cursor: pointer; }
#lm-svg .hit:hover, #lm-svg .hit:focus { stroke: var(--amber); outline: none; }
.lm-ratio { font-size: 1.1rem; white-space: normal !important; }
.st-task { font-weight: 700; margin: .3rem 0; }
.st-out { margin-top: .6rem; }
.st-out table { min-width: 0; }
.st-out .verdict { font-weight: 800; margin: .5rem 0; }
.st-out .verdict.ok { color: var(--ok); }
.st-out .verdict.no { color: var(--no); }

/* order builder */
.order-pool { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0; }
.order-pool button { text-align: left; font: inherit; border: 2px dashed var(--ink-2); background: #fff; color: var(--ink); border-radius: 4px; padding: .35rem .7rem; cursor: pointer; }
.order-pool button.nope { border-color: var(--no); animation: shake .4s; }
.order-list { padding-left: 1.6rem; margin: .3rem 0; }
.order-list li { background: var(--teal-soft); border-radius: 4px; padding: .3rem .6rem; margin: .3rem 0; animation: rise .35s both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* sufficiency cards */
.suff-cards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.suff { border: 2px solid var(--line); border-radius: 4px; padding: .6rem .8rem; background: #fff; display: flex; flex-direction: column; gap: .4rem; }
.suff p { margin: 0; font-weight: 700; }
.suff .opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.suff .opts button { font: inherit; font-size: var(--fs-sm); border-radius: 4px; padding: .1rem .6rem; cursor: pointer; border: 2px solid var(--teal); background: #fff; color: var(--teal-deep); font-weight: 700; }
.suff .opts button.n { border-color: var(--red); color: var(--red-deep); }
.suff.right { border-color: var(--ok); background: #eef8f1; }
.suff.wrong { border-color: var(--no); animation: shake .4s; }
.suff .why { font-size: var(--fs-sm); color: var(--ink-2); }

/* conditions grid */
.cond-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); margin: 1rem 0; }
.cond { font: inherit; text-align: left; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: .35rem; }
.cond b { color: var(--red-deep); }
.cond .cond-fig { width: 100%; height: auto; display: block; }
.cond .cond-check { font-style: normal; font-weight: 700; color: var(--teal-deep); min-height: 1.4em; font-size: var(--fs-sm); }
.cond.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft), 0 10px 22px rgba(31, 29, 27, .09); }

/* activity */
.yf-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.yf-grid figure { margin: 0; display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.yf-grid svg:not(.ic) { background: #fbf8f3; border: 1px solid var(--line); }
.rs-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.rs-item { border: 2px solid var(--line); background: #fff; border-radius: 4px; padding: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.rs-item > svg { width: 100%; height: auto; display: block; background: #fbf8f3; }
.rs-item .opts { display: flex; flex-wrap: wrap; gap: .3rem; }
.rs-item .opts button { font: inherit; font-size: .85rem; border: 2px solid var(--char-2); background: #fff; border-radius: 4px; padding: 0 .5rem; cursor: pointer; color: var(--ink); }
.rs-item.right { border-color: var(--ok); background: #eef8f1; }
.rs-item.wrong { border-color: var(--no); animation: shake .4s; }
.rs-item .why { font-size: var(--fs-sm); color: var(--ink-2); min-height: 1.2em; }

/* player */
.player { border-radius: 6px; background: var(--char); padding: clamp(.5rem, 2vw, 1rem); color: #fff; box-shadow: 0 0 0 1px #000, 0 0 40px rgba(194, 53, 43, .25); }
.stage { position: relative; border-radius: 3px; overflow: hidden; }
.stage svg:not(.ic) { width: 100%; height: auto; display: block; }
.big-play { position: absolute; inset: 0; margin: auto; width: 5.5rem; height: 5.5rem; border-radius: 50%; border: 4px solid #fff; background: var(--red); color: #fff; display: grid; place-items: center; cursor: pointer; }
.big-play .ic { width: 2.4rem; height: 2.4rem; }
.big-play.hide { display: none; }
.caption { min-height: 3.6em; margin: .75rem .25rem; font-size: var(--fs-lg); line-height: 1.6; }
.controls { display: flex; align-items: center; gap: .6rem; }
.ctrl { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--amber); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.controls input { flex: 1; min-width: 0; accent-color: var(--red); }
.time { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); white-space: nowrap; }
.chapters { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .75rem 0 0; list-style: none; }
.chapters button { border: 1px solid rgba(255, 255, 255, .45); background: transparent; color: #f1ebe2; border-radius: 3px; padding: .1rem .7rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chapters button.on { background: var(--red); border-color: var(--red); color: #fff; }

.table-wrap { overflow-x: auto; margin: .6rem 0 1.2rem; }
.cmp { width: 100%; border-collapse: collapse; background: var(--card); min-width: 34rem; }
.cmp th, .cmp td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: middle; }
.cmp thead th { background: var(--char); color: #fff; }
.cmp tbody th { background: var(--teal-soft); }

.score-pill { display: inline-block; background: var(--red); color: #fff; padding: .1rem .9rem; border-radius: 4px; font-weight: 700; }
.lk-q { background: var(--card); border-radius: 4px; padding: 1rem; margin: .8rem 0; border-left: 5px solid var(--red); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lk-q-stem { font-weight: 700; margin-bottom: .6rem; overflow-wrap: anywhere; }
.lk-opts { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.lk-opt { display: flex; gap: .6rem; align-items: center; text-align: left; font: inherit; padding: .45rem .7rem; border: 2px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer; min-width: 0; }
.lk-opt-key { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--char); color: #fff; flex: none; font-size: .95rem; }
.lk-opt.is-right { border-color: var(--ok); background: #e3f3e8; }
.lk-opt.is-wrong { border-color: var(--no); background: #fbe7e3; }
.lk-explain { margin: .6rem 0 0; }
.lk-explain.ok { color: var(--ok); } .lk-explain.no { color: var(--no); }
.qa details, .cq-parts details { background: var(--card); border-radius: 4px; padding: .6rem .9rem; margin: .5rem 0; border-left: 5px solid var(--teal); }
.cq .cq-parts details { background: #f7f3ed; }
.qa summary, .cq-parts summary { cursor: pointer; font-weight: 700; }
.qa details p, .cq-parts details p { margin: .6rem 0 .2rem; }
.cq { margin: 1rem 0; }
.cq-stem { font-weight: 800; font-size: var(--fs-lg); }
.cq-parts { list-style: none; padding: 0; }
.summary ul { padding-left: 1.3rem; }
.summary li { margin: .4rem 0; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem 1rem; }
.pager-btn { display: inline-block; padding: .5rem 1.1rem; border-radius: 4px; background: var(--char); color: #fff; text-decoration: none; font-weight: 700; }
.pager-btn.disabled { background: #ddd5c9; color: #5d564f; }
.credit { color: var(--ink-2); font-size: var(--fs-sm); padding-bottom: 2rem; }

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
[data-reveal].is-in { opacity: 1; transform: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
