/* --- GLOBÁLNÍ PROMĚNNÉ --- */
:root {
    --dark-blue: rgb(21, 61, 138);
    --light-blue: rgb(0, 159, 227);
    --white: rgb(255, 255, 255);
    --black: rgb(0, 0, 0);
}

/* --- RESET A ZÁKLAD --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Oswald', sans-serif;
}

body {
    background-color: var(--white);
    color: var(--black);
    overflow-x: hidden;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    width: 100%;
}

.bg-dark-blue { background-color: var(--dark-blue); color: var(--white); }
.bg-light-blue { background-color: var(--light-blue); color: var(--white); }

/* --- 1. ÚVODNÍ SEKCE (HERO) --- */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    flex-direction: column;
    background-color: var(--dark-blue);
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.6; /* Lehký překryv pro lepší čitelnost textu */
    z-index: 1;
}

.hero-content {
    flex: 1;
    display: flex;
    position: relative;
    z-index: 2;
}

.hero-top-left {
    position: absolute;
    top: 60px;
    left: 20px;
}

.skewed-box {
    transform: rotate(-4deg);
    display: inline-block;
    background-color: transparent !important; 
    padding: 0;
    /* Filtr vytvoří jednolitý stín přesně podle vnějšího obrysu všech řádků */
    filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.25));
}

.skewed-box h1, .skewed-box h2 {
    display: inline;
    background-color: var(--light-blue);
    color: var(--white);
    padding: 8px 15px;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.45; 
    text-transform: uppercase;
    transform: none; 
    
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    
    /* Původní box-shadow je zcela odstraněn */
}

.hero-candidate-photo {
    position: absolute;
    bottom: 0;
    right: 0; /* Změna z 5% na 0 pro zarovnání úplně doprava */
    height: 95%;
    max-width: 60%;
    display: flex;
    align-items: flex-end;
}

.hero-candidate-photo img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.hero-bottom-left {
    position: absolute;
    bottom: 40px;
    left: 20px;
    z-index: 3;
}

.name-box {
    padding: 15px 30px;
    display: inline-block;
}

.name-box h2 {
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
}

.name-box p {
    font-size: 1.5rem;
    font-weight: 200;
}

.hero-bottom-bar {
    text-align: center;
    padding: 20px 0;
    z-index: 3;
    position: relative;
}

.hero-bottom-bar h2 {
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- 2. KANDIDÁTKA --- */
.candidates-section {
    background-color: var(--dark-blue);
    /* Přidán obrázek s poloprůhledným modrým filtrem pro dobrou čitelnost nadpisu */
    background-image: linear-gradient(rgba(21, 61, 138, 0.6), rgba(21, 61, 138, 0.6)), url('soubory/pozadi.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 80px 0;
    color: var(--white);
}

.section-title {
    text-align: center;
    font-size: 3.5rem;
    margin-bottom: 60px;
    text-transform: uppercase;
    font-weight: 700;
}

.candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 40px;
}

.candidate-card {
    text-align: center;
}

.photo-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4; /* Poměr stran pro fotky */
    background-color: var(--light-blue); /* Světle modrá v pozadí */
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    /* Flexbox pro vycentrování zmenšené fotky */
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Fotka bude zarovnaná ke spodnímu okraji modrého rámečku */
}

.candidate-photo {
    width: 92%; 
    height: 96%; 
    object-fit: cover;
    object-position: top; /* Zajistí ukotvení portrétu k hornímu okraji hlavy */
}

.candidate-number {
    position: absolute;
    bottom: 0;
    right: 0;
    font-weight: 700;
    font-size: 2rem; /* Zvětšeno na 2rem podle požadavku */
    padding: 5px 15px;
}

.candidate-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.candidate-info p {
    font-size: 1.1rem;
    font-weight: 200;
    margin-bottom: 15px;
}

.btn-more {
    background-color: transparent;
    border: 1px solid var(--white);
    color: var(--white);
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 400;
    transition: all 0.3s ease;
}

