/* ==========================================================================
   Design v3 — Pravidla (/pravidla)
   View:     app/Views/v3/rules.php  ($pageCss = 'rules', $pageJs = 'rules', $pageClass = 'b3-page-rules')
   JS:       public/assets/js/v3/rules.js (ARIA tabs, reset kapitol, rozbalit/sbalit vše, deep-link)
   Prototyp: design_handoff_l2beleth/design/Pravidla v3.dc.html
   Prefix:   .rl3-
   Stavy:    .rl3.is-enhanced   rules.js běží (panely řídí atribut [hidden])
             .rl3-tab.is-active aktivní karta (+ aria-selected z JS)
             .rl3-ch[open]      otevřená kapitola (nativní <details>)
   ========================================================================== */

/* Per-page pozadí (zlatá záře nahoře uprostřed) */
body.b3-page-rules {
    --b-page-bg: radial-gradient(1000px 500px at 50% -100px, rgba(217, 181, 98, .10), transparent 70%), #070d0e;
}

/* ── Obal (.b-page, --b-max:900px) — padding dle prototypu ──────────────── */
.rl3 {
    padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 40px) clamp(80px, 10vw, 128px);
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* ── Hlavička ───────────────────────────────────────────────────────────── */
.rl3-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}
.rl3-head .b-kicker { line-height: 1.55; }
.rl3-h1 {
    --b-h1-size: clamp(40px, 6vw, 76px);
    line-height: 1.02;
    overflow-wrap: break-word;
}

/* ── Karty-taby ─────────────────────────────────────────────────────────── */
.rl3-tabs {
    scroll-margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}
