/* --- Proměnné --- */
:root {
    --primary-color: #2c3e50;
    --text-color: #333333;
    --text-secondary: #444444;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --email-bg: #fafafa;
    --claim-bg: rgba(44, 62, 80, 0.04);
    --img-bg: rgba(0, 0, 0, 0.03);
    --red-color: #d9534f;
    --blue-color: #0056b3;
    --white-color: #ffffff;
    --footer-link-color: #e0e6ed;
    --footer-link-hover: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.03);
    --header-shadow: rgba(0, 0, 0, 0.05);
    --lightbox-bg: rgba(0, 0, 0, 0.8);
    --btn-bg: rgba(255, 255, 255, 0.15);
    --btn-hover-bg: rgba(255, 255, 255, 0.35);
    --border-radius: 8px;
    --max-width: 900px;
    --spacing: 20px;
}

/* --- Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Tělo stránky --- */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Kontejner --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
    width: 100%;
}

/* --- Záhlaví --- */
header {
    background-color: var(--card-bg);
    padding: 60px 0;
    text-align: center;
    box-shadow: 0 2px 10px var(--header-shadow);
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* --- Hlavní obsah --- */
main {
    flex-grow: 1;
    padding-bottom: 60px;
}

/* --- Úvodní text --- */
.intro-text {
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.intro-text p, .text-section p {
    margin-bottom: 15px;
}

.intro-text p:last-child, .text-section p:last-child {
    margin-bottom: 0; 
}

/* --- Informace o autorovi --- */
.author-info {
    margin-top: 28px;
    padding: 12px 16px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
    font-size: 0.95rem;
}

.author-info p {
    margin-bottom: 4px;
}

.author-info p:last-child {
    margin-bottom: 0;
}

.author-info a {
    color: var(--blue-color);
    text-decoration: none;
}

.author-info a:hover {
    text-decoration: underline;
}

/* --- Bílá karta --- */
.card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.card h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 20px;
}

/* --- Zvýrazněný claim --- */
.claim-block {
    margin: 40px 0;
    padding: 20px 25px;
    border-left: 4px solid var(--primary-color);
    background-color: var(--claim-bg);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.claim-block p {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.5;
    margin: 0;
}

/* --- Sekce se dvěma obrázky --- */
.comparison-section h2 {
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

/* --- Sekce s jedním obrázkem --- */
.single-image-section h2 {
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

/* --- Obrázky a popisy --- */
figure {
    display: flex;
    flex-direction: column;
}

figure img {
    width: 100%;
    max-height: 350px;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius);
    display: block;
    background-color: var(--img-bg);
    cursor: pointer;
    transition: transform 0.2s ease;
}

figure img:hover {
    transform: scale(1.02);
}

figcaption.comparison-description, 
figcaption.section-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-style: normal;
    text-align: left;
    padding-top: 15px;
    border-top: none;
    line-height: 1.7;
}

/* --- Běžné seznamy --- */
ul, ol {
    padding-left: 28px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
}

li:last-child {
    margin-bottom: 0;
}

li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

ul ul, ol ol, ul ol, ol ul {
    padding-left: 20px;
    margin-top: 6px;
    margin-bottom: 6px;
}

ul ul {
    list-style-type: circle;
}

ul ul ul {
    list-style-type: square;
}

ol ol {
    list-style-type: lower-alpha;
}

.red-bold {
    color: var(--red-color);
    font-weight: bold;
}

/* --- E-mailový box --- */
.email-box {
    border-left: 4px solid var(--primary-color);
    background-color: var(--email-bg);
    font-style: italic;
    color: var(--text-color);
}

.email-box p {
    margin-bottom: 15px;
}

.email-box p:last-child {
    margin-bottom: 0;
}

/* --- Číslovaný seznam v e-mailu --- */
ol.custom-email-list {
    list-style-type: none;
    counter-reset: main-counter;
    padding-left: 28px;
    margin-top: 20px;
    margin-bottom: 20px;
}

ol.custom-email-list > li {
    counter-increment: main-counter;
    margin-top: 25px;
    margin-bottom: 12px;
    color: var(--red-color);
    font-weight: bold;
}

ol.custom-email-list > li:first-child {
    margin-top: 5px;
}

ol.custom-email-list > li::before {
    content: counter(main-counter) " ";
}

ol.custom-email-list > li > p {
    color: var(--text-color);
    font-weight: normal;
    font-style: italic;
    margin-top: 6px;
    margin-bottom: 12px;
}

ol.custom-email-list ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 12px;
}

ol.custom-email-list ul li {
    color: var(--text-color);
    font-weight: normal;
    font-style: italic;
    margin-bottom: 6px;
}

ol.custom-email-list > li > ol {
    list-style-type: none;
    counter-reset: sub-counter;
    padding-left: 20px;
    margin-top: 12px;
}

ol.custom-email-list > li > ol > li {
    counter-increment: sub-counter;
    margin-top: 18px;
    margin-bottom: 10px;
    color: var(--blue-color);
    font-weight: bold;
}

ol.custom-email-list > li > ol > li:first-child {
    margin-top: 8px;
}

ol.custom-email-list > li > ol > li::before {
    content: counter(main-counter) counter(sub-counter, lower-alpha) " ";
}

ol.custom-email-list > li > ol > li > p {
    color: var(--text-color);
    font-weight: normal;
    font-style: italic;
    margin-top: 6px;
    margin-bottom: 10px;
}

/* --- Jednoduchý číslovaný seznam --- */
ol.simple-numbered-list {
    list-style-type: none;
    counter-reset: simple-counter;
    padding-left: 28px;
    margin-bottom: 20px;
}

ol.simple-numbered-list > li {
    counter-increment: simple-counter;
    margin-bottom: 10px;
    line-height: 1.6;
}

ol.simple-numbered-list > li::before {
    content: counter(simple-counter);
    display: inline-block;
    margin-right: 15px;
    font-weight: bold;
}

/* --- Zápatí --- */
footer {
    background-color: var(--primary-color);
    color: var(--white-color);
    text-align: center;
    padding: 30px 0;
    font-size: 0.9rem;
}

footer a {
    color: var(--footer-link-color);
    text-decoration: underline;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--footer-link-hover);
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--lightbox-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 80vw;
    max-height: 85vh;
}