.btn-more:hover {
    background-color: var(--light-blue);
    border-color: var(--light-blue);
}

/* --- MODÁLNÍ OKNO KANDIDÁTA --- */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(21, 61, 138, 0.9);
    justify-content: center;
    align-items: center;
    /* Animace ztmavení pozadí */
    animation: modalBgFade 0.3s ease-out;
}

.modal-content {
    background-color: var(--white);
    color: var(--black);
    padding: 40px;
    width: 90%;
    max-width: 600px;
    position: relative;
    border-radius: 8px;
    text-align: center;
    
    /* Omezení na 90 % výšky okna (vytvoří okraj nahoře a dole) */
    max-height: 90vh; 
    display: flex;
    flex-direction: column;
    
    /* ZDE MŮŽETE MĚNIT ANIMACE (odkomentujte tu, kterou chcete použít) */
    animation: modalZoomIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Možnost 1: Zoom In */
    /* animation: modalSlideUp 0.4s ease-out; */                  /* Možnost 2: Slide Up */
    /* animation: modal3DFlip 0.5s ease-out; */                   /* Možnost 3: 3D Flip */
}

/* --- VLASTNÍ VZHLED SCROLLBARU PRO IMPRESUM --- */
#modalBio::-webkit-scrollbar {
    width: 6px;
}
#modalBio::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}
#modalBio::-webkit-scrollbar-thumb {
    background: var(--light-blue); 
    border-radius: 4px;
}
#modalBio::-webkit-scrollbar-thumb:hover {
    background: var(--dark-blue); 
}