.rl3-tab {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    padding: 22px 24px;
    border: 1px solid #1d2d31;
    border-radius: 14px;
    background: #0b1315;
    box-shadow: none;
    color: #e7eeec;
    font-size: 15px;
    line-height: 1.55;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--b-dur) ease, box-shadow 200ms ease, background-color var(--b-dur) ease;
}
.rl3-tab:hover { border-color: #2a3e42; color: #e7eeec; }
.rl3-tab__icon {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1d2d31;
    font-size: 24px;
    line-height: 1;
    color: #cfdcda;
    transition: border-color var(--b-dur) ease, color var(--b-dur) ease;
}
.rl3-tab__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rl3-tab__kicker {
    font-size: 13px;
    font-variant: small-caps;
    letter-spacing: .24em;
    color: #a4b6b4;
}
.rl3-tab__title {
    font-family: var(--b-display);
    font-size: 19px;
    font-weight: 700;
    color: #cfdcda;
    overflow-wrap: break-word;
    transition: color var(--b-dur) ease;
}
.rl3-tab.is-active {
    border-color: #d9b562;
    background: radial-gradient(circle at 0 0, rgba(217, 181, 98, .16), transparent 70%), #0b1315;
    box-shadow: 0 0 40px rgba(217, 181, 98, .15);
}
.rl3-tab.is-active .rl3-tab__icon { border-color: #d9b562; color: #e3c47f; }
.rl3-tab.is-active .rl3-tab__title { color: #e3c47f; }

/* ── Panel sekce ────────────────────────────────────────────────────────── */
.rl3-panel {
    display: flex;
    flex-direction: column;
    gap: 48px;
    min-width: 0;
    scroll-margin-top: 24px;
}
.rl3-panel[hidden] { display: none; }

/* Titulek panelu jen bez JS (s JS ho nahrazuje karta-tab). */
.rl3-panel__title {
    margin: 0;
    font-family: var(--b-display);
    font-weight: 700;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.15;
    color: #e3c47f;
    text-align: center;
}
.b3-js .rl3-panel__title { display: none; }

/* Než rules.js převezme řízení (html.b3-js už je): jen první panel, případně cíl kotvy. */
.b3-js .rl3:not(.is-enhanced) .rl3-panel ~ .rl3-panel { display: none; }
.b3-js .rl3:not(.is-enhanced):has(:target) .rl3-panel:not(:target):not(:has(:target)) { display: none; }
.b3-js .rl3:not(.is-enhanced) .rl3-panel:is(:target, :has(:target)) { display: flex; }

/* ── Úvod sekce (TOS: nadpis + perex) ──────────────────────────────────── */
.rl3-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.rl3-intro__title {
    margin: 0;
    font-family: var(--b-display);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.12;
    color: #e3c47f;
    overflow-wrap: break-word;
}
.rl3-intro__p {
    margin: 0;
    max-width: 62ch;
    font-size: 19px;
    font-style: italic;
    line-height: 1.6;
    color: #cfdcda;
}
.rl3-intro > :not(.rl3-intro__title):not(.rl3-intro__p) { align-self: stretch; text-align: left; }

/* ── Rozbalit / sbalit vše ──────────────────────────────────────────────── */
.rl3-toolbar { display: flex; justify-content: flex-end; }
.rl3-toggle { padding: 1px 6px; }            /* prototyp: výchozí padding <button> */
.rl3-toggle[hidden] { display: none; }

/* ── Akordeon kapitol (<details>) ───────────────────────────────────────── */
.rl3-chapters {
    display: flex;
    flex-direction: column;
    margin-top: -32px;
    border-bottom: 1px solid #1d2d31;
}
.rl3-ch {
    margin: 0;
    padding: 0;
    border: 0;
    border-top: 1px solid #1d2d31;
    scroll-margin-top: 24px;
}
.rl3-ch__sum {
    display: block;
    list-style: none;
    cursor: pointer;
    color: #e7eeec;
    transition: color var(--b-dur) ease;
}
.rl3-ch__sum::-webkit-details-marker { display: none; }
.rl3-ch__sum::marker { content: ''; }
.rl3-ch__sum:hover { color: #e3c47f; }
.rl3-ch__row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
    font-size: 15px;
    line-height: 1.55;
    text-align: left;
}
.rl3-ch__num {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a3e42;
    font-family: var(--b-display);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    color: #a4b6b4;
    box-shadow: none;
    transition: border-color var(--b-dur) ease, color var(--b-dur) ease, box-shadow 200ms ease;
}
.rl3-ch__title {
    font-family: var(--b-display);
    font-weight: 700;
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.2;
    overflow-wrap: break-word;
}
.rl3-ch__icon {
    display: flex;
    align-items: center;
    font-size: 20px;
    line-height: 1;
    color: #8a6a2a;
}
.rl3-ch__icon .ph-minus { display: none; }
.rl3-ch[open] > .rl3-ch__sum .rl3-ch__icon .ph-plus { display: none; }
.rl3-ch[open] > .rl3-ch__sum .rl3-ch__icon .ph-minus { display: inline-block; }
.rl3-ch[open] > .rl3-ch__sum .rl3-ch__num {
    border-color: #d9b562;
    color: #e3c47f;
    box-shadow: 0 0 20px rgba(217, 181, 98, .3);
}

/* Obsah kapitoly — odsazení na úroveň názvu (64 + 18 px), na úzkém displeji menší */
.rl3-ch__panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 0 32px clamp(0px, calc(40vw - 144px), 82px);
    min-width: 0;
}
.rl3-plain {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* ── Bloky obsahu ───────────────────────────────────────────────────────── */
.rl3-p {
    margin: 0;
    font-size: 18px;
    line-height: 1.7;
    color: #cfdcda;
    overflow-wrap: break-word;
}
.rl3-em {
    margin: 0;
    font-size: 19px;
    font-style: italic;
    line-height: 1.55;
    color: #e3c47f;
}
.rl3-label {
    margin: 6px 0 0;
    font-family: var(--b-body);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.55;
    font-variant: small-caps;
    letter-spacing: .2em;
    color: #3cc9b4;
}
.rl3-label :is(strong, b) { font-weight: inherit; }
.rl3-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rl3-list > li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 8px;
    font-size: 17px;
    line-height: 1.6;
    color: #cfdcda;
}
.rl3-list > li > .ph-fire {
    margin-top: 5px;
    font-size: 14px;
    color: #d9b562;
}
.rl3-li { min-width: 0; overflow-wrap: break-word; }
.rl3-li p { margin: 0; }
.rl3-li p + p { margin-top: 6px; }
.rl3-li :is(ul, ol) { margin: 6px 0 0; padding-left: 1.2em; }
.rl3-olist {
    margin: 0;
    padding-left: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 17px;
    line-height: 1.6;
    color: #cfdcda;
}
.rl3-olist > li { padding-left: .3em; }
.rl3-olist > li::marker { color: #e3c47f; font-family: var(--b-display); font-size: .82em; }
.rl3-olist li p { margin: 0; }
.rl3 :is(.rl3-p, .rl3-li, .rl3-olist, .rl3-intro__p) :is(strong, b) { color: #e7eeec; font-weight: 600; }
.rl3 :is(.rl3-p, .rl3-em, .rl3-li, .rl3-olist, .rl3-intro__p, .rl3-raw) a {
    color: #e3c47f;
    text-decoration: underline;
    text-decoration-color: rgba(227, 196, 127, .4);
    text-underline-offset: 3px;
}
.rl3 :is(.rl3-p, .rl3-em, .rl3-li, .rl3-olist, .rl3-intro__p, .rl3-raw) a:hover { color: #f6ead0; text-decoration-color: currentColor; }

/* Nerozpoznané bloky (tabulky, citace, obrázky…) */
.rl3-raw {
    min-width: 0;
    font-size: 18px;
    line-height: 1.7;
    color: #cfdcda;
    overflow-wrap: break-word;
}
.rl3-raw p { margin: 0 0 .8em; }
.rl3-raw > :last-child, .rl3-raw > * > :last-child { margin-bottom: 0; }
.rl3-raw :is(h1, h2, h3, h4, h5, h6) { margin: 0 0 .5em; font-size: 18px; line-height: 1.3; color: #e3c47f; }
.rl3-raw :is(ul, ol) { margin: 0 0 .8em; padding-left: 1.3em; }
.rl3-raw :is(strong, b) { color: #e7eeec; font-weight: 600; }
.rl3-raw blockquote {
    margin: 0;
    padding: 2px 0 2px 20px;
    border-left: 2px solid #8a6a2a;
    font-style: italic;
    color: #e3c47f;
}
.rl3-raw img { height: auto; border: 1px solid #1d2d31; border-radius: 14px; }
.rl3-raw table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
}
.rl3-raw :is(th, td) { padding: 8px 12px; border: 1px solid #1d2d31; text-align: left; vertical-align: top; }
.rl3-raw th { font-weight: 400; font-variant: small-caps; letter-spacing: .14em; color: #a6ebdd; background: #0b1315; }
.rl3-raw code { padding: .1em .35em; border: 1px solid #1d2d31; border-radius: 4px; background: #0e1a1b; font-size: .88em; }
.rl3-raw pre { margin: 0; padding: 14px 16px; overflow-x: auto; border: 1px solid #1d2d31; border-radius: 12px; background: #0b1315; font-size: 15px; }
.rl3-raw hr { height: 1px; margin: 1em 0; border: 0; background: #14201f; }

/* ── Naposledy aktualizováno ────────────────────────────────────────────── */
.rl3-updated {
    margin: 0;
    font-size: 14px;
    font-style: italic;
    color: #6f8584;
    text-align: center;
}
