/* ==========================================================================
   1. ZÁKLADNÍ RESET A NASTAVENÍ STRÁNKY
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* FIX: Zabírá místo pro scrollbar dopředu, takže stránka neodskakuje vpravo/vlevo */
    scrollbar-gutter: stable;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fcfdfe;
    color: #2c3e50;
    line-height: 1.6;
}

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

main {
    padding: 40px 0;
}

/* Společný styl pro nadpisy sekcí / stránek */
.section-title, .page-title {
    font-size: 1.8rem;
    color: #1a3326;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after, .page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: #2e5a44;
    border-radius: 2px;
}

/* ==========================================================================
   2. HLAVIČKA A NAVIGACE
   ========================================================================== */
header {
    background-color: #1a3326; /* Tmavá břidlicově zelená */
    color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-area span {
    font-size: 0.9rem;
    color: #a3c2b2;
    letter-spacing: 1px;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

nav a:hover, nav a.active {
    background-color: #2e5a44;
    color: #ffffff;
}

/* ==========================================================================
   3. HLAVNÍ BANNER (HERO SEKCE NA ÚVODU)
   ========================================================================== */
.main-banner {
    position: relative;
    height: 350px;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    text-align: center;
    padding: 0 20px;
}

.banner-overlay h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.banner-overlay p {
    font-size: 1.2rem;
    font-style: italic;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* ==========================================================================
   4. RYCHLÉ ODKAZY (GRID KARTY NA ÚVODU)
   ========================================================================== */
.quick-links {
    margin-bottom: 50px;
}

.grid-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 30px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #1a3326;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eef2f0;
    transition: all 0.2s ease;
}

.link-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    object-fit: contain;
}

.link-card span {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(46, 90, 68, 0.12);
    border-color: #2e5a44;
}

/* ==========================================================================
   5. ÚVODNÍ STRÁNKA: ROZVRŽENÍ (AKTUALITY VLEVO + KALENDÁŘ VPRAVO)
   ========================================================================== */
.flex-news-cal {
    display: flex;
    gap: 40px;
}

.news-list {
    flex: 2;
}

.calendar-aside {
    flex: 1;
    background-color: #f4f7f5;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #2e5a44;
    height: fit-content;
}

/* --- STYLOVÁNÍ NÁHLEDŮ AKTUALIT (INDEX) --- */
#aktuality-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.news-entry {
    display: flex;
    gap: 20px;
    background: #ffffff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eef2f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
    /* DŮLEŽITÉ: Umožňuje roztáhnout klikací plochu na celou kartu */
    position: relative; 
    cursor: pointer;
}

.news-date {
    background-color: #2e5a44;
    color: #ffffff;
    font-weight: bold;
    padding: 10px;
    border-radius: 6px;
    min-width: 65px;
    height: fit-content;
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.news-content {
    flex: 1;
}

.news-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
}

.news-content h3 a {
    color: #1a3326;
    text-decoration: none;
    transition: color 0.2s;
}

/* TRIK: Neviditelná vrstva odkazu přes celou plochu .news-entry */
.news-entry h3 a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.news-content p {
    margin: 0;
    color: #555555;
    font-size: 0.95rem;
}

/* Hover efekty pro celou klikací kartu */
.news-entry:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 90, 68, 0.1);
}

.news-entry:hover .news-content h3 a {
    color: #438463;
}

/* Tlačítko "Všechny aktuality" */
.btn-more {
    display: inline-block;
    background: #2e5a44;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-more:hover {
    background: #1d3a2b;
}

/* --- ZVLÁŠTNÍ ÚPRAVA PRO KOMPAKTNÍ ÚŘEDNÍ HODINY --- */
.uredni-hodiny-wrapper {
    max-width: 320px;
    width: 100%;
}

.news-entry-hours {
    display: flex;
    gap: 20px;
    background: #ffffff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eef2f0;
    margin-bottom: 15px;
}

.news-content-hours {
    display: flex;
    align-items: center;
    flex: 1;
}

.news-content-hours p {
    margin: 0;
    white-space: nowrap;
    color: #2c3e50;
    font-size: 1rem;
}

.btn-more-hours {
    display: block;
    background: #2e5a44;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
    margin-top: 20px;
    text-align: center;
}

.btn-more-hours:hover {
    background: #1d3a2b;
}

/* --- STYLOVÁNÍ MINIKALENDÁŘE --- */
#kalendar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cal-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e6e2;
}

