/* =========================================================================
   U.S. BORDER PATROL — El Protector 2026 (Gran Final)
   Herní dokumentace USBP. Statický web, bez build stepu.
   Paleta vychází z odznaku USBP: lesní zeleň + mosaz, na pouštním papíře.
   ========================================================================= */

:root {
    /* Zeleň odznaku */
    --green-abyss: #06180F;
    --green-deep: #0B2B1E;
    --green: #14503A;
    --green-mid: #1E6B4C;
    --green-pale: #E4EDE6;

    /* Mosaz / zlato z lemu odznaku */
    --brass: #C9A227;
    --brass-light: #E7C765;
    --brass-dark: #8A6E16;

    /* Poušť */
    --sand-deep: #C6BCA4;
    --sand: #DED5C0;
    --sand-light: #EFE9DB;
    --paper: #FBF8F1;

    --text: #17211B;
    --muted: #5C665F;
    --line: #CFC5AC;
    --line-soft: #E2DAC7;

    /* Signální barvy pro callouty */
    --red: #96211F;
    --red-bg: #FAECEA;
    --amber: #9A6208;
    --amber-bg: #FBF1DE;
    --blue: #1C4E68;
    --blue-bg: #E9F1F5;

    --radius: 3px;
    --shadow: 0 14px 34px rgba(11, 43, 30, 0.13);
    --shadow-sm: 0 3px 10px rgba(11, 43, 30, 0.10);

    --font-head: "Arial Narrow", "Bahnschrift SemiCondensed", "Franklin Gothic Medium", "Roboto Condensed", sans-serif;
    --font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: "Cascadia Mono", Consolas, "Courier New", monospace;

    --content-max: 1120px;
    --toc-w: 250px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--sand);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.62;
    -webkit-text-size-adjust: 100%;
}

/* --- Přeskočit na obsah (klávesnice) ------------------------------------ */
.skip {
    position: absolute;
    left: -9999px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--brass);
    color: var(--green-abyss);
    font-weight: 700;
}
.skip:focus { left: 12px; top: 12px; }

/* --- Horní pruh: neherní upozornění ------------------------------------- */
.topstrip {
    background: var(--green-abyss);
    border-bottom: 1px solid rgba(201, 162, 39, 0.34);
    color: #C9CFC7;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.topstrip-in {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
    justify-content: center;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 7px 20px;
    text-align: center;
}
.topstrip-label {
    padding: 1px 7px;
    border: 1px solid rgba(231, 199, 101, 0.45);
    color: var(--brass-light);
    font-weight: 700;
}

