/*
 * The Shepherd's Staff — layout only. Colours, fonts and buttons come from the
 * theme (WordPress global styles / preset variables), with neutral fallbacks.
 */
.sst {
	--sst-accent: var(--wp--preset--color--primary, var(--wp--preset--color--accent, var(--wp--preset--color--ti-accent, var(--wp--preset--color--contrast, var(--wp--preset--color--ti-fg, #2b2b2b)))));
	--sst-heading: var(--wp--preset--color--contrast, var(--wp--preset--color--foreground, inherit));
	--sst-surface: var(--wp--preset--color--base, var(--wp--preset--color--background, var(--wp--preset--color--ti-bg, #fff)));
	--sst-border: color-mix(in srgb, currentColor 16%, transparent);
	--sst-muted: color-mix(in srgb, currentColor 66%, transparent);
	--sst-soft: color-mix(in srgb, var(--sst-accent) 7%, transparent);
	--sst-gap: var(--wp--style--block-gap, 1.5rem);
	--sst-radius: 6px;
	container-type: inline-size;
	container-name: sst;
}
.sst *, .sst *::before, .sst *::after { box-sizing: border-box; }
.sst .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sst :focus-visible { outline: 2px solid var(--sst-accent); outline-offset: 2px; }
.sst img { max-width: 100%; height: auto; display: block; }
.sst-heading { margin: 0 0 1rem; }
.sst-muted { color: var(--sst-muted); }
.sst-eyebrow { margin: 0 0 .3rem; font-size: .76em; letter-spacing: .12em; text-transform: uppercase; color: var(--sst-accent); font-weight: 600; display: flex; align-items: center; gap: .4em; }
.sst-notice { padding: .9rem 1rem; border: 1px solid var(--sst-border); border-radius: var(--sst-radius); color: var(--sst-muted); margin: 0 0 1rem; }
.sst-notice--error { border-left: 3px solid var(--sst-accent); }
.sst-more { margin: 1rem 0 0; }
.sst-more a, .sst-link { color: var(--sst-accent); }
.sst-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .8rem 0 0; }
.sst-badge { display: inline-block; padding: .1em .55em; border-radius: 999px; font-size: .75em; font-weight: 600; background: var(--sst-soft); color: var(--sst-accent); border: 1px solid color-mix(in srgb, var(--sst-accent) 30%, transparent); vertical-align: middle; }
.sst-dot { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--sst-dot, currentColor); flex: none; }
.sst-plain { list-style: none; margin: 0; padding: 0; }
.sst-plain li { margin: .2rem 0; }
.sst .is-loading { opacity: .5; transition: opacity .15s; pointer-events: none; }
.sst-ref { white-space: nowrap; }

/* ---------- Calendar ---------- */
.sst-cal__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.sst-cal__title { margin: 0; font-size: 1.35em; min-width: 9ch; text-align: center; }
.sst-cal__nav { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border: 1px solid var(--sst-border); border-radius: 50%; text-decoration: none; color: inherit; font-size: 1.3em; line-height: 1; }
.sst-cal__nav:hover { border-color: var(--sst-accent); color: var(--sst-accent); }
.sst-cal__today { font-size: .85em; color: var(--sst-accent); }
.sst-cal__views { margin-left: auto; display: inline-flex; border: 1px solid var(--sst-border); border-radius: 999px; overflow: hidden; }
.sst-cal__views button { font: inherit; font-size: .85em; padding: .35em .9em; border: 0; background: transparent; color: inherit; cursor: pointer; }
.sst-cal__views button[aria-pressed="true"] { background: color-mix(in srgb, var(--sst-accent) 16%, transparent); font-weight: 700; }
.sst-cal__filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .9rem; }
.sst-chip { font: inherit; font-size: .82em; display: inline-flex; align-items: center; gap: .4em; padding: .3em .75em; border: 1px solid var(--sst-border); border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.sst-chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }

.sst-month { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 0; font-size: .86em; }
.sst-month th { padding: .4rem .25rem; font-weight: 600; text-align: center; color: var(--sst-muted); font-size: .85em; text-transform: uppercase; letter-spacing: .06em; border: 0; }
.sst-month abbr { text-decoration: none; }
.sst-day { vertical-align: top; height: 6.6rem; padding: .25rem .3rem .4rem; border: 1px solid var(--sst-border); }
.sst-day.is-other { background: color-mix(in srgb, currentColor 3%, transparent); }
.sst-day.is-other .sst-day__num { opacity: .45; }
.sst-day__num { display: block; text-align: right; font-size: .9em; font-variant-numeric: tabular-nums; margin-bottom: .15rem; }
.sst-day.is-today .sst-day__num { color: var(--sst-accent); font-weight: 700; }
.sst-day.is-today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sst-accent) 55%, transparent); }
.sst-day__events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .15rem; }
.sst-day__events li { min-width: 0; }
.sst-ev { font: inherit; font-size: .92em; display: block; width: 100%; text-align: left; padding: .12rem .3rem .12rem .4rem; border: 0; border-left: 3px solid var(--sst-dot, var(--sst-accent)); border-radius: 2px; background: color-mix(in srgb, var(--sst-dot, var(--sst-accent)) 9%, transparent); color: inherit; cursor: pointer; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sst-ev:hover { background: color-mix(in srgb, var(--sst-dot, var(--sst-accent)) 18%, transparent); }
.sst-ev__time { color: var(--sst-muted); font-variant-numeric: tabular-nums; }

.sst-listday { margin: 0 0 1rem; }
.sst-listday.is-past { opacity: .6; }
.sst-listday__date { margin: 0 0 .35rem; font-size: 1em; padding-bottom: .25rem; border-bottom: 1px solid var(--sst-border); }
.sst-listday.is-today .sst-listday__date { color: var(--sst-accent); }
.sst-listday ul { list-style: none; margin: 0; padding: 0; }
.sst-ev--row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .1rem .75rem; white-space: normal; padding: .45rem .6rem; margin: .2rem 0; background: transparent; border-left-width: 3px; }
.sst-ev--row .sst-ev__title { font-weight: 600; }
.sst-ev--row .sst-ev__where { grid-column: 2; color: var(--sst-muted); font-size: .88em; }

.sst-cal--month .sst-list-wrap { display: none; }
.sst-cal--list .sst-grid-wrap { display: none; }
/* Phones: always the list */
@container sst (max-width: 620px) {
	.sst-cal .sst-grid-wrap { display: none; }
	.sst-cal .sst-list-wrap { display: block; }
	.sst-cal__views { display: none; }
	.sst-ev--row { grid-template-columns: 5rem minmax(0, 1fr); }
}
.sst-subscribe { margin: 1rem 0 0; font-size: .88em; }
.sst-subscribe a { color: var(--sst-accent); }

/* ---------- Event pop-up ---------- */
.sst-dialog { container-type: normal; width: min(34rem, 92vw); max-height: 88vh; padding: 1.5rem 1.6rem 1.4rem; border: 1px solid var(--sst-border); border-radius: 10px; background: var(--sst-surface); color: var(--sst-heading); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.sst-dialog::backdrop { background: rgba(0,0,0,.4); }
.sst-dialog__close { position: absolute; top: .5rem; right: .6rem; width: 2.2rem; height: 2.2rem; border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: inherit; }
.sst-detail__title { margin: 0 0 .3rem; font-size: 1.35em; outline: none; }
.sst-detail__when { margin: 0; font-weight: 600; }
.sst-detail__where { margin: .1rem 0 0; color: var(--sst-muted); }
.sst-detail__img { margin: .9rem 0 0; border-radius: var(--sst-radius); }
.sst-detail__summary { margin: .8rem 0 0; font-style: italic; }
.sst-detail__desc { margin-top: .6rem; }
.sst-detail__desc p { margin: 0 0 .6rem; }

/* ---------- Coming up ---------- */
.sst-upcoming__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sst-border); }
.sst-up { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--sst-border); align-items: start; }
.sst-tile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: .4rem .2rem .45rem; border: 1px solid var(--sst-border); border-radius: var(--sst-radius); line-height: 1; }
.sst-tile__mon { font-size: .72em; text-transform: uppercase; letter-spacing: .12em; color: var(--sst-accent); font-weight: 700; }
.sst-tile__day { font-size: 2.1em; font-weight: 600; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.sst-tile__to { font-size: .72em; color: var(--sst-muted); margin-top: .2rem; }
.sst-up__title { margin: 0; font-size: 1.15em; line-height: 1.3; }
.sst-up__title a { color: inherit; text-decoration: none; }
.sst-up__title a:hover { text-decoration: underline; }
.sst-up__when { margin: .2rem 0 0; color: var(--sst-muted); font-size: .9em; }
.sst-up__desc { margin: .45rem 0 0; }
.sst-up .sst-buttons { margin-top: .6rem; }

/* ---------- Featured banner ---------- */
.sst-banner { display: grid; gap: 0; border-radius: 10px; overflow: hidden; background: var(--sst-soft); border: 1px solid color-mix(in srgb, var(--sst-accent) 25%, transparent); }
.sst-banner__body { padding: clamp(1.25rem, 4cqi, 2.5rem); }
.sst-banner__title { margin: 0 0 .4rem; }
.sst-banner__when { margin: 0; font-weight: 600; }
.sst-banner__text { margin: .7rem 0 0; max-width: 60ch; }
.sst-banner__img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
@container sst (min-width: 680px) {
	.sst-banner.has-image { grid-template-columns: 2fr 3fr; }
	.sst-banner__img img { aspect-ratio: auto; min-height: 100%; }
}

/* ---------- Lord's Day ---------- */
.sst-date { margin: -.5rem 0 1rem; color: var(--sst-muted); }
.sst-services { display: grid; gap: var(--sst-gap); grid-template-columns: 1fr; }
@container sst (min-width: 700px) { .sst-services { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); } }
.sst-service { padding: 1.2rem 1.3rem; border: 1px solid var(--sst-border); border-radius: var(--sst-radius); }
.sst-service__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; margin-bottom: .8rem; padding-bottom: .6rem; border-bottom: 1px solid var(--sst-border); }
.sst-service__name { margin: 0; font-size: 1.2em; }
.sst-service__time { color: var(--sst-muted); }
.sst-sermon { margin-bottom: .9rem; }
.sst-sermon__title { margin: 0; font-size: 1.15em; font-weight: 600; color: var(--sst-heading); }
.sst-sermon__meta { margin: .15rem 0 0; color: var(--sst-muted); font-size: .92em; }
.sst-readings, .sst-hymns { margin-top: .8rem; }
.sst-hymns ol li::marker { color: var(--sst-muted); }
.sst-hymn__num { font-variant-numeric: tabular-nums; color: var(--sst-muted); }
.sst-order { list-style: none; margin: 0; padding: 0; }
.sst-order__item { display: grid; grid-template-columns: minmax(8rem, 40%) minmax(0, 1fr); gap: .2rem .8rem; padding: .35rem 0; border-bottom: 1px dotted var(--sst-border); }
.sst-order__label { font-variant: small-caps; letter-spacing: .03em; }
.sst-order__value { text-align: right; }
.sst-order__text { grid-column: 1 / -1; margin: .3rem 0 .2rem; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--sst-accent); font-size: .92em; }
.sst-order__text p { margin: 0 0 .4rem; }
@container sst (max-width: 420px) { .sst-order__item { grid-template-columns: 1fr; } .sst-order__value { text-align: left; } }
.sst-lectio { margin: 1rem 0 0; }