.cal-item:last-child {
    border-bottom: none;
}

.cal-date {
    background: #ffffff;
    border: 2px solid #2e5a44;
    border-radius: 6px;
    min-width: 55px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.cal-date strong {
    display: block;
    font-size: 1.3rem;
    color: #2e5a44;
    padding-top: 3px;
    line-height: 1.1;
}

.cal-date span {
    display: block;
    background: #2e5a44;
    color: #ffffff;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 2px 0;
    font-weight: bold;
}

.cal-info {
    font-weight: 600;
    color: #1a3326;
    font-size: 1rem;
    line-height: 1.3;
}

.cal-info small {
    color: #666666;
    font-weight: normal;
    display: inline-block;
    margin-top: 4px;
}

/* ==========================================================================
   6. STRÁNKA: AKTUALITY (AKTUALITY.HTML - PROUD PLNÝCH ČLÁNKŮ)
   ========================================================================== */
.archiv-stream {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 30px;
}

.full-article-card {
    background: #ffffff;
    padding: 35px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    border: 1px solid #eef2f0;
}

.article-meta {
    display: inline-block;
    background: #2e5a44;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.full-article-card h2 {
    color: #1a3326;
    font-size: 1.8rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 20px;
}

.article-perex {
    font-size: 1.15rem;
    color: #4a5568;
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.6;
    border-left: 4px solid #2e5a44;
    padding-left: 15px;
}

.article-body {
    font-size: 1.05rem;
    color: #2d3748;
    line-height: 1.8;
    white-space: pre-line; /* Klíčové: drží odstavce a entery ze Supabase */
}

/* ==========================================================================
   7. STRÁNKA: KONTAKT (KONTAKT.HTML)
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #eef2f0;
    border-left: 4px solid #2e5a44;
    box-shadow: 0 3px 8px rgba(0,0,0,0.02);
}

.contact-card h3 {
    color: #1a3326;
    font-size: 1.25rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-card h3 i {
    color: #2e5a44;
    font-size: 1.2rem;
}

.contact-card p {
    margin-bottom: 10px;
    color: #4a5568;
}

.contact-card p:last-child {
    margin-bottom: 0;
}

.contact-card strong {
    color: #1a3326;
}

.contact-card a {
    color: #2e5a44;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.contact-card a:hover {
    color: #438463;
    text-decoration: underline;
}

/* Úřední hodiny v tabulce */
.hours-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
}

.hours-table td {
    padding: 8px 0;
    color: #4a5568;
    border-bottom: 1px solid #f0f4f2;
}

.hours-table tr:last-child td {
    border-bottom: none;
}

.hours-table td:first-child {
    width: 30%;
    color: #1a3326;
}

/* --- NOVÝ MODERNÍ GRID PRO ÚŘEDNÍ HODINY ZE SUPABASE --- */
.hours-card-full {
    background: #ffffff;
    border: 1px solid #eef2f0;       /* 1. Nejdřív jemný rámeček kolem dokola */
    border-left: 4px solid #2e5a44;  /* 2. Až POTOM silná zelená linka vlevo */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    padding: 25px;
    margin-top: 20px;
}

