* {
    box-sizing: border-box;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    line-height: 1.4em;
}

html {
    scroll-behavior: smooth; /* Plynulé scrollování na kotvy napříč celým webem */
}

body {
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #000;
}

/* --- UNIVERZÁLNÍ HLAVIČKA --- */
.main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    padding: 20px 40px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .logo-link {
    position: absolute;
    left: 40px;
    display: flex;
    align-items: center;
}

.main-header .logo {
    height: 60px;
}

.main-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #0070af;
    font-variant: small-caps;
    text-align: center;
    display: block; /* Vynucení zobrazení v hlavičce */
}

/* Skrytí H1 uvnitř samotných dokumentů, nechceme ho 2x */
main > h1 {
    display: none; 
}

/* --- GRID DLAŽDIC (PRO ÚVODNÍ STRANU) --- */
.regulations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto 0 auto;
    padding: 0 20px 60px 20px;
    align-items: start; 
}

.tile {
    background-color: #f2f7ec;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tile:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tile-header {
    background-color: #57aa27;
    position: relative;
    height: 240px; 
    transition: background-color 0.2s ease;
}

.tile-header:hover { background-color: #4f9a23; }

.tile-header-link {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    padding: 25px;
    display: flex;
    flex-direction: column;
    color: white;
    text-decoration: none;
    z-index: 1;
}

.tile-id { font-size: 1.5rem; font-weight: bold; margin-bottom: 10px; }
.tile-title { font-size: 1.5rem; margin: 0 0 20px 0; line-height: 1.2; font-weight: bold; }
.tile-meta { margin-top: auto; }
.tile-meta p { margin: 3px 0; font-size: 0.95rem; font-weight: normal; padding-right: 40px; }
.tile-meta p strong { font-weight: bold; }

.toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    z-index: 2;
}

.toggle-btn svg { width: 32px; height: 32px; transition: transform 0.3s ease; }
.tile.open .toggle-btn svg { transform: rotate(180deg); }

.tile-versions {
    display: none;
    padding: 15px;
    flex-direction: column;
    gap: 6px;
}

.tile.open .tile-versions { display: flex; }

.version-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch; 
    border-radius: 8px;
    overflow: hidden; 
    transition: filter 0.2s ease;
}

.version-row:hover { filter: brightness(0.95); }
.version-row:nth-child(even) { background-color: #d1e5c2; }
.version-row:nth-child(odd) { background-color: #bfdcae; }
.version-row.current { background-color: #57aa27; }

.v-link-main {
    display: flex;
    flex-grow: 1;
    padding: 0 0 0 15px;
    text-decoration: none;
    color: #000;
}
.version-row.current .v-link-main { color: white; }

.v-info {
    display: flex;
    flex-direction: column; 
    justify-content: center;
    gap: 2px;
    padding: 10px 0;
}

.v-year { font-weight: bold; font-size: 1.05rem; }
.v-date { font-weight: normal; font-size: 0.85rem; opacity: 0.95; }

.btn-prilohy {
    background-color: white;
    color: #000;
    text-decoration: none;
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.btn-prilohy:hover { background-color: #e8e8e8; }

/* --- UNIVERZÁLNÍ STYLY PRO DOKUMENTY A PŘÍLOHY --- */
.document-wrapper {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    font-size: 10pt;
    padding: 0 2rem;
    background-color: transparent;
}

/* Navigační lišta pod hlavičkou */
.document-toolbar {
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.document-toolbar .back-button-container a {
    padding: 10px 15px;
    background-color: #0070af;
    border: 2px #0070af solid;
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0px 0px 6px #aaa;
    transition-duration: .2s;
    display: inline-block;
}

.document-toolbar .back-button-container a:hover {
    background-color: white;
    color: #0070af;
}

.document-toolbar .platnost-info-container p {
    margin: 0;
    font-weight: 700;
    font-size: 11pt;
}

/* Rozcestník v dokumentu */
.doc-summary-container {
    max-width: 600px;
    margin: 0 auto 40px auto;
    font-size: 11pt;
}

.doc-summary-container li a {
    color: #0070af;
    font-weight: 700;
    text-decoration: none;
}

.doc-summary-container li::marker {
    color: #0070af;
}

.doc-summary-container ol, .doc-summary-container ul {
    padding-left: 30px;
}

/* Obecná typografie v dokumentech */
.doc-content h2 {
    font-variant: small-caps;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    border-bottom: 2px #0070af dotted;
}

.doc-content p { margin-top: 0; margin-bottom: 6px; }
.doc-content ul li { list-style-type: "- "; }

/* Zvýraznění kotev */
:target { animation: highlight-target 2s ease-out; }
@keyframes highlight-target {
    0% { background-color: rgba(255, 216, 79, 0.6); } 
    100% { background-color: transparent; }
}

/* IKONY PRO KOPÍROVÁNÍ (obecné třídy pro JS skript) */
.doc-content li[id] { position: relative; }
.copy-anchor-btn {
    position: absolute; left: -24px; top: 1px; opacity: 0;
    cursor: pointer; background: none; border: none; padding: 0;
    color: #0070af; transition: opacity 0.2s, transform 0.1s, color 0.2s;
    display: flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; pointer-events: none;
}
.copy-anchor-btn.visible { opacity: 0.5; pointer-events: auto; }
.copy-anchor-btn:hover { opacity: 1 !important; transform: scale(1.1); }
.copy-anchor-btn.copied { color: #57aa27; opacity: 1 !important; }
.copy-anchor-btn svg { width: 100%; height: 100%; fill: currentColor; }


/* --- RESPONSIVITA --- */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        padding: 12px 20px;
        gap: 8px;
    }
    .main-header .logo-link {
        position: relative;
        left: 0;
    }
    .main-header .logo { height: 45px; }
    .main-header h1 { font-size: 1.3rem; line-height: 1.2; }
    .document-wrapper { padding: 0 1rem; }
}