/* Kufic theme — fully self-contained (the only stylesheet loaded for this
   theme), so it also carries the shared nav/footer chrome and the classes
   used by includes/notifications.php, includes/zuhrchangebanner.php and
   includes/salaahtimechanges.php's markup is NOT used here -- this theme's
   "Upcoming changes" panel is bespoke (like Zellij/Contemporary/Geometric),
   redrawn by script.js on a screen-mode day rollover. Palette comes from
   skins/*.css custom properties (fallbacks inline default to indigo-gold).

   Design language: square Kufic calligraphy is built entirely from
   horizontal and vertical strokes -- no curves, no diagonals. Every card,
   panel and pill in this theme is cut with a right-angle staircase notch
   (--kf-clip) instead of a rounded corner or the diagonal chamfer the
   Geometric theme already uses, and headings/labels are set in Reem Kufi,
   a Latin display face explicitly modelled on Kufic letterforms. Times
   themselves stay in a plain tabular-numeral sans (Inter) -- legibility of
   the actual prayer times is the board's one non-negotiable job.

   Layout contract: at 992px+ the board fills the viewport exactly with no
   page scroll (only the Notices/Changes panels scroll internally if they
   must), and type scales with viewport height so a TV renders larger than
   a laptop. Below 992px it's a normal stacked, scrolling page. */

