/*
Theme Name: American Hungarian Federation
Theme URI: https://www.americanhungarianfederation.org/
Description: Custom block theme for the American Hungarian Federation ("Modern Civic" design). Colors, fonts and layout live in theme.json; editors change the header, footer and templates in Appearance › Editor.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: ahf
*/

/* Hungarian tricolor bar, used above the hero headline. */
.ahf-tricolor {
	display: flex;
	gap: 6px;
	margin: 0 0 1.25rem;
}
.ahf-tricolor span {
	width: 28px;
	height: 6px;
	border-radius: 3px;
	background: #fff;
}
.ahf-tricolor span:first-child { background: #d2333a; }
.ahf-tricolor span:last-child  { background: #3e8a55; }

/* The old site's right-hand column, now a box inside the page. */
.ahf-context-box {
	background: var(--wp--preset--color--soft);
	border-top: 4px solid var(--wp--preset--color--accent);
	border-radius: 12px;
	padding: 1.25rem 1.5rem;
	margin-block: 2rem;
	font-size: 0.95rem;
	line-height: 1.5;
}
.ahf-context-box > :first-child { margin-top: 0; }
.ahf-context-box > :last-child { margin-bottom: 0; }
.ahf-context-box > * + * { margin-block-start: 0.75rem; }
.ahf-context-box h2, .ahf-context-box h3, .ahf-context-box h4 { font-size: 1.05rem; }
.ahf-context-box ul { padding-left: 1.1rem; }
.ahf-context-box li + li { margin-top: 0.35rem; }
.ahf-context-box .wp-block-image img { max-width: 220px; width: 100%; height: auto; border-radius: 6px; }
.ahf-context-box .wp-block-image.alignleft,
.ahf-context-box .wp-block-image.alignright { max-width: 40%; }
.ahf-context-box::after { content: ""; display: table; clear: both; }
/* Short boxes sit beside the opening of the story on wider screens. */
@media (min-width: 900px) {
	.ahf-context-box.ahf-context-side {
		float: right;
		clear: right;
		width: min(36%, 320px);
		margin: 0.35rem 0 1.25rem 2rem !important;
	}
}

/* Photos inside stories: text wraps around small ones. */
.wp-block-post-content .wp-block-image.alignright,
.wp-block-post-content .wp-block-image.alignleft { max-width: min(45%, 360px); margin-top: 0.35rem; margin-bottom: 1rem; }
.wp-block-post-content .wp-block-image.alignright { float: right; margin-left: 1.5rem; margin-right: 0; }
.wp-block-post-content .wp-block-image.alignleft { float: left; margin-right: 1.5rem; margin-left: 0; }
.wp-block-post-content .wp-block-image.alignright img,
.wp-block-post-content .wp-block-image.alignleft img { border-radius: 8px; }
.wp-block-post-content::after { content: ""; display: table; clear: both; }
.ahf-article .wp-block-separator { clear: both; }

/* Old content often has small inline photos; keep them from overflowing on phones. */
.wp-block-post-content img { max-width: 100%; height: auto; }
.wp-block-post-content table { display: block; overflow-x: auto; max-width: 100%; }

/* Cards */
.ahf-card { border-radius: 14px; overflow: hidden; }
.ahf-card .wp-block-post-featured-image img { border-radius: 14px; }

/* News list on the homepage */
.ahf-news-list .wp-block-post {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-block: 1rem;
}
.ahf-news-list .wp-block-post:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.ahf-news-list a { text-decoration: none; color: var(--wp--preset--color--ink); }
.ahf-news-list a:hover { color: var(--wp--preset--color--accent); }

/* Footer links */
.ahf-footer a { color: #c5cae2; text-decoration: none; }
.ahf-footer a:hover { color: #fff; text-decoration: underline; }

/* Language switch placeholder (Polylang will replace this). */
.ahf-lang a { text-decoration: none; }

/* Header: stack neatly on phones. */
@media (max-width: 781px) {
	.ahf-header { gap: 0.75rem !important; }
}

/* ---- Header ---- */
.ahf-site-header {
	background: #fff;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-block: 0.85rem;
}
.ahf-header { gap: 1rem 1.75rem; }
.ahf-site-title {
	font-weight: 800;
	font-size: 1.2rem;
	line-height: 1.2;
	max-width: 11ch;
	margin: 0;
}
.ahf-site-title a { color: var(--wp--preset--color--navy); text-decoration: none; }
.ahf-main-nav a { text-decoration: none; }
.ahf-main-nav .current-menu-item > a,
.ahf-main-nav a[aria-current="page"] { color: var(--wp--preset--color--accent); }
.ahf-main-nav .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 10px;
	padding: 0.4rem 0;
	min-width: 230px !important;
	box-shadow: 0 12px 30px rgba(15, 22, 64, 0.12);
}
.ahf-main-nav .wp-block-navigation__submenu-container a { padding: 0.45rem 1rem !important; }
.ahf-lang { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--wp--preset--color--muted); }
.ahf-header-actions { gap: 1rem; }

/* ---- Main areas ---- */
/* Header, main and footer sit flush against each other. */
body .wp-site-blocks > * + * { margin-block-start: 0; }
.ahf-main { padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60); }
.ahf-main.ahf-front { padding-block: 0; }
.ahf-front > .wp-block-post-content > :first-child { margin-top: 0; }
.ahf-front > .wp-block-post-content > :last-child { margin-bottom: 0; }
.ahf-front > .wp-block-post-content > .alignfull { margin-block: 0; }
.ahf-article .wp-block-post-title { margin-top: 0.25rem; }
.ahf-post-meta { gap: 0.75rem; align-items: baseline; }
.ahf-post-meta .wp-block-post-terms a { color: var(--wp--preset--color--accent); text-decoration: none; }
.ahf-hero-image img { border-radius: 14px; max-height: 480px; object-fit: cover; }
.ahf-more-heading { margin-top: 0; }

/* ---- Homepage sections (blocks inside the Home page) ---- */
.ahf-hero { padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70); }
.ahf-hero h1, .ahf-hero h2 { color: #fff; }
.ahf-hero .ahf-hero-lead { font-size: 1.25rem; color: var(--wp--preset--color--on-navy); max-width: 40rem; }
.ahf-hero .is-style-outline .wp-block-button__link {
	background: transparent;
	color: #fff;
	border: 2px solid #fff;
}
.ahf-campaign {
	background: #fff;
	color: var(--wp--preset--color--ink);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
	max-width: 420px;
	margin-left: auto;
}
.ahf-campaign .wp-block-image { margin: 0; }
.ahf-campaign .wp-block-image img { width: 100%; height: 300px; object-fit: cover; object-position: center 20%; display: block; }
.ahf-campaign-body { padding: 1.5rem; }
.ahf-campaign-body h2 { color: var(--wp--preset--color--ink); font-size: 1.45rem; margin: 0.4rem 0 0.6rem; }
.ahf-campaign-body p { font-size: 1rem; color: var(--wp--preset--color--muted); }
.ahf-campaign-body .wp-block-button__link { background: var(--wp--preset--color--navy); font-size: 1rem; }
.ahf-label {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin: 0;
}
.ahf-section { padding-block: var(--wp--preset--spacing--60); }
.ahf-pillar { background: #fff; border-radius: 14px; padding: 1.85rem; height: 100%; box-sizing: border-box; }
.ahf-pillar h3 { color: var(--wp--preset--color--ink); margin-top: 0; }
.ahf-pillar p { font-size: 1rem; color: var(--wp--preset--color--muted); }
.ahf-pillar a { font-weight: 700; font-size: 1rem; }
.ahf-pillar::before {
	content: "";
	display: block;
	width: 36px;
	height: 4px;
	border-radius: 2px;
	background: var(--wp--preset--color--accent);
	margin-bottom: 1rem;
}
.ahf-section-head { justify-content: space-between; align-items: baseline; }
.ahf-section-head a { font-weight: 700; }
.ahf-lead-story .wp-block-post-featured-image img { border-radius: 14px; height: 360px; object-fit: cover; }
.ahf-lead-story .wp-block-post-title { font-size: 1.75rem; }
.ahf-lead-story .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.ahf-lead-story .wp-block-post-excerpt { color: var(--wp--preset--color--muted); }
.ahf-facts { text-align: center; padding-block: var(--wp--preset--spacing--50); }
.ahf-facts .ahf-fact { font-size: 2.75rem; font-weight: 800; color: var(--wp--preset--color--navy); margin: 0; line-height: 1.1; }
.ahf-facts p { color: var(--wp--preset--color--muted); font-size: 1rem; margin-top: 0.25rem; }
.ahf-cta { padding-block: var(--wp--preset--spacing--60); }
.ahf-cta h2 { color: #fff; margin: 0 0 0.4rem; }
.ahf-cta .wp-block-button__link { background: #fff; color: var(--wp--preset--color--navy); }
.ahf-cta .is-style-outline .wp-block-button__link { background: transparent; color: #fff; border: 2px solid #fff; }

/* ---- News cards and category pills ---- */
.ahf-news-card .wp-block-post-featured-image { margin-bottom: 0.75rem; }
.ahf-news-card .wp-block-post-featured-image img { border-radius: 12px; }
.ahf-news-card .wp-block-post-title { margin: 0.2rem 0 0.4rem; font-size: 1.2rem; }
.ahf-news-card .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.ahf-news-card .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }
.ahf-news-card .wp-block-post-excerpt { font-size: 1rem; color: var(--wp--preset--color--muted); }
.ahf-cat-pills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2rem; }
.ahf-cat-pills li a {
	display: inline-block;
	padding: 0.4rem 0.95rem;
	border-radius: 999px;
	background: var(--wp--preset--color--soft);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
}
.ahf-cat-pills li a:hover { background: var(--wp--preset--color--navy); color: #fff; }

/* ---- Footer ---- */
.ahf-footer { padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40); font-size: 0.95rem; }
.ahf-footer-name { color: #fff; margin: 0; }
.ahf-footer-heading { color: #fff; font-size: 1rem; margin: 0 0 0.75rem; }
.ahf-footer-links { list-style: none; padding: 0; margin: 0; }
.ahf-footer-links li { margin-bottom: 0.4rem; }
.ahf-footer-legal {
	border-top: 1px solid #263070;
	margin-top: var(--wp--preset--spacing--40);
	padding-top: 1.25rem;
	font-size: 0.82rem;
}
.ahf-footer-legal p { margin: 0 0 0.35rem; }

/* Visible keyboard focus everywhere. */
a:focus-visible, button:focus-visible, .wp-element-button:focus-visible {
	outline: 3px solid #f2b705;
	outline-offset: 2px;
}
