/**
 * Extra component styles layered on top of style.css.
 * Kept separate so later tweaks don't bloat the main stylesheet.
 */

/* Primary nav menu — reset WordPress's default UL styles inside .main-nav */
.site-header .main-nav .menu { display: flex; gap: 0.125rem; margin: 0; padding: 0; list-style: none; align-items: center; }
/* IMPORTANT: position: static so the megamenu's `inset-inline: 0` spans the header width,
   not the narrow <li> width. The header itself is position:fixed → containing block. */
.site-header .main-nav .menu > li { position: static; }
.site-header .main-nav .menu > li > a,
.site-header .main-nav .menu > li > button {
	display: inline-flex; align-items: center; gap: 0.25rem;
	padding: 0.5rem 0.875rem; border-radius: 9999px;
	font-size: 0.9375rem; white-space: nowrap;
	color: inherit; cursor: pointer; border: 0; background: transparent;
	transition: background var(--duration-fast);
}
.site-header:not(.is-overlay) .main-nav .menu > li > a:hover,
.site-header:not(.is-overlay) .main-nav .menu > li > button:hover { background: var(--color-navy-50); }
.site-header.is-overlay .main-nav .menu > li > a:hover,
.site-header.is-overlay .main-nav .menu > li > button:hover { background: rgb(255 255 255 / 0.12); }

/* WordPress's default sub-menu — fully hidden; the megamenu walker renders its own panel */
.site-header .main-nav .sub-menu { display: none; }

