/* ==========================================================================
   Friends of St John, Tideswell — "The Cathedral of the Peak"
   Contemporary 2026 Editorial & Destination Design System (WCAG 2.2 AA)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  /* Contemporary Heritage & Community Palette (WCAG 2.2 AA Verified) */
  --bg-page: #f8f7f4;
  --bg-surface: #ffffff;
  --bg-muted: #f0eee8;
  --bg-subtle: #e5e1d8;
  --bg-dark: #0f2027;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-footer: #0b171d;

  --text-primary: #141c22;      /* >16:1 on #ffffff */
  --text-secondary: #47545d;    /* >7.5:1 on #ffffff */
  --text-inverse: #ffffff;
  --text-footer: #d9e2e6;       /* >13:1 on #0b171d */

  /* Deep Peak District Teal (>7.4:1 contrast with white) */
  --color-primary: #0f5f66;
  --color-primary-hover: #09444a;

  /* Refined Heritage Claret / Berry (>7.2:1 contrast with white) */
  --color-fosj: #9e2646;
  --color-fosj-hover: #7c1b35;

  --color-accent: #8c5012;
  --color-accent-soft: #fbf6ee;
  --color-gold: #d49535;
  --color-charcoal: #18262e;
  --color-border: rgba(20, 28, 34, 0.09);
  --color-border-strong: #d4d0c5;
  --color-focus: #9e2646;

  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --max-width: 1240px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --shadow-sm: 0 4px 20px -2px rgba(15, 32, 39, 0.06), 0 2px 6px -1px rgba(15, 32, 39, 0.04);
  --shadow-md: 0 16px 36px -6px rgba(15, 32, 39, 0.11), 0 4px 12px -2px rgba(15, 32, 39, 0.05);
  --shadow-lg: 0 24px 48px -12px rgba(15, 32, 39, 0.18);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.03rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-page);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: var(--color-fosj);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #ffffff;
  outline-offset: -4px;
}

/* Global Focus Indicator (WCAG 2.2 AA 2.4.7 & 2.4.11) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* Editorial + Modern Geometric Typography */
h1, h2, h3, h4 {
  color: var(--text-primary);
  margin-top: 0;
  letter-spacing: -0.02em;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.8vw, 3.25rem);
  font-weight: 700;
  line-height: 1.14;
  margin-bottom: 0.85rem;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

h3 {
  font-family: var(--font-sans);
  font-size: clamp(1.18rem, 1.7vw, 1.38rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

h4 {
  font-family: var(--font-sans);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

ul, ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1 0 auto;
}

.section {
  padding: 4.25rem 0;
}

.section--muted {
  background-color: var(--bg-muted);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section--surface {
  background-color: var(--bg-surface);
}

.section--dark {
  background-color: var(--bg-dark);
  color: #f2f5f7;
}

.section--dark h2,
.section--dark h3,
.section--dark .lead {
  color: #ffffff;
}

.section__header {
  margin-bottom: 2.5rem;
  max-width: 780px;
}

.section__header--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--color-fosj);
  background: rgba(158, 38, 70, 0.08);
  padding: 0.32rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.16rem;
  color: var(--text-secondary);
  line-height: 1.68;
}

/* Sleek Top Welcome Bar */
.top-bar {
  background-color: var(--bg-dark);
  color: #e2eaee;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.45rem 0;
  letter-spacing: 0.01em;
}

.top-bar__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.top-bar a {
  color: #8ce4ed;
  text-decoration: none;
  font-weight: 600;
}

.top-bar a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Glassmorphic Sticky Header & Modern FoSJ Identity */
.site-header {
  background-color: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 24px -4px rgba(15, 32, 39, 0.05);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  gap: 1rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.site-brand:hover {
  color: var(--text-primary);
}

/* Tower Silhouette Crest */
.site-brand::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 46px;
  background-image: url("/images/logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  flex-shrink: 0;
}

.site-brand__badge {
  background: linear-gradient(135deg, var(--color-fosj) 0%, #7c1b35 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-block;
  box-shadow: 0 4px 10px rgba(158, 38, 70, 0.22);
  flex-shrink: 0;
}

.site-brand__text {
  display: flex;
  flex-direction: column;
}

.site-brand__title {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.45vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
  white-space: nowrap;
}

.site-brand__subtitle {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 0.14rem;
  white-space: nowrap;
}

/* Mobile Menu Button */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-page);
  color: var(--text-primary);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--bg-muted);
}