.hours-header-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e6e2;
    padding-bottom: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.hours-title-full {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hours-icon-full {
    font-size: 1.4rem;
    color: #2e5a44;
}

.hours-title-full h3 {
    margin: 0;
    color: #1a3326;
    font-size: 1.3rem;
    font-weight: 700;
}

.hours-title-full p {
    margin: 4px 0 0 0;
    color: #666666;
    font-size: 0.95rem;
}

.hours-time-badge-full {
    background: #f4f7f5;
    color: #2e5a44;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e0e6e2;
}

.hours-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.date-badge-full {
    background: #fcfdfe;
    border: 1px solid #eef2f0;
    border-radius: 6px;
    padding: 14px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease-in-out;
}

.date-badge-full:hover {
    border-color: #2e5a44;
    background: #f4f7f5;
    transform: translateY(-2px);
}

.date-text-full {
    color: #1a3326;
    font-weight: 600;
    font-size: 1.05rem;
}

.date-badge-next-full {
    background: #f4f7f5;
    border-color: #2e5a44;
    box-shadow: 0 2px 6px rgba(46, 90, 68, 0.12);
}

.date-badge-next-full .date-text-full {
    color: #2e5a44;
    font-weight: 700;
}

.next-label-full {
    font-size: 0.65rem;
    text-transform: uppercase;
    background: #2e5a44;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Sekce s mapou */
.contact-map {
    height: 100%;
}

.map-wrapper {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #eef2f0;
}

/* ==========================================================================
   8. PATIČKA
   ========================================================================== */
footer {
    background-color: #1a3326;
    color: #a3c2b2;
    text-align: center;
    padding: 25px 0;
    margin-top: 60px;
    font-size: 0.95rem;
    border-top: 3px solid #2e5a44;
}

/* ==========================================================================
   9. RESPONSIVITA (MEDIA QUERIES PRO MOBILY A TABLETY)
   ========================================================================== */
@media (max-width: 992px) {
    .flex-news-cal {
        flex-direction: column;
        gap: 40px;
    }
    
    .uredni-hodiny-wrapper {
        max-width: 100%; /* Na tabletech/mobilech ať se roztáhnou na plnou šířku */
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .map-wrapper {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .main-banner {
        height: 250px;
    }

    .banner-overlay h2 {
        font-size: 1.8rem;
    }

    .news-entry, .news-entry-hours {
        flex-direction: column;
        gap: 12px;
    }

    .news-date {
        min-width: auto;
        display: inline-block;
        align-self: flex-start;
        padding: 6px 15px;
    }
    
    .full-article-card {
        padding: 20px;
    }
}

/* ==========================================================================
   10. SEKCE: MODERNÍ KOMPAKTNÍ FOTOGALERIE (ALBA V MŘÍŽCE)
   ========================================================================== */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Na velkém monitoru vytvoří 3 sloupce */
    gap: 30px;
    margin-top: 20px;
}

.album-card {
    background: #ffffff;
    border: 1px solid #eef2f0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.album-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f4f7f5;
}

.album-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Počet fotek v rohu alba */
.album-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(26, 51, 38, 0.85); /* Tmavě zelená s průhledností */
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(3px);
}

.album-card-info {
    padding: 18px;
    border-top: 1px solid #f4f7f5;
}

.album-card-info h3 {
    color: #1a3326;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    transition: color 0.2s ease;
}

/* Efekty při najetí myší na kartu */
.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(46, 90, 68, 0.1);
    border-color: #2e5a44;
}

.album-card:hover .album-card-image img {
    transform: scale(1.04);
}

.album-card:hover .album-card-info h3 {
    color: #2e5a44;
}

/* Přizpůsobení pro mobilní telefony */
@media (max-width: 768px) {
    .albums-grid {
        grid-template-columns: 1fr; /* Na mobilu jedno album na řádek přes celou šířku */
        gap: 20px;
    }
}

/* ==========================================================================
   11. SEKCE: ČLENSKÁ SEKCE A PCLOUD ÚLOŽIŠTĚ
   ========================================================================== */
.member-login-card {
    max-width: 450px;
    margin: 60px auto;
    background: #ffffff;
    border: 1px solid #eef2f0;
    border-radius: 8px;
    padding: 40px 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
}

.login-header {
    margin-bottom: 25px;
}

.login-icon {
    font-size: 2.5rem;
    color: #2e5a44;
    margin-bottom: 15px;
    background: #f4f7f5;
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    display: inline-block;
}

.login-header h3 {
    color: #1a3326;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

.member-login-card input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d0dad5;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}

.member-login-card input[type="password"]:focus {
    border-color: #2e5a44;
    box-shadow: 0 0 0 3px rgba(46, 90, 68, 0.1);
}

.btn-login {
    width: 100%;
    background-color: #2e5a44;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: #1a3326;
}

.login-error {
    color: #c0392b;
    font-size: 0.9rem;
    margin-top: 15px;
    font-weight: 600;
}

/* Panel po přihlášení */
.member-welcome-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #eef2f0;
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.status-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 4px;
}

.member-welcome-bar p {
    color: #555;
    font-size: 0.95rem;
    margin: 0;
}

.btn-logout {
    background: transparent;
    border: 1px solid #d0dad5;
    color: #666;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #fdf2f2;
    color: #c0392b;
    border-color: #f5c2c2;
}

/* Obálka pro pCloud iframe */
.pcloud-iframe-container {
    background: #ffffff;
    border: 1px solid #eef2f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

@media (max-width: 768px) {
    .member-welcome-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .btn-logout {
        width: 100%;
        text-align: center;
    }
}