/* --- Masthead ----------------------------------------------------------- */
.masthead {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, var(--green-deep), #0E3826);
    border-bottom: 2px solid var(--brass-dark);
    box-shadow: 0 2px 14px rgba(6, 24, 15, 0.4);
}
.masthead-in {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    justify-content: space-between;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 10px 20px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #F3EFE2;
    text-decoration: none;
}
.brand-shield { flex: none; width: 40px; height: 46px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-l1 {
    font-family: var(--font-head);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.brand-l2 {
    color: var(--brass-light);
    font-size: 11px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.mainnav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.mainnav a {
    display: block;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #DDE5DC;
    font-family: var(--font-head);
    font-size: 15px;
    letter-spacing: 0.09em;
    text-decoration: none;
    text-transform: uppercase;
}
.mainnav a:hover {
    border-color: rgba(231, 199, 101, 0.45);
    background: rgba(231, 199, 101, 0.11);
    color: #FFF;
}
.mainnav a.is-current {
    border-color: var(--brass);
    background: rgba(201, 162, 39, 0.19);
    color: var(--brass-light);
}
.mainnav .navsep {
    width: 1px;
    height: 22px;
    margin: 0 6px;
    background: rgba(231, 199, 101, 0.32);
}
.mainnav a.lang { font-size: 13px; letter-spacing: 0.14em; }

/* --- Hero --------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(6, 24, 15, 0.95), rgba(20, 80, 58, 0.88)),
        linear-gradient(90deg, rgba(201, 162, 39, 0.2), transparent 48%);
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
    color: #F4F1E6;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 78px, rgba(255, 255, 255, 0.035) 78px 79px);
    pointer-events: none;
}
.hero-in {
    position: relative;
    z-index: 1;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 34px 20px 30px;
}
.kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 10px;
    border: 1px solid rgba(231, 199, 101, 0.42);
    background: rgba(231, 199, 101, 0.09);
    color: var(--brass-light);
    font-family: var(--font-head);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.hero h1 {
    margin: 0;
    font-family: var(--font-head);
    font-size: clamp(2.3rem, 6.5vw, 3.9rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.hero-sub {
    max-width: 780px;
    margin: 14px 0 0;
    color: rgba(244, 241, 230, 0.86);
    font-size: 15.5px;
    line-height: 1.58;
}
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.hero-meta span {
    padding: 4px 10px;
    border: 1px solid rgba(231, 199, 101, 0.3);
    background: rgba(0, 0, 0, 0.22);
    color: rgba(244, 241, 230, 0.9);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.03em;
}
.hero-meta span strong { color: var(--brass-light); font-weight: 700; }

/* Odkazy na tmavém pozadí musí být mosazné, ne výchozí modré. */
.hero a,
footer.site a {
    color: var(--brass-light);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(231, 199, 101, 0.5);
    text-underline-offset: 2px;
}
.hero a:hover,
footer.site a:hover {
    color: #FFF;
    text-decoration-color: currentColor;
}

/* --- Layout: obsah + hlavní sloupec ------------------------------------- */
.layout {
    display: grid;
    grid-template-columns: var(--toc-w) minmax(0, 1fr);
    gap: 30px;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 26px 20px 60px;
}

.toc {
    position: sticky;
    top: 78px;
    align-self: start;
    max-height: calc(100vh - 96px);
    padding: 16px 14px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-top: 3px solid var(--green);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}
.toc-title {
    margin: 0 0 10px;
    color: var(--green);
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}
.toc li { counter-increment: toc; }
.toc a {
    display: block;
    padding: 5px 6px 5px 26px;
    position: relative;
    border-left: 2px solid var(--line-soft);
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.35;
    text-decoration: none;
}
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute;
    left: 7px;
    color: var(--sand-deep);
    font-family: var(--font-mono);
    font-size: 10.5px;
}
.toc a:hover { border-left-color: var(--brass); color: var(--green); background: var(--sand-light); }
.toc a.is-active {
    border-left-color: var(--green);
    background: var(--green-pale);
    color: var(--green);
    font-weight: 600;
}
.toc a.is-active::before { color: var(--green-mid); }

main { min-width: 0; }

/* --- Sekce dokumentu ---------------------------------------------------- */
.doc-section {
    margin: 0 0 20px;
    padding: 22px 26px 24px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--green);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 80px;
}

.doc-section h2 {
    margin: 0 0 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--green-deep);
    font-family: var(--font-head);
    font-size: clamp(1.35rem, 3.4vw, 1.7rem);
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}
.doc-section h3 {
    margin: 24px 0 9px;
    color: var(--green);
    font-family: var(--font-head);
    font-size: 1.16rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.doc-section h4 {
    margin: 18px 0 6px;
    color: var(--green-deep);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.doc-section > h3:first-of-type { margin-top: 4px; }

.doc-section p { margin: 0 0 12px; }
.doc-section p:last-child { margin-bottom: 0; }

.section-lead {
    margin: 0 0 16px !important;
    padding-left: 13px;
    border-left: 3px solid var(--brass);
    color: #37423B;
    font-size: 16.5px;
}

.doc-section ul,
.doc-section ol { margin: 0 0 13px; padding-left: 22px; }
.doc-section li { margin-bottom: 6px; }
.doc-section li > ul,
.doc-section li > ol { margin: 6px 0 4px; }

.doc-section ul { list-style: none; padding-left: 20px; }
.doc-section ul > li { position: relative; }
.doc-section ul > li::before {
    content: "";
    position: absolute;
    top: 0.62em;
    left: -14px;
    width: 6px;
    height: 6px;
    background: var(--green-mid);
    transform: rotate(45deg);
}
.doc-section ul ul > li::before { background: var(--sand-deep); }

ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li {
    position: relative;
    counter-increment: step;
    margin-bottom: 11px;
    padding: 2px 0 2px 42px;
    min-height: 28px;
}
ol.steps > li::before {
    content: counter(step);
    position: absolute;
    top: 1px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green);
    color: var(--sand-light);
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
}
ol.steps ul { margin-top: 7px; }

.doc-section a:not(.card) {
    color: var(--green-mid);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--brass);
    text-underline-offset: 2px;
}
.doc-section a:not(.card):hover {
    background: var(--green-pale);
    color: var(--green);
    text-decoration-color: var(--green);
}

