/* ============================================================
   IWS Melbourne — Modern theme
   Edit the variables in :root to retheme the entire site.
   ============================================================ */

/* ---- Circular Std ---- */
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-Book.woff2') format('woff2'),
         url('../fonts/CircularStd-Book.woff') format('woff');
    font-weight: 300 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-BookItalic.woff2') format('woff2'),
         url('../fonts/CircularStd-BookItalic.woff') format('woff');
    font-weight: 300 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-Medium.woff2') format('woff2'),
         url('../fonts/CircularStd-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-MediumItalic.woff2') format('woff2'),
         url('../fonts/CircularStd-MediumItalic.woff') format('woff');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-Bold.woff2') format('woff2'),
         url('../fonts/CircularStd-Bold.woff') format('woff');
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-BoldItalic.woff2') format('woff2'),
         url('../fonts/CircularStd-BoldItalic.woff') format('woff');
    font-weight: 600 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-Black.woff2') format('woff2'),
         url('../fonts/CircularStd-Black.woff') format('woff');
    font-weight: 800 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-BlackItalic.woff2') format('woff2'),
         url('../fonts/CircularStd-BlackItalic.woff') format('woff');
    font-weight: 800 900;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Brand */
    --color-primary:       #A2C037;
    --color-primary-dark:  #7FA02C;
    --color-primary-soft:  #EFF4DE;
    --color-accent:        #D63B3B;
    --color-accent-dark:   #B82E2E;

    /* Neutrals */
    --color-text:          #1F2933;
    --color-text-muted:    #6B7280;
    --color-bg:            #FFFFFF;
    --color-bg-alt:        #F7F8F5;
    --color-border:        #E5E7EB;
    --color-footer-bg:     #2A2F36;
    --color-footer-text:   #C7CCD2;
    --color-footer-heading:#FFFFFF;

    /* Typography */
    --font-sans: 'Circular Std', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fs-body: 16px;
    --fs-sm:   0.875rem;
    --fs-lg:   1.125rem;
    --fs-xl:   1.5rem;
    --fs-2xl:  2rem;
    --fs-3xl:  2.5rem;
    --lh-body: 1.65;
    --lh-tight: 1.2;

    /* Layout */
    --container: 1180px;
    --radius:    0;
    --radius-sm: 0;
    --control-h: 38px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --shadow:    0 6px 20px rgba(0,0,0,.07);
    --gap-1: 0.5rem;
    --gap-2: 1rem;
    --gap-3: 1.5rem;
    --gap-4: 2rem;
    --gap-5: 3rem;
    --gap-6: 4.5rem;

    /* Transitions */
    --t-fast: 150ms ease;
    --t-base: 250ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
/* Form controls don't inherit the page font/weight by default — force it */
button, input, optgroup, select, textarea { font-family: inherit; font-weight: inherit; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    font-weight: 300;
    line-height: var(--lh-body);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary-dark); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--color-primary); }
h1, h2, h3, h4 { font-weight: 700; line-height: var(--lh-tight); color: var(--color-text); margin: 0 0 var(--gap-2); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
p  { margin: 0 0 var(--gap-2); }
ul, ol { padding-left: 1.2rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gap-3); }
.section   { padding: var(--gap-6) 0; }
.section--alt { background: var(--color-bg-alt); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto var(--gap-5); }
.section__eyebrow { color: var(--color-primary-dark); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-sm); }
.section__title { margin-top: var(--gap-1); }
.section__lead  { color: var(--color-text-muted); }

