/* Reset a základní nastavení */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    /* Layered background: darker green at top, softer below, with highlights */
    background-color: #eaf6ef;
    /* fallback color */
    background-image:
        radial-gradient(1200px 400px at 8% 8%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(800px 300px at 85% 85%, rgba(255, 255, 255, 0.28), transparent),
        linear-gradient(180deg, #5f9a2f 0%, #79b93b 30%, #9cd66a 70%, #dff5d9 100%);
    background-blend-mode: overlay, overlay, normal;
    background-attachment: fixed;
    color: #21321a;
    line-height: 1.6;
}

:root {
    --accent: #2e7d32;
    --muted: #6b8a5a;
    --panel-bg: rgba(255, 255, 255, 0.95);
    --radius: 12px;
}

.footer-basic {
    padding: 40px 0;
    background-color: #ffffff;
    color: #4b4c4d;
}


.footer-basic ul {
    padding: 0;
    list-style: none;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-basic li {
    padding: 0 10px;
}

.footer-basic ul a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
}

.footer-basic ul a:hover {
    opacity: 1;
}

.footer-basic .social {
    text-align: center;
    padding-bottom: 25px;
}

.footer-basic .social>a {
    font-size: 24px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #ccc;
    margin: 0 8px;
    color: inherit;
    opacity: 0.75;
}

.footer-basic .social>a:hover {
    opacity: 0.9;
}

.footer-basic .copyright {
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 0;
}

.footer-basic .footer-logo {
    text-align: center;
    margin-top: 10px;
}

.footer-basic .footer-logo img {
    height: 40px;
    display: inline-block;
    /* vycentruje logo */
}

/* Grid layout */
.container {
    display: grid;
    grid-template-columns: 275px 600px 275px;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Levý panel */
aside.left {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-logo {
    display: block;
    margin: 0 auto 12px;
    max-width: 160px
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0
}

.nav-list li {
    list-style: none
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent
}

.nav-list a:hover {
    background: linear-gradient(90deg, rgba(46, 125, 50, 0.06), rgba(46, 125, 50, 0.02));
    box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.04)
}

.nav-list a:focus-visible {
    outline: 3px solid rgba(46, 125, 50, 0.12);
    outline-offset: 2px
}

.nav-list a.active {
    background: linear-gradient(90deg, rgba(46, 125, 50, 0.12), rgba(46, 125, 50, 0.06));
    box-shadow: none
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.search-box label {
    font-size: 0.9rem;
    color: var(--muted)
}

.search-box input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(16, 24, 32, 0.06)
}

.contact-info {
    font-size: 0.95rem;
    color: var(--muted)
}


/* Střední panel */
main {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

main h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #567125;
    text-align: center;
}

main p {
    margin-bottom: 20px;
    color: #567125;
    text-align: center;
}

main h3 {
    margin-bottom: 5px;
    color: #567125;
    text-align: left;
}
/* --- Styl pro mřížku karet --- */
.members-grid {
    display: grid;
    /* Automaticky vytvoří sloupce, minimální šířka karty 240px */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 25px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* --- Vzhled jednotlivé karty --- */
.member-card-box {
    background-color: #ffffff;
    border: 1px solid #c9d6af;
    border-radius: 15px; /* Zaoblené rohy karty */
    padding: 25px 15px;
    text-align: center; /* Vše zarovnáno na střed */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Jemný stín */
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Efekt při najetí myší na celou kartu */
.member-card-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(86, 113, 37, 0.15);
    border-color: #79b93b;
}

/* --- Fotka v kartě --- */
.member-photo {
    width: 120px;  /* Větší fotka než v tabulce */
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #567125;
    margin-bottom: 15px;
    cursor: pointer; /* Ukáže, že jde rozkliknout */
}

.member-photo:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* --- Texty v kartě --- */
.member-card-box h3 {
    color: #21321a;
    font-size: 1.25rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.member-card-box .role {
    color: #567125;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    min-height: 25px; /* Aby byly karty stejně vysoké i s kratší funkcí */
}

.member-card-box .contact {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    background-color: #f6fbe9; /* Podbarvení kontaktu */
    padding: 8px 15px;
    border-radius: 20px;
    white-space: nowrap; /* ZAJISTÍ, ŽE ČÍSLO BUDE VŽDY NA JEDEN ŘÁDEK */
}
/* Tabulka výboru */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}
/* --- Úprava malé fotky --- */
.table-avatar {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #567125;
    display: block;
    margin: 0 auto;
    /* Nové: ukáže, že jde kliknout */
    cursor: pointer;
    transition: 0.3s;
}

.table-avatar:hover {
    opacity: 0.8;
    transform: scale(1.1); /* Lehké zvětšení při najetí myší */
    border-color: #79b93b;
}

/* --- Modální okno (pozadí) --- */
.modal {
    display: none; /* Ve výchozím stavu skryté */
    position: fixed; 
    z-index: 2000; /* Musí být nad vším ostatním */
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); /* Fallback barva */
    background-color: rgba(0,0,0,0.9); /* Černá s průhledností */
}

/* --- Zvětšený obrázek --- */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 600px; /* Maximální šířka fotky */
    max-height: 80vh; /* Aby se vešla na výšku displeje */
    object-fit: contain;
    border-radius: 8px;
    animation-name: zoom;
    animation-duration: 0.3s;
}

/* --- Popisek pod fotkou --- */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
    font-size: 1.2rem;
}

