/* =====================================================================
   HOME PAGE — style.css
   Layout unique to index.html. Shared design system lives in
   assets/css/main.css.
   ===================================================================== */

/* ---------- hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 102px 0 92px;
}

@media (max-width: 900px) {
    .hero {
        padding: 92px 0 64px;
    }
}

@media (max-width: 560px) {
    .hero {
        padding: 90px 0 48px;
    }
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 700px 460px at 82% -10%, rgba(199, 151, 59, .14), transparent 70%),
    radial-gradient(ellipse 520px 420px at 6% 110%, rgba(199, 151, 59, .10), transparent 70%);
    z-index: 0;
}

/* DEFAULT (Mobile Screens): Single column, natural HTML order (Text first, Prayer Widget second) */
.hero .wrap {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr; /* Force 1 column on mobile */
    gap: 36px;
    align-items: center;
}

/* DESKTOP (Screens wider than 900px): Side-by-side 2 columns */
@media (min-width: 901px) {
    .hero .wrap {
        grid-template-columns: 1.25fr .75fr;
        gap: 60px;
    }
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(36px, 4.6vw, 58px);
    line-height: 1.06;
    margin: 0 0 20px;
    letter-spacing: -.01em;
}

.hero h1 em {
    font-style: italic;
    color: var(--gold-bright);
}

.hero p.lede {
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--deep-ink-dim);
    max-width: 56ch;
    margin: 0 0 32px;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 34px;
    margin-top: 46px;
    padding-top: 28px;
    border-top: 1px solid var(--deep-line);
}

.hero-stats div .stat-num {
    font-size: 28px;
    color: var(--gold-bright);
}

.hero-stats div span {
    font-size: 11.5px;
    letter-spacing: .04em;
    color: var(--deep-ink-dim);
    text-transform: uppercase;
}

.art-panel {
    position: relative;
    aspect-ratio: 4/5;
    border-radius: 20px 20px 20px 20px;
    overflow: hidden;
    border: 1px solid var(--deep-line);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5);
}

.art-panel svg {
    width: 100%;
    height: 100%;
    display: block;
}

.about-teaser-cta {
    margin-top: 6px;
}

.prayer-widget {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--deep-2), var(--deep));
    padding: 34px 28px;
}

/* the art-panel's 4:5 ratio suits the SVG illustration; this widget is a
   list of text rows, so let it size to its content instead */
.art-panel.prayer-widget {
    aspect-ratio: auto;
}

.pw-header {
    text-align: center;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--deep-line);
}

.pw-location {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin-bottom: 8px;
}

.pw-hijri {
    display: block;
    font-size: 13px;
    color: var(--deep-ink-dim);
    margin-bottom: 2px;
}

.pw-greg {
    display: block;
    font-size: 12px;
    color: var(--deep-ink-dim);
    opacity: .85;
}

.pw-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.pw-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 14px;
    border-radius: 8px;
    transition: background .3s ease;
}

.pw-row .pw-name {
    font-size: 14.5px;
    color: var(--deep-ink-dim);
    letter-spacing: .02em;
}

.pw-row .pw-time {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--deep-ink);
}

.pw-row.is-next {
    background: rgba(199, 151, 59, .16);
}

.pw-row.is-next .pw-name,
.pw-row.is-next .pw-time {
    color: var(--gold-bright);
}

.pw-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--deep-line);
    text-align: center;
    font-size: 10.5px;
    letter-spacing: .03em;
    color: var(--deep-ink-dim);
    line-height: 1.5;
}

/* Next Prayer Highlight Effect */
[data-prayer-row].is-next {
    position: relative;
    background: rgba(212, 175, 55, 0.15); /* Light gold accent fill */
    border-left: 4px solid #d4af37; /* Gold side marker */
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); /* Glowing aura */
    animation: prayerPulse 2.5s infinite ease-in-out;
    border-radius: 6px;
    transition: all 0.4s ease;
}

[data-prayer-row].is-next [data-prayer-time],
[data-prayer-row].is-next span {
    color: #fce788 !important; /* Brighter gold text */
    font-weight: 700;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

@keyframes prayerPulse {
    0% {
        box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.65);
    }
    100% {
        box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
    }
}

/* ---------- Al Zahra Centre teaser ---------- */
#centre {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.90) 0%, rgba(255, 255, 255, 0.65) 100%),
    url("/assets/img/centre/InsideCentrePic.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    padding: 80px 0;
}

.cc-teaser {
    display: grid;
    grid-template-columns:1.05fr .95fr;
    gap: 50px;
    align-items: center;
}

.cc-teaser-copy p {
    color: var(--ink-dim);
    line-height: 1.85;
    font-size: 15.5px;
    margin: 0 0 18px;
}

.cc-teaser-stats {
    display: flex;
    gap: 28px;
    margin: 0 0 26px;
}

