/* ==========================================================================
   pages.css — page-specific styles for the root-level KofC pages
   (home / news / people / joinus / mcgivney_story / qrpage)

   Consolidates, from KofC-dev: css/index.css (the section, card, gallery and
   button rules), css/news.css, css/people.css, css/join.css,
   css/join_form.css, css/mcgivney_story.css and css/qrpage.css.

   Loaded AFTER css/kofc-chrome.css, which already provides the tokens,
   reset, navbar, hero, footer and floating buttons.
   ========================================================================== */

/* --- Page hero backdrops -------------------------------------------------
   The page-title bands (home / news / calendar / join us) all use the shared
   .hero + .bkg-gradient grey gradient from css/kofc-chrome.css, matching how
   KofC-dev actually rendered them. No photo hero variants are used. */

/* --- Home: hero extras --------------------------------------------------- */
.tagline {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--blue80);
	padding: 6px 16px;
	border-radius: 20px;
	font-weight: 600;
	font-size: 1.2rem;
	margin-bottom: 1.5rem;
}

.tagline img { width: 2rem; }

.hero h1 { margin-bottom: 1.5rem; }

.hero-content .btn-joinus { margin-top: 2rem; }

.sword-image {
	display: flex;
	width: 45%;
	border-radius: 16px;
	border: 1px solid var(--blue);
	overflow: hidden;
	box-shadow: var(--shadow);
}
.sword-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1s ease;
}
.sword-image:hover img { transform: scale(1.4) translateX(-13%); }

/* --- Sections ------------------------------------------------------------ */
.section { padding: 80px 8%; }

.section-header {
	text-align: center;
	margin-bottom: 50px;
}
.section-header h2 {
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	color: var(--black);
	margin-bottom: 10px;
}
.section-header h3 {
	font-size: clamp(1.1rem, 2vw, 1.4rem);
	color: var(--black);
	font-weight: 600;
}
.section-header p { color: var(--grey); }

.deco-line {
	width: 60px;
	height: 4px;
	background-color: var(--blue);
	margin: 15px auto 0;
	border-radius: 2px;
}

/* --- Cards / pillars / people ------------------------------------------- */
.services-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 30px;
}

.service-card {
	background: var(--white);
	padding: 35px 25px;
	border-radius: 12px;
	border: 1px solid #E2E8F0;
	transition: var(--transition);
	text-align: center;
}
.service-card:hover {
	transform: translateY(-8px);
	border-color: var(--blue);
	box-shadow: var(--shadow);
}
.service-card img {
	width: 4rem;
	margin: 0 auto 20px;
}
.service-card h3 { font-size: 1.3rem; margin-bottom: 12px; }
.service-card h4 { font-size: 1.15rem; margin-bottom: 8px; }
.service-card p  { color: var(--grey); font-size: .95rem; }

.cards-section { margin: 4% 0; }

.people-img {
	width: 90% !important;
	border-radius: 20px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.people-mail {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: .75rem;
	font-size: 1.9rem;
	color: var(--grey80);
	transition: var(--transition);
}
.people-mail:hover { color: var(--dyellow); transform: scale(1.12); }

/* --- Split image sections (history) ------------------------------------- */
.img-section {
	padding: 100px 8%;
	display: flex;
	align-items: center;
	text-align: center;
	justify-content: space-between;
	gap: 40px;
}
.img-section-content { max-width: 600px; }
.img-section h1 {
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	line-height: 1.2;
	margin-bottom: 1.5rem;
	color: var(--black);
}
.img-section p { color: var(--grey); margin-bottom: 2rem; }

.side-image {
	display: flex;
	width: 50%;
	border-radius: 16px;
	border: 1px solid var(--blue);
	overflow: hidden;
	box-shadow: var(--shadow);
}
.side-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1s ease;
}
.side-image:hover img { transform: scale(1.2); }

/* --- Links & buttons ---------------------------------------------------- */
.link1 {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background-color: var(--grey60);
	color: var(--white) !important;
	padding: 5px 15px;
	border-radius: 8px;
	font-weight: 600;
	box-shadow: 0 4px 15px var(--grey60);
	transition: var(--transition);
}
.link1:hover {
	background-color: var(--blue);
	transform: translateY(-3px);
	box-shadow: 0 6px 20px var(--blue80);
}

