/* Leicester Salaah Times: public site styles.
   Shared by every public page and the header/footer includes. */

:root {
    --page: #F7F5EF;
    --surface: #FFFFFF;
    --tint: #EEEBE3;
    --primary: #0F4C5C;
    --primary-2: #1E6C6E;
    --accent: #E36414;
    --accent-mid: #CA560F;
    --accent-text: #B34C0D;
    --accent-tint: #FBEBDD;
    --info-tint: #E4EEEE;
    --ink: #1C2026;
    --muted: #596870;
    --subtle: #748289;
    --rule: #e3e0d6;
    --rule-strong: #cbc6b8;
    --on-primary: #FFFFFF;
    --on-primary-muted: #C9D6D9;
    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --wrap: 1040px;
    --gutter: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }

a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
    margin: 0;
}

p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap, .container {
    max-width: var(--wrap);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.is-hidden { display: none !important; }

/* ---------- Site header ---------- */
.site-nav {
    background: var(--primary);
    color: var(--on-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
    min-height: 58px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 16px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--on-primary);
    text-decoration: none;
    min-width: 0;
    padding: 8px 0;
}
.nav-brand:hover { color: var(--on-primary); }
.nav-logo { width: 40px; height: 40px; object-fit: contain; background: #fff; border: 1px solid #fff; border-radius: 0; flex-shrink: 0; }
.nav-logo.nav-logo-mark { background: none; border: 0; width: 36px; height: 36px; }
.nav-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--on-primary);
    margin: 0;
}
.nav-links { display: flex; align-items: stretch; }
.nav-links a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--on-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}
.nav-links a:hover { text-decoration: underline; text-underline-offset: 4px; color: var(--on-primary); }
.nav-links a.active { background: var(--page); color: var(--primary); font-weight: 600; }
.nav-links a.active:hover { text-decoration: none; }
.nav-toggle {
    display: none;
    align-self: center;
    background: none;
    border: 1px solid var(--on-primary-muted);
    color: var(--on-primary);
    font-size: 1.1rem;
    line-height: 1;
    padding: 7px 10px;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--sans);
}
.nav-mobile { display: none; background: var(--primary); border-top: 1px solid var(--primary-2); }
.nav-mobile a {
    display: block;
    padding: 12px var(--gutter);
    color: var(--on-primary);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid var(--primary-2);
}
.nav-mobile a:last-child { border-bottom: 0; }
.nav-mobile a.active { background: var(--page); color: var(--primary); font-weight: 600; }

@media (max-width: 760px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
    .nav-mobile.open { display: block; }
    .nav-title { font-size: 1.15rem; }
}

/* Date line under the header (home page) */
.dateline {
    border-bottom: 1px solid var(--rule-strong);
    background: var(--page);
    font-size: 0.92rem;
    color: var(--muted);
}
.dateline .wrap { padding-top: 10px; padding-bottom: 10px; }
.dateline .dl-date { color: var(--ink); font-weight: 600; }
.dateline .dl-hijri { color: var(--primary-2); font-weight: 600; }
.dateline .dl-sep { color: var(--rule-strong); padding: 0 6px; }
.dateline .dl-next { display: block; margin-top: 2px; }
.dateline .dl-next strong { color: var(--ink); }
.dateline .dl-tag { margin-bottom: 2px; color: var(--muted); }

/* ---------- Page heading (inner pages) ---------- */
.page-head {
    border-bottom: 1px solid var(--rule-strong);
    padding: 28px 0 18px;
    margin-bottom: 24px;
}
.page-head h1 { font-size: 2.1rem; }
.page-head .page-sub { margin-top: 6px; color: var(--muted); font-size: 1rem; max-width: 60ch; }
.page-body { padding-bottom: 48px; }

.breadcrumb { font-size: 0.88rem; color: var(--muted); padding-top: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .bc-sep { padding: 0 6px; color: var(--subtle); }

/* ---------- Heading bands ---------- */
/* Town and city bands: secondary teal. Date headings: primary teal. */
.band {
    display: block;
    background: var(--primary-2);
    color: var(--on-primary);
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.12rem;
    line-height: 1.3;
    padding: 8px 12px;
    margin: 28px 0 0;
}
.band h2, .band h3 { color: var(--on-primary); font-size: inherit; }
.band p { color: var(--on-primary-muted); font-family: var(--sans); font-size: 0.85rem; font-weight: 400; }

.section-title {
    font-size: 1.4rem;
    margin: 28px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule-strong);
}

