:root {
    --primary-color: #02204d;
    --secondary-color: #808080;
    --tertiary-color: #002d70;
    --light-gray: #f8f9fa;
    --text-dark: #333333;
    --text-light: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Typography Scale */
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.75rem; }

@media (min-width: 768px) {
    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.5rem; }
}

/* Navbar Customization */
.navbar {
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand, .nav-link {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
}

.navbar-toggler {
    border-color: rgba(0,0,0,0.1);
}

.navbar-toggler-icon {
    filter: none;
}

/* Hero Section */
.hero {
    background-color: #ffffff;
    padding: 80px 0 110px;
    text-align: center;
}

.hero-subtitle {
    max-width: 920px;
    margin: 0 auto 4rem;
    color: var(--primary-color);
    font-size: clamp(2rem, 3.6vw, 3.6rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-weight: 800;
}

.hero-representatives-title {
    margin: 0 0 1rem;
    color: var(--primary-color);
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 600;
    line-height: 1.35;
}

.hero-representatives-title span {
    display: block;
    font-weight: 800;
    font-size: 1.35em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-representatives-divider {
    width: 80px;
    height: 4px;
    margin: 0 auto 2.5rem;
    background: var(--secondary-color);
}

.hero-representatives {
    max-width: 1000px;
    margin: 0 auto;
}

.hero-representative-card {
    position: relative;
    padding: 1.75rem 1rem 1.5rem;
    overflow: hidden;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 6px 20px rgba(2, 32, 77, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-representative-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-color);
}

.hero-representative-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(2, 32, 77, 0.18);
}

.hero-representative-card img {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto 1.1rem;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0 0 3px var(--primary-color);
    object-fit: cover;
    object-position: center top;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.hero-representative-card:hover img {
    filter: grayscale(0%);
}

.hero-representative-name {
    margin: 0 0 0.35rem;
    color: var(--primary-color);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.hero-representative-role {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

/* Sections */
section {
    padding: 60px 0;
}

.bg-light-custom {
    background-color: var(--light-gray);
}

/* Program Points */
.program-item {
    border-left: 5px solid var(--primary-color);
    padding: 30px;
    margin-bottom: 30px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.program-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.program-item h3 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    text-transform: uppercase;
}

.modal-body h6 {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-body ul {
    padding-left: 1.25rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

/* People Cards (ODS Style inspired) */
.person-card {
    border: none;
    transition: transform 0.3s ease;
    margin-bottom: 30px;
}

.person-card:hover {
    transform: translateY(-5px);
}

.person-card img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-left: auto;
    margin-right: auto;
    object-fit: cover;
    object-position: center top;
    border-radius: 8px;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.person-card:hover img {
    filter: grayscale(0%);
}

.person-card .card-body {
    padding: 1.5rem 0;
}

.person-name {
    font-weight: bold;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.person-position {
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.person-age {
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    margin-bottom: 0;
    position: relative;
    top: -15px;
}

.person-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.person-toggle {
    margin-top: 1rem;
    width: 100%;
    max-width: 280px;
    border: 1px solid var(--primary-color);
    border-radius: 999px;
    background: transparent;
    color: var(--primary-color);
    font-weight: 700;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.person-toggle:hover,
.person-toggle:focus-visible {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 8px 20px rgba(2, 32, 77, 0.15);
}

.person-card.is-open .person-toggle {
    background: var(--primary-color);
    color: var(--text-light);
}

.person-more {
    width: 100%;
    max-width: 280px;
    text-align: left;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(2, 32, 77, 0.15);
    border-radius: 12px;
    background: rgba(2, 32, 77, 0.03);
    color: var(--text-dark);
}

.person-more p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    white-space: pre-line;
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: var(--text-light);
    padding: 40px 0;
}

.philosophy-badge {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 1px;
    display: inline-block;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Utility */
.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
    font-weight: 600;
    padding: 10px 25px;
}

.btn-primary-custom:hover {
    background-color: #001f42;
    border-color: #001f42;
    color: var(--text-light);
}

/* QR Code */
.qr-code-container {
    padding: 10px;
    background: #fff;
    display: inline-block;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.qr-code-container img {
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Blog (Klobucké postřehy) */
.blog-post {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.blog-post-title {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.blog-post-meta {
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.blog-post-img {
    display: inline-block;
    width: auto;
    max-width: 280px;
    height: 200px;
    object-fit: cover;
    vertical-align: top;
    margin-right: 0.75rem;
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-post-img:hover,
.blog-post-img:focus {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Zpravodaj Showcase */
.zpravodaj-showcase {
    background: linear-gradient(180deg, #f7f8fb 0%, #edf1f7 100%);
    padding: 28px 0 68px;
}

.zpravodaj-gallery {
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.zpravodaj-card {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    overflow: visible;
    position: relative;
}

.zpravodaj-img {
    width: min(100%, 560px);
    max-width: 560px;
    height: auto;
    max-height: 540px;
    object-fit: contain;
    transform-origin: center center;
    background: rgba(255, 255, 255, 0.9);
    margin: 0;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.zpravodaj-img:hover,
.zpravodaj-img:focus {
    transform: scale(1.02);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.22);
}

.zpravodaj-showcase .poster-lead {
    color: var(--primary-color);
}

/* Poster Showcase (eye-catching banner between hero and program) */
.poster-showcase {
    background: linear-gradient(135deg, var(--primary-color), var(--tertiary-color));
    padding: 70px 0;
}

.poster-lead {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
}

.poster-showcase .blog-post.poster-gallery {
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

.poster-card {
    text-align: center;
}

.poster-card figcaption {
    margin-top: 0.75rem;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

.poster-img {
    max-width: 240px;
    height: 320px;
    margin-right: 0;
    border: 4px solid #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.poster-img:hover,
.poster-img:focus {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

@media (max-width: 767.98px) {
    .zpravodaj-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .zpravodaj-img {
        max-height: 420px;
    }
}

@media (max-width: 575.98px) {
    .zpravodaj-showcase {
        padding: 12px 0 44px;
    }

    .zpravodaj-gallery {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        margin: 0 -0.25rem;
    }

    .zpravodaj-card {
        width: 100%;
    }

    .zpravodaj-img {
        width: 100%;
        max-width: 100%;
        max-height: 72vh;
        border-width: 2px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
    }

    .poster-img {
        max-width: 160px;
        height: 213px;
    }
}

@media (max-width: 575.98px) {
    .blog-post-img {
        max-width: 170px;
        height: 135px;
        margin-right: 0.5rem;
    }
}

/* ==========================================================================
   Lightbox (full-size image viewer) – works on desktop and mobile
   ========================================================================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    cursor: zoom-in !important;
    overflow: hidden;
    overscroll-behavior: contain;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.lightbox-overlay.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-stage {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    cursor: zoom-in !important;
    position: relative;
}

.lightbox-stage.is-zoomed {
    overflow: scroll;
    cursor: grab !important;
}

.lightbox-overlay img {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    max-width: min(100%, 1200px);
    max-height: min(100%, 900px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    cursor: zoom-in !important;
    touch-action: none;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center;
    transition: transform 0.15s ease;
}

.lightbox-overlay img.is-zoomed {
    cursor: grab;
}

.lightbox-overlay img.is-dragging {
    transition: none;
    cursor: grabbing;
}

.lightbox-overlay.is-open .lightbox-stage:hover,
.lightbox-overlay.is-open .lightbox-stage:focus-visible,
.lightbox-overlay.is-open img:hover,
.lightbox-overlay.is-open img:focus-visible {
    cursor: zoom-in;
}

.lightbox-overlay.is-open .lightbox-stage.is-zoomed,
.lightbox-overlay.is-open img.is-zoomed {
    cursor: grab !important;
}

.lightbox-overlay.is-open img.is-dragging {
    cursor: grabbing !important;
}

/* Navigation arrows – hidden unless the current post has several images */
.lightbox-nav {
    display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.52);
    color: #ffffff;
    font-size: 1.9rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 1081;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.26);
    -webkit-tap-highlight-color: transparent;
}

.lightbox-overlay.has-slider .lightbox-nav {
    display: flex;
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-nav:hover,
.lightbox-nav:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 1);
    outline: none;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
}

/* Image counter (e.g. "2 / 5") – only shown for multi-image posts */
.lightbox-counter {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.95rem;
    border-radius: 20px;
    z-index: 1081;
}

.lightbox-overlay.has-slider .lightbox-counter {
    display: block;
}

.lightbox-zoom-controls {
    position: fixed;
    top: 72px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 1081;
    color: #ffffff;
    font-size: 0.9rem;
}

.lightbox-zoom-controls button,
.lightbox-zoom-level {
    min-width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.52);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lightbox-zoom-controls button {
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-zoom-controls button:hover,
.lightbox-zoom-controls button:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: #ffffff;
    outline: none;
}

.lightbox-zoom-controls button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.lightbox-zoom-level {
    min-width: 3.5rem;
}

@media (max-width: 575.98px) {
    .lightbox-overlay {
        padding: 10px;
        padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-zoom-controls {
        top: 62px;
        right: 10px;
    }
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1081;
}

.lightbox-close:hover,
.lightbox-close:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

html.lightbox-open,
body.lightbox-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.blog-post-note {
    font-size: 0.9rem;
    color: var(--secondary-color);
    border-left: 3px solid var(--secondary-color);
    padding-left: 1rem;
}

.blog-section-title {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.blog-section-subtitle {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.blog-post-full {
    margin-top: 2rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
}

.blog-post-full > summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Blog preview cards (Klobucké postřehy)
   Each post is collapsed into a neat preview (photo + title + text excerpt)
   and expands to the full article on demand.
   ========================================================================== */
.blog-post.is-collapsed {
    padding: 0;
    overflow: hidden;
}

.blog-post-preview {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    cursor: pointer;
}

.blog-post-preview-media {
    flex: 0 0 240px;
    max-width: 240px;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
    background-color: #f0f0f0;
}

.blog-post-preview-media img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.blog-post-preview:hover .blog-post-preview-media img {
    transform: scale(1.04);
}

.blog-post-preview-media.is-empty {
    display: none;
}

.blog-post-preview-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.75rem;
    min-width: 0;
}

.blog-post.is-collapsed .blog-post-preview-body .blog-post-title {
    margin-bottom: 0.25rem;
}

.blog-post-preview-excerpt {
    color: #555;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-readmore {
    margin-top: auto;
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    color: var(--secondary-color);
    font-weight: 600;
    cursor: pointer;
}

.blog-post-readmore:hover,
.blog-post-readmore:focus {
    text-decoration: underline;
    outline: none;
}

@media (max-width: 575.98px) {
    .blog-post-preview {
        flex-direction: column;
        gap: 0;
    }

    .blog-post-preview-media {
        flex-basis: auto;
        max-width: 100%;
        border-radius: 8px 8px 0 0;
    }

    .blog-post-preview-media img {
        min-height: 200px;
        max-height: 240px;
    }

    .blog-post-preview-body {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   Responsive optimizations
   Ensures comfortable browsing on small phones (e.g. iPhone 13 – 390px),
   large phones (e.g. Samsung S24 Ultra), tablets and desktops.
   ========================================================================== */

/* Prevent horizontal overflow on any device */
html, body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* Small phones and up: tighten spacing so content fits comfortably */
@media (max-width: 575.98px) {
    section {
        padding: 40px 0;
    }

    .hero {
        padding: 48px 0 72px;
    }

    .hero-subtitle {
        font-size: 1.75rem;
        margin-bottom: 2.5rem;
    }

    .hero-representatives-divider {
        margin-bottom: 1.75rem;
    }

    .hero-representative-card {
        padding: 1.4rem 0.6rem 1.1rem;
    }

    .hero-representative-card img {
        width: 104px;
    }

    .hero-representative-name {
        font-size: 0.95rem;
    }

    .hero-representative-role {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    h2 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .program-item {
        padding: 20px;
        margin-bottom: 20px;
    }

    .program-item h3 {
        font-size: 1.1rem;
    }

    .person-card {
        margin-bottom: 16px;
    }

    .person-card .card-body {
        padding: 1rem 0;
    }

    .person-card img {
        max-width: 160px;
    }

    .person-name {
        font-size: 1.1rem;
    }

    .philosophy-badge {
        font-size: 0.95rem;
        padding: 8px 16px;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .blog-post {
        padding: 20px;
        margin-bottom: 2.5rem;
    }
}

/* Medium/large phones (e.g. S24 Ultra in portrait): slightly larger avatars */
@media (min-width: 576px) and (max-width: 767.98px) {
    .person-card img {
        max-width: 200px;
    }
}

/* Tablets: keep balanced sizing */
@media (min-width: 768px) and (max-width: 991.98px) {
    .person-card img {
        max-width: 220px;
    }
}