/* --- Animace přiblížení --- */
@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

/* --- Tlačítko zavřít (X) --- */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Responsivita pro mobily */
@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }
}

/* Zarovnání obsahu buněk na střed (svisle), aby text ladil s fotkou */
.styled-table td {
    vertical-align: middle;
}

/* Volitelné: Zmenšení šířky sloupce pro fotku */
.styled-table th:first-child, 
.styled-table td:first-child {
    width: 80px;
    text-align: center;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #567125;
}

.styled-table thead tr {
    background-color: #567125;
    color: #ffffff;
    text-align: left;
    font-weight: bold;
}

.styled-table th,
.styled-table td {
    padding: 14px 18px;
    border: 1px solid #c9d6af;
}

.styled-table tbody tr:nth-child(even) {
    background-color: #f6fbe9;
}

.styled-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.styled-table tbody tr:hover {
    background-color: #e3f2d1;
    transition: background-color 0.2s ease-in-out;
}

.members {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* two equal columns */
    gap: 20px;
    margin-bottom: 20px;
}

.member-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-align: center;
    transition: transform 220ms cubic-bezier(.2, .9, .2, 1),
        box-shadow 220ms cubic-bezier(.2, .9, .2, 1);
    will-change: transform, box-shadow;
}

.member-card img {
    width: 100%;
    height: auto;
    border-bottom: 2px solid #c8e6c9;
    transition: transform 300ms ease;
}

.member-card h3 {
    font-size: 1.5rem;
    margin: 15px 0;
    color: #2e7d32;
    text-align: center;
}

.member-card p {
    margin: 10px;
    margin-left: 3px;
    margin-right: 3px;
    color: #66bb6a;
}

/* Hover / focus effect: lift + stronger shadow + slight image zoom */
.member-card:hover,
.member-card:focus-within {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.member-card:hover img,
.member-card:focus-within img {
    transform: scale(1.03);
}

/* Pravý panel */
aside.right {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

aside.right h2 {
    margin-bottom: 15px;
}

form {
    display: grid;
    gap: 15px;
}

label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
}

input,
textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background: #0055a3;
}