/* ---------- Bulletins ---------- */
.sst-bulletins__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sst-border); }
.sst-bulletin { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--sst-border); }
.sst-bulletin__date { margin: 0; font-weight: 600; }
.sst-bulletin__sermon { margin: .1rem 0 0; color: var(--sst-muted); font-size: .9em; }
.sst-bulletin__pdf { flex: none; padding: .3em .9em; border: 1px solid var(--sst-accent); border-radius: 999px; color: var(--sst-accent); text-decoration: none; font-size: .85em; font-weight: 600; }
.sst-bulletin__pdf:hover { background: var(--sst-soft); }

/* ---------- Family worship ---------- */
.sst-fw__bar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.sst-fw__week { margin: 0; flex: 1; text-align: center; font-weight: 600; font-size: 1.1em; outline: none; }
.sst-fw__title { display: block; font-weight: 400; font-size: .85em; color: var(--sst-muted); }
.sst-fw__grid { display: grid; gap: var(--sst-gap); grid-template-columns: 1fr; }
@container sst (min-width: 720px) { .sst-fw__grid { grid-template-columns: 1fr 1fr; } }
/* Readings and catechism each take the full width; the shorter sections sit side by side below. */
.sst-fw__readings, .sst-fw__catechism { grid-column: 1 / -1; }
/* The week's readings as one shaded row per day: the day on the left, its readings wrapping on the right. */
.sst-fw__readings .sst-readtable, .sst-fw__readings .sst-readtable tbody { display: block; }
.sst-fw__readings .sst-readtable tbody { display: flex; flex-direction: column; gap: .45rem; }
.sst-fw__readings .sst-readtable tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; padding: .55rem .85rem; border: 1px solid var(--sst-border); border-radius: calc(var(--sst-radius) - 2px); background: var(--sst-soft); }
.sst-fw__readings .sst-readtable th, .sst-fw__readings .sst-readtable td { display: block; padding: 0; border: 0; }
.sst-fw__readings .sst-readtable th { flex: 0 0 8.75rem; width: auto; font-size: .78em; letter-spacing: .08em; text-transform: uppercase; }
.sst-fw__readings .sst-readtable td { flex: 1 1 14rem; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.sst-fw__readings .sst-readtable td * { white-space: normal; }
}
.sst-fw__section { padding: 1.1rem 1.25rem; border: 1px solid var(--sst-border); border-radius: var(--sst-radius); }
.sst-fw__h { margin: 0 0 .6rem; font-size: 1.05em; }
.sst-fw__section ol { margin: 0; padding-left: 1.2rem; }
.sst-fw__section ol li { margin: .25rem 0; }
.sst-fw__section p { margin: 0 0 .5rem; }
.sst-readtable { width: 100%; border-collapse: collapse; margin: 0; }
.sst-readtable th, .sst-readtable td { padding: .35rem .2rem; border: 0; border-bottom: 1px solid var(--sst-border); text-align: left; vertical-align: top; }
.sst-readtable th { font-weight: 600; width: 38%; color: var(--sst-muted); }
.sst-qa { margin: 0 0 .9rem; padding: .1rem 0 .1rem 1rem; border-left: 3px solid var(--sst-accent); }
.sst-qa p { margin: 0 0 .35rem; }
.sst-qa__q { font-weight: 600; }
.sst-qa__n { color: var(--sst-accent); font-weight: 700; }
.sst-fw__hymnline { font-size: 1.1em; }
.sst-prepare { margin-top: var(--sst-gap); padding: 1.1rem 1.25rem; background: var(--sst-soft); border-radius: var(--sst-radius); }
.sst-prepare__grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.sst-prepare__svc p { margin: 0 0 .3rem; }

