/* ============================================================
   Franktown Bulletin — extras
   Button styles (the design-system Button was inline-styled in
   React) + small page/shortcode-mode helpers. Loaded after
   franktown-design.css. Tokens come from that file's :root.
   ============================================================ */

.ftk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--font-sans);
	font-weight: var(--weight-semibold, 600);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1.1;
	border: 1.5px solid transparent;
	border-radius: var(--radius-button, 6px);
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background .2s ease, border-color .2s ease, transform .12s ease;
}
.ftk-btn--full { width: 100%; }
.ftk-btn--sm { padding: 9px 18px; font-size: var(--text-sm); }
.ftk-btn--md { padding: 13px 26px; font-size: var(--text-sm); }
.ftk-btn--lg { padding: 16px 34px; font-size: var(--text-base); }

.ftk-btn--primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.ftk-btn--primary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.ftk-btn--navy { background: var(--primary); color: #fff; border-color: var(--primary); }
.ftk-btn--navy:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.ftk-btn--secondary { background: transparent; color: var(--primary); border-color: var(--border-strong); }
.ftk-btn--secondary:hover { background: var(--bg-inset); }
.ftk-btn--ghost { background: transparent; color: var(--secondary); }
.ftk-btn--ghost:hover { background: var(--bg-inset); }
.ftk-btn:active { transform: translateY(1px); }

/* Buttons are anchors; the scoped `#ftw a` / `.ftkb a` link color (id+element
   specificity) would otherwise override the button text colors. These
   higher-specificity rules keep button text correct (e.g. white on gold/navy). */
#ftw a.ftk-btn--primary, .ftkb a.ftk-btn--primary,
#ftw a.ftk-btn--accent, .ftkb a.ftk-btn--accent { color: var(--btn-fg); }
#ftw a.ftk-btn--navy, .ftkb a.ftk-btn--navy { color: #fff; }
#ftw a.ftk-btn--secondary, .ftkb a.ftk-btn--secondary { color: var(--primary); }
#ftw a.ftk-btn--ghost, .ftkb a.ftk-btn--ghost { color: var(--secondary); }
#ftw a.ftk-btn--primary:hover, .ftkb a.ftk-btn--primary:hover { color: var(--btn-fg); }
#ftw a.ftk-btn--navy:hover, .ftkb a.ftk-btn--navy:hover { color: #fff; }

/* Gold icon variant for the Church Center app tile (button.tile already
   handles the button reset via the design system's a.tile, button.tile rule) */
#ftw .tile__icon--gold { background: var(--gold-050); color: var(--gold-600); }

/* The app pop-up (.ftk-sheet) uses display:flex, which overrides the [hidden]
   attribute. Keep it truly hidden until JS opens it (toggling .hidden). */
.ftk-sheet[hidden] { display: none !important; }

/* Shortcode mode: keep the card to a sensible reading width and lift it a touch */
.ftk-welcome--shortcode {
	max-width: 520px;
	margin: 0 auto;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(20,30,50,.08), 0 22px 54px rgba(20,30,50,.16);
}

/* Full-screen page mode: card is the page */
.ftk-page-body {
	margin: 0;
	background: #0e1622;
}
.ftk-page-body .ftk-welcome--page {
	min-height: 100vh;
	max-width: 520px;
	margin: 0 auto;
	background: #fff;
}
@media (max-width: 520px) {
	.ftk-page-body .ftk-welcome--page { max-width: none; }
}

/* ============================================================
   Bulletin (hand-designed) — structural grid only.
   All visual styling is inline in templates/bulletin.php; these
   classes drive the responsive split via a container query.
   ============================================================ */
.ftkb.bd-root, .ftkb.bd-root * { box-sizing: border-box; }
.ftkb.bd-root {
	container-type: inline-size;
	container-name: bd;
	background: #fff;
	width: 100%;
}
.ftkb .bd-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
.ftkb .bd-canvas { position: sticky; top: 0; height: 100vh; min-height: 680px; }
.ftkb .bd-canvas-art { height: 100%; }
.ftkb .bd-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.1fr; gap: 50px; align-items: start; }

/* Floating site menu — desktop: sticky over the content column (unchanged). */
.ftkb .bd-menu { position: sticky; top: 0; z-index: 40; height: 0; }

/* The site menu rendered inside the top bar. Sized to match the live
   site header (Nunito Sans 700, 17px, near-black) so it reads identically. */
.ftkb .ftk-sitemenu__list {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
	gap: 8px 30px; list-style: none; margin: 0; padding: 0;
}
.ftkb .ftk-sitemenu__list li { margin: 0; }
.ftkb .ftk-sitemenu__list a {
	color: #2b2b2b; font-family: var(--font-sans);
	font-weight: 700; font-size: 17px; line-height: 1.2; letter-spacing: .2px;
	text-decoration: none; white-space: nowrap;
}
.ftkb .ftk-sitemenu__list a:hover { color: var(--navy-900); }

/* Top-bar header — lightweight match of the site header: logo left, menu
   right on desktop; collapses to a hamburger + dropdown when the bar itself
   runs out of room (driven by the bar's own width — see @container bdbar). */
