/* HLAVNÍ STYLOPIS - Hvězda Severu */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@6..144,300..800&display=swap');

:root {
    /* Barevná paleta */
    --primary: #588157;       /* Hlavní zelená */
    --primary-dark: #3A5A40;  /* Tmavší zelená (hover, nadpisy) */
    --accent: #A3B18A;        /* Světlejší zelená (doplňková) */
    --bg-light: #DAD7CD;      /* Pozadí sekcí */
    --white: #ffffff;
    --text-main: #333333;     /* Hlavní text */
    --text-muted: #666666;    /* Doplňkový text */
    --gray-placeholder: #e0e0e0; /* Pro chybějící obrázky */
    
    /* Rozměry */
    --container-width: 1100px;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Google Sans Flex', sans-serif;
    background-color: var(--white);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- TYPOGRAFIE --- */
h1, h2, h3, h4 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; text-align: center; }
p { margin-bottom: 1rem; }
a { text-decoration: none; color: inherit; transition: color 0.3s; }

/* --- KOMPONENTY --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary);
    color: var(--white);
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--white);
}

/* --- HEADER & NAVIGACE --- */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Mobilní menu */
@media (max-width: 768px) {
    .nav-links { display: none; } 
}

/* --- SECTIONS --- */
section {
    padding: 60px 0;
    /* PŘIDÁNO: Odsazení pro kotvy (kvůli fixní hlavičce) */
    /* Header má 70px, dáme 90px pro malou mezeru */
    scroll-margin-top: 60px; 
}

.bg-light { background-color: var(--bg-light); }

/* --- HERO SECTION --- */
.hero {
    height: 80vh;
    background-color: var(--gray-placeholder);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero h1 { color: var(--white); margin-bottom: 20px; }
.hero p { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; }

/* --- HODNOTY (Values) --- */
.values-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 800px;
    margin: 40px auto 0 auto;
}

.value-item {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px;
    border-bottom: 1px solid var(--accent);
}

.value-left { text-align: left; }
.value-center { text-align: center; }
.value-right { text-align: right; }

/* --- SOCIAL LINKS --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 50px;
    background: var(--white);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-weight: 600;
    color: var(--primary-dark);
}

.social-btn:hover {
    background: var(--bg-light);
    transform: translateY(-3px);
}

/* --- LATEST ARTICLE --- */
.latest-article-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.article-img-placeholder {
    width: 100%;
    height: 250px;
    background-color: var(--gray-placeholder);
}

.article-content {
    padding: 30px;
}

/* --- FOOTER --- */
footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 40px 0;
    margin-top: auto;
    text-align: center;
}

footer a { color: var(--accent); }

/* --- SPECIFICKÉ STYLY PRO STRÁNKU "O ODDÍLU" --- */

/* Profil hlavního vedoucího */
.leader-spotlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    border-left: 5px solid var(--primary);
}

.leader-photo-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: var(--gray-placeholder);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.leader-bio {
    text-align: center;
}

/* Karty kluboven - FIX (FLEXBOX) */
.clubhouse-grid {
    display: flex;
    flex-direction: column; /* Výchozí: Mobil - pod sebou */
    gap: 30px;
    margin-top: 30px;
}

.clubhouse-card {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    transition: transform 0.3s;
    flex: 1; /* Roztáhne se na dostupnou šířku */
}

.clubhouse-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.clubhouse-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Časy schůzek */
.meeting-times {
    list-style: none;
    background: var(--bg-light);
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.meeting-times li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.meeting-times li:last-child { border-bottom: none; }
.meeting-day { font-weight: 700; color: var(--primary-dark); }

/* --- SPECIFICKÉ STYLY PRO STRÁNKU "ČLENOVÉ" --- */

/* Galerie družin */
.patrols-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 50px;
}

.patrol-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.patrol-card-img {
    width: 100%;
    height: 100%;
    background-color: var(--gray-placeholder);
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.patrol-card:hover .patrol-card-img {
    transform: scale(1.05);
}

.patrol-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 10px 15px;
    font-weight: 700;
    text-align: center;
}

/* Karty vedoucích */
.team-section {
    margin-top: 60px;
}

.leader-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.leader-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    padding-bottom: 20px;
    border-top: 4px solid var(--primary);
    transition: transform 0.3s;
}

.leader-card:hover {
    transform: translateY(-5px);
}

.leader-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--gray-placeholder);
    background-size: cover;
    background-position: center;
    margin: 30px auto 15px auto;
    border: 3px solid var(--bg-light);
}

.leader-info h3 {
    margin-bottom: 5px;
    color: var(--primary-dark);
}

.nickname {
    display: block;
    font-family: monospace;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.9em;
}

.leader-role {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: block;
}

.contact-info {
    font-size: 0.9em;
    color: var(--text-main);
}

.contact-info a {
    color: var(--primary);
    display: block;
    margin: 2px 0;
}

