/* Rustic theme — a parchment notice board framed on walnut. 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 panels scroll internally), and type
   scales with viewport height. Below 992px it's a stacked, scrolling page. */

html, body {
    margin: 0;
    padding: 0;
    background: var(--rs-wood, #2e2117);
    color: var(--rs-ink, #2b1f17);
    font-family: 'Josefin Sans', 'Helvetica Neue', Arial, sans-serif;
}
body {
    background-image: url("assets/woodgrain.svg"), linear-gradient(180deg, var(--rs-wood-2, #3b2b1e), var(--rs-wood, #2e2117));
    background-size: 120px 120px, auto;
    background-repeat: repeat, no-repeat;
    background-attachment: fixed, fixed;
}
a:link, a:visited, a:hover, a:active { color: var(--rs-terracotta, #b5532e); text-decoration: none; }

/* ---------- Nav (shared markup from navigation.php) ---------- */
#nav ul { list-style: none; margin: 0; padding: 0; overflow: hidden; background: rgba(0, 0, 0, .35); border-bottom: 1px solid rgba(201, 154, 58, .35); }
#nav li { float: right; }
/* One shared line-height, no vertical padding: name cell and links are the
   same height, so the active background spans the whole bar. */
#nav li a { display: block; color: var(--rs-paper, #f3e9d6); text-align: center; padding: 0 14px; line-height: 48px; text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
#nav li a:hover:not(.active) { background: rgba(255, 255, 255, .06); }
#nav li span { display: block; color: var(--rs-gold, #c99a3a); text-align: center; padding: 0 20px; line-height: 48px; }
#nav .active { background: var(--rs-terracotta, #b5532e); }
#nav .active a { color: var(--rs-paper, #f3e9d6); }
#nav #nav_name { font-family: 'Lora', Georgia, serif; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 19px; line-height: 48px; text-align: left; }
#nav #myname { width: 500px; float: left; margin: 0 0 0 20px; }
#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: var(--rs-gold, #c99a3a); 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; }
}

/* ---------- Footer (shared markup from footer.php) — static, never fixed ---------- */
footer.footer {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    color: rgba(243, 233, 214, .65);
    font-size: 13px;
    background: rgba(0, 0, 0, .35);
    border-top: 1px solid rgba(201, 154, 58, .35);
    padding: 12px 16px;
    text-align: center;
}
footer.footer a { color: var(--rs-gold, #c99a3a); }
.mb-switchers { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 12px; line-height: 0; }
.mb-switchers a { color: inherit; opacity: .5; }
.mb-switchers a:hover { opacity: 1; }
.mb-switchers svg { width: 18px; height: 18px; display: block; fill: currentColor; }
/* Skins can recolour the terracotta rule SVG (loaded as <img>) via a filter. */
.rs-rule { filter: var(--rs-ornament-filter, none); }
@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 (framed parchment) ---------- */
.rs-wrap { padding: clamp(10px, 1.6vh, 26px) clamp(12px, 1.8vw, 36px); box-sizing: border-box; }
.rs-board {
    max-width: 1900px;
    margin: 0 auto;
    background: var(--rs-paper, #f3e9d6);
    color: var(--rs-ink, #2b1f17);
    border: 3px double var(--rs-gold, #c99a3a);
    outline: 10px solid var(--rs-paper-2, #e9dcc3);
    outline-offset: 0;
    box-shadow: 0 0 0 12px var(--rs-wood-2, #3b2b1e), 0 24px 50px var(--rs-shadow, rgba(0, 0, 0, .35));
    padding: clamp(10px, 1.8vh, 28px) clamp(14px, 2vw, 40px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 18px);
}
.rs-hidden { display: none; }
.rs-rule { display: block; width: 100%; height: clamp(10px, 1.6vh, 20px); opacity: .9; }

/* Header */
.rs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.rs-masjid-name {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 3.4vh, 3rem);
    line-height: 1.05;
    color: var(--rs-terracotta, #b5532e);
}
.rs-masjid-area { text-transform: uppercase; letter-spacing: .16em; font-size: clamp(.7rem, 1.4vh, 1rem); color: var(--rs-muted, #7a6a5a); margin-top: 4px; }
.rs-dates { text-align: right; font-size: clamp(.85rem, 1.8vh, 1.3rem); }
.rs-date-hijri { color: var(--rs-muted, #7a6a5a); font-style: italic; font-family: 'Lora', Georgia, serif; }

/* Main: clock + sun times | salaah list */
.rs-main { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(14px, 2.4vw, 50px); align-items: start; }
.rs-clock {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: clamp(2.4rem, 8.5vh, 7rem);
    line-height: 1;
    letter-spacing: -.01em;
}
.rs-next { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3em .7em; margin-top: clamp(6px, 1.2vh, 14px); font-size: clamp(.95rem, 2.2vh, 1.7rem); }
.rs-next-label { text-transform: uppercase; letter-spacing: .16em; font-size: .6em; font-weight: 600; color: var(--rs-muted, #7a6a5a); }
.rs-next-name { font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 1.4em; color: var(--rs-terracotta, #b5532e); }
.rs-next-name small { font-family: 'Josefin Sans', sans-serif; font-size: .5em; font-weight: 400; color: var(--rs-muted, #7a6a5a); }
.rs-next-count { font-family: 'Lora', Georgia, serif; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.25em; color: var(--rs-olive, #6b7a3a); }
.rs-next-meta { font-size: .7em; color: var(--rs-muted, #7a6a5a); }

.rs-sun { list-style: none; margin: clamp(10px, 2vh, 24px) 0 0; padding: 0; font-size: clamp(.85rem, 1.9vh, 1.4rem); }
.rs-sun li { display: flex; align-items: baseline; gap: .5em; padding: clamp(2px, .5vh, 6px) 0; }
.rs-sun li span { color: var(--rs-muted, #7a6a5a); }
.rs-sun li i { flex: 1; border-bottom: 2px dotted var(--rs-line, rgba(43, 31, 23, .22)); transform: translateY(-.25em); }
.rs-sun li b { font-family: 'Lora', Georgia, serif; font-variant-numeric: tabular-nums; }

/* Shared column width for the list header and rows, so labels line up over
   the numbers regardless of the two very different font sizes. */
.rs-list { --rs-col: clamp(5rem, 10vh, 8.5rem); }
.rs-list-head {
    display: grid;
    grid-template-columns: 1fr var(--rs-col) var(--rs-col);
    gap: .6em;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: clamp(.6rem, 1.3vh, .9rem);
    font-weight: 600;
    color: var(--rs-muted, #7a6a5a);
    padding: 0 0 4px;
    border-bottom: 1px solid var(--rs-line, rgba(43, 31, 23, .22));
    text-align: right;
}
.rs-list-head span:first-child { text-align: left; }
.rs-row {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr var(--rs-col) var(--rs-col);
    align-items: baseline;
    gap: .6em;
    padding: clamp(6px, 1.5vh, 20px) 0;
    border-bottom: 1px solid var(--rs-line, rgba(43, 31, 23, .22));
    font-size: clamp(1.1rem, 3vh, 2.6rem);
}
.rs-row-name { font-family: 'Lora', Georgia, serif; font-weight: 700; }
.rs-leader { border-bottom: 2px dotted var(--rs-line, rgba(43, 31, 23, .22)); transform: translateY(-.28em); }
.rs-row-adhan, .rs-row-salaah { font-family: 'Lora', Georgia, serif; font-variant-numeric: tabular-nums; text-align: right; }
.rs-row-adhan { font-weight: 700; }
.rs-row-salaah { color: var(--rs-olive, #6b7a3a); font-weight: 700; }
.rs-row-jumuah { border-bottom: 0; }
.rs-row-jumuah .rs-row-name, .rs-row-jumuah .rs-row-adhan { color: var(--rs-muted, #7a6a5a); }

/* Next salaah (script.js) */
.rs-row.is-next .rs-row-name, .rs-row.is-next .rs-row-adhan { color: var(--rs-terracotta, #b5532e); }
.rs-row.is-next .rs-leader { border-color: var(--rs-terracotta, #b5532e); }

/* Current salaah — js/livetime.js puts .vibrate-1 on the .azan-checker's
   parent (this row): a rubber-stamp "NOW". */
.rs-row.vibrate-1 .rs-row-name::after {
    content: "NOW";
    display: inline-block;
    margin-left: .6em;
    padding: .05em .45em;
    border: 2px solid var(--rs-terracotta, #b5532e);
    border-radius: 4px;
    color: var(--rs-terracotta, #b5532e);
    font-family: 'Josefin Sans', sans-serif;
    font-size: .45em;
    font-weight: 600;
    letter-spacing: .18em;
    transform: rotate(-6deg) translateY(-.35em);
    opacity: .85;
}

/* Bottom panels */
.rs-bottom { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(12px, 2vw, 40px); }
/* A masjid can turn off either panel (admin/settings.php) -- fill the row
   with whichever one is left rather than leaving an empty column. */
.rs-bottom:has(> :only-child) { grid-template-columns: 1fr; }
.rs-panel { min-height: 0; }
.rs-panel-title {
    margin: 0 0 clamp(4px, .8vh, 10px);
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1rem, 2.3vh, 1.7rem);
    color: var(--rs-terracotta, #b5532e);
    border-bottom: 1px solid var(--rs-line, rgba(43, 31, 23, .22));
    padding-bottom: 4px;
}
.rs-table { width: 100%; border-collapse: collapse; font-size: clamp(.8rem, 1.7vh, 1.2rem); }
.rs-table th, .rs-table td { padding: clamp(2px, .6vh, 8px) 6px; text-align: center; }
.rs-table thead th { font-size: .75em; text-transform: uppercase; letter-spacing: .1em; color: var(--rs-muted, #7a6a5a); font-weight: 600; }
.rs-table tbody th { text-align: left; font-family: 'Lora', Georgia, serif; font-weight: 700; }
.rs-table tbody td { font-family: 'Lora', Georgia, serif; font-variant-numeric: tabular-nums; }
.rs-table tbody tr + tr { border-top: 1px dotted var(--rs-line, rgba(43, 31, 23, .22)); }
.rs-empty { margin: 0; color: var(--rs-muted, #7a6a5a); font-size: clamp(.8rem, 1.6vh, 1.1rem); }

/* Shared includes inside the panels */
.rs-changes #notice-container { margin-top: clamp(6px, 1vh, 12px); }
.rs-changes .snotice {
    margin: 0;
    padding: 6px 10px;
    border-left: 3px solid var(--rs-olive, #6b7a3a);
    background: var(--rs-paper-2, #e9dcc3);
    border-radius: 3px;
    font-family: inherit;
    font-weight: 400;
    text-transform: none;
    line-height: 1.4;
    font-size: clamp(.75rem, 1.5vh, 1.05rem);
    text-align: left;
    color: var(--rs-ink, #2b1f17);
}
.rs-notices #notice-container { display: none; }
.rs-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(--rs-paper-2, #e9dcc3);
    border: 0;
    border-left: 3px solid var(--rs-terracotta, #b5532e);
    border-radius: 3px;
    box-shadow: none;
    text-align: left;
    color: var(--rs-ink, #2b1f17);
}
.rs-notices .card-header { margin: 0 0 4px; font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: clamp(.95rem, 2vh, 1.5rem); }
.rs-notices .card-text { margin: 0; font-size: clamp(.8rem, 1.6vh, 1.15rem); line-height: 1.45; }

/* ---------- 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; }
    .rs-wrap { flex: 1 1 auto; min-height: 0; display: flex; }
    .rs-board { flex: 1 1 auto; min-height: 0; width: 100%; }
    .rs-head, .rs-rule, .rs-main { flex: 0 0 auto; }
    .rs-bottom { flex: 1 1 auto; min-height: 0; }
    .rs-panel { overflow-y: auto; }
}

/* ---------- Mobile / tablet: stacked, scrolling ---------- */
@media (max-width: 991px) {
    .rs-board { outline-width: 6px; box-shadow: 0 0 0 8px var(--rs-wood-2, #3b2b1e); }
    .rs-head { flex-direction: column; align-items: center; text-align: center; }
    .rs-dates { text-align: center; }
    .rs-main { grid-template-columns: 1fr; }
    .rs-clockbox { text-align: center; }
    .rs-clock { font-size: clamp(2.2rem, 10.5vw, 4.5rem); }
    .rs-next { justify-content: center; }
    .rs-list { --rs-col: 4.6rem; }
    .rs-row { font-size: clamp(1.1rem, 5.5vw, 1.8rem); }
    .rs-bottom { grid-template-columns: 1fr; }
}
