/* ==========================================
   1. GLOBAL CONTAINER & LAYOUT SETUP
   ========================================== */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

section {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #eaeaea;
}

section:nth-child(even) {
    background-color: #fcfcfc; /* Subtle alternating background */
}

.space {
    height: 15px;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
}

.subtitle p {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0;
}

/* ==========================================
   2. INTRO SECTION STYLING
   ========================================== */
#intro {
    background-color: #ffffff;
}

.intro-grid {
    display: grid;
    grid-template-columns: auto 2px 1fr;
    align-items: center;
    gap: 40px;
}

#image_intro {
    max-width: 280px;
    height: auto;
    display: block;
}

.line {
    width: 2px;
    height: 120px;
    background-color: #ddd;
}

#intro-text h1 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

#intro-text p {
    margin: 0;
    line-height: 1.6;
    color: #444;
}

/* ==========================================
   3. BRANCH SECTIONS (Horní Benešov, Bratříkov, Dewon)
   ========================================== */
.default-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.places-descriptor {
    display: flex;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid #eaeaea;
}

.place-descriptor-decoration {
    width: 8px;
    flex-shrink: 0;
}

.place-descriptor-info {
    padding: 30px;
    flex-grow: 1;
}

.place-descriptor-info h1 {
    margin: 0 0 10px 0;
    font-size: 1.6rem;
    color: #1a1a1a;
}

.place-descriptor-info p {
    margin: 4px 0;
    color: #555;
    font-size: 0.95rem;
}

/* Visual images styling */
.place-visual, .visual {
    width: 100%;
}

.imagebox img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: block;
}

.caption-image {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* ==========================================
   4. EU SUBSIDIES GALLERY
   ========================================== */
.undefault-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: center;
}

.dotacebox img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 10px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

.dotacebox img:hover {
    transform: scale(1.03);
}

/* ==========================================
   5. FOOTER STYLING
   ========================================== */


/* ==========================================
   6. RESPONSIVE DESIGN FOR PHONES & TABLETS
   ========================================== */
@media (max-width: 900px) {
    /* Intro stacks vertically */
    .intro-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }
    
    .line {
        display: none; /* Hide decorative vertical line on mobile */
    }

    #image_intro {
        margin: 0 auto;
    }

    /* Branch grids stack to single column and force photo-first order */
    .default-grid {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    /* Force the visual/photo block to always come first */
    .default-grid .place-visual,
    .default-grid .visual {
        order: 1;
    }

    /* Force the text/descriptor block to always come second */
    .default-grid .places-descriptor {
        order: 2;
    }
    .places-descriptor{
        width: 98%;
    }

    /* Fix image box height for phones */
    .imagebox img {
        height: 220px;
    }

    /* EU Subsidies grid turns into 2 columns */
    .undefault-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer stacks vertically */
    #footer-grid-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 25px 15px;
    }
    
    /* EU Subsidies grid turns into 1 column for very small screens */
    .undefault-grid {
        grid-template-columns: 1fr;
    }
}