code {
    padding: 1px 5px;
    border: 1px solid var(--line-soft);
    border-radius: 2px;
    background: var(--sand-light);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* --- Callouty ----------------------------------------------------------- */
.callout {
    margin: 15px 0;
    padding: 13px 16px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--muted);
    border-radius: var(--radius);
    background: var(--sand-light);
}
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout ul, .callout ol { margin-bottom: 0; }
.callout-tag {
    display: inline-block;
    margin-bottom: 7px;
    padding: 2px 8px;
    border-radius: 2px;
    color: #FFF;
    font-family: var(--font-head);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    background: var(--muted);
}

.callout.critical { border-left-color: var(--red); background: var(--red-bg); }
.callout.critical .callout-tag { background: var(--red); }
.callout.warn { border-left-color: var(--amber); background: var(--amber-bg); }
.callout.warn .callout-tag { background: var(--amber); }
.callout.info { border-left-color: var(--blue); background: var(--blue-bg); }
.callout.info .callout-tag { background: var(--blue); }
.callout.new { border-left-color: var(--green-mid); background: var(--green-pale); }
.callout.new .callout-tag { background: var(--green-mid); }
.callout.changed { border-left-color: var(--brass-dark); background: #FAF3DF; }
.callout.changed .callout-tag { background: var(--brass-dark); }
.callout.ask {
    border-left-color: var(--green-deep);
    border-style: dashed;
    border-left-style: solid;
    background: #F1F3EE;
}
.callout.ask .callout-tag { background: var(--green-deep); }

p.example {
    margin: 11px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--sand-deep);
    background: var(--sand-light);
    color: #3D473F;
    font-size: 15px;
    font-style: italic;
}
p.example strong { font-style: normal; color: var(--green-deep); }