.cc-teaser-stats div .stat-num {
    font-size: 24px;
    color: var(--gold-deep);
}

.cc-teaser-stats div span {
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* on this light section, the art panel needs light-section borders */
#centre .art-panel {
    border-color: var(--line);
}

/* ---------- gallery ---------- */
.gallery-strip {
    display: grid;
    grid-template-columns:repeat(6, 1fr);
    gap: 10px;
}

.gallery-strip .tile {
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--gold-tint);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
}

.gallery-strip .tile img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crops the image to fill the tile perfectly without squeezing it */
    display: block; /* Removes unwanted whitespace at the bottom of the image */
}

.gallery-strip .tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(150deg, rgba(169, 129, 44, .18), transparent 60%);
}

/* ---------- contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 70px;
}

.contact-list {
    list-style: none;
    margin: 0 0 34px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-list li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    font-size: 15px;
    color: var(--ink-dim);
}

.contact-list svg {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--gold);
    margin-top: 2px;
}

.contact-list a {
    text-decoration: none;
    color: var(--ink-dim);
}

.contact-list a:hover {
    color: var(--gold);
}

.map-frame {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    aspect-ratio: 4/3;
    box-shadow: var(--shadow);
}

.map-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .hero .wrap {
        grid-template-columns:1fr;
        gap: 44px;
    }

    .art-panel {
        order: initial;
        aspect-ratio: 16/10;
    }

    .prayer-widget {
        padding: 26px 22px;
    }

    .cc-teaser {
        grid-template-columns:1fr;
    }

    .contact-grid {
        grid-template-columns:1fr;
        gap: 40px;
    }

    .cc-teaser {
        gap: 32px;
    }

    .gallery-strip {
        grid-template-columns:repeat(3, 1fr);
    }

    .president-card {
        grid-template-columns:1fr;
        text-align: center;
        justify-items: center;
    }
}

@media (max-width: 560px) {
    .gallery-strip {
        grid-template-columns:repeat(2, 1fr);
    }

    .pw-row {
        padding: 10px 10px;
    }

    .pw-row .pw-time {
        font-size: 15px;
    }

    .hero-stats, .cc-teaser-stats {
        gap: 22px;
        flex-wrap: wrap;
    }
}

/* =====================================================================
   SWIPEABLE CAROUSELS (EVENTS & GALLERY)
   ===================================================================== */

/* ---------- Mobile Events Carousel ---------- */
@media (max-width: 900px) {
    #home-events-list {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 16px !important;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }

    #home-events-list::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

    #home-events-list .event-card {
        flex: 0 0 100% !important; /* Forces exactly 1 card full width */
        scroll-snap-align: center !important;
        min-width: 100%;
        box-sizing: border-box;
    }
}

/* ---------- Full-Width Slider Gallery (Desktop & Mobile) ---------- */
.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.gallery-strip {
    display: flex !important;
    grid-template-columns: none !important; /* Overrides CSS Grid */
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth;
    gap: 0 !important;
    width: 100%;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gallery-strip::-webkit-scrollbar {
    display: none;
}

.gallery-strip .tile {
    flex: 0 0 100% !important; /* 1 big image at a time */
    min-width: 100%;
    scroll-snap-align: center !important;
    aspect-ratio: 16 / 9 !important; /* Landscape ratio for slider hero display */
    border-radius: 12px !important;
}

/* Gallery Arrow Navigation Buttons */
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    background: rgba(14, 51, 36, 0.85); /* Matches --deep theme color */
    color: var(--gold-bright);
    border: 1px solid var(--deep-line);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.gallery-btn:hover {
    background: var(--gold-bright);
    color: var(--deep);
}

.gallery-btn.prev {
    left: 16px;
}

.gallery-btn.next {
    right: 16px;
}

/* Donation Popup Styles */
.popup-overlay {
    display: none; /* Hidden until triggered by JS */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-content {
    background-color: var(--bg);
    padding: 30px 40px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-family: inherit;
}

.popup-content img {
    border: 1px solid var(--line);
    border-radius: 12px;
}

.popup-content h2 {
    margin-top: 0;
    color: #333;
}

@media (max-width: 560px) {
    .popup-content .bank-card h3 {
        font-size: 16px;
    }

    .popup-content .bank-row span:first-child {
        font-size: 11px;
    }

    .popup-content .bank-row span:last-child {
        font-size: 13px;
    }
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--gold);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-popup:hover {
    color: #111;
}

.donation-details {
    background-color: var(--ink-dim);
    padding: 20px;
    margin: 20px 0;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
    text-align: left;
}

.donation-details p {
    margin: 8px 0;
    font-size: 16px;
    color: #333;
}

.donate-btn {
    background-color: #0056b3; /* Adjust to match your site's primary theme */
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    margin-top: 10px;
}

.donate-btn:hover {
    background-color: #004494;
}

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