.link2 {
	color: var(--grey80) !important;
	font-weight: 800;
	transition: var(--transition);
}
.link2:hover { color: var(--dyellow) !important; }

.btn-joinus {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background-color: var(--blue60);
	color: var(--white) !important;
	padding: 10px 22px;
	border-radius: 8px;
	font-weight: 600;
	box-shadow: 0 4px 15px var(--blue60);
	transition: var(--transition);
}
.btn-joinus:hover {
	background-color: var(--blue);
	transform: translateY(-3px);
	box-shadow: 0 6px 20px var(--blue80);
}

/* --- News / TMIY blocks ---------------------------------------------------
   KofC-dev/css/tmiyad.css is never linked by its header.php, so the TMIY block
   was really styled by css/index.css + css/news.css. Those live values are
   reproduced here: .news-format is only a thin wrapper (10px 0) and the inner
   .img-section / .gallery-section supply the 8% inset and vertical rhythm. */
.news-format { padding: 10px 0; }

.news-date {
	display: block;
	text-align: center;
	color: var(--black);
	/* KofC-dev/css/news.css set this label in Hind, not Montserrat. */
	font-family: 'Hind', 'Montserrat', sans-serif;
	font-style: normal;
	font-size: 1rem;
}

.kofc-names { color: var(--black) !important; }

.gallery-section {
	display: block;
	text-align: center;
	padding: 100px 8%;
}
.gallery-section > span { color: var(--blue); }

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
}
.gallery-item {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	height: 220px;
	box-shadow: var(--shadow);
}
.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: var(--transition);
}
.gallery-item:hover img { transform: scale(1.08); }

/* --- TMIY block ---------------------------------------------------------
   Ported verbatim from KofC-dev/css/index.css (the .tmiy-* rules that were
   actually live). `margin: 0 auto` is the one addition: css/kofc-chrome.css
   makes every img display:block, so centring can no longer come from the
   inherited text-align:center the way it did in KofC-dev. */
.tmiy-logo img {
	width: 60%;
	margin: 0 auto 1.5rem;
	transition: var(--transition);
}
.tmiy-logo:hover img { transform: scale(1.02); }

.tmiy-paradisus img {
	width: 40%;
	margin: 0 auto 1rem;
	transition: var(--transition);
}
.tmiy-paradisus img:hover { transform: scale(1.02); }

.img-section h1 span {
    color: var(--blue);
}

/* Bullets inherit KofC-dev's global `li` rule (blue text, 1rem left padding);
   flex only lines up the Material Symbols chevron that replaced <i class="bx">. */
.tmiy-paradisus li {
	color: var(--blue);
	text-align: left;
	padding-left: 1rem;
	margin-bottom: .5rem;
	display: flex;
	gap: .5rem;
	align-items: baseline;
}
.tmiy-paradisus ul { padding-bottom: 1rem; }

/* .tmiy-gift p has no rule in KofC-dev/css/index.css - it inherits .img-section p
   (grey, centred, 2rem bottom margin), which pages.css already declares. */

.tmiy-footer {
	padding-top: 1.5rem;
	font-size: .8rem !important;
}

/* --- Join Us ------------------------------------------------------------ */
.join-section {
	padding: 80px 8%;
	display: block;
	text-align: center;
}
/* KofC-dev/css/join.css had .join-section-content { max-width: 100% } */
.join-section-content { max-width: 100%; }

.join-section h2 {
	font-size: clamp(1.3rem, 3vw, 1.9rem);
	color: var(--black);
	margin-bottom: .75rem;
}
.join-section h3 {
	font-size: clamp(1.1rem, 2.4vw, 1.5rem);
	color: var(--blue);
}

.join-side {
	display: flex;
	justify-content: center;
	width: 70%;
	max-width: 800px;
	justify-self: center;
	margin: 5% 15%;
	border-radius: 16px;
	border: 1px solid var(--blue);
	overflow: hidden;
	box-shadow: var(--shadow);
	background: var(--white);
}