.date-heading + .band { margin-top: 2px; }
.date-heading, .band.band-date {
    display: block;
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--on-primary);
    background: var(--primary);
    margin: 32px 0 0;
    padding: 9px 12px;
}
.band.band-date { font-size: 1.12rem; padding: 8px 12px; margin-top: 28px; }

/* ---------- Tabs ---------- */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--primary);
    margin: 0 0 20px;
}
.tab-btn {
    flex: 0 0 auto;
    background: none;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 11px 18px;
    width: auto;
    font-family: var(--sans);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    line-height: 1.25;
}
.tab-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.tab-btn.active { background: var(--primary); color: var(--on-primary); text-decoration: none; }
.tab-btn .tab-count { font-weight: 400; }
@media (max-width: 560px) {
    .tab-nav .tab-btn { flex: 1 1 0; padding: 10px 6px; font-size: 0.86rem; text-align: center; }
}

/* ---------- Form controls ---------- */
.field-label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0 0 6px; color: var(--ink); }
.input, .select,
input[type=text].input, input[type=search].input {
    width: 100%;
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: 2px;
    padding: 9px 10px;
    margin: 0;
    line-height: 1.3;
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--ink); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--sans);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 9px 14px;
    border: 1px solid var(--rule-strong);
    border-radius: 2px;
    background: var(--surface);
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    width: auto;
    margin: 0;
}
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: underline; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-mid); border-color: var(--accent-mid); color: var(--ink); }
.btn-dark { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-dark:hover { background: var(--primary-2); border-color: var(--primary-2); color: var(--on-primary); }
.btn-donate { background: var(--accent-text); border-color: var(--accent-text); color: #fff; }
.btn-donate:hover { background: #963F0A; border-color: #963F0A; color: #fff; }
.btn-plain { background: none; border-color: transparent; padding-left: 0; padding-right: 0; color: var(--accent-text); text-decoration: underline; }
.btn-plain:hover { color: var(--ink); }

/* 12h/24h toggle */
.bst-toggle-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--muted);
}
.bst-time-toggle {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: 2px;
    padding: 4px 10px;
    min-width: 46px;
    width: auto;
    margin: 0;
    cursor: pointer;
    line-height: 1.3;
}
.bst-time-toggle:hover { border-color: var(--primary); }

.bst-time, .num { font-variant-numeric: tabular-nums; }

/* ---------- Notices ---------- */
.notice {
    border: 1px solid var(--accent-mid);
    background: var(--accent-tint);
    color: var(--ink);
    padding: 12px 14px;
    margin: 14px 0;
    font-size: 0.92rem;
    line-height: 1.5;
}
.notice strong.notice-title { display: block; margin-bottom: 2px; }
.notice-info { border-color: var(--primary-2); background: var(--info-tint); }

/* ---------- Small text labels (not badges) ---------- */
.tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-2);
    white-space: nowrap;
}
.tag-warn { color: var(--accent-text); }
.next-mark {
    display: inline-block;
    background: var(--accent);
    color: var(--ink);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: 2px;
}

/* ---------- Empty states ---------- */
.lst-empty {
    border-top: 1px solid var(--rule-strong);
    border-bottom: 1px solid var(--rule-strong);
    padding: 22px 0;
    margin: 16px 0;
}
.lst-empty-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.lst-empty-body { color: var(--muted); font-size: 0.95rem; max-width: 60ch; }

/* ---------- Key / value rows ---------- */
.kv { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
.kv:last-child { border-bottom: 0; }
.kv-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.kv-val { min-width: 0; overflow-wrap: anywhere; }
.kv-val.stack a, .kv-val .stack a { display: block; }

/* ---------- Plain tables ---------- */
.ruled-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.ruled-table th, .ruled-table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.ruled-table thead th {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--ink);
    background: var(--page);
}

/* ---------- Leaflet ---------- */
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { border-radius: 2px; box-shadow: none; border: 1px solid var(--ink); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-bar, .leaflet-bar a { border-radius: 0 !important; }
.leaflet-tooltip.mosque-pin-tooltip {
    background: var(--primary);
    border: 0;
    border-radius: 0;
    color: #fff;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    padding: 3px 7px;
    box-shadow: none;
}
.leaflet-tooltip.mosque-pin-tooltip::before { display: none; }
.map-popup-name { font-weight: 700; font-size: 15px; color: var(--primary); margin-bottom: 4px; }
.map-popup-addr { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.map-popup-link { font-size: 13px; font-weight: 600; color: var(--accent-text); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--primary);
    color: var(--on-primary-muted);
    margin-top: 48px;
    font-size: 0.9rem;
}
.site-footer .footer-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 28px var(--gutter) 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
}
.site-footer .footer-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--on-primary); margin-bottom: 6px; }
.site-footer .footer-heading { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-primary-muted); margin-bottom: 8px; }
.site-footer .footer-links { list-style: none; margin: 0; padding: 0; }
.site-footer .footer-links li { padding: 3px 0; }
.site-footer a { color: var(--on-primary); text-decoration: underline; text-decoration-color: var(--primary-2); }
.site-footer a:hover { color: var(--on-primary); text-decoration-color: var(--on-primary); }
.site-footer .footer-app { margin-top: 10px; }
.site-footer .footer-copy {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 12px var(--gutter) 18px;
    border-top: 1px solid var(--primary-2);
    font-size: 0.8rem;
}
@media (max-width: 560px) {
    .site-footer .footer-inner { grid-template-columns: 1fr; gap: 18px; }
    .page-head h1 { font-size: 1.7rem; }
}

