/* The week ahead (js/pages/home.js fills it, js/home-week.js lights it).
 *
 * The story above ends at night, and this chapter keeps that night: the same
 * forest ink the story's ground settles into, so there is no seam. Seven
 * lanterns hang on a gold garland, one for each of the next seven days, with
 * the Gregorian and Hijri date and how many weekly programs meet that day
 * (a day links to them); as the garland rises into view they light one after
 * another, today first. Under them, what's coming up (each date in a lit
 * arched window, like the masjid's windows at night) and the newest stories on
 * a night page ruled twice in gold, like a manuscript. The section's foot is
 * the same ink as the Houses of Allah wall below, so the wall rises out of the
 * night. Nothing is pinned: this is the calm stretch between two full-page
 * moments. Only transform and opacity move, and only with the scroll.
 */
:root {
    --wk-ink: #0b231f;
    --wk-cream: #fbf3e2;
    --wk-muted: rgba(251, 243, 226, .7);
    /* An eight-point star, and a pointed (mihrab) arch as a mask and as a gold double line. */
    --wk-star: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22%3E%3Cpath d=%22M10.00 0.50 L12.78 3.28 L16.72 3.28 L16.72 7.22 L19.50 10.00 L16.72 12.78 L16.72 16.72 L12.78 16.72 L10.00 19.50 L7.22 16.72 L3.28 16.72 L3.28 12.78 L0.50 10.00 L3.28 7.22 L3.28 3.28 L7.22 3.28Z%22 fill=%22black%22/%3E%3C/svg%3E");
    --wk-arch: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 115%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 115V50C0 24 22 9 50 0C78 9 100 24 100 50V115Z%22 fill=%22black%22/%3E%3C/svg%3E");
    --wk-arch-line: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 115%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M1 115V50C1 24.6 22.6 9.8 50 1.1C77.4 9.8 99 24.6 99 50V115%22 fill=%22none%22 stroke=%22%23e3a340%22 stroke-width=%221.6%22 vector-effect=%22non-scaling-stroke%22/%3E%3Cpath d=%22M5.5 115V51C5.5 27.5 25 13.4 50 5.6C75 13.4 94.5 27.5 94.5 51V115%22 fill=%22none%22 stroke=%22%23f6d690%22 stroke-opacity=%220.45%22 stroke-width=%220.8%22 vector-effect=%22non-scaling-stroke%22/%3E%3C/svg%3E");
    /* One swag of the garland: a gold cord sagging between two nails. */
    --wk-swag: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 20%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 1Q50 37 100 1%22 fill=%22none%22 stroke=%22%23e3a340%22 stroke-opacity=%220.6%22 stroke-width=%221.2%22 vector-effect=%22non-scaling-stroke%22/%3E%3C/svg%3E");
    /* The lantern (a small fanous), 24 x 48: its gilded frame, and its arched glass. */
    --wk-lamp-frame: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 48%22%3E%3Ccircle cx=%2212%22 cy=%223.4%22 r=%222.2%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.3%22/%3E%3Cpath d=%22M12 5.8C9.2 7.4 7.4 9.3 6.9 11.4H17.1C16.6 9.3 14.8 7.4 12 5.8Z%22/%3E%3Crect x=%225.4%22 y=%2211.4%22 width=%2213.2%22 height=%222.3%22 rx=%221.1%22/%3E%3Cpath d=%22M6.4 14H17.6L18.8 17.4V30.2L17.6 33.2H6.4L5.2 30.2V17.4Z%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.3%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M6.6 33.2H17.4L12 40.4Z%22/%3E%3Cpath d=%22M12 40V45.2%22 stroke=%22black%22 stroke-width=%221.2%22/%3E%3Ccircle cx=%2212%22 cy=%2246%22 r=%221%22/%3E%3C/svg%3E");
    --wk-lamp-glass: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 48%22%3E%3Cpath d=%22M7.4 31.8V19.6C7.4 17.3 9.6 16 12 15.4C14.4 16 16.6 17.3 16.6 19.6V31.8Z%22/%3E%3C/svg%3E");
}

