/* Royston Parish Church – theme (based on the live site's navy / teal palette) */
:root {
  --rpc-navy: #193564;
  --rpc-navy-dark: #091831;
  --rpc-navy-mid: #142a50;
  --rpc-accent: #2ec5ce;
  --rpc-accent-dark: #1fa3ab;
  --rpc-light: #f4f7fb;
  --bs-body-font-family: "Poppins", "Helvetica", "Arial", sans-serif;
  --bs-body-color: #2b3445;
  --bs-link-color: var(--rpc-navy);
  --bs-link-color-rgb: 25, 53, 100;
  --bs-link-hover-color: var(--rpc-accent-dark);
  --bs-link-hover-color-rgb: 31, 163, 171;
}

body { background: #fff; line-height: 1.7; }
h1, h2, h3, h4, h5, h6 { color: var(--rpc-navy); font-weight: 600; }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; z-index: 2000; padding: .5rem 1rem; background: var(--rpc-accent); color: #fff; }

/* ---------- Navigation ---------- */
.site-nav {
  background: #fff;
  box-shadow: 0 2px 12px rgba(9, 24, 49, .08);
  position: sticky; top: 0; z-index: 1030;
  padding: .5rem 0;
}
.site-nav .navbar-brand { color: var(--rpc-navy); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-sub { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rpc-accent-dark); }
.site-nav .nav-link {
  color: var(--rpc-navy); font-weight: 500; font-size: .92rem;
  padding: .5rem .7rem !important; border-radius: .4rem;
}
.site-nav .nav-link:hover, .site-nav .nav-link:focus { color: var(--rpc-accent-dark); }
.site-nav .nav-link.active { color: var(--rpc-accent-dark); }
.site-nav .dropdown-menu {
  border: 0; border-top: 3px solid var(--rpc-accent);
  border-radius: 0 0 .5rem .5rem; box-shadow: 0 10px 30px rgba(9, 24, 49, .15);
  padding: .5rem 0; min-width: 230px;
}
.site-nav .dropdown-item { font-size: .9rem; color: var(--rpc-navy); padding: .45rem 1.2rem; }
.site-nav .dropdown-item:hover, .site-nav .dropdown-item:focus { background: var(--rpc-light); color: var(--rpc-accent-dark); }
.site-nav .dropdown-item.active, .site-nav .dropdown-item:active { background: var(--rpc-navy); color: #fff; }
.site-nav .navbar-brand { flex-shrink: 0; }
@media (min-width: 1200px) {
  .site-nav .dropdown:hover > .dropdown-menu { display: block; margin-top: 0; }
}
/* Tighter menu between the xl and xxl breakpoints so it doesn't run into the logo */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .site-nav .nav-link { font-size: .84rem; padding: .5rem .45rem !important; white-space: nowrap; }
}
@media (max-width: 1199.98px) {
  .site-nav .navbar-collapse { max-height: 75vh; overflow-y: auto; padding-bottom: .75rem; }
  .site-nav .dropdown-menu { box-shadow: none; border-top: 0; border-left: 3px solid var(--rpc-accent); border-radius: 0; }
}

/* ---------- Hero / banners ---------- */
.hero {
  position: relative; color: #fff;
  background: url("../img/Church2.jpg") center / cover no-repeat;
  min-height: 560px; display: flex; align-items: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(9, 24, 49, .88) 0%, rgba(25, 53, 100, .6) 55%, rgba(25, 53, 100, .25) 100%);
}
.hero > .container { position: relative; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; color: var(--rpc-accent); font-weight: 600; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.15; }

.services-card {
  background: rgba(255, 255, 255, .97); color: var(--bs-body-color);
  border-radius: 1rem; padding: 1.75rem; box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}
.services-card h2 { font-size: 1.35rem; }
.service-time {
  display: inline-block; min-width: 5.5rem; font-weight: 700; color: #fff;
  background: var(--rpc-navy); border-radius: .4rem; padding: .2rem .6rem; text-align: center; font-size: .9rem;
}