/* Picture band, as in the app: the scene for the next prayer. */
.dateline--hero {
    position: relative;
    background-color: var(--primary);
    background-size: cover;
    background-position: center 75%;
    border-bottom: 0;
    color: var(--on-primary);
}
.dateline--hero::before { content: ""; position: absolute; inset: 0; background: rgba(10, 36, 44, 0.55); }
.dateline--hero .wrap { position: relative; padding-top: 64px; padding-bottom: 22px; }
.dateline--hero .dl-tag,
.dateline--hero .dl-date,
.dateline--hero .dl-hijri { color: var(--on-primary); }
.dateline--hero .dl-sep { color: var(--on-primary-muted); }
.dateline--hero .dl-next { display: block; margin: 0 0 14px; color: var(--on-primary); }
.dateline--hero .dl-next-k { display: block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-primary-muted); }
.dateline--hero .dl-next strong.dl-next-name { display: block; font-family: var(--serif); font-size: 2.8rem; font-weight: 600; line-height: 1.1; color: var(--on-primary); margin: 4px 0 6px; }
.dateline--hero .dl-next-sub { display: block; color: var(--on-primary-muted); }
@media (max-width: 600px) {
    .dateline--hero .wrap { padding-top: 44px; }
    .dateline--hero .dl-next-name { font-size: 2.1rem; }
}

/* Masjid page: the app's masjid scene above the name. */
.mp-banner { height: 220px; background-color: var(--primary); background-size: cover; background-position: center 75%; margin: 0 calc(-1 * var(--gutter)); }
@media (min-width: 1072px) { .mp-banner { margin: 0; } }
@media (max-width: 600px) { .mp-banner { height: 140px; } }

/* ---------- Masjid logo beside a name ---------- */
.mlogo {
    display: block;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 0;
}
.mlogo.mlogo-sm { width: 24px; height: 24px; flex-basis: 24px; }
.with-logo { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.with-logo > .wl-text { flex: 1 1 auto; min-width: 0; }
.with-logo.wl-center { align-items: center; }

/* ---------- Jummah labels: 1st, 2nd, 3rd, or a single Jummah ---------- */
.jchip {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.02em;
    padding: 0 5px;
    border: 1px solid currentColor;
    border-radius: 2px;
    background: var(--surface);
    white-space: nowrap;
    vertical-align: 1px;
}
.jchip-1 { color: var(--primary); }
.jchip-2 { color: var(--accent-text); }
.jchip-3 { color: var(--primary-2); }
.jchip-one, .jchip-n { color: var(--muted); }
.jname { margin-left: 2px; }

/* Map popup: logo beside the name */
.map-popup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.map-popup-head .map-popup-name { margin-bottom: 0; min-width: 0; }

/* Sisters facilities: pink square label */
.sis-chip {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.45;
    padding: 0 6px;
    color: #9D174D;
    background: #FCE7F3;
    border: 1px solid #BE185D;
    border-radius: 2px;
}
.btn.facility-filter-btn.sis-filter { color: #9D174D; background: #FCE7F3; border-color: #BE185D; font-weight: 700; }
.btn.facility-filter-btn.sis-filter:hover { color: #9D174D; border-color: #BE185D; }
.btn.facility-filter-btn.sis-filter.active { background: #BE185D; border-color: #BE185D; color: #fff; }

/* Facilities as small square labels in a wrapping row */
.fac-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.fac-list > li { padding: 0; border: 0; min-width: 0; }
.fac-list > li.fac-wide { flex: 1 1 100%; overflow-wrap: anywhere; }
.fac-chip {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.45;
    padding: 1px 6px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: 2px;
}
.fac-chip.fac-access { color: #1E6C6E; background: #E4EEEE; border-color: #1E6C6E; }
.fac-chip.sis-chip { color: #9D174D; background: #FCE7F3; border-color: #BE185D; }
