/*
Theme Name: Church Theme
Author: Paul Spann — Internet Solutions Services Limited
Author URI: https://issl.co.uk
Description: An accessible, responsive Roman Catholic church theme with editable Mass times, PDF newsletters, two header logos, homepage photographs and parish contact details. Designed by Paul Spann for Internet Solutions Services Limited.
Version: 2.0.2
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: sacred-heart-parish
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --parish-primary: #8c1515;
  --parish-primary-dark: #5f0707;
  --parish-gold: #c4a35a;
  --parish-cream: #f7f2e8;
  --parish-text: #28241f;
  --parish-white: #fff;
  --parish-border: rgba(75, 13, 33, .14);
  --parish-shadow: 0 18px 50px rgba(50, 28, 20, .11);
  --parish-radius: 8px;
  --parish-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--parish-text);
  background: var(--parish-white);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
img { max-width: 100%; height: auto; }
a { color: var(--parish-primary); text-underline-offset: .2em; }
a:hover { color: var(--parish-primary-dark); }
h1, h2, h3, h4 { color: var(--parish-primary-dark); line-height: 1.22; margin-top: 0; }
h1 { font-size: clamp(2.25rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
p { margin: 0 0 1.2rem; }
.container { width: min(calc(100% - 40px), var(--parish-width)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { clip: auto; width: auto; height: auto; top: 8px; left: 8px; z-index: 99999; padding: 10px 14px; background: #fff; color: #000; }

.site-topbar { background: var(--parish-primary-dark); color: #fff; font-size: .92rem; }
.topbar-inner { min-height: 36px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.topbar-inner a { color: #fff; text-decoration: none; }
.topbar-icon { color: var(--parish-gold); font-weight: 800; margin-right: 7px; }
.mass-times-quick { position: relative; }
.mass-times-trigger { display: block; padding-block: 5px; }
.mass-times-popover { position: absolute; top: 100%; right: 0; z-index: 1200; width: min(390px, calc(100vw - 28px)); max-height: 72vh; padding: 28px; overflow: auto; border-top: 4px solid var(--parish-gold); border-radius: 0 0 var(--parish-radius) var(--parish-radius); background: #fff; color: var(--parish-text); box-shadow: 0 18px 50px rgba(0,0,0,.28); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.mass-times-quick:hover .mass-times-popover, .mass-times-quick:focus-within .mass-times-popover { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mass-times-popover h2, .mass-times-popover h3, .mass-times-popover h4 { color: var(--parish-primary-dark); font-size: 1.15rem; }
.mass-times-popover p, .mass-times-popover li { margin-bottom: .55rem; font-size: .92rem; line-height: 1.5; }
.mass-times-popover .button { margin-top: 10px; padding: 8px 13px; background: var(--parish-primary); border-color: var(--parish-primary); color: #fff; font-size: .82rem; }
.site-branding { background: var(--parish-primary-dark); border-bottom: 0; }
.branding-inner { min-height: 126px; display: grid; grid-template-columns: 108px 1fr 108px; align-items: center; gap: 22px; padding-block: 10px; }
.header-logo { display: flex; align-items: center; justify-content: center; min-width: 0; }
.header-logo img, .custom-logo { width: auto; max-width: 98px; max-height: 104px; object-fit: contain; }
.header-logo-left img { max-width: 78px; }
.header-logo-right img { max-width: 58px; }
.site-title-wrap { text-align: center; }
.site-title { display: block; color: #fff; font-size: clamp(1.65rem, 3.5vw, 2.7rem); font-weight: 700; line-height: 1.1; text-decoration: none; }
.site-title:hover, .site-title:focus { color: #fff; }
.site-tagline { margin: 6px 0 0; color: rgba(255,255,255,.82); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; }

.site-navigation { position: sticky; top: 0; z-index: 1000; background: var(--parish-primary-dark); box-shadow: 0 5px 5px rgba(0, 0, 0, .2); }
.nav-inner { position: relative; }
.menu-toggle { display: none; width: 100%; padding: 14px 0; border: 0; background: transparent; color: #fff; font: inherit; font-weight: 700; text-align: left; }
.menu-toggle::after { content: "☰"; float: right; }
.primary-menu, .primary-menu ul { margin: 0; padding: 0; list-style: none; }
.primary-menu { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; }
.primary-menu > li { position: relative; }
.primary-menu > li > a { position: relative; display: flex; min-height: 54px; align-items: center; padding: 0 14px; color: #fff; font-size: .85rem; font-weight: 700; text-decoration: none; }
.primary-menu > li > a::after { content: ""; position: absolute; right: 14px; bottom: 8px; left: 14px; height: 2px; background: var(--parish-gold); transform: scaleX(0); transform-origin: center; transition: transform .2s ease; }
.primary-menu > li > a:hover::after, .primary-menu > li > a:focus::after, .primary-menu > .current-menu-item > a::after, .primary-menu > .current-menu-ancestor > a::after { transform: scaleX(1); }
.primary-menu a:hover, .primary-menu a:focus, .primary-menu .current-menu-item > a { color: #fff; }
.primary-menu ul { display: none; position: absolute; z-index: 20; min-width: 245px; border-top: 3px solid var(--parish-gold); background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.2); }
.primary-menu li:hover > ul, .primary-menu li:focus-within > ul { display: block; }
.primary-menu ul a { display: block; padding: 11px 13px; border-bottom: 1px solid #ddd; color: #002147; font-size: .82rem; line-height: 1.35; text-decoration: none; white-space: nowrap; transition: color .2s ease, background .2s ease; }
.primary-menu ul a:hover, .primary-menu ul a:focus, .primary-menu ul .current-menu-item > a { background: #f5f5f5; color: var(--parish-primary-dark); }
.primary-menu ul ul { top: -3px; left: 100%; }

.hero { position: relative; min-height: 590px; display: grid; place-items: center; background: var(--hero-image, linear-gradient(135deg, #6f1833, #280711)); background-position: center; background-size: cover; color: #fff; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 8px; background: var(--parish-gold); }
.hero-content { position: relative; z-index: 1; max-width: 780px; padding-block: 90px; text-align: center; }
.hero-kicker { margin-bottom: 10px; color: #f4d890; font-size: .9rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.hero h1 { margin-bottom: 20px; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.hero p { font-size: clamp(1.05rem, 2vw, 1.3rem); text-shadow: 0 2px 10px rgba(0,0,0,.9); }
.button { display: inline-block; margin: 12px 5px 0; padding: 13px 22px; border: 2px solid var(--parish-gold); border-radius: 3px; background: var(--parish-gold); color: #2e160a; font-weight: 700; text-decoration: none; }
.button:hover { border-color: #fff; background: #fff; color: var(--parish-primary-dark); }
.button-outline { background: transparent; color: #fff; }

.home-section { padding-block: 80px; }
.section-heading { max-width: 720px; margin: 0 auto 42px; text-align: center; }
.section-heading::after { content: ""; display: block; width: 72px; height: 3px; margin: 20px auto 0; background: var(--parish-gold); }
.welcome-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 54px; align-items: center; }
.welcome-image img { width: 100%; min-height: 390px; object-fit: cover; border-radius: var(--parish-radius); box-shadow: var(--parish-shadow); }
.eyebrow { color: var(--parish-primary); font-size: .85rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.mass-section { position: relative; overflow: hidden; background: var(--parish-primary-dark); color: #fff; }
.mass-section::before,
.mass-section::after { content: ""; position: absolute; z-index: 0; pointer-events: none; background: rgba(255,255,255,.045); }
.mass-section::before { top: 38px; right: calc(4% + 82px); width: 70px; height: 330px; }
.mass-section::after { top: 112px; right: 4%; width: 234px; height: 70px; }
.mass-section h2, .mass-section h3 { color: #fff; }
.mass-grid { position: relative; z-index: 1; display: grid; grid-template-columns: .75fr 1.25fr; gap: 55px; align-items: start; }
.mass-times-card { padding: 38px; border-top: 5px solid var(--parish-gold); border-radius: var(--parish-radius); background: #fff; color: var(--parish-text); box-shadow: 0 18px 55px rgba(0,0,0,.24); }
.mass-times-card h3 { color: var(--parish-primary-dark); }
.mass-times-text > :last-child { margin-bottom: 0; }
.mass-times-text h2, .mass-times-text h3, .mass-times-text h4 { color: var(--parish-primary-dark); font-size: 1.2rem; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.photo-card { position: relative; min-height: 300px; overflow: hidden; border-radius: var(--parish-radius); background: var(--parish-cream); }
.photo-card img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; transition: transform .5s ease; }
.photo-card:hover img { transform: scale(1.035); }

.newsletter-section { background: var(--parish-cream); }
.newsletter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.newsletter-card { display: flex; flex-direction: column; padding: 28px; border: 1px solid var(--parish-border); border-top: 4px solid var(--parish-gold); border-radius: var(--parish-radius); background: #fff; box-shadow: 0 10px 30px rgba(50,28,20,.06); }
.newsletter-card h3 { margin-bottom: 8px; }
.newsletter-date { color: #6f665d; font-size: .9rem; }
.newsletter-card .button { align-self: flex-start; margin-top: auto; background: var(--parish-primary); border-color: var(--parish-primary); color: #fff; }
.newsletter-card .button:hover { background: var(--parish-primary-dark); }
.newsletter-actions { margin-top: 36px; text-align: center; }

.entry-wrap { padding-block: 70px 90px; }
.entry-header { margin-bottom: 32px; padding-bottom: 22px; border-bottom: 3px solid var(--parish-gold); }
.entry-title { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); }
.entry-content > * { max-width: 850px; }
.entry-content > .alignwide { max-width: var(--parish-width); }
.entry-content > .alignfull { max-width: none; }
.newsletter-list { display: grid; gap: 18px; }
.newsletter-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 24px; border: 1px solid var(--parish-border); border-radius: var(--parish-radius); background: #fff; }
.newsletter-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin: 34px 0; padding: 22px; border-radius: var(--parish-radius); background: var(--parish-cream); }
.newsletter-filter label { display: block; margin-bottom: 5px; color: var(--parish-primary-dark); font-weight: 700; }
.newsletter-filter select { min-width: 180px; padding: 11px 38px 11px 12px; border: 1px solid #b8afa5; border-radius: 4px; background: #fff; font: inherit; }
.newsletter-filter .button { min-height: 48px; }
.newsletter-filter__reset { align-self: center; color: var(--parish-primary-dark); font-weight: 700; }
.newsletter-archive-heading { margin: 0 0 22px; color: var(--parish-primary-dark); }

.site-footer { background: var(--parish-primary-dark); color: rgba(255,255,255,.83); }
.footer-main { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding-block: 36px; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer h2, .site-footer h3 { margin-bottom: 10px; }
.site-footer p { margin-bottom: .7rem; }
.site-footer a { color: #fff; }
.footer-address { white-space: pre-line; }
.facebook-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.facebook-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #1877f2; color: #fff; font-size: 1.25rem; }
.footer-bottom { padding-block: 11px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; }

@media (max-width: 900px) {
  .welcome-grid, .mass-grid, .footer-main { grid-template-columns: 1fr; }
  .newsletter-grid { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 500px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 28px), var(--parish-width)); }
  .topbar-inner { justify-content: center; flex-wrap: wrap; gap: 5px 18px; padding-block: 8px; }
  .mass-times-popover { position: fixed; top: 52px; right: 14px; left: 14px; width: auto; }
  .branding-inner { min-height: 104px; grid-template-columns: 62px 1fr 62px; gap: 10px; padding-block: 8px; }
  .header-logo img, .custom-logo { max-width: 58px; max-height: 78px; }
  .header-logo-left img { max-width: 52px; }
  .header-logo-right img { max-width: 42px; }
  .site-tagline { font-size: .75rem; }
  .menu-toggle { display: block; }
  .primary-menu { display: none; padding-bottom: 10px; }
  .primary-menu.is-open { display: block; }
  .primary-menu > li > a { min-height: 0; padding: 12px 0; }
  .primary-menu > li > a::after { right: 0; bottom: 5px; left: 0; transform-origin: left; }
  .primary-menu ul { display: block; position: static; padding-left: 18px; border-top: 0; background: transparent; box-shadow: none; }
  .primary-menu ul a { padding: 9px 0; border-color: rgba(255,255,255,.18); color: #fff; white-space: normal; }
  .primary-menu ul a:hover, .primary-menu ul a:focus { background: transparent; color: var(--parish-gold); }
  .hero { min-height: 470px; }
  .mass-section::before { top: 50px; right: 74px; width: 48px; height: 250px; }
  .mass-section::after { top: 105px; right: 28px; width: 140px; height: 48px; }
  .home-section { padding-block: 58px; }
  .photo-grid, .newsletter-grid { grid-template-columns: 1fr; }
  .photo-card { min-height: 240px; }
  .photo-card img { min-height: 240px; }
  .newsletter-row { grid-template-columns: 1fr; }
  .newsletter-filter { display: grid; }
  .newsletter-filter select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
