/* Contemporary theme — light bento grid, soft indigo accent. 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 and includes/zuhrchangebanner.php.

   Layout contract: at 992px+ the board fills the viewport exactly with no
   page scroll (only the two bottom tiles scroll internally), and type
   scales with viewport height. Below 992px it's a stacked, scrolling page. */

html, body {
    margin: 0;
    padding: 0;
    background: var(--ct-bg, #f3f4f8);
    color: var(--ct-ink, #14161f);
    font-family: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a:link, a:visited, a:hover, a:active { color: var(--ct-accent, #5b5bd6); text-decoration: none; }

/* ---------- Nav (shared markup from navigation.php) ---------- */
#nav ul { list-style: none; margin: 0; padding: 0; overflow: hidden; background: var(--ct-card, #fff); border-bottom: 1px solid var(--ct-line, #e4e6ee); }
#nav li { float: right; }
/* 48px bar: links are 40px pills with 4px margin; name cell is the full 48px. */
#nav li a { display: block; color: var(--ct-muted, #6f7486); text-align: center; padding: 0 14px; line-height: 40px; margin: 4px; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 700; }
#nav li a:hover:not(.active) { color: var(--ct-ink, #14161f); background: var(--ct-bg, #f3f4f8); }
#nav li span { display: block; text-align: center; padding: 0 20px; line-height: 48px; }
#nav .active { background: transparent; }
#nav .active a { background: var(--ct-accent-soft, #e9e9fb); color: var(--ct-accent-deep, #4747b8); }
#nav #nav_name { font-weight: 800; text-transform: none; letter-spacing: -.01em; font-size: 17px; line-height: 48px; color: var(--ct-ink, #14161f); text-align: left; }
#nav #myname { width: 500px; float: left; margin: 0 0 0 20px; }
#toggle { display: none; width: 26px; height: 0; margin: 10px auto; }
#toggle span:after, #toggle span:before { content: ""; position: absolute; left: 0; top: -8px; }
#toggle span:after { top: 8px; }
#toggle span { position: relative; display: block; }
#toggle span, #toggle span:after, #toggle span:before { width: 100%; height: 2px; background: var(--ct-ink, #14161f); transition: all .3s; backface-visibility: hidden; border-radius: 2px; }
#toggle.on span { background: 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: 15px; line-height: 36px; text-align: center; }
    #nav li a { border-radius: 0; margin: 0; }
}

/* ---------- Footer (shared markup from footer.php) — static, never fixed ---------- */
footer.footer {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    color: var(--ct-muted, #6f7486);
    font-size: 12px;
    background: var(--ct-card, #fff);
    border-top: 1px solid var(--ct-line, #e4e6ee);
    padding: 10px 16px;
    text-align: center;
}
footer.footer a { color: var(--ct-muted, #6f7486); }
footer.footer a:hover { color: var(--ct-accent, #5b5bd6); }
.mb-switchers { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 12px; line-height: 0; }
.mb-switchers a { color: inherit; opacity: .45; }
.mb-switchers a:hover { opacity: 1; color: var(--ct-accent, #5b5bd6); }
.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; }
}

/* ---------- Board ---------- */
.ct-board {
    max-width: 1900px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(10px, 1.6vh, 26px) clamp(12px, 1.8vw, 36px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.4vh, 22px);
}
.ct-hidden { display: none; }

.ct-tile {
    background: var(--ct-card, #fff);
    border: 1px solid var(--ct-line, #e4e6ee);
    border-radius: clamp(14px, 2vh, 26px);
    padding: clamp(10px, 1.8vh, 24px) clamp(12px, 1.6vw, 28px);
    box-shadow: 0 10px 30px var(--ct-shadow, rgba(20, 22, 31, .07));
    box-sizing: border-box;
    min-width: 0;
}
.ct-tile-label {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: clamp(.6rem, 1.3vh, .9rem);
    font-weight: 800;
    color: var(--ct-muted, #6f7486);
    margin-bottom: clamp(4px, .8vh, 10px);
}

/* Top line */
.ct-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ct-brand { font-size: clamp(.95rem, 2vh, 1.5rem); }
.ct-brand strong { font-weight: 800; }
.ct-brand span { color: var(--ct-muted, #6f7486); margin-left: .6em; font-weight: 500; }
.ct-dates { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-chip {
    display: inline-block;
    padding: .35em .9em;
    border-radius: 999px;
    background: var(--ct-card, #fff);
    border: 1px solid var(--ct-line, #e4e6ee);
    font-size: clamp(.75rem, 1.5vh, 1.05rem);
    font-weight: 700;
}
.ct-chip-soft { background: var(--ct-accent-soft, #e9e9fb); border-color: transparent; color: var(--ct-accent-deep, #4747b8); }

/* Bento row: clock (2) | next ring (1) | today (1) */
.ct-bento { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: clamp(8px, 1.2vw, 22px); align-items: stretch; }
.ct-tile-clock { display: flex; flex-direction: column; justify-content: center; }
.ct-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: clamp(2.6rem, 11vh, 9rem);
    line-height: .95;
    letter-spacing: -.04em;
}
.ct-tile-next { display: flex; flex-direction: column; align-items: stretch; }
.ct-ring-wrap { position: relative; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: clamp(120px, 20vh, 260px); }
.ct-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ct-ring-track { fill: none; stroke: var(--ct-accent-soft, #e9e9fb); stroke-width: 9; }
.ct-ring-bar { fill: none; stroke: var(--ct-accent, #5b5bd6); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ct-ring-text { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 0 14%; }
.ct-ring-name { font-weight: 800; font-size: clamp(1rem, 2.6vh, 2rem); color: var(--ct-accent-deep, #4747b8); }
.ct-ring-name small { display: block; font-size: .55em; font-weight: 700; color: var(--ct-muted, #6f7486); }
.ct-ring-count { font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(1.1rem, 3vh, 2.4rem); letter-spacing: -.02em; }
.ct-ring-meta { font-size: clamp(.65rem, 1.3vh, .95rem); color: var(--ct-muted, #6f7486); font-weight: 600; }

.ct-info { list-style: none; margin: 0; padding: 0; font-size: clamp(.85rem, 1.9vh, 1.4rem); }
.ct-info li { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; padding: clamp(3px, .7vh, 9px) 0; border-top: 1px solid var(--ct-line, #e4e6ee); }
.ct-info li:first-child { border-top: 0; }
.ct-info li span { color: var(--ct-muted, #6f7486); font-weight: 600; }
.ct-info li b { font-variant-numeric: tabular-nums; font-weight: 800; }

/* Prayer tiles */
.ct-prayers { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(8px, 1.2vw, 22px); }
.ct-prayer { position: relative; text-align: center; transition: background-color .3s, color .3s, transform .3s; }
.ct-prayer-name span {
    display: inline-block;
    padding: .3em .9em;
    border-radius: 999px;
    background: var(--ct-bg, #f3f4f8);
    font-weight: 800;
    font-size: clamp(1.15rem, 3vh, 2.1rem);
    letter-spacing: .02em;
}
.ct-prayer-adhan {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: clamp(1.7rem, 5.6vh, 5rem);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin: clamp(6px, 1.2vh, 14px) 0 clamp(2px, .6vh, 8px);
}
.ct-prayer-salaah { font-variant-numeric: tabular-nums; font-weight: 700; font-size: clamp(1rem, 2.6vh, 2.2rem); color: var(--ct-muted, #6f7486); }
.ct-prayer-salaah em { font-style: normal; font-size: .55em; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin-right: .6em; vertical-align: middle; }
.ct-prayer-jumuah .ct-prayer-adhan { color: var(--ct-muted, #6f7486); }

/* Next salaah (script.js): filled indigo tile */
.ct-prayer.is-next { background: var(--ct-accent, #5b5bd6); border-color: var(--ct-accent, #5b5bd6); color: #fff; }
.ct-prayer.is-next .ct-prayer-name span { background: rgba(255, 255, 255, .18); color: #fff; }
.ct-prayer.is-next .ct-prayer-salaah { color: rgba(255, 255, 255, .85); }

/* Current salaah — js/livetime.js puts .vibrate-1 on the .azan-checker's
   parent (this tile): coral "Now" chip in the corner. */
.ct-prayer.vibrate-1::after {
    content: "Now";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: .25em .7em;
    border-radius: 999px;
    background: var(--ct-now, #e2634a);
    color: #fff;
    font-size: clamp(.6rem, 1.2vh, .85rem);
    font-weight: 800;
    letter-spacing: .06em;
}

/* Bottom tiles */
.ct-bottom { display: grid; grid-template-columns: 1fr 1.3fr; 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. */
.ct-bottom:has(> :only-child) { grid-template-columns: 1fr; }
.ct-change-list { list-style: none; margin: 0; padding: 0; }
.ct-change-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.2em;
    align-items: baseline;
    padding: clamp(4px, .9vh, 10px) 0;
    border-top: 1px solid var(--ct-line, #e4e6ee);
    font-size: clamp(.85rem, 1.8vh, 1.3rem);
}
.ct-change-list li:first-child { border-top: 0; }
.ct-change-name { font-weight: 800; }
.ct-change-date { color: var(--ct-muted, #6f7486); font-weight: 600; }
.ct-change-times { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ct-accent-deep, #4747b8); }
.ct-change-times i { font-style: normal; color: var(--ct-muted, #6f7486); }
.ct-empty { margin: 0; color: var(--ct-muted, #6f7486); font-size: clamp(.8rem, 1.6vh, 1.1rem); font-weight: 600; }

/* Shared includes inside the tiles */
.ct-changes #notice-container { margin-top: clamp(8px, 1.2vh, 14px); }
.ct-changes .snotice {
    margin: 0;
    padding: 8px 12px;
    background: var(--ct-now-soft, #fdeae5);
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    text-transform: none;
    line-height: 1.4;
    font-size: clamp(.75rem, 1.5vh, 1.05rem);
    text-align: left;
    color: var(--ct-ink, #14161f);
}
.ct-notices #notice-container { display: none; }
.ct-notices .float-box-fluid {
    display: block;
    max-width: none;
    margin: 0 0 clamp(6px, 1vh, 12px);
    padding: clamp(8px, 1.2vh, 14px) clamp(10px, 1vw, 16px);
    background: var(--ct-accent-soft, #e9e9fb);
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    text-align: left;
    color: var(--ct-ink, #14161f);
}
.ct-notices .card-header { margin: 0 0 4px; font-weight: 800; font-size: clamp(.95rem, 2vh, 1.5rem); color: var(--ct-accent-deep, #4747b8); }
.ct-notices .card-text { margin: 0; font-size: clamp(.8rem, 1.6vh, 1.15rem); line-height: 1.5; font-weight: 500; }

/* ---------- 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; }
    .ct-board { flex: 1 1 auto; min-height: 0; }
    .ct-top, .ct-bento, .ct-prayers { flex: 0 0 auto; }
    .ct-bottom { flex: 1 1 auto; min-height: 0; }
    .ct-bottom .ct-tile { min-height: 0; overflow-y: auto; }
}

/* ---------- Mobile / tablet: stacked, scrolling ---------- */
@media (max-width: 991px) {
    .ct-top { justify-content: center; text-align: center; }
    .ct-dates { justify-content: center; }
    .ct-bento { grid-template-columns: 1fr; }
    .ct-tile-clock { text-align: center; }
    .ct-clock { font-size: clamp(2.6rem, 15vw, 5rem); }
    .ct-ring-wrap { min-height: 220px; }
    .ct-prayers { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ct-prayer-name span { font-size: clamp(1.1rem, 5.5vw, 1.7rem); }
    .ct-prayer-adhan { font-size: clamp(1.6rem, 8vw, 2.6rem); }
    .ct-prayer-salaah { font-size: clamp(.95rem, 4.5vw, 1.4rem); }
    .ct-bottom { grid-template-columns: 1fr; }
}