.lightbox img {
    max-width: 80vw;
    max-height: 75vh;
    object-fit: contain;
    cursor: default;
}

.lightbox-caption {
    color: var(--white-color);
    font-size: 1.05rem;
    margin-top: 15px;
    text-align: center;
    max-width: 700px;
}

.lightbox .close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--white-color);
    font-size: 42px;
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    z-index: 1010;
}

.lightbox .close-btn:hover {
    opacity: 1;
}

.lightbox .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--btn-bg);
    color: var(--white-color);
    border: none;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    z-index: 1010;
}

.lightbox .nav-btn:hover {
    background-color: var(--btn-hover-bg);
}

.lightbox .prev-btn {
    left: 40px;
}

.lightbox .next-btn {
    right: 40px;
}

/* --- Mřížka pro galerii fotografií --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-grid figure {
    margin: 0;
}

.gallery-grid figure img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover; 
    max-height: none;
}

.gallery-grid figcaption {
    font-size: 0.85rem;
    padding-top: 8px;
    line-height: 1.4;
}



/* --- Responzivita --- */
@media (max-width: 768px) {
    header {
        padding: 40px 0;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
        margin-bottom: 30px;
    }

    .claim-block p {
        font-size: 1.15rem;
    }

    .lightbox .nav-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .lightbox .prev-btn { left: 15px; }
    .lightbox .next-btn { right: 15px; }

    .lightbox .close-btn {
        top: 20px;
        right: 25px;
        font-size: 36px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 sloupce na tabletu */
        gap: 15px;
    }
}



@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* 1 sloupec na telefonu */
    }
}