/* Footer nav lists (wp_nav_menu containers) */
.site-footer .columns .menu { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.625rem; }
.site-footer .columns .menu a { color: rgb(255 255 255 / 0.75); font-size: 0.9375rem; }
.site-footer .columns .menu a:hover { color: #fff; }

.site-footer .legal-links .menu-item a { color: rgb(255 255 255 / 0.50); }
.site-footer .legal-links .menu-item a:hover { color: #fff; }

/* Mobile-nav primary menu */
.mobile-nav nav .menu { display: flex; flex-direction: column; }
.mobile-nav nav .menu > li { border-top: 1px solid var(--color-line); }
.mobile-nav nav .menu > li:first-child { border-top: 0; }
.mobile-nav nav .menu > li > a { font-family: var(--font-serif); font-size: 1.25rem; padding: 1rem 0; display: block; color: var(--color-navy); }
.mobile-nav nav .sub-menu { padding-inline-start: 0; display: none; padding-bottom: .75rem; }
.mobile-nav nav li.is-open > .sub-menu { display: block; animation: mnav-in .3s var(--ease-sps); }
@keyframes mnav-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mobile-nav nav .sub-menu a { display: block; padding: 0.5rem 0.75rem; font-family: var(--font-sans); font-size: 0.9375rem; color: var(--color-muted); }
.mobile-nav nav .sub-menu .mnav-all a { font-weight: 500; color: var(--color-navy); }
.mobile-nav .mnav-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 1rem 0; border: 0; background: transparent; font-family: var(--font-serif); font-size: 1.25rem; color: var(--color-navy); text-align: start; cursor: pointer; }
.mobile-nav .mnav-toggle svg { width: 1rem; height: 1rem; transition: transform .3s; }
.mobile-nav li.is-open > .mnav-toggle svg { transform: rotate(180deg); }

/* Pagination */
.navigation.pagination { margin-top: 3rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.nav-links a, .nav-links span.page-numbers { display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem; border-radius: 9999px; border: 1px solid var(--color-line); font-size: 0.875rem; }
.nav-links a:hover { border-color: var(--color-navy); }
.nav-links .current { background: var(--color-navy); color: #fff; border-color: var(--color-navy); }

/* Language menu (header) */
.lang-menu { position: relative; display: none; }
@media (min-width: 640px) { .lang-menu { display: block; } }
.lang-btn { display: inline-flex; align-items: center; gap: .375rem; height: 2.5rem; padding: 0 .75rem; border: 0; border-radius: 9999px; background: transparent; font-family: var(--font-sans); font-size: .875rem; color: inherit; cursor: pointer; transition: background var(--duration-fast); }
.site-header:not(.is-overlay) .lang-btn:hover { background: var(--color-navy-50); }
.site-header.is-overlay .lang-btn:hover { background: rgb(255 255 255 / .1); }
.lang-chev { opacity: .7; transition: transform .3s; } .lang-menu.is-open .lang-chev { transform: rotate(180deg); }
.lang-list { position: absolute; inset-inline-end: 0; top: 3rem; z-index: 60; min-width: 10rem; margin: 0; padding: .25rem 0; list-style: none; overflow: hidden; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-lift); }
.lang-list a { display: block; padding: .5rem 1rem; font-family: var(--font-sans); font-size: .875rem; color: var(--color-navy); text-align: start; text-decoration: none; }
.lang-list a:hover { background: var(--color-ivory); }
.lang-list a.is-current { font-weight: 600; }
/* Language buttons (mobile menu) */
.mnav-lang-l { margin: 1rem 0 0; font-family: var(--font-sans); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--color-muted); }
.mnav-langs { margin: .5rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.mnav-langs a { display: inline-flex; align-items: center; height: 2.5rem; padding: 0 1rem; border: 1px solid var(--color-line); border-radius: 9999px; font-family: var(--font-sans); font-size: .875rem; color: var(--color-navy); text-decoration: none; }
.mnav-langs a.is-current { border-color: var(--color-navy); background: var(--color-navy); color: #fff; }

/* Polylang language switcher */
.lang-switch ul { display: flex; gap: 0.25rem; font-size: 0.875rem; }
.lang-switch li a { display: inline-flex; align-items: center; padding: 0.375rem 0.625rem; border-radius: 9999px; }
.lang-switch li.current-lang a { font-weight: 600; }

/* Logo show/hide against overlay vs. scrolled */
.site-header.is-overlay .logo-dark { display: none; }
.site-header.is-overlay .logo-light { display: inline; }
.site-header:not(.is-overlay) .logo-light { display: none; }
.site-header:not(.is-overlay) .logo-dark { display: inline; }
.site-header.is-scrolled { background: rgb(255 255 255 / 0.95); color: var(--color-navy); box-shadow: 0 1px 0 var(--color-line); backdrop-filter: blur(10px); }
.site-header.is-scrolled.is-overlay .logo-dark { display: inline; }
.site-header.is-scrolled.is-overlay .logo-light { display: none; }
.site-header.is-scrolled.is-overlay { background: rgb(255 255 255 / 0.95); color: var(--color-navy); box-shadow: 0 1px 0 var(--color-line); }
.site-header.is-scrolled.is-overlay img { filter: none; }

/* Comments default hidden on CPTs */
.single-sps_news .comments-area,
.single-sps_event .comments-area,
.single-sps_ministry .comments-area,
.single-sps_church .comments-area { display: none; }

/* Skip link: hidden until a keyboard user tabs to it */
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 100; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { width: auto; height: auto; overflow: visible; clip-path: none; padding: .625rem 1.25rem; border-radius: 9999px; background: var(--color-navy); color: #fff; font-family: var(--font-sans); font-size: .9375rem; box-shadow: var(--shadow-lift); }
[dir="rtl"] .skip-link { left: auto; right: 1rem; }

/* ═════════ App-style bottom bar (phones and tablets): a floating dock ═════════ */
.mbar { display: none; }
@media (max-width: 1023px) {
	:root { --mbar-h: 4rem; --mbar-gap: .625rem; }
	/* room for the dock, inside the (navy) footer so no white strip shows under it */
	.site-footer { padding-bottom: calc(var(--mbar-h) + var(--mbar-gap) * 2 + env(safe-area-inset-bottom, 0px)); }
	/* nothing may make the page wider than the screen (that would push the dock's right side off-screen) */
	html, body { overflow-x: hidden; }
	@supports (overflow: clip) { html, body { overflow-x: clip; } }
	/* centred with plain left/transform so every phone browser places it the same */
	.mbar { display: block; position: fixed; left: 50%; right: auto; bottom: calc(var(--mbar-gap) + env(safe-area-inset-bottom, 0px)); z-index: 55; margin: 0;
		width: calc(100vw - 1.5rem); width: calc(100% - 1.5rem); max-width: 30rem; -webkit-transform: translateX(-50%); transform: translateX(-50%);
		border-radius: 1.375rem; background: rgb(255 255 255 / .96); -webkit-backdrop-filter: saturate(1.8) blur(16px); backdrop-filter: saturate(1.8) blur(16px);
		border: 1px solid rgb(20 44 70 / .08); box-shadow: 0 12px 32px -10px rgb(6 18 33 / .45), 0 2px 6px -2px rgb(6 18 33 / .18); }
	.mbar ul { display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch; height: var(--mbar-h); margin: 0; padding: 0 .375rem; list-style: none; }
	.mbar li { display: flex; justify-content: center; min-width: 0; }
	.mbar-item, .mbar-wa { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; width: 100%; height: 100%; padding: 0; border: 0; background: none;
		color: #66727f; font-family: var(--font-sans); font-size: .6875rem; font-weight: 500; line-height: 1; letter-spacing: .01em; text-decoration: none; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
	/* icon sits in a soft pill that fills in for the current page */
	.mbar-ico { display: grid; place-items: center; width: 3rem; height: 1.875rem; border-radius: 999px; transition: background-color .25s ease, transform .2s ease; }
	.mbar-item svg { width: 1.375rem; height: 1.375rem; }
	.mbar-item:active .mbar-ico { transform: scale(.92); }
	.mbar-item.is-on { color: var(--color-navy); font-weight: 600; }
	.mbar-item.is-on .mbar-ico { background: rgb(20 44 70 / .09); }
	.mbar-item.is-on svg { stroke-width: 2.1; }
	.mbar-item:focus-visible, .mbar-wa:focus-visible { outline: 2px solid var(--color-navy); outline-offset: -4px; border-radius: 1rem; }
	/* centre action: a round button lifted out of the dock */
	.mbar-wa { justify-content: flex-end; padding-bottom: .5rem; color: #128C4B; font-weight: 600; }
	.mbar-wa-btn { position: absolute; top: -1.375rem; left: 50%; display: grid; place-items: center; width: 3.375rem; height: 3.375rem; margin-left: -1.6875rem; border-radius: 999px;
		background: linear-gradient(160deg, #2fe27a, #1aa851); color: #fff; box-shadow: 0 0 0 5px #fff, 0 10px 20px -6px rgb(18 140 75 / .65); transition: transform .2s ease; }
	.mbar-wa-btn svg { width: 1.625rem; height: 1.625rem; }
	.mbar-wa:active .mbar-wa-btn { transform: scale(.93); }
	.mbar-wa--contact { color: var(--color-navy); }
	.mbar-wa--contact .mbar-wa-btn { background: linear-gradient(160deg, #24507d, #12304f); box-shadow: 0 0 0 5px #fff, 0 10px 20px -6px rgb(10 23 38 / .6); }
	.mbar-wa--contact .mbar-wa-btn svg { width: 1.375rem; height: 1.375rem; }
	.mbar-wa--contact.is-on .mbar-wa-btn { box-shadow: 0 0 0 5px #fff, 0 0 0 7px rgb(20 44 70 / .18), 0 10px 20px -6px rgb(10 23 38 / .6); }
	[lang="ur"] .mbar-item, [lang="ur"] .mbar-wa { font-family: var(--font-urdu, "Noto Nastaliq Urdu"), serif; font-size: .6875rem; line-height: 1.3; gap: 0; }
	[lang="ur"] .mbar-wa { padding-bottom: .25rem; }
	/* hide the dock while the full-screen menu is open */
	body:has(.mobile-nav.is-open) .mbar { opacity: 0; pointer-events: none; transform: translate(-50%, 1rem); }
	.mbar { transition: opacity .2s ease, transform .2s ease; }
	.mobile-nav .panel { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
}
@media print { .mbar { display: none !important; } body { padding-bottom: 0 !important; } }

/* ═════════ Phone layout polish ═════════ */
@media (max-width: 1023px) {
	/* footer links: comfortable tap height */
	.site-footer .columns a, .site-footer .legal-links a { display: inline-block; padding-block: .5rem; }
	.site-footer .socials a { min-width: 2.75rem; min-height: 2.75rem; display: inline-grid; place-items: center; }
}
@media (max-width: 639px) {
	/* "What we believe": compact rows instead of tall tiles */
	.hm-faith .pillars { margin-top: 2.5rem; }
	.hm-faith .pillars .pillar { flex-direction: row; align-items: center; justify-content: flex-start; gap: 1.25rem; min-height: 0; padding: 1.25rem; text-align: start; }
	.hm-faith .pillars .pillar-n { flex-shrink: 0; width: 2.75rem; font-size: 2rem; line-height: 1; }
	.hm-faith .pillars .pillar-t { font-size: 1.25rem; line-height: 1.25; }
	.hm-faith .pillars .pillar-s { margin-top: .25rem; }
}
@media (max-width: 1023px) {
	/* full-screen sliders end above the bottom bar, so their controls stay visible */
	.spsl.spsl--full, .hs { min-height: min(calc(100svh - var(--mbar-h) - env(safe-area-inset-bottom, 0px)), 980px); }
	/* filter pills never break onto two lines */
	.seg-btn, .chip { white-space: nowrap; }
	.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.seg::-webkit-scrollbar { display: none; }
	.seg-btn { padding: 0 .85rem; flex-shrink: 0; }
}
@media (max-width: 1023px) {
	/* top slider: less empty space above/below the text so the whole slide, controls included, fits above the bottom bar */
	.spsl.spsl--top .spsl-copy { padding-top: calc(var(--spsl-head) + 1.75rem); }
	.spsl.spsl.has-bar .spsl-copy { padding-bottom: 6.5rem; }
	.spsl.spsl.has-thumbs.has-bar .spsl-copy { padding-bottom: 8.5rem; }
}

/* Top menu drop-downs: the open tab is highlighted; panels fade in */
@media (min-width: 1280px) {
	.site-header:not(.is-overlay) .main-nav button[aria-expanded="true"] { background: var(--color-navy-50); }
	.site-header.is-overlay .main-nav button[aria-expanded="true"] { background: rgb(255 255 255 / .14); }
}
@media (min-width: 1280px) and (prefers-reduced-motion: no-preference) {
	.site-header .megamenu.is-open { animation: mega-in .18s var(--ease-sps, ease) both; }
}
@keyframes mega-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ═════════ Back-to-top button (every page) ═════════ */
.totop { position: fixed; z-index: 54; inset-inline-end: 1.5rem; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); display: grid; place-items: center; width: 3.25rem; height: 3.25rem; padding: 0; border: 0; border-radius: 9999px; background: var(--color-navy); color: #fff; cursor: pointer;
	box-shadow: 0 12px 28px -10px rgb(11 29 49 / .55), 0 0 0 1px rgb(255 255 255 / .12) inset; opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9);
	transition: opacity .3s var(--ease-sps, ease), transform .3s var(--ease-sps, ease), visibility 0s linear .3s, background-color .2s; }
.totop[hidden] { display: none; }
.totop.is-shown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.totop:hover { background: var(--color-burgundy); }
.totop:hover .totop-ico { transform: translateY(-2px); }
.totop:active { transform: scale(.94); }
.totop:focus-visible { outline: 3px solid #e5cf9c; outline-offset: 3px; }
.totop-ico { position: relative; transition: transform .2s ease; }
.totop-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 2.5; }
.totop-ring circle { stroke: rgb(255 255 255 / .16); }
.totop-ring .totop-p { stroke: #e5cf9c; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--sp, 0) * 100); transition: stroke-dashoffset .1s linear; }
@media (max-width: 1023px) {
	.totop { inset-inline-end: 1rem; width: 2.875rem; height: 2.875rem; bottom: calc(var(--mbar-h) + var(--mbar-gap) * 2 + .375rem + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .totop, .totop-ico { transition: opacity .2s; transform: none !important; } }
@media print { .totop { display: none !important; } }