.nav-toggle__icon {
  display: inline-block;
  width: 1.15rem;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1.15rem;
  height: 2px;
  background: currentColor;
}

.nav-toggle__icon::before {
  top: -5px;
}

.nav-toggle__icon::after {
  top: 5px;
}

/* Primary Nav List (Modern Pill Navigation) */
.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.site-nav__item {
  position: relative;
  margin: 0;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.52rem 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.site-nav__link:hover {
  background-color: var(--bg-muted);
  color: var(--text-primary);
}

.site-nav__link[aria-current="page"],
.site-nav__item--active > .site-nav__link {
  background-color: var(--bg-dark);
  color: #ffffff;
}

/* Submenu / Dropdown */
.site-nav__sublist {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 255px;
  background-color: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 0.55rem;
  margin: 0;
  z-index: 1010;
}

.site-nav__item:hover > .site-nav__sublist,
.site-nav__item:focus-within > .site-nav__sublist,
.site-nav__item.is-open > .site-nav__sublist {
  display: block;
}

.site-nav__sublink {
  display: block;
  padding: 0.55rem 0.9rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.site-nav__sublink:hover,
.site-nav__sublink[aria-current="page"] {
  background-color: var(--bg-muted);
  color: var(--color-primary);
}

/* Contemporary Pill Buttons */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.45rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn--primary {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 95, 102, 0.25);
}

.btn--primary:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 95, 102, 0.32);
}

.btn--fosj {
  background-color: var(--color-fosj);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(158, 38, 70, 0.25);
}

.btn--fosj:hover {
  background-color: var(--color-fosj-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn--secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--color-border-strong);
}

.btn--secondary:hover {
  background-color: var(--bg-muted);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--light {
  background-color: #ffffff;
  color: var(--bg-dark);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn--light:hover {
  background-color: var(--bg-page);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn--outline-light {
  background-color: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn--outline-light:hover {
  background-color: #ffffff;
  color: var(--bg-dark);
}

/* ==========================================================================
   Immersive Full-Bleed Cinema Hero & Bento Photo Grid
   ========================================================================== */
.hero {
  padding: 1.5rem 0 2.5rem;
}

.hero-showcase {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  padding: 3.5rem;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  background-color: var(--bg-dark);
  background-image:
    linear-gradient(105deg, rgba(11, 23, 29, 0.92) 0%, rgba(11, 23, 29, 0.74) 48%, rgba(11, 23, 29, 0.25) 100%),
    url("/images/church side.JPG");
  background-size: cover;
  background-position: center 35%;
}

.hero-showcase__content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.38rem 0.95rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.15rem;
}

.hero-showcase h1 {
  color: #ffffff;
  font-size: clamp(2.25rem, 4.2vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 1.1rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.hero-showcase p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.14rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
  max-width: 610px;
}

/* Floating Glass Stats / Highlights Strip inside Hero */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.hero-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
  margin-top: 1.25rem;
}

.hero-mosaic__item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 195px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: flex;
  align-items: flex-end;
  background: var(--bg-dark);
}

.hero-mosaic__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-mosaic__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 23, 29, 0.88) 0%, rgba(11, 23, 29, 0.25) 55%, rgba(11, 23, 29, 0.05) 100%);
  transition: opacity 0.3s ease;
}

.hero-mosaic__item:hover img {
  transform: scale(1.06);
}

