/*
Theme Name: St. Dominic's Parish
Theme URI: https://www.stdominicbarbados.com
Author: Parish Office
Description: Custom theme for St. Dominic's Roman Catholic Church Barbados, built to match the parish's existing brand (Montserrat type, deep blue accent, full-bleed photo banners).
Version: 1.0.0
Requires PHP: 7.4
Text Domain: stdominic
*/

/* ---------- Design tokens ---------- */
:root {
	--color-primary: #294489;
	--color-accent: #c0392b;
	--color-text: #2a2a2a;
	--color-text-muted: rgba(0, 0, 0, 0.6);
	--color-bg-tint: rgba(0, 0, 0, 0.05);
	--font-heading: 'Montserrat', sans-serif;
	--font-body: 'Montserrat', sans-serif;
	--container-max: 1200px;
}

@font-face {
	font-family: 'Montserrat';
	src: url('fonts/regular.woff2') format('woff2'),
	     url('fonts/regular.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Montserrat';
	src: url('fonts/bold.woff2') format('woff2'),
	     url('fonts/bold.woff') format('woff');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

body {
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.75;
	color: var(--color-text);
	background: #fff;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; color: var(--color-primary); line-height: 1.25; }
h2 { font-size: 24px; margin-bottom: 24px; }
h3 { font-size: 19px; margin-bottom: 16px; }

.entry-content p { margin-bottom: 24px; }
.entry-content a { text-decoration: underline; font-weight: 600; transition: opacity .2s ease; }
.entry-content a:hover { opacity: .7; }

.container { margin: 0 auto; padding: 0 40px; }

.screen-reader-text { position: absolute; left: -9999px; }

/* ---------- Site header ---------- */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 100;
	padding: 18px 0;
	background: transparent;
	color: #fff;
	transition: background-color .25s ease, color .25s ease, padding .2s ease;
}

.site-header.is-scrolled,
.site-header.no-banner {
	background: #fff;
	color: var(--color-text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	padding: 10px 0;
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 12px;
}

.site-branding img { max-height: 46px; width: auto; }

.site-branding .site-title {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 18px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: inherit;
}

.primary-nav ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	position: relative;
}

.primary-nav a {
	display: block;
	padding: 10px 16px;
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: opacity .2s ease;
}

.primary-nav a:hover { opacity: .65; }

.primary-nav li { position: relative; }

.primary-nav ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	flex-direction: column;
	padding: 8px 0;
	z-index: 10;
}

/* Third level and deeper (e.g. About the parish -> Sunday School) must
   open sideways instead of reusing the top:100% rule above -- otherwise
   they render on top of their own siblings in the dropdown that's
   already open above them. */
.primary-nav ul ul ul {
	top: -8px;
	left: 100%;
}

.primary-nav li:hover > ul { display: flex; }

.primary-nav ul ul a { color: var(--color-text); padding: 10px 20px; font-weight: 500; }

.menu-toggle {
	display: none;
	background: none;
	border: none;
	color: inherit;
	font-size: 24px;
	cursor: pointer;
}

/* ---------- Page banner ---------- */
.page-banner {
	position: relative;
	min-height: 380px;
	display: flex;
	align-items: flex-end;
	background-color: #111;
	background-size: cover;
	background-position: center;
	color: #fff;
}

.page-banner:before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0.05) 100%);
}

.page-banner .container { position: relative; padding-top: 140px; padding-bottom: 50px; }

.page-banner h1 {
	color: #fff;
	font-size: 44px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.page-banner .entry-meta {
	margin-top: 12px;
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: .9;
}

.page-banner .entry-meta a { text-decoration: underline; }

/* homepage hero (no title banner, just full photo) */
.home-hero {
	position: relative;
	min-height: 620px;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
}

.home-hero:before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.08) 60%, rgba(0, 0, 0, 0.25) 100%);
}

.home-hero .container {
	position: relative;
	padding-top: 120px;
	display: grid;
	grid-template-columns: minmax(260px, 380px) 1fr;
	gap: 40px;
	align-items: center;
}

.home-hero .mass-times-card {
	background: rgba(90, 90, 210, 0.3);
	color: var(--color-accent);
	padding: 28px 30px;
	border-radius: 2px;
}

.home-hero .mass-times-card h2 {
	color: var(--color-accent);
	text-align: center;
	text-transform: uppercase;
	margin-bottom: 14px;
}

.home-hero .mass-times-card p {
	color: var(--color-accent);
	font-weight: 700;
	margin-bottom: 6px;
	line-height: 1.5;
}

.home-hero .site-tagline {
	color: #fff;
	text-align: left;
}

.home-hero .site-tagline p {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 22px;
	margin-bottom: 6px;
}

.home-hero .site-tagline p span {
	display: inline-block;
	background: rgba(88, 44, 145, 0.85);
	padding: 6px 14px;
}

.hero-social-icons {
	margin-top: 16px;
	display: flex;
	gap: 8px;
}

.hero-social-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: #fff;
	font-size: 14px;
}