/* ---------- Sunday school ---------- */
.sst-ss__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sst-gap); grid-template-columns: 1fr; }
@container sst (min-width: 600px) { .sst-ss__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container sst (min-width: 960px) { .sst-ss__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sst-class { padding: 1.1rem 1.25rem; border: 1px solid var(--sst-border); border-radius: var(--sst-radius); }
.sst-class__name { margin: 0; font-size: 1.15em; }
.sst-class__meta { margin: .2rem 0 0; color: var(--sst-muted); font-size: .92em; }
.sst-class__desc, .sst-class__cur { margin: .6rem 0 0; }
.sst-lessons { list-style: none; margin: .8rem 0 0; padding: .6rem 0 0; border-top: 1px solid var(--sst-border); font-size: .92em; }
.sst-lessons li { margin: .35rem 0; }
.sst-lessons__date { display: inline-block; min-width: 3.6em; color: var(--sst-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.sst-lessons__title { font-weight: 600; }
.sst-lessons__extra { display: block; margin-left: 3.9em; color: var(--sst-muted); font-size: .92em; }

/* ---------- Service times ---------- */
.sst-times__list { margin: 0; }
.sst-times__row { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px dotted var(--sst-border); }
.sst-times__row dt { font-weight: 600; }
.sst-times__row dd { margin: 0; font-variant-numeric: tabular-nums; }
.sst-times__addr { margin-top: .9rem; font-style: normal; }
.sst-times__addr a { color: var(--sst-accent); }

/* Bulletin viewer */
.sst-bv { --sst-bv-bg: color-mix(in srgb, currentColor 6%, transparent); }
.sst-bv__head { text-align: center; margin-bottom: 1rem; }
.sst-bv__head > p { margin: 0; }
.sst-bv__date { font-size: 1.35em; font-weight: 600; }
.sst-bv__sermon { opacity: .8; font-style: italic; }
.sst-bv__stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px; padding: 1.25rem .25rem; background: var(--sst-bv-bg); border-radius: 6px; overflow: hidden; outline-offset: 3px; touch-action: pan-y; }
.sst-bv__spread { display: flex; justify-content: center; align-items: flex-start; gap: 4px; }
.sst-bv__page { display: block; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.25); }
.sst-bv__spread.is-pair .sst-bv__page:first-child { box-shadow: -2px 2px 10px rgba(0,0,0,.18), inset -14px 0 18px -14px rgba(0,0,0,.25); }
.sst-bv__spread.is-pair .sst-bv__page:last-child { box-shadow: 2px 2px 10px rgba(0,0,0,.18), inset 14px 0 18px -14px rgba(0,0,0,.25); }
.sst-bv__spread.turn-next { animation: sst-bv-next .32s ease-out; }
.sst-bv__spread.turn-prev { animation: sst-bv-prev .32s ease-out; }
@keyframes sst-bv-next { from { opacity: .2; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes sst-bv-prev { from { opacity: .2; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sst-bv__spread.turn-next, .sst-bv__spread.turn-prev { animation: none; } }
.sst-bv__status { position: absolute; inset: auto 0; text-align: center; margin: 0; opacity: .75; }
.sst-bv__status[hidden] { display: none; }
.sst-bv__turn { position: absolute; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 .15em; }
.sst-bv__turn--prev { left: .5rem; }
.sst-bv__turn--next { right: .5rem; }
.sst-bv__turn:disabled { opacity: 0; pointer-events: none; }
.sst-bv__turn:hover, .sst-bv__turn:focus-visible { background: rgba(0,0,0,.8); }
.sst-bv__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: .75rem; }
.sst-bv__count { opacity: .8; }
.sst-bv__tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.sst-bv__pick select { font: inherit; padding: .35rem .5rem; max-width: 16rem; }
.sst-bv__btn { display: inline-flex; align-items: center; padding: .35rem .85rem; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: .9em; text-decoration: none; cursor: pointer; }
.sst-bv.is-full { background: #2b2724; color: #f4efe6; padding: 1rem; display: flex; flex-direction: column; justify-content: center; }
.sst-bv.is-full .sst-bv__stage { background: transparent; flex: 1; }
.sst-bv.is-full .sst-bv__pick select { color: #222; }
.sst-bv__head .sst-eyebrow { text-align: center; }