/* --- Join form (parity with KofC-dev/css/join_form.css) -----------------
   Nesting now matches KofC-dev/joinus.php exactly:
       .join-side > form.join-form > div.join-form-wrapper > fields
   The wrapper is the padded card, so its 3vh inset sits *inside* the blue
   border instead of being clipped by .join-side { overflow: hidden }.
   Two insets/overflows were fixed here:
     1. Dev's `.join-form { margin: 0 10% }` was measured against a content box
        with no side padding of its own; the wrapper already supplies that inset
        here, so the form stays full width (stacking both pushed fields out).
     2. min-width:0 lets the form shrink inside .join-side's flex row instead of
        keeping the inputs' intrinsic (~20-char) min-content width. */
.join-form { display: block; width: 100%; min-width: 0; }

.join-form-wrapper {
	display: block;
	width: 100%;
	padding: 3vh;
	border-radius: 10px;
	text-align: left;
	justify-items: center;
}
.join-form-wrapper h2 {
	/* KofC-dev used --red90; pages.css keeps the solid token. */
	color: var(--red);
	padding: 10px;
	border-radius: 5px;
	font-size: 1.2rem;
}
/* Dev's flat 2rem is kept at desktop width and only shrinks on phones, where it
   would otherwise out-run the card (dev bumped it to 2.5rem there). */
.join-form-wrapper h3 {
	color: var(--blue);
	font-size: clamp(1.5rem, 3.2vw, 2rem);
	padding: 10px;
}
.join-form-wrapper h4 { font-size: 1rem; padding: 10px; color: var(--grey); }

.join-input-set {
	width: 100%;
	display: grid;
	background-color: var(--white60);
	padding: 4vh 3vw;
}
/* Grid items default to min-width:auto, i.e. the input's intrinsic ~20-char
   width, which is what pushed the fields past the wrapper padding. */
.join-input-set > * { min-width: 0; }

/* Dev hung the checkbox with `display:block; padding-left:15px; text-indent:-15px`
   and a `transform: scale(2)` box — that transform is what pushed dev's own
   labels outside their padding on narrow screens. Flex does the same hanging
   indent without overflowing, so the 1.3rem label size from dev is safe here. */
.join-checkbox-text {
	display: flex;
	width: 50%;
	justify-self: center;
	align-items: center;
	gap: .75rem;
	font-size: clamp(1.2rem, 2.6vw, 1.3rem);
	text-align: left;
	margin: 1% 0;
}
.join-checkbox {
	/* Dev used `transform: scale(2)` on a 25x10 box; that transform is what
	   overflowed its own padding. A fixed square box gives the same visual size
	   without leaving the wrapper. */
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	accent-color: var(--blue80);
	cursor: pointer;
}

.join-input-text {
	font: inherit;
	font-size: clamp(1.2rem, 2.6vw, 1.3rem);
	background-color: var(--blue60);
	color: var(--white);
	margin: 10px;
	padding: 10px 30px;
	border-radius: 100px;
	border: none;
}
.join-input-text::placeholder { color: var(--grey70); }
.join-input-text:focus {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 1000px var(--blue60) inset !important;
	-webkit-text-fill-color: var(--white) !important;
}

.join-form-btns { padding: 2%; }

.join-btn {
	background-color: var(--grey60);
	color: var(--white);
	font-weight: 600;
	font-size: clamp(1.2rem, 3vw, 1.5rem);
	padding: 10px 25px;
	border-radius: 100px;
	border: none;
	cursor: pointer;
	transition: var(--transition);
}
.join-btn:hover { background-color: var(--blue); }
.join-btn:active { transform: scale(.98); }
.join-btn[disabled] { opacity: .6; cursor: progress; }

.join-err {
	display: block;
	color: var(--red);
	font-size: 1.2rem;
	font-weight: 600;
	min-height: 1.4em;
}
.join-ok {
	display: block;
	color: var(--blue);
	font-size: 1.05rem;
	font-weight: 600;
	padding: 10px 0;
}

/* --- Join Us step 2: confirm-your-e-mail card ---------------------------
   The card reuses .join-form > .join-form-wrapper, so only the extra note and
   the "spent" state need rules. .join-confirm is the child of .join-side that
   replaces form.join-form when joinus.php?t=<token> is opened. */