.page-banner {
  position: relative; color: #fff; padding: 4.5rem 0 3.5rem;
  background: url("../img/church-banner.jpg") center 30% / cover no-repeat;
}
/* Darker on the left behind the white title, lighter on the right so the interior shows */
.page-banner::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(9, 24, 49, .82) 0%, rgba(9, 24, 49, .6) 40%, rgba(9, 24, 49, .3) 100%); }
.page-banner > .container { position: relative; }
.page-banner h1 { color: #fff; margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-banner .breadcrumb { margin: .5rem 0 0; font-size: .875rem; }
.page-banner .breadcrumb a { color: var(--rpc-accent); text-decoration: none; }
.page-banner .breadcrumb-item.active, .page-banner .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .75); }

/* ---------- Content ---------- */
.section { padding: 4rem 0; }
.section-alt { background: var(--rpc-light); }
.section-title { position: relative; padding-bottom: .75rem; margin-bottom: 1.5rem; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 3px; background: var(--rpc-accent); border-radius: 2px; }
.text-center .section-title::after, .section-title.text-center::after { left: 50%; transform: translateX(-50%); }

.lead-box { border-left: 4px solid var(--rpc-accent); background: var(--rpc-light); padding: 1rem 1.25rem; border-radius: 0 .5rem .5rem 0; }

.card-rpc { border: 0; border-radius: .9rem; overflow: hidden; box-shadow: 0 6px 24px rgba(9, 24, 49, .08); transition: transform .2s, box-shadow .2s; }
/* Equal-height cards across a grid row – only when the card is alone in its column,
   otherwise it stretches to the whole column and overflows whatever sits under it */
.row > [class*="col"] > .card-rpc:only-child { height: 100%; }
.card-rpc:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(9, 24, 49, .14); }
/* Most site photos are 10:3 banners with text baked in, so cards keep that ratio to avoid cropping it */
.card-rpc .card-img-top { aspect-ratio: 10 / 3; object-fit: cover; }
.card-rpc .card-title { font-size: 1.1rem; }
.card-rpc a.stretched-link { color: inherit; text-decoration: none; }

.icon-badge { width: 3rem; height: 3rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--rpc-navy); color: #fff; font-size: 1.25rem; flex-shrink: 0; }

