/* ============================================================
   EVENTS PAGE STYLES
   ============================================================ */

/* ─── Page Hero ─────────────────────────────────────────────── */
.events-hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, #000 100%);
    padding: 80px 0 60px;
    color: white;
    text-align: center;
}

.page-hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.page-hero-content p {
    font-size: 1.1rem;
    opacity: 0.88;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── Events Section ─────────────────────────────────────────── */
.events-section {
    padding: 60px 0 80px;
    background: white;
}

.events-block {
    margin-bottom: 60px;
}

.events-block-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--green);
    display: flex;
    align-items: center;
    gap: 10px;
}

.events-block-title.past {
    color: var(--text-med);
    border-bottom-color: var(--border);
}

/* ─── Loading / Empty ────────────────────────────────────────── */
.events-loading,
.events-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
    font-size: 1rem;
}

.events-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 14px;
    opacity: 0.4;
}

/* ─── Events Grid ────────────────────────────────────────────── */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* ─── Event Card ─────────────────────────────────────────────── */
.event-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.13);
}

.event-card-flyer {
    position: relative;
    width: 100%;
    padding-top: 65%;
    background: var(--bg-light);
    overflow: hidden;
}

.event-card-flyer img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.event-card:hover .event-card-flyer img {
    transform: scale(1.04);
}

.event-card-no-flyer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-light);
    opacity: 0.3;
}

.event-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--green-dark);
    color: white;
    border-radius: 10px;
    padding: 6px 10px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.2;
    min-width: 52px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.event-date-badge .badge-month {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-date-badge .badge-day {
    font-size: 1.4rem;
    font-weight: 800;
}

.event-date-badge .badge-year {
    font-size: 0.65rem;
    opacity: 0.8;
}

.event-past-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.38);
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-past-label {
    background: rgba(0,0,0,0.65);
    color: rgba(255,255,255,0.85);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.event-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0;
}

.event-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.83rem;
    color: var(--text-med);
}

.event-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-card-meta i {
    color: var(--green);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.event-card-desc {
    font-size: 0.85rem;
    color: var(--text-med);
    line-height: 1.5;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-view-flyer {
    margin-top: auto;
    padding-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--green);
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
}

/* ─── Flyer Lightbox ─────────────────────────────────────────── */
.flyer-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.18s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.flyer-lb-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.flyer-lb-close:hover { background: rgba(255,255,255,0.25); }

.flyer-lb-content {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    max-width: 1200px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
}

.flyer-lb-content img {
    flex-shrink: 0;
    max-width: 620px;
    width: 100%;
    border-radius: 12px;
    object-fit: contain;
    max-height: 88vh;
}

.flyer-lb-info {
    flex: 1;
    color: white;
    padding-top: 8px;
}

.flyer-lb-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
}

.flyer-lb-info p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

.flyer-lb-info p i {
    color: var(--green);
    width: 16px;
    flex-shrink: 0;
    margin-top: 3px;
}

/* ─── Admin Events Styles ────────────────────────────────────── */
.admin-events-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.admin-event-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    transition: box-shadow 0.15s;
}

.admin-event-row:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); }

.admin-event-flyer {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: var(--bg-light);
    object-fit: cover;
    flex-shrink: 0;
}

.admin-event-flyer-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.4rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.admin-event-info {
    flex: 1;
    min-width: 0;
}

.admin-event-info h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-event-info .event-meta-row {
    font-size: 0.8rem;
    color: var(--text-med);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-event-info .event-meta-row span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-event-info .event-meta-row i {
    color: var(--green);
    width: 12px;
}

.admin-event-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.admin-event-badge.published { background: #dcfce7; color: #166534; }
.admin-event-badge.draft     { background: #f3f4f6; color: #6b7280; }
.admin-event-badge.past      { background: #fef9c3; color: #854d0e; }

.admin-event-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Event form ─────────────────────────────────────────────── */
.event-flyer-preview {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 220px;
    border: 1px solid var(--border);
}

.event-flyer-preview img {
    width: 100%;
    display: block;
}

/* ─── Memorials ──────────────────────────────────────────────── */
.events-block-title.memorials {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
}

.memorials-sub-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.memorials-grid {
    margin-bottom: 40px;
}

.memorial-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.memorial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.13);
}

.memorial-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}

.memorial-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.memorial-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #9ca3af;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    color: rgba(255,255,255,0.4);
}

.memorial-type-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.memorial-type-badge.service {
    background: rgba(30, 64, 175, 0.92);
    color: #fff;
}

.memorial-type-badge.announcement {
    background: rgba(109, 40, 217, 0.92);
    color: #fff;
}

.memorial-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.memorial-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
}

.memorial-card-date {
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.memorial-card-desc {
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
    .events-grid { grid-template-columns: 1fr; }

    .flyer-lb-content {
        flex-direction: column;
        align-items: center;
    }

    .flyer-lb-content img { max-width: 100%; max-height: 55vh; }

    .admin-event-row { flex-wrap: wrap; }
    .admin-event-actions { width: 100%; justify-content: flex-end; }

    .memorial-card-image { height: 160px; }
    .memorials-sub-title { font-size: 1rem; }
}

@media (max-width: 480px) {
    .memorial-card-body { padding: 14px; }
    .memorial-card-image { height: 140px; }
}

@media (hover: none) {
    .memorial-card:hover { transform: none; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
}