.join-confirm { display: block; width: 100%; min-width: 0; }
.join-confirm .join-form { margin: 0; }
.join-confirm-note {
	font-size: clamp(1rem, 2.4vw, 1.15rem);
	line-height: 1.5;
	color: var(--black);
	padding: 10px;
}
.join-confirm[data-join-confirm="pending"] .join-btn { background-color: var(--blue); }
.join-confirm[data-join-confirm="confirmed"] h2 { color: var(--blue); }
.join-confirm[data-join-confirm="invalid"] h2,
.join-confirm[data-join-confirm="expired"] h2,
.join-confirm[data-join-confirm="error"] h2 { color: var(--red); }

/* --- Father McGivney story ---------------------------------------------
   KofC-dev's .mcgstory-section declared background-size/-repeat/-position but no
   background-image at all, so the page rendered on the plain body colour. Same
   here — no photo backdrop. */
.mcgstory-section {
	width: 100%;
	background-color: var(--white);
	padding: 60px 8% 80px;
}
.mcgstory-content {
	max-width: 900px;
	margin: 0 auto;
}
.mcgstory-content h1 {
	text-align: center;
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 900;
	margin-bottom: 1.5rem;
}
.mcgstory-content p {
	padding-top: 1.25rem;
	font-size: 1.1rem;
	text-align: left;
	line-height: 1.8;
	color: var(--grey);
}
.mcgstory-text-bold { font-weight: 700; color: var(--black); }
.mcgstory-content a { color: var(--dbrown); }
.mcgstory-content a:hover,
.mcgstory-content a:visited:hover { color: var(--red); }

/* --- QR share page ------------------------------------------------------ */
.qrcode {
	width: 100%;
	display: block;
	text-align: center;
	padding: 40px 8% 80px;
}
.qrcode h1 {
	width: 100%;
	font-size: clamp(2.5rem, 6vw, 5rem);
	padding-top: 4vh;
	color: var(--black);
}
.qrcode img {
	width: min(40%, 480px);
	margin: 5vh auto 0;
	border-radius: 12px;
	box-shadow: var(--shadow);
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1080px) {
	.section { padding: 60px 5%; }

	/* .news-format stays a thin wrapper at every width (as in KofC-dev); the
	   inner .gallery-section / .img-section supply the inset. */
	.news-format { padding: 10px 0; }
	.gallery-section { padding: 60px 5%; }

	.img-section {
		display: grid;
		padding: 60px 5%;
	}
	.side-image,
	.sword-image { width: 100%; }

	.tagline {
		display: inline-grid;
		justify-items: center;
		gap: 0;
	}

	.tmiy-logo img { width: 100%; }
	.tmiy-paradisus img { width: 60%; }

	.join-section { padding: 60px 5%; }
	.join-side {
		width: 96%;
		max-width: 800px;
		justify-self: center;
		margin: 5% 2%;
	}
	/* .join-form carries no side margin at any width now — the wrapper's own
	   padding is the inset (dev reset its 10% margin here too). */
	.join-form-wrapper { padding: 4vh 3%; }
	.join-form-wrapper h2 { font-size: 1rem; }
	/* Dev used a flat 2.5rem, which out-ran the card on phones; clamped here so
	   the heading stays inside the wrapper padding. */
	.join-form-wrapper h3 {
		font-size: clamp(1.4rem, 6vw, 1.9rem);
		line-height: 1.2;
		padding-top: 2vh;
	}
	.join-form-wrapper h4 { font-size: 1rem; line-height: 1.2; }
	.join-checkbox-text { font-size: 1.2rem; margin: 2% 0 2% 10%; }
	.join-checkbox { width: 26px; height: 26px; }
	.join-input-set { padding: 4vh 0; }
	/* 96% + 2% side margins === the grid column, so inputs can never cross the
	   wrapper padding (dev used the same pair). */
	.join-input-text { width: 96%; margin: 2%; }
	.join-btn { font-size: clamp(1.5rem, 7vw, 2rem); margin-top: 6%; }

	.cards-section { margin: 15% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.sword-image:hover img,
	.side-image:hover img,
	.gallery-item:hover img { transform: none; }
}