.person-card { text-align: center; }
.person-card img { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 6px 20px rgba(9, 24, 49, .15); background: #fff; }
.person-card h3 { font-size: 1.1rem; margin: 1rem 0 .15rem; }
.person-card .role { color: var(--rpc-accent-dark); font-size: .9rem; font-weight: 500; }

.feature-list li { margin-bottom: .35rem; }
.rounded-img { border-radius: .9rem; box-shadow: 0 8px 26px rgba(9, 24, 49, .12); }

.btn-rpc { background: var(--rpc-navy); border-color: var(--rpc-navy); color: #fff; }
.btn-rpc:hover, .btn-rpc:focus { background: var(--rpc-accent-dark); border-color: var(--rpc-accent-dark); color: #fff; }
.btn-accent { background: var(--rpc-accent); border-color: var(--rpc-accent); color: var(--rpc-navy-dark); font-weight: 600; }
.btn-accent:hover, .btn-accent:focus { background: #fff; border-color: #fff; color: var(--rpc-navy); }

.table-rpc thead th { background: var(--rpc-navy); color: #fff; font-weight: 500; border-color: var(--rpc-navy); }
.table-rpc td { vertical-align: top; }

/* Services & Events: each day is a <tbody>, its date shown once across all its events */
.table-events .event-day { border-top: 2px solid var(--rpc-navy); }
.table-events .event-day:nth-of-type(even) > tr > * { background: var(--rpc-light); }
.table-events .event-date { color: var(--rpc-navy); font-weight: 600; vertical-align: top; white-space: nowrap; }
@media (max-width: 575.98px) {
  .table-events .event-date { white-space: normal; min-width: 6.5rem; }
}

.embed-frame { width: 100%; border: 0; border-radius: .75rem; box-shadow: 0 6px 24px rgba(9, 24, 49, .08); background: #fff; }

.magazine-item { text-align: center; text-decoration: none; color: var(--rpc-navy); display: block; }
.magazine-item img { border-radius: .4rem; box-shadow: 0 4px 16px rgba(9, 24, 49, .15); transition: transform .2s; aspect-ratio: 210 / 297; object-fit: cover; width: 100%; }
.magazine-item:hover img { transform: scale(1.03); }
.magazine-item span { display: block; margin-top: .5rem; font-size: .9rem; font-weight: 500; }

.partner-logo { display: flex; align-items: center; justify-content: center; height: 140px; padding: 1.25rem; background: #fff; border-radius: .9rem; box-shadow: 0 6px 24px rgba(9, 24, 49, .08); }
.partner-logo img { max-height: 100%; object-fit: contain; }

.accordion-rpc .accordion-button:not(.collapsed) { background: var(--rpc-navy); color: #fff; }
.accordion-rpc .accordion-button:not(.collapsed)::after { filter: brightness(0) invert(1); }
.accordion-rpc .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(46, 197, 206, .35); }

/* Article content migrated from the old CMS */
.article-body h1, .article-body h2 { font-size: 1.6rem; margin: 2rem 0 1rem; }
.article-body h3 { font-size: 1.3rem; margin: 1.75rem 0 .75rem; }
.article-body h4 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.article-body > :first-child { margin-top: 0; }
.article-body img { border-radius: .6rem; margin: .5rem 0 1rem; }
.article-body ul, .article-body ol { margin-bottom: 1rem; }
.article-body li { margin-bottom: .3rem; }
.article-body blockquote { border-left: 4px solid var(--rpc-accent); padding: .5rem 1rem; background: var(--rpc-light); }
.article-body .table-responsive { margin: 1rem 0 2rem; }

/* Sunday reading sheet (generated by tools/update_readings.py) */
.article-body .reading-heading { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rpc-accent-dark); border-top: 1px solid #e3e8ef; padding-top: 1.5rem; margin-top: 2.25rem; }
.article-body .reading-intro { margin-top: 2rem; color: var(--rpc-navy); }
.article-body .reading-ref { text-align: right; font-style: italic; color: var(--rpc-navy); font-weight: 500; }
.article-body .liturgy-cue { margin-bottom: .25rem; }
.article-body .liturgy-response { padding-left: 1rem; border-left: 3px solid var(--rpc-accent); }


/* ---------- Events ---------- */
.event-card { overflow: hidden; }
.event-image { width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block; }
.event-card .col-md-5 .event-image { height: 260px; }
/* Side-by-side layout: the picture fills its column, so the text (not a tall photo) sets the card height */
@media (min-width: 768px) {
  .event-card .col-md-5 { min-height: 300px; }
  .event-card .col-md-5 .event-image { position: absolute; inset: 0; height: 100%; }
}
.event-image-contain { object-fit: contain; padding: 1.5rem; background: #fff; border-bottom: 1px solid #e3e8ef; }
.event-image-placeholder { display: flex; align-items: center; justify-content: center; font-size: 3.5rem; color: rgba(255, 255, 255, .85);
  background: linear-gradient(135deg, var(--rpc-navy-dark), var(--rpc-navy) 60%, var(--rpc-accent-dark)); }
.event-badge { position: absolute; top: 1rem; left: 1rem; background: #fff; color: var(--rpc-navy); border-radius: .6rem; padding: .35rem .8rem;
  text-align: center; font-size: .8rem; font-weight: 600; text-transform: uppercase; line-height: 1.1; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.event-badge span { display: block; font-size: 1.6rem; font-weight: 700; }
.event-meta { margin-bottom: 1rem; }
.event-meta li { display: flex; gap: .6rem; align-items: baseline; color: var(--rpc-navy); font-weight: 500; margin-bottom: .25rem; }
.event-meta i { color: var(--rpc-accent-dark); }
#events-list .event-card { scroll-margin-top: 6rem; }

/* Compact home page cards, used when there are more than three events */
.event-card-compact .event-thumb { width: 9.5rem; }
.event-card-compact .event-image { position: absolute; inset: 0; height: 100%; min-height: 0; }
.event-card-compact .event-image-contain { padding: .5rem; border-bottom: 0; border-right: 1px solid #e3e8ef; }
.event-card-compact .event-image-placeholder { font-size: 2rem; }
.event-card-compact .event-badge { top: .5rem; left: .5rem; padding: .2rem .55rem; font-size: .7rem; }
.event-card-compact .event-badge span { font-size: 1.2rem; }
.event-card-compact .event-meta { margin-bottom: 0; font-size: .875rem; }
.event-card-compact .card-body { min-height: 8.5rem; }
@media (max-width: 575.98px) {
  .event-card-compact .event-thumb { width: 7rem; }
}

/* ---------- Home page: church photo fixed behind the whole page ---------- */
/* A fixed layer rather than background-attachment: fixed, which phones (iOS) ignore */
body.home-photo { background: var(--rpc-navy-dark); }
body.home-photo::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url("../img/church-photo.jpg") center 30% / cover no-repeat;
}
/* Phones in portrait get a smaller crop centred on the tower */
@media (max-width: 767.98px) and (orientation: portrait) {
  body.home-photo::before { background-image: url("../img/church-photo-small.jpg"); background-position: center top; }
}
/* Light white veil softens (fades) the photo without darkening it */
body.home-photo::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .35);
}
/* The welcome block sits near the top */
.home-photo .hero { background: none; min-height: 0; align-items: flex-start; }
.home-photo .hero > .container { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.home-photo .hero::before { display: none; }
.home-photo .hero h1, .home-photo .hero p, .home-photo .hero .eyebrow {
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7), 0 2px 18px rgba(0, 0, 0, .55);
}
.home-photo .hero .eyebrow { color: var(--rpc-accent); }
/* See-through panel behind the welcome text only, so the photo itself isn't darkened */
.home-photo .welcome-panel {
  background: rgba(9, 24, 49, .62); border-radius: 1rem; padding: 2rem 2.25rem;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}
.home-photo .welcome-panel h1, .home-photo .welcome-panel p { text-shadow: none; }
@media (max-width: 575.98px) {
  .home-photo .welcome-panel { padding: 1.5rem 1.25rem; }
}
/* Content sections float over the photo as panels */
.home-photo main > .section, .home-photo main > .section-alt { background: transparent; padding: 1.5rem 0; }
.home-photo main > .hero + .section { padding-top: .5rem; }
.home-photo main > .section:last-child { padding-bottom: 4rem; }
.home-photo main > .section > .container {
  background: rgba(255, 255, 255, .95); border-radius: 1.25rem; padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (max-width: 575.98px) {
  .home-photo .hero { min-height: 0; }
  .home-photo main > .section > .container { padding: 1.5rem 1rem; border-radius: 1rem; width: calc(100% - 1.5rem); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--rpc-navy-dark); color: #fff; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--rpc-accent); }
.footer-heading { color: var(--rpc-accent); font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1rem; }
.footer-bottom { background: #06101f; color: rgba(255, 255, 255, .7); }
.social-btn { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .1); }
.social-btn:hover { background: var(--rpc-accent); color: var(--rpc-navy-dark) !important; }

.back-to-top {
  position: fixed; right: 1rem; bottom: 1rem; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%;
  background: var(--rpc-accent); color: var(--rpc-navy-dark); font-size: 1.2rem;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 1040;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }

/* Cookie consent banner (assets/js/consent.js) */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
  background: var(--rpc-navy-dark); color: #fff; box-shadow: 0 -.25rem 1rem rgba(0, 0, 0, .2);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cookie-banner a { color: var(--rpc-accent); }
.cookie-banner a:hover { color: #fff; }
.footer-bottom .link-button { background: none; border: 0; padding: 0; color: #fff; font: inherit; }
.footer-bottom .link-button:hover { color: var(--rpc-accent); }

/* Large gutters are wider than the container padding on small screens and cause sideways scrolling */
@media (max-width: 991.98px) {
  .row.g-5 { --bs-gutter-x: 1.5rem; }
}

@media (max-width: 575.98px) {
  .hero { min-height: 0; padding: 3.5rem 0; }
  .section { padding: 2.75rem 0; }
  .brand-name { font-size: .95rem; }
}