:root {
    /* Two-step right-angle staircase notch, top-left + bottom-right. */
    --kf-notch: 16px;
    --kf-clip: polygon(
        0 calc(var(--kf-notch) * 2), var(--kf-notch) calc(var(--kf-notch) * 2), var(--kf-notch) var(--kf-notch), calc(var(--kf-notch) * 2) var(--kf-notch), calc(var(--kf-notch) * 2) 0,
        100% 0,
        100% calc(100% - var(--kf-notch) * 2), calc(100% - var(--kf-notch)) calc(100% - var(--kf-notch) * 2), calc(100% - var(--kf-notch)) calc(100% - var(--kf-notch)), calc(100% - var(--kf-notch) * 2) calc(100% - var(--kf-notch)), calc(100% - var(--kf-notch) * 2) 100%,
        0 100%
    );
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--kf-bg, #141a33);
    color: var(--kf-ink, #eef1fb);
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}
a:link, a:visited, a:hover, a:active {
    color: var(--kf-accent, #d4af37);
    text-decoration: none;
}

/* ---------- Nav (shared markup from navigation.php) ---------- */
#nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--kf-nav, #0d1226);
}
#nav li { float: right; }
#nav li a {
    display: block;
    color: var(--kf-ink, #eef1fb);
    text-align: center;
    padding: 0 14px;
    line-height: 48px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .03em;
}
#nav li a:hover:not(.active) { background-color: var(--kf-surface, #1e2748); }
#nav li span { display: block; color: var(--kf-ink, #eef1fb); text-align: center; padding: 0 20px; line-height: 48px; }
#nav .active { background-color: var(--kf-accent, #d4af37); }
#nav .active a { color: var(--kf-accent-ink, #14162a); }
#nav #nav_name {
    font-family: 'Reem Kufi', 'Inter', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: 19px;
    line-height: 48px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#nav #myname { width: 500px; float: left; margin: 0 0 0 20px; overflow: hidden; }

#toggle { display: none; width: 28px; height: 0; margin: 10px auto; }
#toggle span:after, #toggle span:before { content: ""; position: absolute; left: 0; top: -9px; }
#toggle span:after { top: 9px; }
#toggle span { position: relative; display: block; }
#toggle span, #toggle span:after, #toggle span:before {
    width: 100%;
    height: 3px;
    background-color: var(--kf-accent, #d4af37);
    transition: all .3s;
    backface-visibility: hidden;
}
#toggle.on span { background-color: transparent; }
#toggle.on span:before { transform: rotate(45deg) translate(5px, 5px); }
#toggle.on span:after { transform: rotate(-45deg) translate(7px, -8px); }
#toggle.on + #menu { opacity: 1; visibility: visible; }
.show-menu { text-decoration: none; text-align: center; padding: 10px 0; display: none; }
input[type=checkbox] { display: none; }
input[type=checkbox]:checked ~ #menu { display: block; }

@media screen and (max-width: 975px) {
    #nav ul { position: static; display: none; }
    #nav li { margin-bottom: 1px; }
    #nav ul li, #nav li a { width: 100%; }
    .show-menu { display: block; }
    #toggle { display: block; }
    #nav #myname { width: 100%; text-align: center; }
    #nav #nav_name { font-size: 16px; line-height: 36px; }
}

/* ---------- Footer (shared markup from footer.php) — static, never fixed ---------- */
footer.footer {
    width: 100%;
    box-sizing: border-box;
    color: var(--kf-muted, #8b93b8);
    font-size: 13px;
    background-color: var(--kf-nav, #0d1226);
    border-top: 2px solid var(--kf-accent, #d4af37);
    padding: 12px 16px;
    text-align: center;
    position: relative;
}
footer.footer a { color: var(--kf-accent, #d4af37); }
.mb-switchers { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 12px; line-height: 0; }
.mb-switchers a { color: inherit; opacity: .55; }
.mb-switchers a:hover { opacity: 1; }
.mb-switchers svg { width: 18px; height: 18px; display: block; fill: currentColor; }
@media screen and (max-width: 975px) {
    footer.footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; min-height: 44px; }
    footer.footer .mb-footer-info { display: none; }
}

/* ---------- Picture-frame border ----------
   A square-Kufic picture frame: a double ruled line that steps into a
   right-angle staircase at each corner -- the same staircase notch used
   on every card/panel below, drawn as a stroke instead of a clip-path.
   Default here is the indigo-gold skin's own file (assets/kufic-frame-
   indigo-gold.svg); each other skin overrides border-image-source with
   its own colour-matched file (skins/*.css). The accent colour has to be
   baked into each file rather than read via currentColor: an SVG
   referenced through url() in border-image-source is an opaque replaced
   image, not part of the document's CSS cascade, so currentColor inside
   it never picks up an element's `color` in any tested browser. */
.kf-frame {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: clamp(14px, 2.4vh, 32px) solid transparent;
    border-image-source: url("assets/kufic-frame-indigo-gold.svg");
    border-image-slice: 90;
    border-image-repeat: stretch;
}

/* ---------- Board ---------- */
.kf-board {
    max-width: 1900px;
    margin: 0 auto;
    width: 100%;
    /* Top padding trimmed well below the bottom: on a laptop-height
       viewport the header/hero/prayers stack left too little room for
       the Changes/Notices panels above the picture-frame border, so the
       saved space here goes toward .kf-bottom instead of being split
       evenly. */
    padding: clamp(2px, 0.6vh, 10px) clamp(10px, 1.6vw, 30px) clamp(8px, 1.4vh, 22px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(5px, 0.9vh, 16px);
    color: var(--kf-ink, #eef1fb);
}
.kf-hidden { display: none; }

/* Header: masjid | clock | dates */
.kf-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(8px, 1.5vw, 30px);
    background: var(--kf-surface, #1e2748);
    border: 1px solid var(--kf-line, rgba(212, 175, 55, .3));
    clip-path: var(--kf-clip);
    padding: clamp(6px, 1.1vh, 18px) clamp(16px, 2.2vw, 34px);
}
.kf-brand-name {
    font-family: 'Reem Kufi', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vh, 2.5rem);
    line-height: 1.1;
    letter-spacing: .01em;
}
.kf-brand-area {
    font-size: clamp(.8rem, 1.6vh, 1.15rem);
    color: var(--kf-muted, #8b93b8);
    margin-top: 2px;
}
.kf-clock {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-size: clamp(2rem, 5.8vh, 5rem);
    line-height: 1;
    letter-spacing: -.01em;
    text-align: center;
    color: var(--kf-accent, #d4af37);
}
.kf-dates { text-align: right; }
.kf-date { font-size: clamp(.85rem, 1.8vh, 1.3rem); font-weight: 600; }
.kf-date-hijri { color: var(--kf-muted, #8b93b8); font-weight: 400; }

/* Hero: next salaah countdown, segmented "brick" progress bar */
.kf-hero { text-align: center; }
.kf-hero-panel {
    display: inline-block;
    background: var(--kf-surface, #1e2748);
    border: 1px solid var(--kf-line, rgba(212, 175, 55, .3));
    clip-path: var(--kf-clip);
    padding: clamp(10px, 1.8vh, 22px) clamp(20px, 3vw, 50px);
    min-width: min(560px, 92%);
    box-sizing: border-box;
}
.kf-hero-label {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: clamp(.7rem, 1.3vh, 1rem);
    font-weight: 700;
    color: var(--kf-muted, #8b93b8);
}
.kf-hero-name {
    font-family: 'Reem Kufi', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 4.6vh, 3.6rem);
    color: var(--kf-accent, #d4af37);
    line-height: 1.15;
}
.kf-hero-name small { font-family: 'Inter', sans-serif; font-size: .4em; font-weight: 600; color: var(--kf-muted, #8b93b8); }
.kf-hero-count {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: clamp(1.8rem, 5.2vh, 4rem);
    margin-top: clamp(2px, .6vh, 8px);
}
.kf-hero-meta { font-size: clamp(.75rem, 1.5vh, 1.1rem); color: var(--kf-muted, #8b93b8); margin-top: 2px; }
.kf-segments {
    display: grid;
    grid-auto-flow: column;
    gap: 3px;
    margin-top: clamp(8px, 1.4vh, 16px);
}
.kf-segments i {
    display: block;
    height: clamp(6px, 1vh, 12px);
    background: var(--kf-line, rgba(212, 175, 55, .3));
}
.kf-segments i.on { background: var(--kf-accent, #d4af37); }

/* Prayer cards: equal columns for any count, staircase-notched */
.kf-prayers {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: clamp(8px, 1.2vw, 22px);
}
.kf-prayer {
    position: relative;
    background: var(--kf-surface, #1e2748);
    border: 1px solid var(--kf-line, rgba(212, 175, 55, .3));
    clip-path: var(--kf-clip);
    padding: clamp(12px, 2.6vh, 30px) clamp(8px, 1vw, 18px);
    text-align: center;
    transition: background-color .3s, color .3s, border-color .3s;
}
.kf-prayer-name {
    font-family: 'Reem Kufi', 'Inter', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: clamp(1.15rem, 3vh, 2.1rem);
    color: var(--kf-accent, #d4af37);
    margin-bottom: clamp(6px, 1.4vh, 16px);
}
.kf-prayer-adhan {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: clamp(1.7rem, 5.6vh, 5.1rem);
    line-height: 1.05;
}
.kf-prayer-salaah {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: clamp(1rem, 2.6vh, 2.2rem);
    color: var(--kf-muted, #8b93b8);
    margin-top: clamp(4px, 1vh, 12px);
}
.kf-prayer-salaah span:not([data-field]) {
    font-family: 'Inter', sans-serif;
    font-size: .5em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-right: .6em;
    vertical-align: middle;
}
.kf-prayer-jumuah .kf-prayer-adhan { color: var(--kf-muted, #8b93b8); }

/* Next salaah (set by script.js) */
.kf-prayer.is-next {
    background: var(--kf-accent, #d4af37);
    border-color: var(--kf-accent, #d4af37);
}
.kf-prayer.is-next .kf-prayer-name,
.kf-prayer.is-next .kf-prayer-adhan,
.kf-prayer.is-next .kf-prayer-salaah { color: var(--kf-accent-ink, #14162a); }

/* Current salaah — js/livetime.js puts .vibrate-1 on the .azan-checker's
   parent, i.e. this card. A square "Now" tag, no shake/animation. */
.kf-prayer.vibrate-1 { border-color: var(--kf-now, #c2572b); border-width: 2px; }
.kf-prayer.vibrate-1::after {
    content: "Now";
    position: absolute;
    top: 0;
    right: 0;
    background: var(--kf-now, #c2572b);
    color: #fff;
    font-size: clamp(.55rem, 1.1vh, .8rem);
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 3px 9px;
}

/* Info strip */
.kf-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(6px, 1vw, 16px);
}
.kf-pill {
    display: flex;
    align-items: baseline;
    gap: .5em;
    background: var(--kf-surface, #1e2748);
    border: 1px solid var(--kf-line, rgba(212, 175, 55, .3));
    padding: clamp(4px, .8vh, 10px) clamp(12px, 1.4vw, 24px);
}
.kf-pill-label {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: clamp(.7rem, 1.4vh, 1rem);
    font-weight: 600;
    color: var(--kf-muted, #8b93b8);
}
.kf-pill-value { font-size: clamp(.95rem, 2.1vh, 1.6rem); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--kf-accent, #d4af37); }

/* Bottom: changes | notices */
.kf-bottom {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(8px, 1.2vw, 22px);
}
/* A masjid can turn off either panel (admin/settings.php) -- fill the row
   with whichever one is left rather than leaving an empty column. */
.kf-bottom:has(> :only-child) { grid-template-columns: 1fr; }
.kf-panel {
    background: var(--kf-surface, #1e2748);
    border: 1px solid var(--kf-line, rgba(212, 175, 55, .3));
    clip-path: var(--kf-clip);
    padding: clamp(8px, 1.4vh, 18px) clamp(12px, 1.6vw, 24px);
}
.kf-panel-title {
    margin: 0 0 clamp(4px, .8vh, 10px);
    font-family: 'Reem Kufi', 'Inter', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: clamp(1rem, 2.3vh, 1.6rem);
    color: var(--kf-accent, #d4af37);
    border-bottom: 2px solid var(--kf-line, rgba(212, 175, 55, .3));
    padding-bottom: 6px;
}
.kf-change-list { list-style: none; margin: 0; padding: 0; }
.kf-change-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: clamp(6px, 1.1vh, 12px) 0;
    border-bottom: 1px dashed var(--kf-line, rgba(212, 175, 55, .3));
    font-size: clamp(.85rem, 1.8vh, 1.25rem);
}
.kf-change-list li:last-child { border-bottom: 0; }
.kf-change-name { font-family: 'Reem Kufi', 'Inter', sans-serif; font-weight: 700; color: var(--kf-accent, #d4af37); }
.kf-change-date { color: var(--kf-muted, #8b93b8); font-size: .85em; }
.kf-change-times { font-variant-numeric: tabular-nums; font-weight: 700; }
.kf-empty { margin: 0; color: var(--kf-muted, #8b93b8); font-size: clamp(.8rem, 1.6vh, 1.1rem); }

/* Shared includes inside the panels */
.kf-notices #notice-container { display: none; }   /* panel supplies its own heading */
.kf-notices .float-box-fluid {
    display: block;
    max-width: none;
    margin: 0 0 clamp(6px, 1vh, 12px);
    padding: clamp(6px, 1vh, 12px) clamp(8px, 1vw, 16px);
    background: var(--kf-bg, #141a33);
    border: 0;
    border-left: 4px solid var(--kf-accent, #d4af37);
    text-align: left;
}
.kf-notices .card-header {
    margin: 0 0 4px;
    font-family: 'Reem Kufi', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(.95rem, 2vh, 1.5rem);
    color: var(--kf-accent, #d4af37);
}
.kf-notices .card-text { margin: 0; font-size: clamp(.8rem, 1.6vh, 1.15rem); line-height: 1.45; }
.kf-changes #notice-container { margin-top: clamp(6px, 1vh, 12px); }
.kf-changes .snotice {
    margin: 0;
    background: var(--kf-bg, #141a33);
    border-left: 4px solid var(--kf-now, #c2572b);
    padding: 6px 10px;
    font-family: inherit;
    font-weight: 600;
    text-transform: none;
    line-height: 1.35;
    font-size: clamp(.75rem, 1.5vh, 1.05rem);
    text-align: left;
}

/* ---------- Laptop / TV: fill the viewport, no page scroll ---------- */
@media (min-width: 992px) {
    html, body { height: 100%; overflow: hidden; }
    body { display: flex; flex-direction: column; }
    #nav, footer.footer { flex: 0 0 auto; }
    .kf-top, .kf-hero, .kf-prayers, .kf-strip { flex: 0 0 auto; }
    .kf-bottom { flex: 1 1 auto; min-height: 0; }
    .kf-panel { min-height: 0; overflow-y: auto; }
}

/* ---------- Mobile / tablet: stacked, scrolling ---------- */
@media (max-width: 991px) {
    .kf-top { grid-template-columns: 1fr; text-align: center; }
    .kf-dates { text-align: center; }
    .kf-clock { font-size: clamp(2.6rem, 13vw, 4.4rem); }
    .kf-hero-panel { min-width: 0; width: 100%; }
    .kf-prayers { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kf-prayer-name { font-size: clamp(1.1rem, 5.5vw, 1.7rem); }
    .kf-prayer-adhan { font-size: clamp(1.6rem, 8vw, 2.6rem); }
    .kf-prayer-salaah { font-size: clamp(1rem, 4.8vw, 1.4rem); }
    .kf-bottom { grid-template-columns: 1fr; }
}