.hero-mosaic__label {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.95rem 1.15rem;
  font-size: 0.94rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.hero-mosaic__label::after {
  content: "→";
  font-weight: 800;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.hero-mosaic__item:hover .hero-mosaic__label::after {
  transform: translateX(3px);
}

/* Fallback for any split hero__grid usage */
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

/* Page Header / Banner for Subpages */
.page-header {
  background: linear-gradient(135deg, #0f2027 0%, #193642 100%);
  color: #ffffff;
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}

.page-header h1 {
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.page-header .lead {
  color: rgba(255, 255, 255, 0.86);
  max-width: 760px;
}

.breadcrumb {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.breadcrumb a {
  color: #9be7f0;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.breadcrumb li {
  margin: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Grid Systems & Sleek Elevated Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.layout-sidebar {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 3rem;
  align-items: start;
}

.layout-sidebar--right {
  grid-template-columns: 1fr 340px;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card > a {
  display: block;
  overflow: hidden;
}

.card__image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card__image {
  transform: scale(1.04);
}

.card__body {
  padding: 1.75rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.card__body > :last-child {
  margin-bottom: 0;
}

.card__footer {
  margin-top: auto;
  padding-top: 1.25rem;
}

.card__footer a:not(.btn) {
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card__footer a:not(.btn):hover {
  text-decoration: underline;
}

/* Modern Bento Photo Grid for Homepage */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 260px;
  gap: 1.25rem;
}

.bento-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  background: var(--bg-dark);
}

.bento-item--span-7 {
  grid-column: span 7;
}

.bento-item--span-5 {
  grid-column: span 5;
}

.bento-item--span-4 {
  grid-column: span 4;
}

.bento-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-item:hover img {
  transform: scale(1.05);
}

.bento-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 23, 29, 0.9) 0%, rgba(11, 23, 29, 0.35) 55%, rgba(11, 23, 29, 0.05) 100%);
}

.bento-item__content {
  position: relative;
  z-index: 2;
  padding: 1.5rem 1.75rem;
  width: 100%;
}

.bento-item__tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.bento-item__content h3 {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin-bottom: 0.3rem;
}

.bento-item__content p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.93rem;
  margin-bottom: 0;
}

/* Callout & Notice Boxes */
.callout {
  background-color: var(--color-accent-soft);
  border-left: 4px solid var(--color-fosj);
  border-top: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.85rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.callout--info {
  background-color: #f0f7f8;
  border-left-color: var(--color-primary);
}

.callout h3, .callout h4 {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

/* Badge / Pill */
.badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.26rem 0.75rem;
  border-radius: var(--radius-pill);
  background-color: var(--bg-muted);
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.badge--primary {
  background-color: #e2f2f3;
  color: var(--color-primary-hover);
}

.badge--fosj {
  background-color: #fae6ec;
  color: var(--color-fosj-hover);
}

.badge--seasonal {
  background-color: #faecd8;
  color: #6b3f08;
}

/* Worship Timetable: Accessible Desktop Table & Mobile Cards */
.worship-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.worship-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.98rem;
}

.worship-table th,
.worship-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.worship-table thead th {
  background-color: var(--bg-dark);
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 700;
  border-bottom: 3px solid var(--color-primary);
}

.worship-table tbody th {
  background-color: var(--bg-page);
  font-family: var(--font-sans);
  font-weight: 700;
  width: 18%;
  color: var(--text-primary);
}

.worship-table tbody tr:last-child th,
.worship-table tbody tr:last-child td {
  border-bottom: 0;
}

.service-time {
  display: inline-block;
  font-weight: 800;
  color: var(--color-primary);
}

.worship-mobile-cards {
  display: none;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.worship-day-card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.worship-day-card h3 {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.worship-day-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.worship-day-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--color-border-strong);
  margin: 0;
}

.worship-day-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Events List & Cards */
.event-card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.event-card--seasonal {
  border-left-color: var(--color-fosj);
  background: #fffcfd;
}

.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.65rem;
}

.event-card__location {
  color: var(--text-secondary);
  font-weight: 600;
}

.event-card__note {
  font-size: 0.92rem;
  background-color: var(--bg-page);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* Sub-navigation / Sidebar Menu */
.subnav-card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.subnav-card h2,
.subnav-card h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--color-border);
}

.subnav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.subnav-list li {
  margin-bottom: 0.25rem;
}

.subnav-list a {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
}

.subnav-list a:hover,
.subnav-list a[aria-current="page"] {
  background-color: var(--bg-muted);
  color: var(--color-primary);
}

.subnav-list a[aria-current="page"] {
  background-color: #e2f2f3;
  color: var(--color-primary-hover);
  font-weight: 700;
}

/* Photo Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.35rem;
  margin: 1.5rem 0;
}

.gallery-item {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 0;
  display: flex;
  flex-direction: column;
}

.gallery-item a {
  display: block;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 195px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item a:hover img {
  transform: scale(1.04);
}

.gallery-item figcaption {
  padding: 0.75rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Clergy & Contact Cards */
.clergy-card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
}

.clergy-card__role {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 0.75rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.contact-list li {
  margin-bottom: 0.45rem;
}

/* Directory Listing Items (Shops, Eating Out, Area) */
.directory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.35rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.directory-item {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.45rem;
  box-shadow: var(--shadow-sm);
  margin: 0;
}

.directory-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.directory-item__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.directory-item__header h3 {
  margin-bottom: 0;
}

/* Live Open/Closed Status Pills */
.live-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.live-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.live-status--open {
  background-color: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
}

.live-status--open .live-status__dot {
  background-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.live-status--closed {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.live-status--closed .live-status__dot {
  background-color: #94a3b8;
}

/* Real-Time Tideswell & Peak District Live Data Dashboard */
.live-dashboard {
  background: linear-gradient(135deg, #0d2128 0%, #15353f 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(155, 231, 240, 0.22);
}

.live-dashboard__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.live-dashboard__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.live-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
  display: inline-block;
}

.live-dashboard__meta {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.live-dashboard__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

.live-metric {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.live-metric__label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9be7f0;
  margin-bottom: 0.4rem;
}

.live-metric__value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.live-metric__sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.45;
  margin: 0;
}

.live-metric__sub a {
  color: #9be7f0;
  font-weight: 700;
  text-decoration: underline;
}

.live-metric__sub a:hover {
  color: #ffffff;
}

@media (max-width: 980px) {
  .live-dashboard__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .live-dashboard {
    padding: 1.35rem 1.25rem;
  }
  .live-dashboard__grid {
    grid-template-columns: 1fr;
  }
}

/* Site Footer */
.site-footer {
  background-color: var(--bg-footer);
  color: var(--text-footer);
  padding: 4rem 0 2.5rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer h2,
.site-footer h3 {
  font-family: var(--font-sans);
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 0.95rem;
}

.site-footer a {
  color: #9be7f0;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.2fr;
  gap: 2.25rem;
  margin-bottom: 2.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.65rem;
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(217, 226, 230, 0.82);
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .hero__grid,
  .layout-sidebar,
  .layout-sidebar--right {
    grid-template-columns: 1fr;
  }

  .hero-mosaic,
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-item--span-7,
  .bento-item--span-5,
  .bento-item--span-4 {
    grid-column: span 1;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .top-bar {
    display: none;
  }

  .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
    column-gap: 0.85rem;
    row-gap: 0;
  }

  .site-brand {
    min-width: 0;
    gap: 0.65rem;
    align-items: center;
  }

  .site-brand__text {
    min-width: 0;
  }

  .site-brand__title,
  .site-brand__subtitle {
    white-space: normal;
    overflow-wrap: break-word;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    padding-top: 0.9rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.85rem;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .site-nav__link {
    width: 100%;
    justify-content: space-between;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
  }

  .site-nav__sublist {
    position: static;
    display: block;
    background: var(--bg-page);
    border: 0;
    box-shadow: none;
    padding: 0.25rem 0 0.25rem 1rem;
    margin-top: 0.25rem;
  }
}

@media (max-width: 760px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .hero-mosaic,
  .bento-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .bento-item--span-7,
  .bento-item--span-5,
  .bento-item--span-4 {
    grid-column: span 1;
  }

  .hero-showcase {
    padding: 2rem 1.5rem;
    min-height: 440px;
  }

  /* Switch Worship Timetable from desktop table to mobile grouped cards */
  .worship-table-wrapper {
    display: none;
  }

  .worship-mobile-cards {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section {
    padding: 2.75rem 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1.15rem;
  }

  .site-header__inner {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    column-gap: 0.75rem;
  }

  .site-brand {
    gap: 0.45rem;
  }

  .site-brand::before {
    width: 20px;
    height: 34px;
  }

  .site-brand__badge {
    font-size: 0.7rem;
    padding: 0.32rem 0.45rem;
  }

  .site-brand__title {
    font-size: clamp(0.86rem, 3.6vw, 1rem);
    line-height: 1.2;
  }

  .site-brand__subtitle {
    display: none;
  }

  .nav-toggle {
    padding: 0.45rem 0.8rem;
    font-size: 0.82rem;
    gap: 0.4rem;
  }

  .directory-list {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  .top-bar,
  .site-header,
  .btn-group,
  .site-footer {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .worship-table-wrapper {
    display: block !important;
  }
}
