@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Poppins:wght@600&family=Noto+Sans+Arabic:wght@400;700&display=swap');


:root {
    --bg: #f6efe4; /* warm beige background */
    --surface: rgba(255, 248, 240, 0.895); /* card surface (soft beige) */
    --text: #2e2a23; /* dark brown text */
    --muted: #7d8b86; /* muted gray/green */
    --primary: #338000; /* brand green */
    --accent: #88b070; /* soft accent green */
    --border: rgba(46,34,22,0.06); /* subtle brown border */
    --tile-beige: #efe7db; /* beige tile base */
    --tile-white: #ffffff; /* tile white */
}  

.masjidbox-wrapper {
    background: white;
    height: 100%;
}

.masjidbox-wrapper iframe {
  width: 100%;
  height: 420px;
  min-height: 360px;
  border: 0;
  background: transparent;
  border-radius: 8px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    margin: 0;
    padding: 0;
    color: var(--text);
    background-color: var(--bg);
    position: relative;

    /* decorative background now rendered via pseudo-element at 60% opacity */
    -webkit-font-smoothing: antialiased;
}

/* Background overlay using the arabesque motif at 60% opacity */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url('../images/arabesque.png');
    background-repeat: repeat;
    /* use fixed tile size so tiles repeat both horizontally and vertically and sit flush */
    background-size: 460px 460px;
    /* align to the very top-left so tiles sit adjacent */
    background-position: 0 0;
    opacity: 0.3; /* 60% opacity as requested */
    z-index: 0;
} 

.container {
    max-width: 1100px;
    margin: 0 auto;
    /* remove top padding so banner can sit flush against the top edge */
    padding: 0 20px 20px;
    position: relative;
    z-index: 1; /* ensure content sits above the background overlay */
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    background: transparent;
}

/* removed decorative gradient bar to keep a flat look */



.brand { display: flex; align-items: center; gap: 12px; }
.brand .brand-text { display: flex; flex-direction: column; }
.brand h1 {
    font-family: 'Poppins', Inter, sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    margin: 0;
    color: var(--text);
}

.brand p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

/* logo */
.site-logo { width: 36px; height: 36px; object-fit: contain; display: block; border-radius: 8px; }

/* Docked banner at the very top with a larger logo */
.site-header { position: relative;
}
.logo-banner {
    position: absolute;
    top: 0; /* docked to the very top */
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 0px 0px 136px 14px;
    background:linear-gradient(263deg, rgba(253, 187, 45, 0.41) 0%, rgba(253, 187, 45, 0.7) 20%, rgba(110, 191, 143, 0.1) 60%,rgba(34, 193, 195, 0.2) 70%) ;   
    
    box-shadow: 0 22px 60px rgba(16,24,24,0.14), 0 8px 22px rgba(46,34,22,0.06);
    border: 1px solid var(--border);
    transform: translateY(-40px); /* overlap slightly to reduce header gap */
    z-index: 80;
    transition: transform 240ms ease, box-shadow 240ms ease;
} 

/* make sure header content has enough space below the banner */
/* reduce gap and allow banner to overlap slightly */
.site-header {  
    padding-top: 8px; 
    margin-top: 32px; 

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 32px;
    box-shadow: 0 22px 60px rgba(16,24,24,0.14), 0 8px 22px rgba(46,34,22,0.06);
}

@media (max-width: 768px) {
    /* scale down on tablets */
    .logo-banner { left: 14px; padding: 12px 14px; transform: translateY(-8px); }
    .site-header { padding-top: 8px; }
} 

@media (max-width: 480px) {
    /* mobile: inline banner so it doesn't consume too much vertical space */
    .logo-banner { position: relative; transform: translateY(0); left: 0; display: inline-flex; margin-bottom: 6px; padding: 8px 10px; }
    .site-header { padding-top: 12px; }
}

/* Double logo size and ensure spacing to avoid overlap */
.site-logo { width: 160px; height: 160px; }

@media (max-width: 768px) {
    .site-logo { width: 128px; height: 128px; }
}

@media (max-width: 480px) {
    .site-logo { width: 80px; height: 80px; }
}

/* move the brand text to the right so it is not covered by the banner */
@media (min-width: 640px) {
    .brand { padding-left: 160px; }
}
.brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 3; }

@media (max-width: 480px) {
    .site-logo { width: 64px; height: 64px; }
    .logo-banner { transform: translateY(-8px); padding: 6px 8px; }
    .brand h1 { font-size: 1.05rem; }
}

