/* =========================================================================
   Community Centre — clean & modern stylesheet
   Colour variables are injected from config.php (see header.php :root block)
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    color: var(--dark);
    background: var(--light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; color: var(--dark); margin-top: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: min(1140px, 92%); margin-inline: auto; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-block; padding: .8rem 1.6rem; border-radius: 8px;
    font-weight: 600; cursor: pointer; border: 0; transition: .2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); text-decoration: none; }
.btn-accent  { background: var(--accent); color: var(--dark); }
.btn-accent:hover { filter: brightness(.95); text-decoration: none; }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1da851; color: #fff; text-decoration: none; }

/* ---- Announcement bar -------------------------------------------------- */
.announce-bar { background: var(--accent); color: var(--dark); font-weight: 500; }
.announce-inner { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; flex-wrap: wrap; }
.announce-msg { flex: 1; min-width: 200px; }
.announce-link { color: var(--dark); font-weight: 700; text-decoration: underline; white-space: nowrap; }
.announce-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--dark); opacity: .7; }
.announce-close:hover { opacity: 1; }

/* ---- Newsletter band --------------------------------------------------- */
.newsletter-band { background: var(--primary-d); color: #fff; }
.newsletter-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.5rem 0; flex-wrap: wrap; }
.newsletter-text h3 { color: #fff; margin: 0 0 .25rem; font-size: 1.4rem; }
.newsletter-text p { margin: 0; opacity: .9; }
.newsletter-form { flex: 1; min-width: 280px; max-width: 480px; }
.newsletter-row { display: flex; gap: .5rem; }
.newsletter-row input[type=email] { flex: 1; padding: .75rem .9rem; border: 0; border-radius: 8px; font: inherit; }
.newsletter-form .consent { display: flex; gap: .5rem; align-items: flex-start; margin-top: .7rem; font-size: .82rem; opacity: .9; }
.newsletter-form .consent input { margin-top: .2rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Header / Nav ------------------------------------------------------ */
.site-header {
    background: #fff; position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 12px rgba(0,0,0,.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-logo { height: 52px; width: auto; }
.brand-text strong { display: block; font-size: 1.15rem; color: var(--primary); }
.brand-text small { color: #6b7280; font-size: .78rem; }

.site-nav ul { list-style: none; display: flex; align-items: center; gap: .3rem; margin: 0; padding: 0; }
.site-nav a {
    display: inline-block; padding: .6rem .9rem; color: var(--dark);
    font-weight: 500; border-radius: 6px;
}
.site-nav a:hover { background: var(--light); text-decoration: none; }
.site-nav a.active { color: var(--primary); }
.btn-donate {
    background: var(--accent); color: var(--dark) !important; margin-left: .5rem;
    font-weight: 700 !important;
}
.btn-donate:hover { filter: brightness(.95); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--dark); border-radius: 3px; transition: .2s; }

/* ---- Hero -------------------------------------------------------------- */
.hero {
    position: relative; color: #fff; text-align: center;
    padding: 6rem 0; background: var(--primary-d);
    background-size: cover; background-position: center;
}
.hero-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}
.hero::before { content: ''; position: absolute; inset: 0; background: rgba(11,86,80,.5); z-index: 1; }
.hero .container { position: relative; z-index: 2; }
/* Respect users who prefer reduced motion — fall back to the still hero image */
@media (prefers-reduced-motion: reduce) {
    .hero-video { display: none; }
}
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .5rem; }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0 auto 1.8rem; opacity: .95; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---- Sections ---------------------------------------------------------- */
.section { padding: 4rem 0; }
.section-alt { background: #fff; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-title p { color: #6b7280; max-width: 620px; margin: .4rem auto 0; }
.lead { font-size: 1.1rem; }

/* ---- Cards / grids ----------------------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: #fff; border: 1px solid #eef0f2; border-radius: 14px;
    padding: 1.8rem; transition: .2s; box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.card .icon {
    width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
    background: var(--light); color: var(--primary); font-size: 1.5rem; margin-bottom: 1rem;
}
.card h3 { margin-bottom: .4rem; }
.card p { color: #4b5563; margin: 0; }

/* ---- Video block ------------------------------------------------------- */
.video-frame {
    max-width: 880px; margin: 0 auto; border-radius: 14px; overflow: hidden;
    box-shadow: 0 12px 32px rgba(0,0,0,.12); background: #000; line-height: 0;
}
.video-frame video { width: 100%; height: auto; display: block; }

/* ---- Prayer times block ------------------------------------------------ */
.muted { color: #6b7280; font-size: .9rem; }

/* Full-width live Mawaqit widget (landscape mosque-screen look) */
.prayer-live { max-width: 1040px; margin: 0 auto 3rem; }
.prayer-live iframe {
    width: 100% !important; height: 600px; border: 0; display: block;
    border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

/* Monthly timetable PDF, displayed inline */
.timetable-block { max-width: 860px; margin: 0 auto; text-align: center; }
.timetable-block h3 { margin-bottom: .25rem; }
.pdf-frame {
    margin-top: 1.2rem; border: 1px solid #eef0f2; border-radius: 14px; overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.06); background: #f1f3f5;
}
.pdf-frame iframe { width: 100%; height: 580px; border: 0; display: block; }
.pdf-actions { margin-top: 1.2rem; }

@media (max-width: 640px) {
    .prayer-live iframe { height: 520px; }
    .pdf-frame iframe { height: 440px; }
}

/* ---- Gallery ----------------------------------------------------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery-grid img { width: 100%; height: 240px; object-fit: cover; border-radius: 12px; cursor: pointer; transition: .2s; }
.gallery-grid img:hover { transform: scale(1.02); filter: brightness(1.05); }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: none; place-items: center; z-index: 100; padding: 2rem; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px; }
.lightbox .close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 2.4rem; cursor: pointer; }

/* ---- CTA band ---------------------------------------------------------- */
.cta-band { background: var(--primary); color: #fff; text-align: center; padding: 3.5rem 0; }
.cta-band h2 { color: #fff; }
.cta-band p { opacity: .9; max-width: 600px; margin: .5rem auto 1.5rem; }

/* ---- Forms ------------------------------------------------------------- */
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: .35rem; }
.form-row input, .form-row textarea {
    width: 100%; padding: .75rem .9rem; border: 1px solid #d1d5db;
    border-radius: 8px; font: inherit; background: #fff;
}
.form-row input:focus, .form-row textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.alert { padding: .9rem 1.1rem; border-radius: 8px; margin-bottom: 1.2rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---- Contact layout ---------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.contact-info p { margin: .4rem 0; }
.map-embed iframe { width: 100%; min-height: 300px; border: 0; border-radius: 12px; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { background: var(--dark); color: #cbd5e1; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding: 3.5rem 0; }
.footer-col h4 { color: #fff; margin-bottom: 1rem; }
.footer-col a { color: #cbd5e1; }
.footer-col a:hover { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.social { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.social a {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border-radius: 50%; background: rgba(255,255,255,.1); color: #cbd5e1; transition: .2s;
}
.social a:hover { background: var(--accent); color: var(--dark); }

/* Floating WhatsApp chat button (site-wide) */
.wa-float {
    position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px;
    border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.28); z-index: 80; transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.2rem 0; font-size: .88rem; text-align: center; }
.footer-bottom a { color: #94a3b8; }

/* ---- Admin ------------------------------------------------------------- */
.admin-shell { min-height: 70vh; display: grid; place-items: center; padding: 3rem 0; }
.admin-card { background: #fff; border-radius: 16px; padding: 2.5rem; width: min(440px, 92%); box-shadow: 0 12px 40px rgba(0,0,0,.1); }
.admin-card h1 { font-size: 1.5rem; text-align: center; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .prayer-wrap, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    .site-nav { display: none; width: 100%; }
    .site-nav.open { display: block; }
    .header-inner { flex-wrap: wrap; }
    .site-nav ul { flex-direction: column; align-items: stretch; width: 100%; padding-top: .5rem; }
    .grid-3, .grid-2, .gallery-grid { grid-template-columns: 1fr; }
}