.confirmation {
    display: none;
    background: #e0ffe0;
    border: 1px solid #90ee90;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

/* Footer */
.footer-basic {
    padding: 40px 0;
    background-color: #ffffff;
    color: #4b4c4d;
}

.footer-basic ul {
    padding: 0;
    list-style: none;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-basic li {
    padding: 0 10px;
}

.footer-basic ul a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
}

.footer-basic ul a:hover {
    opacity: 1;
}

.footer-basic .social {
    text-align: center;
    padding-bottom: 25px;
}

.footer-basic .social>a {
    font-size: 24px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #ccc;
    margin: 0 8px;
    color: inherit;
    opacity: 0.75;
}

.footer-basic .social>a:hover {
    opacity: 0.9;
}

.footer-basic .copyright {
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 0;
}

.footer-basic .footer-logo {
    text-align: center;
    margin-top: 10px;
}

.footer-basic .footer-logo img {
    height: 40px;
    display: inline-block;
    /* vycentruje logo */
}

@media (prefers-reduced-motion: reduce) {

    .member-card,
    .member-card img {
        transition: none !important;
        transform: none !important;
        will-change: auto;
    }
}

@media (pointer: coarse) {

    .member-card:hover,
    .member-card:focus-within {
        transform: none;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    }

    .member-card img {
        transform: none;
    }
}

/* Responsivita */
@media(max-width:900px) {
    .container {
        grid-template-columns: 1fr;
    }

    aside.left,
    aside.right,
    main {
        order: initial;
    }
}
/* --- MOBILNÍ MENU A ÚPRAVY ROZLOŽENÍ --- */

/* Výchozí stav: mobilní prvky jsou na desktopu skryté */
.mobile-header, .mobile-nav-overlay {
    display: none;
}

/* Responsivita pro mobily a tablety (pod 900px) */
@media(max-width: 900px) {
    
    /* 1. Změna rozložení stránky */
    .container {
        display: flex;
        flex-direction: column;
        margin-top: 60px; /* Místo pro fixní horní lištu */
    }

    /* PŘEHÁZENÍ POŘADÍ PRVKŮ (Order) */
    /* Hlavní obsah bude první */
    main {
        order: 1;
    }

    /* Pravý panel (Formulář) bude druhý */
    aside.right {
        order: 2;
    }

    /* Levý panel (Mapa a adresa) bude až nakonec */
    aside.left {
        order: 3;
        margin-top: 0;
    }

    /* 2. Skrytí duplicitní navigace a vyhledávání v levém panelu */
    /* Na mobilu nechceme navigaci dole, je v hamburger menu */
    aside.left nav, 
    aside.left .search-box, 
    aside.left .nav-logo {
        display: none;
    }

    /* Ujištění, že mapa a kontakt zůstanou viditelné */
    aside.left .contact-info, 
    aside.left iframe {
        display: block;
        width: 100%;
    }

    /* 3. Stylování horní lišty (Hamburger) */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: var(--accent); /* Zelená */
        padding: 15px 20px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        color: white;
    }

    .mobile-title {
        font-weight: 700;
        font-size: 1.1rem;
    }

    .hamburger {
        cursor: pointer;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .hamburger span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: white;
        border-radius: 3px;
    }

    /* 4. Stylování vyjížděcího menu */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: -100%; /* Skryté vlevo mimo obrazovku */
        width: 280px; /* Šířka menu */
        height: 100vh;
        background-color: #fff;
        z-index: 1001;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        padding: 20px;
        overflow-y: auto;
    }

    .mobile-nav-overlay.active {
        left: 0; /* Vysunutí */
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 20px;
        font-size: 40px;
        cursor: pointer;
        color: var(--accent);
    }

    .mobile-nav-logo {
        max-width: 120px;
        display: block;
        margin: 40px auto 20px;
    }

    .mobile-nav-list {
        list-style: none;
        padding: 0;
        text-align: center;
    }

    .mobile-nav-list li {
        margin: 15px 0;
    }

    .mobile-nav-list a {
        text-decoration: none;
        color: #21321a;
        font-size: 1.2rem;
        font-weight: 600;
        display: block;
        padding: 10px;
        border-radius: 8px;
    }

    .mobile-nav-list a:hover, 
    .mobile-nav-list a.active {
        background-color: #eaf6ef;
        color: var(--accent);
    }
    
    /* Vypnutí gridu z původního CSS, aby fungoval Flexbox */
    .container {
        grid-template-columns: none;
    }
}