/* Common styles shared across all ward templates */

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== Home Page Grid (Campaigns + Events stacked for card grids) ===== */
.home-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 30px 0;
}
.home-campaigns {
    min-width: 0;
}
.home-events {
    min-width: 0;
}
.home-events .btn-secondary,
.home-events .text-link,
.home-events .box-link,
.home-events [data-section="events"] {
    display: inline-block;
    margin-top: 15px;
}

/* ===== Image Card Grid (Campaigns & Events) ===== */
.campaign-grid,
.events-quick-grid,
#homeCampaignGrid,
#homeEventsGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.image-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.image-card-img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #DC241F 0%, #8B1514 50%, #2C3E50 100%);
    position: relative;
}
.image-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Placeholder icon when no image */
.image-card-img:not(:has(img))::before {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: 0.3;
    color: white;
}

.image-card-title {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hidden-card {
    display: none;
}

.show-more-wrapper {
    grid-column: 1 / -1;
    text-align: center;
    padding: 0.5rem 0;
}
.btn-show-more {
    background: transparent;
    color: var(--primary-color, #DC241F);
    border: 2px solid var(--primary-color, #DC241F);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-show-more:hover {
    background: var(--primary-color, #DC241F);
    color: white;
}

/* Maps and detail links in modals */
.maps-link {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--primary-color, #DC241F);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}
.maps-link:hover {
    text-decoration: underline;
}
.detail-link {
    color: var(--primary-color, #DC241F);
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
}
.detail-link:hover {
    text-decoration: underline;
}

/* Responsive: 2 columns on tablet, 1 on mobile */
@media (max-width: 1024px) {
    .campaign-grid,
    .events-quick-grid,
    #homeCampaignGrid,
    #homeEventsGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .campaign-grid,
    .events-quick-grid,
    #homeCampaignGrid,
    #homeEventsGrid {
        grid-template-columns: 1fr;
    }
}

/* ===== Your Voice Grid (Feedback + Polls side-by-side) ===== */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}
.voice-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
}
.voice-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* Classic template: single-column voice grid (sidebar already takes space) */
.content-layout .voice-grid {
    grid-template-columns: 1fr;
}

/* ===== Feedback Form ===== */
.feedback-form .form-group {
    margin-bottom: 15px;
}
.feedback-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.feedback-form input[type="text"],
.feedback-form input[type="email"],
.feedback-form select,
.feedback-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus {
    outline: none;
    border-color: var(--primary-color, #DC241F);
    box-shadow: 0 0 0 2px rgba(220, 36, 31, 0.1);
}
.feedback-form textarea {
    resize: vertical;
    min-height: 100px;
}
.feedback-form button[type="submit"] {
    margin-top: 5px;
}
.feedback-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}
.feedback-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}

/* ===== Home preview grids ===== */
/* Grid layout is handled by the image card grid rules in ward-common.css */