/* make cards a touch translucent so pattern shows through slightly */
.content-section {
    background: var(--surface);
    padding: 18px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(46,34,22,0.06);
}

.btn-primary { box-shadow: 0 2px 8px rgba(46,34,22,0.08); } 


/* Navigation */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.1rem;
    padding: 0px;
    border-radius: 46px;
    width: 68px;
    height: 68px;
    background: rgba(255,250,244,0.25);
    border: #338000 1px solid;
    transition: all 0.2s ease;
}

/* Arabic / RTL support */
.rtl { direction: rtl; font-family: 'Noto Sans Arabic', 'Inter', sans-serif; }
.rtl .brand { text-align: right; }
.rtl .main-nav ul { flex-direction: row-reverse; }
.rtl .main-nav a { text-align: right; }
.rtl .hero-inner { text-align: right; }
.rtl .form-row label { text-align: right; }
.rtl .event-card-content { text-align: right; }
.rtl .salat-table th, .rtl .salat-table td { text-align: right; }


.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 14px;
    align-items: center;
}

.main-nav a {
    color: var(--text);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary);
    background: transparent;
} 

.nav-spacer{ flex: 1 1 auto; }

/* Carousel - FIXED */
.carousel { 
    position: relative; /* ✅ CRITICAL - needed for absolute positioned controls */
    display: block; 
    overflow: hidden; 
    border-radius: 8px;
    min-height: 500px;
}

.carousel-track { 
    display: flex;
    transition: transform 320ms ease;
    will-change: transform;
    gap: 0; /* No gap on mobile */
}

.carousel-slide { 
    min-width: 100%; 
    flex: 0 0 100%; 
    position: relative;
}

.carousel-slide img { 
    width: 100%; 
    height: 500px; 
    object-fit: cover; 
    display: block; 
    border-radius: 8px;
}

.carousel-caption { 
    position: absolute; 
    left: 12px; 
    right: 12px; 
    bottom: 12px; 
    background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.35)); 
    color: #fff; 
    padding: 10px 12px; 
    border-radius: 8px;
}

.carousel-caption h4 { 
    margin: 0 0 4px 0; 
    font-size: 1.05rem;
}

.carousel-caption p { 
    margin: 0; 
    font-size: 0.9rem; 
    opacity: 0.95;
}

.carousel-control { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(255,250,244,0.96); 
    border: none; 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    box-shadow: 0 8px 18px rgba(46,34,22,0.08); 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    font-size: 20px;
    z-index: 10; /* ✅ CRITICAL - ensure buttons appear above slides */
    transition: all 0.2s ease;
    color: var(--text);
}