.week { position: relative; overflow: clip; background: var(--wk-ink); color: var(--wk-cream); padding: 5.5rem 0 5rem; }
/* lamplight: a warm haze behind the garland, brighter as the lanterns come on */
.week::before { content: ''; position: absolute; left: 0; right: 0; top: 6%; height: 52%; pointer-events: none; opacity: var(--wk-haze, 1);
    background: radial-gradient(ellipse 50% 42% at 50% 46%, rgba(227, 163, 64, .07), rgba(227, 163, 64, 0) 72%); }
.week > .container { position: relative; }

/* ------------------------------------------------------------ the head -- */
/* the same rhythm as the arcade's head: a plain eyebrow, the title, one line */
.wk-head { text-align: center; max-width: 42rem; margin: 0 auto; }
.wk-head .eyebrow { color: #e3a340; }
.wk-head .eyebrow::before { display: none; }
.wk-head h2 { margin: .35rem 0 .5rem; font: 800 clamp(34px, 4.6vw, 64px)/1.02 var(--font-display); letter-spacing: -.035em; color: var(--wk-cream); text-wrap: balance; }
.wk-head p { margin: 0 auto; max-width: 34rem; color: var(--wk-muted); font-size: 1.02rem; line-height: 1.55; text-wrap: balance; }

/* --------------------------------------------------------- the garland -- */
.wk-garland { max-width: 1000px; margin: clamp(2.2rem, 4vw, 3rem) auto clamp(2.8rem, 5vw, 4.2rem); }
.wk-days { --sag: 26px; --lw: 28px; --lh: 56px; --maxlen: 34px; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wk-day { position: relative; --len: 14px; }
.wk-day:nth-child(2) { --len: 28px; } .wk-day:nth-child(3) { --len: 18px; } .wk-day:nth-child(4) { --len: 34px; }
.wk-day:nth-child(5) { --len: 12px; } .wk-day:nth-child(6) { --len: 26px; } .wk-day:nth-child(7) { --len: 20px; }
.wk-day::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--sag); background: var(--wk-swag) 0 0 / 100% 100% no-repeat; pointer-events: none; }
.wk-day a { position: relative; display: grid; justify-items: center; align-content: start; text-align: center; padding: calc(var(--sag) * .95) 2px 6px;
    color: var(--wk-cream); text-decoration: none; border-radius: 14px; }