/* --- Štítky ------------------------------------------------------------- */
.pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 2px;
    font-family: var(--font-head);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: 1px;
}
.pill.legal { background: var(--green-pale); color: var(--green); border: 1px solid var(--green-mid); }
.pill.illegal { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.pill.new { background: var(--green-mid); color: #FFF; }
.pill.changed { background: var(--brass-dark); color: #FFF; }

/* --- Tabulky ------------------------------------------------------------ */
.table-scroll {
    position: relative;
    margin: 15px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-scroll:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
/* Stín u pravého okraje jen tehdy, když se tabulka opravdu nevejde. */
.table-scroll.is-scrollable {
    background:
        linear-gradient(90deg, var(--paper) 30%, rgba(251, 248, 241, 0)) left / 28px 100% no-repeat,
        linear-gradient(270deg, var(--paper) 30%, rgba(251, 248, 241, 0)) right / 28px 100% no-repeat,
        radial-gradient(farthest-side at 0 50%, rgba(11, 43, 30, 0.18), transparent) left / 12px 100% no-repeat,
        radial-gradient(farthest-side at 100% 50%, rgba(11, 43, 30, 0.18), transparent) right / 12px 100% no-repeat;
    background-attachment: local, local, scroll, scroll;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    background: #FFF;
    font-size: 14.5px;
}
table.data caption {
    padding-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    text-align: left;
}
table.data th,
table.data td {
    padding: 8px 11px;
    border: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
}
table.data thead th {
    background: var(--green);
    border-color: var(--green);
    color: var(--sand-light);
    font-family: var(--font-head);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}
table.data tbody tr:nth-child(even) { background: var(--sand-light); }
table.data tbody th { background: var(--green-pale); font-weight: 700; }
table.data td ul { margin: 0; padding-left: 16px; }
table.data td li { margin-bottom: 3px; }

/* --- Rozcestník na úvodní stránce --------------------------------------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 0 0 22px;
}
.card {
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--brass);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.card:hover {
    transform: translateY(-2px);
    border-top-color: var(--green);
    box-shadow: var(--shadow);
}
.card-eyebrow {
    color: var(--brass-dark);
    font-family: var(--font-head);
    font-size: 11.5px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.card h2 {
    margin: 6px 0 8px;
    color: var(--green-deep);
    font-family: var(--font-head);
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.card-go {
    margin-top: 14px;
    color: var(--green-mid);
    font-family: var(--font-head);
    font-size: 13.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.card:hover .card-go { color: var(--green); }

/* --- Odkazy na PDF ------------------------------------------------------ */
.filelist { display: grid; gap: 10px; margin: 4px 0 0; padding: 0; list-style: none; }
.filelist li::before { display: none; }
.filelist a {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #FFF;
    text-decoration: none;
}
.filelist a:hover { border-color: var(--green-mid); background: var(--sand-light); }
.file-ico {
    flex: none;
    padding: 3px 7px;
    border-radius: 2px;
    background: var(--red);
    color: #FFF;
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.file-txt { display: flex; flex-direction: column; min-width: 0; }
.file-name { color: var(--green-deep); font-weight: 600; }
.file-note { color: var(--muted); font-size: 13px; }

/* --- Patička ------------------------------------------------------------ */
footer.site {
    margin-top: 10px;
    padding: 26px 20px 34px;
    border-top: 2px solid var(--brass-dark);
    background: var(--green-abyss);
    color: #9FAAA1;
    font-size: 13.5px;
}
.footer-in {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 32px;
    justify-content: space-between;
    max-width: var(--content-max);
    margin: 0 auto;
}
footer.site a { color: var(--brass-light); }
.footer-motto {
    color: var(--brass);
    font-family: var(--font-head);
    font-size: 17px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* --- Tlačítko nahoru ---------------------------------------------------- */
.totop {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 30;
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--brass-dark);
    border-radius: 50%;
    background: var(--green-deep);
    color: var(--brass-light);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.totop.is-shown { display: block; }
.totop:hover { background: var(--green); }

/* --- Responzivita ------------------------------------------------------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; gap: 18px; padding-top: 18px; }
    .toc {
        position: static;
        max-height: none;
        padding: 0;
        border-top-width: 1px;
        overflow: visible;
    }
    .toc-title { display: none; }
    .toc-details > summary {
        padding: 12px 15px;
        color: var(--green);
        font-family: var(--font-head);
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        cursor: pointer;
        list-style: none;
    }
    .toc-details > summary::-webkit-details-marker { display: none; }
    .toc-details > summary::after { content: " ▾"; color: var(--brass-dark); }
    .toc-details[open] > summary::after { content: " ▴"; }
    .toc-details[open] > summary { border-bottom: 1px solid var(--line-soft); }
    .toc ol { padding: 8px 12px 12px; }
}

@media (max-width: 700px) {
    body { font-size: 15.5px; }
    .masthead { position: static; }
    .masthead-in { padding: 9px 14px; gap: 8px; }
    .brand-l1 { font-size: 18px; }
    .brand-shield { width: 34px; height: 39px; }
    .mainnav { width: 100%; }
    .mainnav a { padding: 6px 10px; font-size: 14px; }
    .mainnav .navsep { display: none; }
    .hero-in { padding: 24px 14px 22px; }
    .layout { padding: 14px 12px 40px; }
    .doc-section { padding: 17px 15px 19px; }
    .doc-section h2 { font-size: 1.24rem; }
    ol.steps > li { padding-left: 36px; }
    ol.steps > li::before { width: 25px; height: 25px; font-size: 13px; }
    table.data { font-size: 13.5px; }
    table.data th, table.data td { padding: 6px 8px; }
    /* Na úzkém displeji je lepší zalomená hlavička než nutnost scrollovat. */
    table.data thead th { white-space: normal; }
}

/* --- Tisk --------------------------------------------------------------- */
@media print {
    :root { --content-max: 100%; }
    body { background: #FFF; font-size: 10.5pt; line-height: 1.4; }
    .topstrip, .mainnav, .toc, .totop, .hero::before, .card-go { display: none !important; }
    .masthead { position: static; background: none; border-bottom: 2px solid #000; box-shadow: none; }
    .brand { color: #000; }
    .brand-l2 { color: #444; }
    .hero { background: none; border-bottom: 1px solid #000; color: #000; }
    .hero h1 { font-size: 22pt; }
    .hero-sub, .hero-meta span { color: #222; }
    .hero-meta span { border-color: #999; background: none; }
    .kicker { border-color: #666; background: none; color: #333; }
    .layout { display: block; padding: 0; }
    .doc-section {
        margin-bottom: 10pt;
        padding: 0 0 8pt;
        border: 0;
        border-bottom: 1px solid #BBB;
        border-radius: 0;
        background: none;
        box-shadow: none;
        break-inside: auto;
    }
    .doc-section h2 { break-after: avoid; }
    .doc-section h3, .doc-section h4 { break-after: avoid; }
    .callout, table.data, p.example, ol.steps > li { break-inside: avoid; }
    .callout { background: none !important; border: 1px solid #999; border-left-width: 3px; }
    .callout-tag { background: none !important; border: 1px solid #666; color: #000; }
    table.data thead th { background: #DDD !important; color: #000; }
    table.data tbody tr:nth-child(even) { background: #F4F4F4 !important; }
    .pill { border: 1px solid #666 !important; background: none !important; color: #000 !important; }
    footer.site { background: none; border-top: 1px solid #000; color: #333; }
    .footer-motto { color: #000; }
    a { color: #000; text-decoration: none; }
}
