/*
Theme Name: Lodge 43
Theme URI: https://lodge43.org/
Author: Lodge No. 43, F. & A. M.
Description: Custom theme for Lodge No. 43, Free and Accepted Masons. Navy and gold, classic serif headings, full-width homepage and matching interior pages.
Version: 1.1.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lodge43
*/

:root {
	--navy: #0E2440;
	--navy-deep: #081830;
	--gold: #C9A24A;
	--gold-light: #E9C46A;
	--gold-text: #7A5C12;
	--cream: #F7F4EC;
	--line: #E6E0D0;
	--ink: #2A2F38;
	--muted: #555B66;
	--serif: 'Libre Caslon Text', Georgia, serif;
	--sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--navy); }
a:hover { color: var(--gold-text); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--serif);
	color: var(--navy);
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 .6em;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
	left: 12px; top: 12px; z-index: 100000; padding: 12px 18px;
	background: #fff; color: var(--navy); font-weight: 600;
}

.eyebrow {
	display: block;
	font-size: 13px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--gold-text);
	font-weight: 700;
	margin: 0 0 12px;
}

.btn {
	display: inline-block;
	text-decoration: none;
	padding: 14px 24px;
	border-radius: 4px;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
	border: 2px solid transparent;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { color: var(--gold-light); }
.btn-gold { background: var(--gold-light); color: var(--navy); }
.btn-gold:hover { color: var(--navy); background: #f1d283; }
.btn-outline { border-color: var(--navy); color: var(--navy); }

/* ---------- Header ---------- */

.top-strip { background: var(--navy-deep); height: 14px; }

.site-header {
	background: #fff;
	border-bottom: 1px solid var(--line);
	position: relative;
	z-index: 50;
}
.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	padding-top: 16px;
	padding-bottom: 16px;
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand .custom-logo { width: 52px; height: auto; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.brand-tag { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #6B5A2E; white-space: nowrap; }
.header-cta { white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 24px; }

.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav > ul { display: flex; align-items: center; gap: 4px 32px; flex-wrap: nowrap; }
.primary-nav > ul > li > a { font-size: 16px; }
.primary-nav > ul > li.menu-item-has-children > a::after { display: none; }
.primary-nav > ul > li > a { white-space: nowrap; }
.primary-nav li { position: relative; }
.primary-nav a {
	display: block;
	padding: 10px 0;
	color: var(--navy);
	text-decoration: none;
	font-weight: 500;
	font-size: 15px;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a { color: var(--gold-text); }
.primary-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 6px; height: 6px;
	margin-left: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
}
.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: -18px;
	min-width: 250px;
	background: #fff;
	border-top: 3px solid var(--gold);
	box-shadow: 0 12px 30px rgba(14, 36, 64, .14);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s, transform .15s, visibility .15s;
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { padding: 9px 18px; font-size: 14px; }
.primary-nav .sub-menu .sub-menu { top: -11px; left: 100%; }
.primary-nav .sub-menu .menu-item-has-children > a::after { transform: translateY(-2px) rotate(-45deg); }
.submenu-toggle { display: none; }

.nav-toggle {
	display: none;
	background: none;
	border: 2px solid var(--navy);
	border-radius: 4px;
	color: var(--navy);
	font: 600 14px var(--sans);
	padding: 10px 14px;
	cursor: pointer;
	min-height: 44px;
}

@media (max-width: 1200px) {
	.primary-nav > ul > li > a { white-space: normal; }
	.nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
	.header-right { order: 3; width: 100%; display: none; flex-direction: column; align-items: stretch; gap: 16px; padding-bottom: 8px; }
	.site-header.is-open .header-right { display: flex; }
	.site-header .wrap { flex-wrap: wrap; }
	.primary-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
	.primary-nav li { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; }
	.primary-nav li > a { flex: 1; padding: 13px 0; }
	.primary-nav .menu-item-has-children > a::after { display: none; }
	.submenu-toggle {
		display: inline-flex; align-items: center; justify-content: center;
		width: 44px; height: 44px; background: none; border: 0; color: var(--navy); cursor: pointer;
	}
	.submenu-toggle::before {
		content: ""; width: 8px; height: 8px;
		border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
		transform: rotate(45deg); transition: transform .15s;
	}
	.primary-nav li.is-open > .submenu-toggle::before { transform: rotate(-135deg); }
	.primary-nav .sub-menu,
	.primary-nav .sub-menu .sub-menu {
		position: static; width: 100%; min-width: 0; display: none;
		opacity: 1; visibility: visible; transform: none; box-shadow: none; border-top: 0; padding: 0 0 8px 16px;
	}
	.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: none; }
	.primary-nav li.is-open > .sub-menu { display: block; }
	.primary-nav .sub-menu li { border-top: 0; }
	.header-cta { text-align: center; }
}

/* ---------- Page hero (interior pages) ---------- */

.page-hero {
	background: var(--navy);
	color: #fff;
	padding: 72px 0 80px;
	position: relative;
	overflow: hidden;
}
.page-hero::after {
	content: "";
	position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
	background: var(--gold);
}
.page-hero .eyebrow { color: var(--gold-light); }
.page-hero .eyebrow a { color: var(--gold-light); text-decoration: none; }
.page-hero h1 { color: #fff; font-size: clamp(34px, 4.4vw, 52px); margin: 0; max-width: 900px; }
.page-hero .hero-meta { margin: 16px 0 0; color: #C8D1DF; font-size: 15px; }

/* ---------- Content ---------- */

.content-area { padding: 64px 0 96px; }
.entry {
	background: #fff;
	max-width: 860px;
	margin: 0 auto;
	padding: 56px 64px;
	box-shadow: 0 1px 0 var(--line);
}
@media (max-width: 700px) {
	.entry { padding: 36px 22px; }
	.page-hero { padding: 52px 0 60px; }
}

.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 1.2em; }
.entry-content h2 { font-size: 30px; margin: 1.6em 0 .5em; }
.entry-content h3 { font-size: 24px; margin: 1.5em 0 .5em; }
.entry-content h4 { font-size: 20px; margin: 1.4em 0 .5em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content img { border-radius: 2px; }
.entry-content figure { margin: 2em 0; }
.entry-content figcaption, .entry-content .wp-element-caption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.entry-content blockquote {
	margin: 2em 0; padding: 4px 0 4px 24px;
	border-left: 3px solid var(--gold);
	font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--navy);
}
.entry-content hr, .entry-content .wp-block-separator {
	border: 0; border-top: 1px solid var(--line); margin: 2.4em auto; max-width: 120px;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: 15px; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.entry-content th { color: var(--navy); font-weight: 600; background: var(--cream); }
.entry-content iframe { max-width: 100%; }
.entry-content .wp-block-button__link {
	background: var(--navy); color: #fff; border-radius: 4px; padding: 14px 24px;
	font-weight: 700; text-decoration: none;
}
.entry-content .wp-block-button__link:hover { color: var(--gold-light); }
.entry-content .alignleft { float: left; margin: .3em 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.5em; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; display: block; }
.entry-content::after { content: ""; display: table; clear: both; }

.featured-image { margin: 0 0 32px; }
.featured-image img { display: block; width: 100%; }

.section-links { max-width: 860px; margin: 32px auto 0; }
.section-links h2 { font-size: 22px; }
.section-links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.section-links a {
	display: block; background: #fff; padding: 18px 20px; text-decoration: none;
	border-left: 3px solid var(--gold); font-weight: 600;
}

.post-nav { max-width: 860px; margin: 32px auto 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.post-nav a { text-decoration: none; font-weight: 600; }
.post-nav span { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; }

/* ---------- Blog grid ---------- */

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px; }
.post-card { background: #fff; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.post-card:hover { color: var(--ink); }
.post-card .thumb { height: 210px; background: #D9D2BF; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.post-card:hover .thumb img { transform: scale(1.03); }
.post-card .thumb-blank { display: flex; align-items: center; justify-content: center; height: 100%; background: var(--navy); }
.post-card .body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 10px; }
.post-card .date { font-size: 13px; color: var(--gold-text); font-weight: 600; }
.post-card h2 { font-size: 22px; line-height: 1.3; margin: 0; }
.post-card:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.post-card p { margin: 0; font-size: 15px; color: var(--muted); }

.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
	display: inline-flex; min-width: 44px; height: 44px; align-items: center; justify-content: center;
	padding: 0 14px; background: #fff; text-decoration: none; font-weight: 600;
}
.pagination .page-numbers.current { background: var(--navy); color: #fff; }

.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form label { flex: 1; }
.search-form input[type="search"] {
	width: 100%; height: 48px; padding: 0 14px; border: 1px solid #CFC7B3; border-radius: 4px;
	font: 16px var(--sans); background: #fff;
}
.search-form button { height: 48px; border: 0; border-radius: 4px; background: var(--navy); color: #fff; font: 700 15px var(--sans); padding: 0 20px; cursor: pointer; }

/* ---------- Homepage ---------- */

.front-page { background: var(--cream); }
/* The homepage content carries its own sections. If it still contains the old
   built-in header strip, header or footer, hide them so they are not doubled. */
.lodge43-theme .l43 > div:empty:first-child,
.lodge43-theme .l43 > header,
.lodge43-theme .l43 > footer { display: none !important; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-deep); color: #C8D1DF; font-size: 14px; line-height: 1.6; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 64px; padding-bottom: 32px; }
.site-footer .col { flex: 1 1 180px; display: flex; flex-direction: column; gap: 8px; }
.site-footer .col-main { flex: 2 1 280px; gap: 12px; }
.site-footer .footer-name { font-family: var(--serif); font-size: 22px; font-weight: 700; color: #fff; }
.site-footer .footer-head { color: var(--gold-light); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.site-footer a { color: #C8D1DF; text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer .bottom {
	border-top: 1px solid #22385A; padding-top: 20px; padding-bottom: 32px;
	display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 13px; color: #94A3BA;
}
.site-footer .bottom a { color: #94A3BA; }

/* ---------- Upcoming events list ---------- */

.l43-events { display: flex; flex-direction: column; gap: 14px; }
.l43-event {
	background: #fff; display: flex; gap: 22px; align-items: center; padding: 18px 22px;
	text-decoration: none !important; color: var(--ink); transition: box-shadow .15s;
}
.l43-event:hover { box-shadow: 0 6px 18px rgba(14, 36, 64, .10); color: var(--ink); }
.l43-badge { width: 64px; flex-shrink: 0; text-align: center; display: flex; flex-direction: column; border: 1px solid var(--line); }
.l43-badge .mo { background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 0; letter-spacing: .08em; line-height: 1.4; }
.l43-badge .d { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--navy); padding: 4px 0; line-height: 1.3; }
.l43-event-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.l43-event-text .t { font-size: 18px; font-weight: 600; color: var(--navy); line-height: 1.3; }
.l43-event-text .m { font-size: 15px; color: var(--muted); line-height: 1.4; }
.l43-events-empty { background: #fff; padding: 22px; margin: 0; }