.carousel-control:hover {
    background: rgba(255,250,244,1);
    box-shadow: 0 12px 24px rgba(46,34,22,0.12);
    transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev { 
    left: 12px;
}

.carousel-control.next { 
    right: 12px;
}

.carousel-control:focus { 
    outline: 2px solid var(--primary); 
    outline-offset: 2px;
}

.carousel-control:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.visually-hidden { 
    position: absolute !important; 
    height: 1px; 
    width: 1px; 
    overflow: hidden; 
    clip: rect(1px, 1px, 1px, 1px); 
    white-space: nowrap;
}

/* Show 2 slides side-by-side on wide screens - ALWAYS */
@media (min-width: 1024px) {
    .carousel-slide {
        min-width: 50%;
        flex: 0 0 50%;
    }

    .carousel-track {
        gap: 12px; /* Add gap between slides on wide screens */
    }
    
    .carousel-slide img {
        height: 500px;
        border-radius: 8px; /* Keep rounded corners */
    }
}

/* Tablet adjustments */
@media (max-width: 1023px) and (min-width: 769px) {
    .carousel-slide img {
        height: 400px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .carousel-slide img {
        height: 500px;
    }
    
    .carousel-control {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .carousel-control.prev {
        left: 8px;
    }
    
    .carousel-control.next {
        right: 8px;
    }
}

/* MasjidBox widget tweaks (brand overrides) */
#masjidbox-salat { padding: 0px; }
.masjidbox-widget, #masjidbox-salat iframe { display: block; width: 100%; box-sizing: border-box; }
.masjidbox-widget .mb-times, .masjidbox-widget .mb-widget { width: 100% !important; }
/* Stronger color overrides (may need !important depending on their markup) */
.masjidbox-widget * { color: var(--text) !important; }
.masjidbox-widget a { color: var(--primary) !important; }
.masjidbox-widget .mb-header, .masjidbox-widget .mb-title { color: var(--primary) !important; font-weight: 600; }
.masjidbox-widget .mb-today { background: rgba(51,128,0,0.06) !important; border-radius: 6px; }
.masjidbox-widget .mb-times th, .masjidbox-widget .mb-times td { color: var(--text) !important; }
.masjidbox-widget .mb-next, .masjidbox-widget .mb-cta { background: var(--primary) !important; color: #fff !important; border-radius: 6px !important; }
/* Fallback styling for the iframe container */
#masjidbox-salat { position: relative; padding-top: 56px; }

/* Force the visible header to use the brand color and sit above the iframe (covers MasjidBox header if present) */
.masjidbox-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding: 0 14px;
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    z-index: 60;
    box-shadow: 0 6px 18px rgba(46,34,22,0.08);
}
.masjidbox-header .mb-title { font-size:0.95rem; }
.masjidbox-header .mb-next { font-size:0.9rem; opacity:0.95; font-weight:600; }

#masjidbox-salat iframe { display:block; width:100%; border: 1px solid rgba(46,34,22,0.06); border-radius: 0 0 8px 8px; box-sizing: border-box; }
#masjidbox-salat p { margin-top: 8px; color: var(--muted); }

/* Additional MasjidBox color overrides - prefer brand green where possible */
.masjidbox-widget .mb-times th { color: var(--primary) !important; }
.masjidbox-widget .mb-times td { color: var(--text) !important; }
.masjidbox-widget .mb-header, .masjidbox-widget .mb-title { color: #fff !important; background: var(--primary) !important; }
.masjidbox-widget .mb-today { background: rgba(51,128,0,0.12) !important; border-radius:6px; }
.masjidbox-widget .mb-next, .masjidbox-widget .mb-cta { background: var(--primary) !important; color: #fff !important; border-radius: 6px !important; }

/* Fallback panel (shown when iframe is blocked or can't be styled) */
.masjidbox-fallback { display: none; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 20px rgba(46,34,22,0.06); margin-top: 8px; }
.masjidbox-fallback .mb-fallback-header { background: var(--primary); color: #fff; padding: 10px 12px; font-weight: 700; }
.masjidbox-fallback .mb-fallback-body { padding: 12px; background: var(--surface); color: var(--text); }
.masjidbox-fallback .mb-sample-times { list-style: none; padding: 0; margin: 8px 0; }
.masjidbox-fallback .mb-sample-times li { padding: 6px 0; border-bottom: 1px solid rgba(46,34,22,0.03); }
.masjidbox-fallback .mb-fallback-intro { margin: 0 0 10px 0; color: var(--muted); }
.masjidbox-fallback .mb-fallback-cta { margin-top: 10px; }

/* When the masjidbox container has a failure, hide the iframe and show the fallback */
#masjidbox-salat.masjidbox-failed iframe { display: none; }
#masjidbox-salat.masjidbox-failed .masjidbox-fallback { display: block; }


/* Layout: prayer times + support panel */
.salat-row { display: flex; gap: 18px; align-items: flex-start; }
.salat-col { flex: 1 1 auto; min-width: 0; }
    .salat-col { flex: 1 1 auto; max-width: none; border: var(--primary) solid .5px; width: 100%; height: 100%; background-color: white;}
.support-col { flex: 0 0 360px; max-width: 360px; }
.support-card { background: var(--surface); padding: 14px; border-radius: 10px; box-shadow: 0 10px 24px rgba(46,34,22,0.06); color: var(--text); }
.support-card h3 { margin-top: 0; color: var(--primary); font-size: 1.05rem; }
.support-card p { color: var(--text); line-height: 1.45rem; }
.support-card blockquote { margin: 12px 0; padding-left: 12px; border-left: 3px solid rgba(51,128,0,0.12); color: var(--muted); font-style: italic; }
.btn-secondary { display: inline-block; background: transparent; color: var(--primary); border: 2px solid var(--primary); padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.btn-secondary:hover { background: rgba(51,128,0,0.06); box-shadow: 0 6px 18px rgba(46,34,22,0.04); }

/* On larger viewports make the timetable and support panel split 50/50 and fill height */
@media (min-width: 900px) {
    .salat-row { align-items: stretch; }
    /* ensure both columns behave as full-height flex columns */
    .salat-col, .support-col { flex: 1 1 50%; max-width: 50%; display: flex; flex-direction: column; }

    /* keep support card full height and pin CTA to the bottom */
    .support-card { height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
    .support-card .btn-secondary { margin-top: 12px; }

    /* make the MasjidBox container a column flex and let iframe grow */
    #masjidbox-salat { display: flex; flex-direction: column; height: 100%; }
    #masjidbox-salat iframe { min-height: 600px; flex: 1 1 auto; width: 100%; height: auto; }
}


@media (max-width: 900px) {
    .masjidbox-widget, #masjidbox-salat iframe { font-size: 14px; }
    .salat-row { flex: 1 1 auto; flex-direction: column; }
    .support-col { flex: 1 1 auto; max-width: none; }
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: center;
    padding: 24px;
    background: transparent;
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(46,34,22,0.06);
}  

/* Tile frame / Geometric tile border */
.tile-frame {
    position: relative;
    padding: 14px;
    border-radius: 10px;
    background: linear-gradient(263deg, rgba(253, 187, 45, 0.41) 0%, rgba(253, 187, 45, 0.7) 20%, rgba(110, 191, 143, 0.1) 60%,rgba(34, 193, 195, 0.2) 70%) 
}

.tile-frame::before {
    content: '';
    position: absolute;
    inset: -8px;
    z-index: -1;
    background-image: none;
    /* decorative tile removed */
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
} 

.tile-stripe {
    height: 14px;
    background-image: none;
    margin-bottom: 12px;
    border-radius: 8px;
    opacity: 0;
} 

.hero-inner h2 {
    font-family: 'Poppins', Inter, sans-serif;
    color: var(--text);
    font-size: 1.6rem;
    margin: 0 0 8px 0;
}

.hero-inner p {
    margin: 0 0 12px 0;
    color: var(--muted);
}

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
}

/* Contact form */
.contact-form { max-width: 700px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--muted); }
.form-row input, .form-row textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: none; background: #fffaf3; color: var(--text); box-shadow: inset 0 1px 3px rgba(46,34,22,0.04); } 

.form-actions { margin-top: 10px; }
.contact-feedback { margin-top: 10px; color: var(--primary); }

/* Responsive - small screens */
@media (max-width: 768px) {
    .site-header {
        align-items: flex-start;
        gap: 10px;
        position: relative;
    }

    .nav-toggle { display: inline-block; }

    /* Mobile nav becomes a full-width vertical panel under the header */
    .main-nav {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        width: 100%;
        display: none;
        background: var(--surface);
        padding: 8px 0;
        border-radius: 0;
        box-shadow: 0 12px 30px rgba(46,34,22,0.08);
        z-index: 50;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 0;
    }

    .main-nav li + li { border-top: 1px solid rgba(46,34,22,0.03); } 

    .main-nav a { display: block; padding: 12px 16px; border-radius: 0; }

    .main-nav a:hover, .main-nav a:active {
        background: rgba(51,128,0,0.04);
        color: var(--primary);
    } 

    .main-nav a:focus {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    /* Keep RTL alignment correct */
    .rtl .main-nav a { text-align: right; }

    /* Prevent body scroll when nav is open */
    body.nav-open { overflow: hidden; }

    main { gap: 24px; }
}


main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 18px;
}

.content-section {
    background: var(--surface);
    padding: 18px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(46,34,22,0.06);
}

.content-section h2 {
    font-size: 1.1rem;
    color: var(--text);
    margin: 0 0 12px 0;
}

/* Prayer Times Table */
#salat-times h3 { text-align: center; font-weight: normal; margin-bottom: 10px; }

.salat-table { width: 100%; border-collapse: collapse; }

.salat-table th, .salat-table td { padding: 10px 8px; border-bottom: none; text-align: left; }

.salat-table thead th { color: var(--muted); font-weight: 600; }

/* Events Section */
#events-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.event-card { background: var(--surface); border: none; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 6px 18px rgba(46,34,22,0.06); } 

.event-card img { width: 100%; height: 150px; object-fit: cover; }

.event-card-content { padding: 12px; flex: 1 1 auto; }

.event-card-content h4 { margin: 0 0 8px 0; font-size: 1rem; }

.event-card-content p { margin: 0 0 6px 0; font-size: 0.95rem; color: var(--muted); }

footer { text-align: center; padding: 18px 6px; color: var(--muted); font-size: 0.9rem; margin-top: 30px; }

/*Youtube Section */

#youtube-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