.hero-social-mail { background: #363b3e; }
.hero-social-youtube { background: #b31217; }
.hero-social-icon:hover { opacity: .8; }

/* ---------- Main content ---------- */
.site-main { padding: 60px 0; }
.site-main .container { max-width: 900px; }

.site-main.is-wide .container { max-width: none; }

/* ---------- Event archive / listing ---------- */
.event-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 30px;
}

.event-card { border: 1px solid rgba(0, 0, 0, 0.08); }
.event-card .event-card-thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-bg-tint); }
.event-card .event-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.event-card .event-card-body { padding: 18px 20px; }
.event-card h3 { font-size: 16px; margin-bottom: 6px; }
.event-card .event-card-meta { font-size: 12px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.event-card p { font-size: 14px; margin-bottom: 0; }

.pagination { margin-top: 50px; display: flex; gap: 10px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid rgba(0, 0, 0, 0.15); font-size: 14px; }
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ---------- Footer ---------- */
.site-footer { background: #fff; border-top: 1px solid rgba(0, 0, 0, 0.08); font-size: 14px; }
.footer-widgets { background: #f0f0f0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; padding: 60px 40px; margin: 0 -40px; }
.footer-widgets h2 {
	color: var(--color-text);
	font-size: 15px;
	letter-spacing: 0.02em;
	margin-bottom: 14px;
}
.footer-widgets .widget { margin-bottom: 24px; }
.footer-widgets p { margin-bottom: 8px; line-height: 1.5; color: var(--color-text-muted); }
.footer-widgets a { text-decoration: underline; }
.footer-widgets p.footer-note { font-size: 12px; margin-top: 16px; }

.footer-map { margin: 0 -40px; }
.footer-map iframe { width: 100%; height: 250px; border: none; display: block; }

.footer-nav-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 20px;
	padding: 20px 0 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-nav-list a {
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	transition: opacity .2s ease;
}

.footer-nav-list a:hover { opacity: .65; }

.site-footer .footer-bottom {
	padding: 20px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	text-align: center;
	font-size: 13px;
	color: var(--color-text-muted);
}

/* ---------- Buttons ---------- */
.btn, .wp-block-button__link {
	display: inline-block;
	padding: 12px 24px;
	border: 1px solid var(--color-primary);
	color: var(--color-primary);
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	transition: background-color .2s ease, color .2s ease;
}

.btn:hover, .wp-block-button__link:hover { background: var(--color-primary); color: #fff; }

/* ---------- Legacy migrated content (Weebly widget markup kept in post/page content) ---------- */
.entry-content .paragraph { margin-bottom: 20px; line-height: 1.6; }
.entry-content .wsite-content-title { text-align: center; margin: 10px 0 30px; }

.entry-content .styled-hr { border: none; border-top: 1px solid rgba(0, 0, 0, 0.1); height: 0; }

.entry-content .wsite-multicol-table { width: 100%; }
.entry-content .wsite-multicol-col { vertical-align: top; }

.entry-content .wsite-button {
	display: inline-block;
	padding: 13px 45px;
	border: 1px solid var(--color-primary);
	border-radius: 3px;
	background: transparent;
	color: var(--color-primary) !important;
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
	transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.entry-content .wsite-button:hover { background: var(--color-primary); color: #fff !important; }
.entry-content .wsite-button-small { padding: 8px 18px; font-size: 11px; }

.entry-content .wsite-youtube-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.entry-content .wsite-youtube-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.entry-content .colored-box {
	background: var(--color-primary);
	color: #fff;
	padding: 22px 40px;
	border-radius: 4px;
	margin: 30px 0;
}
.entry-content .colored-box .paragraph { color: #fff; }
.entry-content .colored-box .wsite-button-normal {
	border-color: #fff;
	color: #fff !important;
	background: transparent;
}
.entry-content .colored-box .wsite-button-normal:hover { background: #fff; color: var(--color-primary) !important; }
.entry-content .colored-box .wsite-button-highlight {
	background: #fff;
	border-color: #fff;
	color: var(--color-primary) !important;
}
.entry-content .colored-box .wsite-button-highlight:hover { opacity: .8; }

@media (max-width: 700px) {
	.entry-content .wsite-multicol-table,
	.entry-content .wsite-multicol-tbody,
	.entry-content .wsite-multicol-tr,
	.entry-content .wsite-multicol-col {
		display: block;
		width: 100% !important;
	}
	.entry-content .wsite-multicol-col { margin-bottom: 20px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 782px) {
	.primary-nav { display: none; }
	.menu-toggle { display: block; }
	.site-header.nav-open .primary-nav {
		display: block;
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		background: #fff;
	}
	.site-header.nav-open .primary-nav ul { flex-direction: column; }
	.site-header.nav-open .primary-nav a { color: var(--color-text); }
	.site-header.nav-open .primary-nav ul ul { position: static; box-shadow: none; padding-left: 20px; }
	.home-hero .container { grid-template-columns: 1fr; }
	.home-hero .site-tagline { text-align: left; }
	.page-banner h1 { font-size: 30px; }
}

/* ---------- Lightbox (click-to-enlarge for content images) ---------- */
.entry-content .wp-block-gallery img,
.entry-content .wsite-image img {
	cursor: zoom-in;
}

.stdominic-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	cursor: zoom-out;
}

.stdominic-lightbox img {
	max-width: 100%;
	max-height: 100%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.stdominic-lightbox-close {
	position: absolute;
	top: 20px;
	right: 30px;
	background: none;
	border: none;
	color: #fff;
	font-size: 40px;
	line-height: 1;
	cursor: pointer;
}

body.stdominic-lightbox-open { overflow: hidden; }

/* ---------- Photo Gallery page: thumbnails link out to event pages ---------- */
.pg-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.pg-grid .pg-card {
	display: block;
	width: calc(33.33% - 4px);
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.pg-grid .pg-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .2s ease;
}

.pg-grid .pg-card:hover img { transform: scale(1.05); }

@media (max-width: 600px) {
	.pg-grid .pg-card { width: calc(50% - 3px); }
}