.ftkb .bd-menu__pad { container-type: inline-size; container-name: bdbar; }
.ftkb .bd-bar {
	background: #fff; border-radius: 16px;
	box-shadow: 0 12px 30px -12px rgba(17,44,73,0.42);
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding: 11px 22px; position: relative;
}
.ftkb .bd-bar__logo { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.ftkb .bd-bar__nav { display: flex; align-items: center; min-width: 0; }
.ftkb .bd-bar__nav .ftk-sitemenu__list { justify-content: flex-end; flex-wrap: nowrap; }
.ftkb .bd-bar__toggle {
	display: none; align-items: center; justify-content: center;
	width: 42px; height: 42px; flex: none; padding: 0;
	border: 0; background: transparent; border-radius: 10px;
	color: var(--navy-900); cursor: pointer;
}
/* CSS hamburger that morphs to an X when open. */
.ftkb .bd-bar__icon { position: relative; display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: background .15s ease; }
.ftkb .bd-bar__icon::before, .ftkb .bd-bar__icon::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s ease; }
.ftkb .bd-bar__icon::before { top: -7px; }
.ftkb .bd-bar__icon::after { top: 7px; }
.ftkb .bd-bar.is-open .bd-bar__icon { background: transparent; }
.ftkb .bd-bar.is-open .bd-bar__icon::before { transform: translateY(7px) rotate(45deg); }
.ftkb .bd-bar.is-open .bd-bar__icon::after { transform: translateY(-7px) rotate(-45deg); }

/* The switch is based on whether the logo + menu fit in the bar (its own
   width), NOT the page width — so it collapses correctly even though the bar
   only spans the right column on desktop. */
@container bdbar (max-width: 720px) {
	.ftkb .bd-bar__toggle { display: inline-flex; }
	.ftkb .bd-bar__nav {
		display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
		background: #fff; border-radius: 14px; box-shadow: 0 18px 40px -14px rgba(17,44,73,0.5);
		padding: 8px;
	}
	.ftkb .bd-bar.is-open .bd-bar__nav { display: block; }
	.ftkb .bd-bar__nav .ftk-sitemenu__list { flex-direction: column; align-items: stretch; gap: 0; flex-wrap: nowrap; }
	.ftkb .bd-bar__nav .ftk-sitemenu__list a { display: block; padding: 11px 14px; border-radius: 8px; white-space: normal; }
	.ftkb .bd-bar__nav .ftk-sitemenu__list a:hover { background: #f3f1ea; color: var(--navy-900); }
}

@container bd (max-width: 900px) {
	/* Mobile: pin the menu to the very top of the screen (over the hero). */
	.ftkb .bd-menu { position: fixed; top: 0; left: 0; right: 0; height: auto; z-index: 60; }
	.ftkb .bd-menu__pad { padding: 12px !important; }
	.ftkb .bd-grid { grid-template-columns: 1fr; }
	.ftkb .bd-canvas { position: relative; height: auto; min-height: 0; }
	.ftkb .bd-canvas-art { height: 460px !important; }
	.ftkb .bd-right-pad { padding: 48px 32px 40px !important; }
	.ftkb .bd-twocol { grid-template-columns: 1fr !important; gap: 0 !important; }
	.ftkb .bd-foot-grid { grid-template-columns: 1fr; gap: 28px; }
	.ftkb .bd-menu-nav { display: none !important; }
}

/* Fallback for browsers without container queries: stack under 900px viewport. */
@supports not (container-type: inline-size) {
	@media (max-width: 900px) {
		.ftkb .bd-grid { grid-template-columns: 1fr; }
		.ftkb .bd-canvas { position: relative; height: auto; min-height: 0; }
		.ftkb .bd-canvas-art { height: 460px !important; }
		.ftkb .bd-right-pad { padding: 48px 32px 40px !important; }
		.ftkb .bd-twocol { grid-template-columns: 1fr !important; gap: 0 !important; }
		.ftkb .bd-foot-grid { grid-template-columns: 1fr; gap: 28px; }
		.ftkb .bd-menu-nav { display: none !important; }
		.ftkb .bd-menu { position: fixed; top: 0; left: 0; right: 0; height: auto; z-index: 60; }
		.ftkb .bd-menu__pad { padding: 12px !important; }
		/* Header bar → hamburger + dropdown on phones. */
		.ftkb .bd-bar__toggle { display: inline-flex; }
		.ftkb .bd-bar__nav {
			display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
			background: #fff; border-radius: 14px; box-shadow: 0 18px 40px -14px rgba(17,44,73,0.5);
			padding: 8px;
		}
		.ftkb .bd-bar.is-open .bd-bar__nav { display: block; }
		.ftkb .bd-bar__nav .ftk-sitemenu__list { flex-direction: column; align-items: stretch; gap: 0; }
		.ftkb .bd-bar__nav .ftk-sitemenu__list a { display: block; padding: 11px 14px; border-radius: 8px; }
		.ftkb .bd-bar__nav .ftk-sitemenu__list a:hover { background: #f3f1ea; color: var(--navy-900); }
	}
}
