/* General Styles */
body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}


h2, h3 {
    color: #2c3e50;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.sub-title {
    font-size: 3rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.overview {
    padding-top: 115px;
}

/* Overview Section */
.overview-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2rem;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 0;
    gap: 8rem;
    width: 100%;
    border-radius: collapse;
}

.overview-section .content {
    flex: 1 1 50%;
    max-width: 600px;
    padding-right: 1rem;
}

.overview-section .image-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
    grid-template-rows: auto;
    gap: 1rem; /* Wider gap between images */
    flex: 1 1 40%;
    max-width: 500px;
}

/* Mission and Vision Section */
.mission-vision {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    width: 100%;
    margin: 0;
}

.mission, .vision {
    flex: 1 1 45%;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: auto;
    min-height: 500px;
    width: 80%; /* ADD this line to let it stretch inside the flex container */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mission:hover, .vision:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
    background-color: rgba(224, 244, 255, 0.9); /* soft light blue */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mission p, .vision p {
    margin-bottom: 1rem; /* Add space between paragraphs */
    line-height: 1.6;
}

/* New subtle improvements that don't change existing code */
.sub-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #333;
}

.sub-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #55a6e0);
    transition: width 0.4s ease;
}

.mission:hover .sub-title::after,
.vision:hover .sub-title::after {
    width: 100%;
}

/* Simple highlight effect for first paragraph */
.mission p:first-of-type,
.vision p:first-of-type {
    font-weight: 500;
    transition: color 0.3s ease;
}

.mission:hover p:first-of-type,
.vision:hover p:first-of-type {
    color: #3498db;
}

/* Subtle corner accent */
.mission::before,
.vision::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 30px 30px 0;
    border-color: transparent transparent transparent transparent;
    transition: border-color 0.3s ease;
}

.mission:hover::before {
    border-color: transparent #3498db transparent transparent;
}

.vision:hover::before {
    border-color: transparent #55a6e0 transparent transparent;
}

/* Improved accessibility focus states */
.mission:focus,
.vision:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mission, .vision {
        flex: 1 1 100%;
    }
}

/* About Barangay Text Styling */
.overview-section .content p {
    margin-bottom: 1.5rem; /* Add space between paragraphs */
}

/* Set up the image container */
.overview-section .image-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Create 4 columns */
    grid-template-rows: auto; /* Allow rows to grow automatically */
    gap: 0.3rem; /* Thin gap between images */
    justify-items: center; /* Center the images in their grid cells */
    align-items: center; /* Align images vertically */
}

/* Styling for each image */
.overview-image {
    object-fit: cover; /* Ensure images cover their grid cells */
    width: 100%; /* Ensure images fill the grid column width */
    transition: transform 0.3s ease-in-out; /* Smooth transition for hover effect */
    margin: 0; /* Ensure no margins are interfering */
    padding: 0; /* Remove any padding */
    max-height: 100%; /* Ensure images don’t stretch out of the grid */
}

/* Large image spans */
.overview-image:nth-child(1),
.overview-image:nth-child(7),
.overview-image:nth-child(13) {
    grid-column: span 2; /* Make this image span across 2 columns */
    grid-row: span 2; /* Make this image span across 2 rows */
}

/* Medium image spans */
.overview-image:nth-child(2),
.overview-image:nth-child(4),
.overview-image:nth-child(6),
.overview-image:nth-child(8),
.overview-image:nth-child(10),
.overview-image:nth-child(12) {
    grid-column: span 1; /* Each of these takes up 1 column */
    grid-row: span 1; /* Each of these takes up 1 row */
}

/* Small image spans */
.overview-image:nth-child(3),
.overview-image:nth-child(5),
.overview-image:nth-child(9),
.overview-image:nth-child(11),
.overview-image:nth-child(14) {
    grid-column: span 1; /* Each of these takes up 1 column */
    grid-row: span 1; /* Each of these takes up 1 row */
}

/* Offset effects for random positioning */
.overview-image:nth-child(odd) {
    margin-top: -5px; /* Slightly offset odd images */
}

/* Hover effect to grow image */
.overview-image:hover {
    transform: scale(1.05); /* Enlarge the image slightly on hover */
}

.brgytitle{
    font-size: 3rem;
    margin: 0;
    position: relative;
    display: inline-block;
}

.content-wrapper{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

/* Short thick line after the heading */
.content-wrapper h1::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background-color: #0077B6;
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

.section-description {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}


/* officials */
.officials-section {
    text-align: center;
    padding: 2rem;
    background-color: #f9f9f9;
    width: 100%;
    margin: 0;
}

.section-description {
    margin: 0 0 2rem;
    font-size: 1.2rem;
    color: #555;
    width: 50%;
}

.officials-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 2rem;
}

.punong-barangay {
    flex: 1 1 25%; /* Ensures Punong Barangay stays on the left */
    max-width: 300px;
    height: auto; /* Remove fixed height */
}

.officials-right {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    flex: 2 1 70%;
}

.official-card {
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;

    /* Flexbox for vertical alignment */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* Make the portrait image a circle */
.official-portrait {
    width: 150px; /* Set the width */
    height: 150px; /* Set the height */
    border-radius: 50%; /* Make it a circle */
    object-fit: cover; /* Ensure the image covers the circle area without distortion */
    margin-bottom: 1rem; /* Space below the image */
}

.official-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    margin-top: 0;
    margin-bottom: 0;
}

.official-role {
    color: #0077B6;
    font-style: italic;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.official-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin-top: 1rem; /* Space above the description */
}

.official-card:hover {
    transform: scale(1.05); /* Slight zoom effect on hover */
    transition: transform 0.3s ease-in-out;
}