/* KNIHOVNA ANIMACÍ PRO MODÁL */
@keyframes modalBgFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalZoomIn {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modal3DFlip {
    from { opacity: 0; transform: perspective(400px) rotateX(90deg); }
    to { opacity: 1; transform: perspective(400px) rotateX(0deg); }
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 40px;
    cursor: pointer;
    color: var(--black);
    font-weight: 200;
}

.close:hover {
    color: var(--light-blue);
}

.modal-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- ANIMACE PRO ZAVÍRÁNÍ MODÁLU --- */
.modal.closing {
    animation: modalBgFadeOut 0.3s forwards ease-in;
}

.modal.closing .modal-content {
    animation: modalZoomOut 0.3s forwards cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modalBgFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modalZoomOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

/* --- DOČASNÉ PLACEHOLDERY PRO DALŠÍ SEKCE --- */
.placeholder-section {
    padding: 100px 20px;
    text-align: center;
}
.placeholder-section h2 {
    font-size: 2rem;
    font-weight: 200;
}

/* --- RESPONZIVITA (MOBILNÍ ZAŘÍZENÍ) --- */
@media (max-width: 900px) {
    /* Přidáno h2 a zvětšeno řádkování proti překrývání boxů */
    .skewed-box h1, .skewed-box h2 { font-size: 2.5rem; line-height: 1.6; }
    .name-box h2 { font-size: 2rem; }
    .hero-bottom-bar h2 { font-size: 2rem; }
    .hero-candidate-photo { right: 0; max-width: 80%; }
}

@media (max-width: 600px) {
    /* Menší font, větší řádkování a zmenšený padding (vnitřní okraj) */
    .skewed-box h1, .skewed-box h2 { font-size: 1.8rem; line-height: 1.65; padding: 4px 10px; }
    .hero-top-left { top: 30px; left: 10px; }
    .hero-bottom-left { bottom: 30px; left: 10px; }
    .name-box h2 { font-size: 1.5rem; }
    .name-box p { font-size: 1rem; }
    .hero-bottom-bar h2 { font-size: 1.5rem; }
    .candidate-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
}

/* --- GLOBÁLNÍ TŘÍDY A ANIMACE --- */
.dark-text { color: var(--dark-blue); }

.candidate-card, .scroll-anim {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.candidate-card.visible, .scroll-anim.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 3. VOLEBNÍ PROGRAM --- */
.program-section { padding: 80px 0; background-color: var(--white); }
.program-grid { display: grid; gap: 20px; margin-bottom: 30px; }
.main-program { grid-template-columns: repeat(4, 1fr); }
.sub-program { grid-template-columns: repeat(5, 1fr); }

.flip-card {
    background-color: transparent;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
}
.sub-program .flip-card { height: 150px; }

.flip-card-inner {
    position: relative;
    width: 100%; height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
}

.flip-card-front h3 { font-size: 1.8rem; text-transform: uppercase; margin-bottom: 15px; }
.click-indicator { font-size: 0.9rem; font-weight: 200; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 2px;}
.flip-card-back { transform: rotateY(180deg); }
.flip-card-back p { font-size: 1.1rem; font-weight: 200; line-height: 1.4; }

/* --- 5. ŽIVOT V MČ --- */
.life-section { padding: 80px 0; background-color: #f4f4f4; text-align: center; }
.life-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 50px; }
.life-card { background: var(--white); padding: 40px 20px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.life-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; font-weight: 700; margin: 0 auto 20px auto; }
.life-card h3 { font-size: 1.5rem; color: var(--dark-blue); text-transform: uppercase; margin-bottom: 15px; }

/* --- 6. VOLEBNÍ PRŮVODCE --- */
.guide-section { padding: 80px 0; color: var(--white); }
.guide-container { display: flex; gap: 60px; align-items: center; }
.guide-image { flex: 1; text-align: center; }
.guide-image img { max-width: 100%; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.guide-content { flex: 1; }
.guide-step { margin-bottom: 30px; }
.guide-step h4 { font-size: 1.3rem; color: var(--light-blue); text-transform: uppercase; margin-bottom: 5px; }
.guide-step p { font-weight: 200; font-size: 1.1rem; }

/* --- 7. ZÁVĚR --- */
.footer-section { position: relative; height: 600px; display: flex; align-items: center; text-align: center; color: var(--white); }
.footer-bg { position: absolute; top:0; left:0; right:0; bottom:0; background-size: cover; background-position: center; z-index: 1;}
.footer-overlay { position: absolute; top:0; left:0; right:0; bottom:0; opacity: 0.85; z-index: 2;}
.footer-content { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 30px; }
.election-details { font-size: 1.5rem; font-weight: 200; }
.election-date { font-size: 2.5rem; font-weight: 700; margin-bottom: 10px; color: var(--light-blue); }
.btn-facebook { 
    display: inline-block; 
    background-color: var(--light-blue); 
    color: var(--white); 
    padding: 15px 40px; 
    text-decoration: none; 
    font-size: 1.2rem; 
    text-transform: uppercase; 
    font-weight: 700; 
    margin-top: 20px;
    /* Přidán stejný stín jako mají ostatní bloky */
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease; 
}

.btn-facebook:hover { 
    /* Při najetí se stín zvětší a tlačítko nepatrně povyskočí */
    box-shadow: 4px 6px 20px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

/* --- RESPONZIVITA NOVÝCH SEKCI --- */
@media (max-width: 900px) {
    .main-program { grid-template-columns: repeat(2, 1fr); }
    .sub-program { grid-template-columns: repeat(2, 1fr); }
    .guide-container { flex-direction: column; }
    .life-grid { grid-template-columns: 1fr; }
    .project-content { max-width: 80%; }
}

@media (max-width: 600px) {
    .main-program, .sub-program { grid-template-columns: 1fr; }
    .project-content { max-width: 100%; text-align: left; }
    .project-content.right-align { text-align: left; }
    .election-date { font-size: 1.8rem; }
    .footer-section .skewed-box h2 { font-size: 2rem; }
}

/* --- ROZBALOVACÍ GALERIE (ACCORDION) PRO PROJEKTY --- */
.projects-creative-section {
    background-color: var(--white);
    padding: 80px 0;
    overflow-x: hidden; /* Důležité pro skrytí přesahů ze zkosení */
}

/* --- ROZBALOVACÍ GALERIE (ACCORDION) PRO PROJEKTY --- */
.projects-creative-section {
    background-color: var(--white);
    padding: 80px 0;
    overflow-x: hidden;
}

.accordion-gallery-wrapper {
    width: 100%;
    padding: 0 20px; /* Vráceno boční odsazení proti přetékání a nehezkému ořezu */
    max-width: 1400px; /* Ponecháno široké, ale s limitem pro obří monitory */
    margin: 0 auto;
}

.accordion-gallery {
    display: flex;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    gap: 15px; /* Vrácena hezčí větší mezera pro oddělení bloků */
}

.accordion-item {
    position: relative;
    flex: 1;
    overflow: hidden;
    border-radius: 12px; /* Vráceny oblé hrany pro elegantnější vzhled */
    transform: skewX(-8deg);
    transition: flex 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.accordion-bg {
    position: absolute;
    /* Extrémní přesah do stran (-40%) bezpečně eliminuje "bílé trojúhelníky" při roztáhnutí */
    top: 0; left: -40%; right: -40%; bottom: 0;
    background-size: cover;
    background-position: center;
    transform: skewX(8deg);
    transition: transform 0.6s ease;
}

.accordion-overlay {
    position: absolute;
    top: 0; left: -40%; right: -40%; bottom: 0;
    background: linear-gradient(to top, rgba(21, 61, 138, 0.95) 0%, rgba(21, 61, 138, 0) 60%);
    transform: skewX(8deg);
}

.accordion-item:hover {
    flex: 4;
}

.accordion-content {
    position: absolute;
    bottom: 30px;
    left: 40px;
    right: 40px;
    transform: skewX(8deg);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.accordion-title {
    font-size: 1.4rem; /* Úprava: Menší výchozí písmo pro úzký stav */
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0;
    white-space: normal; /* Úprava: Povoleno zalamování textu */
    line-height: 1.2;
    transition: all 0.4s ease;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    /* Ošetření, aby text v úzkém bloku nezabral příliš mnoho řádků */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.accordion-text {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-weight: 200;
    font-size: 1.1rem;
    line-height: 1.4;
}

.accordion-item:hover .accordion-text {
    opacity: 1;
    max-height: 300px;
    margin-top: 15px;
}

.accordion-item:hover .accordion-title {
    font-size: 2rem; /* Úprava: Po roztáhnutí se nadpis zvětší */
    -webkit-line-clamp: unset; /* Úprava: Omezení řádků se zruší, text se ukáže celý */
    overflow: visible;
}

/* RESPONZIVITA PRO ACCORDION NA MOBILECH */
@media (max-width: 900px) {
    .accordion-gallery {
        flex-direction: column;
        height: auto;
        gap: 15px;
        padding: 0 15px; /* Přidání odsazení od krajů mobilu */
    }
    .accordion-item {
        transform: skewX(0);
        height: auto; /* Zrušení fixní výšky pro zabránění skákání */
        min-height: 250px;
        flex: none;
        border-radius: 12px; /* Zpětné zakulacení rohů pro mobil */
        display: flex;
        align-items: flex-end;
    }
    .accordion-item:hover {
        flex: none;
        height: auto; 
    }
    .accordion-bg, .accordion-overlay {
        transform: skewX(0);
        left: 0; right: 0;
    }
    .accordion-content {
        transform: skewX(0);
        position: relative; /* Přepnutí pozicování pro stabilní přizpůsobení výšky */
        bottom: auto; left: auto; right: auto;
        padding: 20px;
        width: 100%;
    }
    .accordion-text {
        opacity: 1; /* Text je na mobilu rovnou viditelný - nic se nerozbaluje */
        max-height: 800px;
        margin-top: 15px;
    }
    .accordion-title {
        font-size: 2rem;
        -webkit-line-clamp: unset;
    }
}
}