/* --- MEDIA QUERIES (DESKTOP) --- */
@media (min-width: 768px) {
    /* Hlavní stránka */
    .latest-article-card { flex-direction: row; }
    .article-img-placeholder { width: 40%; height: auto; }
    .article-content { width: 60%; }

    /* O Oddílu */
    .leader-spotlight {
        flex-direction: row;
        text-align: left;
    }
    .leader-bio { text-align: left; }
    
    /* OPRAVA KLUBOVEN - ZDE SE MĚNÍ NA ŘÁDEK */
    .clubhouse-grid { 
        flex-direction: row; 
    }

    /* Členové */
    .patrols-grid { grid-template-columns: repeat(2, 1fr); }
    .leader-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .patrols-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- SPECIFICKÉ STYLY PRO STRÁNKU "TÁBORY" --- */

/* Akordeon (Rozbalovací sekce) */
.accordion {
    max-width: 900px;
    margin: 40px auto;
}

.accordion-item {
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

.accordion-header {
    width: 100%;
    padding: 20px;
    background-color: var(--white);
    border: none;
    text-align: left;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
    border-radius: 5px;
}

.accordion-header:hover {
    background-color: var(--bg-light);
}

.accordion-header i {
    transition: transform 0.3s ease;
}

.accordion-header.active i {
    transform: rotate(180deg);
}

/* Obsah akordeonu (skrytý) */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #f9f9f9;
}

.accordion-inner {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responzivní mřížka */
    gap: 20px;
}

/* Karta tábora (s efektem prolnutí roku) */
.camp-card {
    position: relative;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: var(--white);
    display: flex;
    flex-direction: column;
}

.camp-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease, filter 0.5s ease;
    z-index: 1;
}

/* Efekt: Rok přes fotku */
.camp-year-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0); /* Průhledná bílá */
    z-index: 2;
    pointer-events: none;
    transition: color 0.3s ease;
}

/* Hover efekt na kartu */
.camp-card:hover .camp-bg {
    transform: scale(1.1);
    filter: brightness(0.3); /* Ztmavnutí fotky */
}

.camp-card:hover .camp-year-overlay {
    color: rgba(255, 255, 255, 0.5); /* Ještě průhlednější rok */
}

/* Informace o táboře (zobrazí se po najetí) */
.camp-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--white);
    z-index: 3;
    
    transition: transform 0.3s ease;
}

.camp-card:hover .camp-info {
    transform: translateY(0);
}

.camp-info h3 { color: var(--white); margin-bottom: 5px; font-size: 1.2rem; }
.camp-info p { font-size: 0.9em; margin-bottom: 10px; line-height: 1.4; color: #ddd; }
.camp-info a { color: var(--accent); font-weight: bold; font-size: 0.9em; }
.camp-info a:hover { text-decoration: underline; color: var(--white); }

/* --- SPECIFICKÉ STYLY PRO STRÁNKU "LOGIN" --- */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh; /* Aby byl formulář vertikálně uprostřed */
    padding: 40px 20px;
}

.login-box {
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    border-top: 5px solid var(--primary);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 129, 87, 0.1);
}

.error-message {
    color: #dc3545;
    background-color: #ffe6e6;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9em;
    display: none; /* Ve výchozím stavu skryto */
}

/* User Info po přihlášení */
.user-info-box {
    text-align: center;
    display: none; /* Ve výchozím stavu skryto */
}

.user-avatar {
    width: 80px;
    height: 80px;
    background-color: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px auto;
}
/* --- SPECIFICKÉ STYLY PRO STRÁNKU "ČLÁNKY" --- */

/* Ovládací panel (Vyhledávání + Tlačítka) */
.articles-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Seznam článků (Grid) */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-thumb {
    height: 200px;
    background-color: var(--gray-placeholder);
    background-size: cover;
    background-position: center;
}

.article-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-tags {
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    background-color: var(--bg-light);
    color: var(--primary-dark);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 5px;
    text-transform: uppercase;
    font-weight: 700;
}

.article-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.article-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex: 1;
}

.article-meta {
    font-size: 0.85rem;
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Detail článku */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.article-header-img {
    width: 100%;
    height: 400px;
    background-color: var(--gray-placeholder);
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-bottom: 30px;
}

.article-content-text {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-main);
}

.article-content-text p {
    margin-bottom: 20px;
}

/* Editor */
.editor-container {
    max-width: 800px;
    margin: 0 auto;
}

.editor-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.editor-form input, 
.editor-form textarea, 
.editor-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.editor-form textarea {
    min-height: 300px;
    resize: vertical;
}

/* Admin tlačítka (zobrazí se jen přihlášeným) */
.admin-only {
    display: none; /* JS to přepne na block/inline-block */
}
/* --- MOBILNÍ MENU --- */
@media (max-width: 768px) {
    /* Zobrazit ikonu hamburgeru (přebijeme inline style) */
    .mobile-menu-icon {
        display: block !important;
        font-size: 1.8rem;
        cursor: pointer;
        color: var(--primary-dark);
        padding: 10px;
    }

    /* Menu se změní na absolutní panel pod hlavičkou */
    .nav-links {
        display: none; /* Ve výchozím stavu skryté */
        position: absolute;
        top: 70px; /* Výška headeru */
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        z-index: 999;
    }

    /* Tuto třídu přidá JavaScript, když se menu otevře */
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    .nav-links li {
        margin: 0 0;
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 5px;
        font-size: 1.2rem;
    }

    /* Animace vysunutí */
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}