/* ---- Top contact strip ---- */
.topbar { background: var(--color-primary); color: #fff; font-size: var(--fs-sm); }
.topbar__row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; gap: var(--gap-3); flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar a:hover { opacity: .85; color: #fff; }
.topbar__contact { display: flex; gap: var(--gap-3); flex-wrap: wrap; }
.topbar__contact span { display: inline-flex; align-items: center; gap: .35rem; }
.topbar__sep { opacity: .55; }
.topbar__social { display: inline-flex; align-items: center; gap: .75rem; }
.topbar__social a { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.topbar__social .icon { width: 18px; height: 18px; display: block; }

/* ---- Header / Nav ---- */
.site-header { background: #fff; position: relative; z-index: 50; box-shadow: var(--shadow-sm); }
.header__row { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-3); padding: .4rem 0; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand img { height: 120px; width: auto; }
.brand__name { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }

.nav-toggle {
    display: none;
    background: none; border: 0; padding: .5rem; cursor: pointer;
    width: 44px; height: 44px;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px; background: var(--color-text); margin: 4px auto;
    transition: transform var(--t-fast);
}

.nav { display: flex; align-items: center; gap: .25rem; }
.nav-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    opacity: 0; visibility: hidden;
    transition: opacity var(--t-base), visibility var(--t-base);
    z-index: 150;
}
.nav-backdrop.is-open { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }
.nav-close { display: none; }
.nav__link {
    position: relative;
    display: inline-block; padding: .6rem .9rem; color: var(--color-text);
    font-weight: 500; transition: color var(--t-fast);
    text-transform: uppercase; letter-spacing: .03em;
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--color-primary-dark); }
/* Animated underline: wipes in left→right on hover, out left→right on leave */
.nav__link::after {
    content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .35rem;
    height: 2px; background: var(--color-primary);
    transform: scaleX(0); transform-origin: right center;
    transition: transform var(--t-base);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left center; }
.nav a.btn { margin-left: var(--gap-2); color: #fff !important; }
.nav a.btn:hover { color: #fff !important; }

/* Dropdown */
.nav__item { position: relative; }
.nav__caret { display: inline-flex; align-items: center; margin-left: .3rem; transition: transform var(--t-fast); }
.nav__caret svg { width: 13px; height: 13px; display: block; }
.nav__item:hover .nav__caret,
.nav__item:focus-within .nav__caret { transform: rotate(180deg); }

.dropdown {
    list-style: none; padding: .5rem; margin: 0;
    position: absolute; top: calc(100% + 10px); left: 50%;
    min-width: 250px; background: #fff;
    border: 1px solid var(--color-border); border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-6px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility 0s linear var(--t-fast);
    z-index: 100;
}
/* Upward pointer notch — centered on the dropdown and aligned with the nav item centre */
.dropdown::before {
    content: ""; position: absolute; top: -7px; left: 50%; margin-left: -7px;
    width: 14px; height: 14px; background: #fff;
    border-left: 1px solid var(--color-border);
    border-top: 1px solid var(--color-border);
    transform: rotate(45deg); border-top-left-radius: 4px;
}
/* Transparent bridge so hover isn't lost crossing the gap */
.dropdown::after {
    content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px;
}
.nav__item:hover > .dropdown,
.nav__item:focus-within > .dropdown {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility 0s;
}
.dropdown a {
    display: block; padding: .6rem .85rem; border-radius: 10px;
    color: var(--color-text); font-weight: 500;
    transition: color var(--t-fast), background var(--t-fast);
}
.dropdown a:hover { color: var(--color-primary-dark); }
/* Top-level leaf items get a trailing north-east arrow */
.dropdown > li > a { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
/* Leaf dropdown items no longer show the ↗ arrow (IQRA keeps its › submenu arrow) */
.dropdown > li:not(.has-submenu) > a::after { display: none; }

/* Submenu (second-level dropdown) */
.dropdown li { position: relative; }
.has-submenu > a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.has-submenu > a::after { content: '›'; color: var(--color-text-muted); font-size: 1.1em; line-height: 1; }
.has-submenu:hover > a::after,
.has-submenu:focus-within > a::after { color: var(--color-primary-dark); }

.submenu {
    list-style: none; padding: .4rem 0; margin: 0;
    position: absolute; top: -.4rem; left: 100%;
    min-width: 220px; background: #fff;
    border: 1px solid var(--color-border); border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    opacity: 0; visibility: hidden; transform: translateX(-6px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility 0s linear var(--t-fast);
    z-index: 101;
}
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
    opacity: 1; visibility: visible; transform: translateX(0);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility 0s;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: var(--control-h); padding: 0 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--color-primary); color: #fff !important;
    font-weight: 600; font-size: var(--fs-sm); line-height: 1;
    border: 0; cursor: pointer; white-space: nowrap;
    transition: background var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: var(--color-primary-dark); }
.btn--accent { background: var(--color-accent); }
.btn--accent:hover { background: var(--color-accent-dark); }
.btn--ghost { background: transparent; color: var(--color-primary-dark) !important; border: 2px solid var(--color-primary); padding: 0 calc(1.25rem - 2px); }
.btn--ghost:hover { background: var(--color-primary); color: #fff !important; }
.btn--lg { height: 48px; padding: 0 1.5rem; font-size: var(--fs-body); }
.btn--block { display: flex; width: 100%; }

/* ---- Ayah strip (under nav) ---- */
.ayah-strip { background: #3c3c3c; color: #fff; }
.ayah-strip__row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--gap-3); padding: .5rem 0;
}
.ayah-strip__text { margin: 0; font-size: 1rem; }
.ayah-strip__btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: #e41b25; color: #fff !important; font-weight: 600;
    padding: .55rem 1.1rem; line-height: 1; white-space: nowrap;
    transition: background var(--t-fast);
}
.ayah-strip__btn:hover { background: #c4151e; }
@media (max-width: 720px) {
    .ayah-strip__row { flex-direction: column; align-items: center; gap: .5rem; text-align: center; }
}

/* ---- Hero slider ---- */
.hero { position: relative; overflow: hidden; background: #000; }
.slider { position: relative; width: 100%; aspect-ratio: 1920 / 648; max-height: 70vh; }
@media (max-width: 720px) {
    /* Wide cinematic ratio collapses to a thin strip on phones — give it real height */
    .slider { aspect-ratio: auto; height: 70vh; min-height: 380px; max-height: 560px; }
    .slide { background-position: center top; }
    .slide__title { font-size: clamp(1.5rem, 7vw, 2.1rem); }
}
.slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 800ms ease;
    display: flex; align-items: center;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide__inner {
    position: relative; z-index: 2;
    max-width: var(--container); width: 100%;
    margin: 0 auto; padding: 0 var(--gap-3);
    color: #fff;
}
.slide__overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 60%); z-index: 1; }
.slide__title { color: #fff; font-size: clamp(1.8rem, 4vw, 3rem); text-shadow: 0 2px 12px rgba(0,0,0,.5); margin-bottom: var(--gap-2); max-width: 600px; }
.slide__sub   { color: #fff; font-size: clamp(1rem, 1.6vw, 1.25rem); margin-bottom: var(--gap-3); max-width: 560px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.slider__dots { position: absolute; bottom: 1.25rem; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: .5rem; }
.slider__dots button {
    width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff;
    background: transparent; padding: 0; cursor: pointer; transition: background var(--t-fast);
}
.slider__dots button[aria-current="true"] { background: #fff; }
.slider__arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.2); color: #fff; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
    transition: background var(--t-fast);
}
.slider__arrow:hover { background: rgba(255,255,255,.4); }
.slider__arrow--prev { left: 1rem; }
.slider__arrow--next { right: 1rem; }

/* ---- Page header (inner pages) ---- */
.page-header { background: var(--color-primary-soft); padding: var(--gap-5) 0; border-bottom: 1px solid var(--color-border); }
.page-header h1 { margin: 0; }
.crumbs { color: var(--color-text-muted); font-size: var(--fs-sm); margin-top: .25rem; }
.crumbs a { color: var(--color-text-muted); }

/* ---- Cards ---- */
.cards { display: grid; gap: var(--gap-3); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
    background: #fff; border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.card__media { height: 220px; background: var(--color-bg-alt); flex-shrink: 0; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__body { padding: var(--gap-3); flex: 1; display: flex; flex-direction: column; }
.card__title { font-size: 1.15rem; margin-bottom: .5rem; }
.card__text { color: var(--color-text-muted); margin-bottom: var(--gap-2); flex: 1; }
.cards--soft .card { background: #F7F8F5; }
.cards--soft .card__media { background: #fff; }

/* ---- CTA banner ---- */
.cta {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff; padding: var(--gap-5) 0; text-align: center;
}
.cta h2 { color: #fff; }
.cta p  { color: rgba(255,255,255,.92); max-width: 640px; margin: 0 auto var(--gap-3); }
.cta .btn { background: #fff; color: var(--color-primary-dark) !important; }
.cta .btn:hover { background: var(--color-bg-alt); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin: var(--gap-3) 0; }
table.data {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
table.data th, table.data td { padding: .9rem 1.1rem; text-align: left; }
table.data thead { background: var(--color-primary); color: #fff; }
table.data tbody tr { border-top: 1px solid var(--color-border); }
table.data tbody tr:nth-child(even) { background: var(--color-bg-alt); }

/* Green variant (enrolment page) */
table.data--sage { box-shadow: none; }
table.data--sage th, table.data--sage td { border: 1px solid #fff; color: #fff; background: #698567; }
table.data--sage thead { background: #698567; }
table.data--sage tbody tr { border-top: 0; }
table.data--sage tbody tr:nth-child(even) td { background: #698567; }

/* Enrolment form intro blocks */
.enrol-intro { display: flex; flex-direction: column; gap: var(--gap-2); margin-bottom: var(--gap-3); }
.enrol-intro__block { background: #E8EFB1; padding: .85rem 1.15rem; margin: 0; line-height: 1.55; }
.enrol-intro__title { font-size: 1rem; font-weight: 700; }

/* Waiver of liability (centered text block) */
.waiver { background: #E8EFB1; padding: var(--gap-3) var(--gap-4); text-align: center; margin-top: 1.5rem;}
.waiver__title { font-size: 1.25rem; font-weight: 700; margin: 0 0 var(--gap-2); }
.waiver p { margin: 0 0 var(--gap-2); }
.waiver p:last-child { margin-bottom: 0; }

/* ---- Forms ---- */
.form { display: flex; flex-direction: column; gap: var(--gap-3); }
.form__grid { display: grid; gap: var(--gap-3); grid-template-columns: repeat(2, 1fr); }
.form__row { display: flex; flex-direction: column; }
.form__row label { font-weight: 600; font-size: var(--fs-sm); color: var(--color-text); margin-bottom: .25rem; }
.form__row .required { color: var(--color-accent); margin-left: .15rem; }
.form input[type="text"], .form input[type="email"], .form input[type="tel"],
.form input[type="number"], .form input[type="date"], .form select {
    width: 100%; font: inherit; font-size: var(--fs-sm);
    height: var(--control-h); padding: 0 .75rem;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: #fff; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form textarea {
    width: 100%; font: inherit; font-size: var(--fs-sm);
    padding: .5rem .75rem;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: #fff; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form input:focus, .form textarea:focus, .form select:focus {
    outline: 0; border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(162,192,55,.25);
}
.form textarea { min-height: 130px; resize: vertical; }
.form__hint { font-size: var(--fs-sm); color: var(--color-text-muted); }
.form__section { display: flex; flex-direction: column; gap: var(--gap-2); padding-top: var(--gap-3); border-top: 1px solid var(--color-border); }
.form__section:first-of-type { padding-top: 0; border-top: 0; }
.form__section h3 { margin: 0 0 .25rem; }

.child-row { display: grid; gap: .5rem; grid-template-columns: 2fr 1fr 2fr auto; align-items: end; margin-bottom: .5rem; padding: .75rem; background: var(--color-bg-alt); border-radius: var(--radius-sm); }
.child-row label { font-size: var(--fs-sm); }
.child-row .remove-child {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--control-h); height: var(--control-h);
    background: var(--color-accent); color: #fff; border: 0;
    border-radius: var(--radius-sm); cursor: pointer; line-height: 1; font-size: 1.1rem;
}

.checkbox { display: flex; align-items: flex-start; gap: .6rem; }
.checkbox input { margin-top: .25rem; }
.checkbox label { font-weight: 400; font-size: var(--fs-sm); color: var(--color-text-muted); }

.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: var(--gap-3); border: 1px solid; }
.alert--success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert--error   { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* Per-field validation: red border only */
.form__row.has-error input,
.form__row.has-error textarea,
.form__row.has-error select {
    border-color: var(--color-accent);
}
.field-error { display: none; }

/* ---- Lists ---- */
.surah-list {
    display: grid; gap: .5rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    list-style: none; padding: 0;
}
.surah-list li a {
    display: block; padding: .75rem 1rem; background: #fff;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    color: var(--color-text); transition: all var(--t-fast);
}
.surah-list li a:hover { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary-dark); }

/* ---- Iqra books grid ---- */
.book-grid { display: grid; gap: var(--gap-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: var(--gap-3); }
.book-grid .book {
    display: flex; flex-direction: column; align-items: center; padding: var(--gap-3);
    background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
    text-align: center; transition: all var(--t-base);
}
.book-grid .book:hover { border-color: var(--color-primary); box-shadow: var(--shadow); transform: translateY(-3px); }
.book__cover { width: 80px; height: 110px; background: var(--color-primary-soft); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; color: var(--color-primary-dark); margin-bottom: var(--gap-2); }

/* ---- Footer ---- */
.site-footer { background: var(--color-footer-bg); color: var(--color-footer-text); padding: var(--gap-5) 0 0; }
.footer-grid { display: grid; gap: var(--gap-5); grid-template-columns: 3fr 2fr 2fr; align-items: start; }
.site-footer h4 { color: var(--color-footer-heading); margin-bottom: var(--gap-2); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .04em; }
.site-footer a { color: var(--color-footer-text); }
.site-footer a:hover { color: var(--color-primary); }
.footer-brand img { height: 100px; width: auto; margin-bottom: var(--gap-3); display: block; }
.footer-col p { margin: 0 0 var(--gap-2); line-height: 1.6; }
.footer-hours { margin-top: var(--gap-2); }
.footer-contact-line { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 var(--gap-2); }
.footer-ico { flex-shrink: 0; width: 18px; height: 18px; color: var(--color-primary); margin-top: .2rem; }
.footer-newsletter { display: flex; max-width: 320px; margin: 0 0 var(--gap-3); }
.footer-newsletter input { flex: 1; min-width: 0; padding: .6rem .75rem; border: 0; background: #fff; color: var(--color-text); font-size: var(--fs-sm); }
.footer-newsletter button { border: 0; background: var(--color-primary); color: #fff; padding: 0 1.1rem; cursor: pointer; text-transform: uppercase; font-weight: 600; }
.footer-newsletter button:hover { background: var(--color-primary-dark); }
.footer-social { display: flex; gap: .75rem; margin-top: var(--gap-1); }
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: rgba(255,255,255,.08); color: var(--color-footer-text);
    transition: background var(--t-fast), color var(--t-fast);
}
.footer-social a:hover { background: var(--color-primary); color: #fff; }
.footer-social .icon { width: 20px; height: 20px; display: block; }
.footer-bottom {
    margin-top: var(--gap-4); padding: var(--gap-2) 0;
    border-top: 1px solid rgba(255,255,255,.08); text-align: center; font-size: var(--fs-sm);
}

/* ---- Map ---- */
.map-wrap { aspect-ratio: 16/8; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.map-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ---- Video embeds ---- */
.video-wrap {
    position: relative; aspect-ratio: 16 / 9; width: 100%;
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
    background: #000;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.book-list {
    display: grid; gap: var(--gap-4);
    grid-template-columns: repeat(2, 1fr);
}
.book-entry {
    background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
}
.book-entry h3 { color: var(--color-primary-dark); padding: var(--gap-3) var(--gap-3) 0; margin: 0; }
.book-entry > p { padding: 0 var(--gap-3); margin: var(--gap-2) 0; }
.book-entry .video-wrap { border-radius: 0; box-shadow: none; }
.book-entry > p:last-child { padding: var(--gap-3); margin: 0; }

.video-grid {
    display: grid; gap: var(--gap-3); margin-top: var(--gap-3);
    grid-template-columns: repeat(2, 1fr);
}
.video-card {
    background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
}
.video-card__title {
    font-size: 1rem; margin: 0; color: var(--color-text);
    padding: var(--gap-2) var(--gap-3);
}
.video-card .video-wrap { border-radius: 0; box-shadow: none; }

@media (max-width: 720px) {
    .book-list, .video-grid { grid-template-columns: 1fr; }
}

/* ---- Two column ---- */
.two-col { display: grid; gap: var(--gap-4); grid-template-columns: 1.2fr 1fr; align-items: start; }
.two-col--even { grid-template-columns: 1fr 1fr; }
.two-col--text-img { grid-template-columns: 1fr 232px; align-items: center; }
.text-img__media img { width: 100%; max-width: 232px; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); margin-left: auto; display: block; }

/* ---- Info rows (image left) ---- */
.info-rows { display: flex; flex-direction: column; gap: var(--gap-5); }
.info-row { display: grid; grid-template-columns: 300px 1fr; gap: var(--gap-4); align-items: center; }
.info-row__media img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); display: block; }
.info-row__body h2 { margin-top: 0; }
.info-row__body p:last-child { margin-bottom: 0; }
@media (max-width: 720px) {
    .info-row { grid-template-columns: 1fr; gap: var(--gap-2); }
    .info-row__media img { max-width: 300px; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.625rem; }
    .section { padding: var(--gap-5) 0; }
    .form__grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .child-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .topbar { display: none; }
    .nav-toggle { display: block; }
    .brand img { height: 60px; }

    /* ---- Mobile nav: offcanvas panel (slides in from the right) ---- */
    .nav {
        position: fixed; top: 0; right: 0; bottom: 0;
        width: min(320px, 85vw); height: 100%;
        flex-direction: column; align-items: stretch;
        background: #fff; padding: 4rem 0 var(--gap-2); gap: 0;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--t-base);
        box-shadow: -8px 0 32px rgba(0,0,0,.18);
        z-index: 200;
    }
    .nav.is-open { transform: translateX(0); }
    .nav-close {
        position: absolute; top: .75rem; right: .9rem;
        width: 40px; height: 40px; display: flex;
        align-items: center; justify-content: center;
        background: transparent; border: 0; cursor: pointer;
        font-size: 1.75rem; line-height: 1; color: var(--color-text);
    }
    .nav__link {
        width: 100%; text-align: left;
        padding: .8rem var(--gap-3);
        border-bottom: 0;
    }
    /* No animated underline in the vertical offcanvas */
    .nav__link::after { display: none; }
    .nav a.btn {
        margin: var(--gap-2) var(--gap-3) var(--gap-1);
        width: auto; text-align: center;
    }

    /* Top-level dropdown parent shows a toggle caret, taps to expand */
    .nav__item { position: static; }
    .nav__item > .nav__link {
        display: flex; align-items: center; justify-content: space-between;
    }
    .nav__caret { transition: transform var(--t-fast); }
    .nav__item.is-open > .nav__link .nav__caret { transform: rotate(180deg); }

    .dropdown {
        position: static; opacity: 1; visibility: visible;
        min-width: 0; width: 100%;
        border: 0; border-radius: 0; box-shadow: none;
        padding: 0; transition: max-height var(--t-base);
        max-height: 0; overflow: hidden;
        background: var(--color-bg-alt);
    }
    /* Neutralise the desktop hover/focus-within transform (higher specificity) */
    .dropdown,
    .nav__item:hover > .dropdown,
    .nav__item:focus-within > .dropdown,
    .nav__item.is-open > .dropdown { transform: none; }
    .dropdown::before, .dropdown::after { display: none; }
    .nav__item.is-open > .dropdown { max-height: 1200px; }
    .dropdown a {
        text-align: left; border-radius: 0; border-bottom: 0;
        padding: .7rem var(--gap-3) .7rem calc(var(--gap-3) + 1rem);
    }

    /* Second-level (IQRA books): shown expanded inline, deeper indent */
    .dropdown li.has-submenu { position: static; }
    .has-submenu > a::after { display: none; }
    .submenu {
        position: static; opacity: 1; visibility: visible;
        min-width: 0; width: 100%;
        border: 0; border-radius: 0; box-shadow: none;
        padding: 0; transition: none;
    }
    .submenu,
    .has-submenu:hover > .submenu,
    .has-submenu:focus-within > .submenu { transform: none; }
    .submenu a { padding-left: calc(var(--gap-3) + 2rem); }

    .footer-grid { grid-template-columns: 1fr; }
    .slide__inner { padding: 0 var(--gap-2); }
}