.wk-day a:hover { color: var(--wk-cream); text-decoration: none; }
.wk-day a:focus-visible { outline: 2px solid #e3a340; outline-offset: 2px; }
/* every hang is as tall as the longest, so the dates below sit on one line whatever the thread */
.wk-hang { position: relative; display: block; width: var(--lw); height: calc(var(--maxlen) + var(--lh)); transform-origin: 50% 0; }
.wk-thread { position: absolute; left: 50%; top: 0; width: 1px; height: var(--len); margin-left: -.5px; background: rgba(227, 163, 64, .6); }
.wk-lamp { position: absolute; left: 0; top: var(--len); width: var(--lw); height: var(--lh); }
/* the glass: dark until lit; the lit glass fades in over it (opacity only) */
.wk-lamp::before, .wk-lamp i { content: ''; position: absolute; inset: 0; -webkit-mask: var(--wk-lamp-glass) center / 100% 100% no-repeat; mask: var(--wk-lamp-glass) center / 100% 100% no-repeat; }
.wk-lamp::before { background: rgba(251, 243, 226, .1); }
.wk-lamp i { background: radial-gradient(circle at 50% 58%, #fffbe9 0 18%, #ffd98a 45%, #f0a93e 100%); }
.wk-lamp::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #f8dc9c, #e3a340 55%, #b97a22);
    -webkit-mask: var(--wk-lamp-frame) center / 100% 100% no-repeat; mask: var(--wk-lamp-frame) center / 100% 100% no-repeat; }
.wk-glow { position: absolute; left: 50%; top: calc(var(--len) + var(--lh) * .52); width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 205, 120, .3), rgba(246, 180, 90, .08) 60%, rgba(246, 180, 90, 0)); }
.wk-dow { margin-top: 10px; font: 700 11px/1.2 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: #e3a340; white-space: nowrap; }
.is-today .wk-dow { color: #0b231f; background: #f6c46e; border-radius: 999px; padding: 3px 8px 2px; margin-top: 7px; letter-spacing: .1em; }
.wk-dnum { margin-top: 5px; font: 700 clamp(26px, 2.5vw, 36px)/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--wk-cream); transition: color .25s; }
.wk-hij { margin-top: 3px; font: 400 18px/1.35 var(--font-arabic); color: rgba(246, 196, 110, .95); }
.wk-count { display: grid; justify-items: center; margin-top: 4px; }
.wk-count b { font: 600 15px/1.2 var(--font-display); color: var(--wk-cream); font-variant-numeric: tabular-nums; }
.wk-jm { margin-top: 3px; font: 700 10px/1 var(--font-display); letter-spacing: .04em; color: #0b231f; background: rgba(246, 196, 110, .9); border-radius: 999px; padding: 3px 7px 2px; }
.wk-day a:hover .wk-dnum { color: #f6c46e; }
.is-quiet .wk-dnum, .is-quiet .wk-count b { color: rgba(251, 243, 226, .55); }
.wk-cap { margin: 1rem 0 0; text-align: center; font-size: 12.5px; color: rgba(251, 243, 226, .6); }
/* a lantern sways a little while the section is on screen (paused off screen) */
@keyframes wk-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.week.is-live .wk-hang { animation: wk-sway 5.5s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -.8s); }

/* ---------------------------------------------------- coming up + stories -- */
.wk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 4.5vw, 4.5rem); align-items: start; max-width: 1180px; margin: 0 auto; }
.wk-grid.no-events, .wk-grid.no-news { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
@media (min-width: 992px) { .wk-events { padding-top: 24px; } }   /* its heading level with the page's */
.wk-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.wk-sub h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 700 12px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: #e3a340; }
.wk-sub h3::before { content: ''; width: 10px; height: 10px; background: currentColor; -webkit-mask: var(--wk-star) center / contain no-repeat; mask: var(--wk-star) center / contain no-repeat; }
/* "see more" links read like the arcade's "Open the arcade" */
.wk-more { font: 600 14px var(--font-display); color: #f6c46e; text-decoration: none; white-space: nowrap; border-bottom: 2px solid rgba(246, 196, 110, .55); padding-bottom: 1px; }
.wk-more::after { content: '\2192'; display: inline-block; margin-left: .35rem; transition: transform .2s; }
.wk-more:hover { color: #fbeed6; text-decoration: none; }
.wk-more:hover::after { transform: translateX(3px); }

/* coming up: each date in a lit arched window */
.wk-list { list-style: none; margin: 0; padding: 0; }
.wk-list li + li { border-top: 1px solid rgba(251, 243, 226, .1); }
.wk-list li.wk-later, .wk-list li.wk-later + li { border-top: 0; }
.wk-later { display: flex; align-items: center; gap: 12px; padding: 14px 0 6px; font: 700 11px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: rgba(246, 196, 110, .75); }
.wk-later::after { content: ''; flex: 1; height: 1px; background: rgba(251, 243, 226, .12); }
.wk-ev { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 10px 14px 4px; margin: 0 -10px 0 -4px;
    color: var(--wk-cream); text-decoration: none; border-radius: 14px; transition: background-color .25s; }
.wk-ev:hover { color: var(--wk-cream); text-decoration: none; background: rgba(251, 243, 226, .045); }
.wk-ev:focus-visible { outline: 2px solid #e3a340; outline-offset: 2px; }
.wk-win { position: relative; display: block; width: 56px; height: 66px; }
.wk-win::before { content: ''; position: absolute; inset: -10px -14px; background: radial-gradient(closest-side, rgba(246, 196, 110, .16), rgba(246, 196, 110, 0)); pointer-events: none; }
.wk-win-in { position: absolute; inset: 0; display: grid; justify-items: center; align-content: end; padding-bottom: 9px; line-height: 1; color: #12362f;
    background: linear-gradient(180deg, #fff4d8 0%, #fbdea0 52%, #f1bd66 100%);
    -webkit-mask: var(--wk-arch) center / 100% 100% no-repeat; mask: var(--wk-arch) center / 100% 100% no-repeat; }
.wk-win-in b { font: 800 22px/1 var(--font-display); letter-spacing: -.02em; }
.wk-win-in small { margin-top: 3px; font: 700 9.5px var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: #7a4a12; }
.wk-win-in i { margin-top: 3px; font: normal 600 9px var(--font-body); color: rgba(18, 54, 47, .72); }
.wk-ev-main { min-width: 0; }
.wk-ev-main b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 600 16px/1.3 var(--font-display); letter-spacing: -.01em; }
.wk-ev-main small { display: block; margin-top: 4px; font-size: 13px; color: var(--wk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev-main small em { font-style: normal; color: #f6c46e; font-weight: 600; }
.wk-chev { color: rgba(251, 243, 226, .5); font-size: 14px; transition: transform .2s, color .2s; }
.wk-ev:hover .wk-chev { transform: translateX(3px); color: #f6c46e; }

/* stories: a night page ruled twice in gold, like a manuscript's frame */
.wk-page { position: relative; background: rgba(251, 243, 226, .035); color: var(--wk-cream); border-radius: 10px; padding: 24px 26px 12px; }
.wk-page::before, .wk-page::after { content: ''; position: absolute; pointer-events: none; }
.wk-page::before { inset: 0; border: 1px solid rgba(227, 163, 64, .45); border-radius: 10px; }
.wk-page::after { inset: 5px; border: 1px solid rgba(227, 163, 64, .18); border-radius: 6px; }
.wk-stories { position: relative; z-index: 1; }
.wk-lead { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; align-items: center; padding: 6px 0 16px; color: var(--wk-cream); text-decoration: none; }
.wk-lead:hover, .wk-row:hover { color: var(--wk-cream); text-decoration: none; }
.wk-cover { position: relative; display: block; overflow: hidden; background: #12362f; border-radius: 6px; aspect-ratio: 4 / 4.8; }
.wk-cover::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(227, 163, 64, .45); pointer-events: none; }
.wk-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; transition: transform .6s var(--ease-out, ease); }
.wk-lead:hover .wk-cover img { transform: scale(1.04); }
/* no picture: a gold eight-point star on forest */
.wk-ph { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, #1d4e42, #0b231f); }
.wk-ph::after { content: ''; position: absolute; left: 50%; top: 50%; width: 38%; aspect-ratio: 1; transform: translate(-50%, -50%); background: #e3a340; opacity: .85;
    -webkit-mask: var(--wk-star) center / contain no-repeat; mask: var(--wk-star) center / contain no-repeat; }
.wk-tag { font: 700 10px var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: #e3a340; }
.wk-lead h4 { margin: .35rem 0 .4rem; font: 700 clamp(18px, 1.6vw, 21px)/1.22 var(--font-display); letter-spacing: -.02em; color: var(--wk-cream); }
.wk-lead p { margin: 0 0 .5rem; font-size: 13.5px; line-height: 1.5; color: var(--wk-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wk-stories time { display: block; font-size: 12px; color: rgba(251, 243, 226, .55); }
.wk-row { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 13px 0; border-top: 1px solid rgba(251, 243, 226, .1); color: var(--wk-cream); text-decoration: none; }
.wk-bullet { width: 9px; height: 9px; margin-top: 2px; background: #e3a340; -webkit-mask: var(--wk-star) center / contain no-repeat; mask: var(--wk-star) center / contain no-repeat; }
.wk-row b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 600 15px/1.3 var(--font-display); }
.wk-row time { margin-top: 3px; }
.wk-lead:hover h4, .wk-row:hover b { text-decoration: underline; text-decoration-color: rgba(227, 163, 64, .7); text-underline-offset: 3px; }
.wk-lead:focus-visible, .wk-row:focus-visible { outline: 2px solid #e3a340; outline-offset: 3px; border-radius: 6px; }
.wk-empty { margin: .4rem 0 .8rem; color: var(--wk-muted); font-size: 14px; }
.week .skeleton { border-radius: 8px; opacity: .08; }

/* ------------------------------------------------ scroll-linked arrival -- */
/* js/home-week.js adds .wk-js and then drives these per frame; without it
   (no JS, reduced motion) everything is simply there and every lamp is lit. */
.wk-js .wk-lamp i, .wk-js .wk-glow { opacity: 0; will-change: opacity; }
.wk-js [data-rise] { opacity: 0; will-change: transform, opacity; }
.week:not(.wk-js) .is-quiet .wk-lamp i { opacity: .45; }
.week:not(.wk-js) .is-quiet .wk-glow { opacity: .2; }

/* --------------------------------------------------------------- phones -- */
@media (max-width: 991.98px) {
    .week { padding: 3.6rem 0 3.4rem; }
    .week > .container { padding-left: 16px; padding-right: 16px; }
    .wk-head h2 { font-size: clamp(28px, 8vw, 36px); }
    .wk-head p { font-size: .92rem; }
    .wk-garland { margin: 1.6rem -6px 2.4rem; }
    .wk-days { --sag: 12px; --lw: 16px; --lh: 32px; --maxlen: 20px; }
    .wk-day { --len: 8px; }
    .wk-day:nth-child(2) { --len: 16px; } .wk-day:nth-child(3) { --len: 10px; } .wk-day:nth-child(4) { --len: 20px; }
    .wk-day:nth-child(5) { --len: 6px; } .wk-day:nth-child(6) { --len: 14px; } .wk-day:nth-child(7) { --len: 11px; }
    .wk-day a { padding: calc(var(--sag) * .95) 0 4px; }
    .wk-glow { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
    .wk-dow { margin-top: 8px; font-size: 9.5px; letter-spacing: .1em; }
    .is-today .wk-dow { padding: 2px 5px 1px; margin-top: 6px; letter-spacing: .04em; }
    .wk-dnum { margin-top: 4px; font-size: 21px; }
    .wk-hij { font-size: 15px; }
    .wk-count b { font-size: 13.5px; }
    .wk-jm { font-size: 8.5px; padding: 2px 4px 1px; letter-spacing: 0; }
    .wk-cap { margin-top: .6rem; font-size: 11.5px; }
    .wk-grid, .wk-grid.no-events, .wk-grid.no-news { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; }
    .wk-ev { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; padding: 12px 8px 12px 2px; margin: 0 -8px 0 -2px; }
    .wk-win { width: 48px; height: 58px; }
    .wk-win-in { padding-bottom: 8px; }
    .wk-win-in b { font-size: 19px; }
    .wk-ev-main b { font-size: 15px; }
    .wk-ev-main small { font-size: 12.5px; }
    .wk-page { padding: 20px 18px 6px; }
    .wk-lead { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding-bottom: 14px; }
    .wk-lead h4 { font-size: 16.5px; }
    .wk-lead p { -webkit-line-clamp: 2; font-size: 12.5px; }
    .wk-row b { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) { .week .wk-hang { animation: none !important; } }
