/*
Theme Name: HitMag Child (Museum)
Template: hitmag
Version: 1.0
Description: Child theme for the American Hungarian Museum (magyarmuseum.org / magyarmuzeum.org). Keeps the original HitMag look; adds per-language footer text and the HunorNet credit.
Text Domain: hitmag-child
*/

/* Footer: Kerkay's source notice centred on its own line, HunorNet credit centred below it
   (HitMag puts them side by side as two 50% floats). */
.site-info-owner,
.site-info-designer {
	float: none;
	width: auto;
	text-align: center;
}
@media (min-width: 768px) {
	.site-info-owner,
	.site-info-designer {
		float: none;
		width: auto;
		text-align: center;
	}
	.site-info-owner {
		padding: 20px 0 8px;
	}
	.site-info-designer {
		padding: 0 0 20px;
	}
}

/* HunorNet credit (RULES.md #5: single support page on hungaria) */
#hunornet-credit {
	margin: 0.5em auto 0;
	max-width: 760px;
	font-size: 0.85em;
	line-height: 1.5;
}
#hunornet-credit img {
	height: 20px;
	vertical-align: middle;
	margin-left: 4px;
}

/* Numbered captions ("#037 filename") under gallery images, always visible, for sorting by number */
.muz-numbered .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static;
	background: none;
	color: inherit;
	font-size: 12px;
	line-height: 1.3;
	margin: 4px 0 0;
	padding: 0;
	text-align: center;
	word-break: break-all;
	opacity: 1;
}
.muz-numbered .wp-block-gallery.has-nested-images figure.wp-block-image {
	flex-direction: column;
}

/* Main menu: tighter item spacing so the categories + Kerkay link + language flag fit on one line */
@media (min-width: 768px) {
	.main-navigation a {
		padding-left: 13px;
		padding-right: 13px;
	}
	.main-navigation .lang-item img {
		vertical-align: middle;
	}
	.main-navigation > div > ul,
	.main-navigation ul.menu {
		font-size: 15px;
		font-size: 0.9375rem;
	}
}

/* "Árpádtól Árpádig" in the top bar: the sister site's colours (navy #1a3a6b, gold #c9a84c), shown prominently */
.hm-top-bar .muz-arpad > a,
#top-navigation .muz-arpad > a,
.muz-arpad > a {
	background: #1a3a6b;
	color: #c9a84c !important;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding-left: 12px;
	padding-right: 12px;
	border-bottom: 2px solid #c9a84c;
}
.muz-arpad > a:hover,
.muz-arpad > a:focus {
	background: #c9a84c;
	color: #1a3a6b !important;
}

/* Language switch: pinned to the far right of the top bar, as a clear button with a large flag,
   so a first-time visitor notices the other language straight away. */
@media (min-width: 768px) {
	.hm-top-bar #top-navigation {
		display: block;
		margin-left: 0;
	}
	.hm-top-bar #top-menu {
		display: flex;
		align-items: center;
		height: 35px;
	}
	.hm-top-bar #top-menu > li.lang-item {
		margin-left: auto;
	}
}
.hm-top-bar #top-menu > li.lang-item > a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 3px 0;
	padding: 3px 12px 3px 8px;
	background: #fff;
	color: #1a3a6b;
	border: 2px solid #1a3a6b;
	border-radius: 15px;
	font-size: 13px;
	font-weight: 700;
	line-height: 19px;
}
.hm-top-bar #top-menu > li.lang-item > a::after {
	content: "\203A"; /* › */
	font-size: 16px;
	line-height: 1;
}
.hm-top-bar #top-menu > li.lang-item > a:hover,
.hm-top-bar #top-menu > li.lang-item > a:focus {
	background: #1a3a6b;
	color: #fff;
}
.hm-top-bar #top-menu > li.lang-item img {
	width: 24px !important;
	height: auto !important;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* Phone-only language button, sitting at the right end of the "Top menu" toggle bar */
.muz-lang-mobile {
	display: none;
}
@media (max-width: 767px) {
	#page { position: relative; }
	.muz-lang-mobile {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		position: absolute;
		top: 8px;
		right: 12px;
		z-index: 1000;
		padding: 3px 10px 3px 6px;
		background: #fff;
		color: #1a3a6b;
		border: 2px solid #1a3a6b;
		border-radius: 15px;
		font: 700 13px/19px "Ubuntu", sans-serif;
		text-decoration: none;
	}
	.muz-lang-mobile img {
		width: 22px !important;
		height: auto !important;
	}
}

/* Header logo at its real size (600 x 216) instead of stretched to the full header width */
.hm-header-image {
	text-align: center;
}
.hm-header-image img {
	float: none;
	width: auto;
	max-width: 100%;
	height: auto;
}

/* Header: logo + link column replace the theme's stretched header image and empty title block */
.hm-header-image,
.header-main-area .site-branding {
	display: none;
}
.muz-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding: 14px 0;
}
.muz-header-logo img {
	display: block;
	width: 600px;
	max-width: 100%;
	height: auto;
}
.muz-header-links ul {
	list-style: none;
	margin: 0;
	padding: 6px 0 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}
.muz-header-links a {
	display: inline-block;
	padding: 4px 12px;
	color: #222;
	font: 600 17px/24px "Ubuntu", sans-serif;
	text-decoration: none;
	border-right: 3px solid #e74c3c;
}
.muz-header-links a:hover {
	color: #e74c3c;
}
.muz-header-links .muz-arpad > a {
	border-right: 0;
	font-size: 18px;
	padding: 7px 16px;
}
@media (max-width: 767px) {
	.muz-header {
		flex-direction: column;
		align-items: center;
		gap: 10px;
	}
	.muz-header-links ul {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		padding: 0;
	}
	.muz-header-links a {
		border-right: 0;
		border-bottom: 2px solid #e74c3c;
		padding: 3px 8px;
	}
}

/* Top bar text a little larger (theme default is 12px) */
.hm-top-bar .top-navigation a {
	font-size: 14px;
}

/* Footer "Links" widget: Árpádtól Árpádig as a plain link like the others (the tab style is for the header) */
.footer-widget-area .muz-arpad > a,
.footer-widget-area .muz-arpad > a:hover {
	background: none;
	color: inherit !important;
	font-weight: inherit;
	letter-spacing: normal;
	padding: 0;
	border-bottom: 0;
}
.footer-widget-area .muz-arpad > a:hover {
	color: #e74c3c !important;
}

/* Footer widgets: spread across the full width instead of crowding to the left; empty columns dropped */
@media (min-width: 768px) {
	.footer-widget-area {
		display: flex;
		justify-content: space-around;
		align-items: flex-start;
		gap: 48px;
	}
	.footer-widget-area .footer-sidebar {
		float: none;
		width: auto;
		flex: 0 1 300px;
		margin: 0;
	}
	.footer-widget-area .footer-sidebar:not(:has(*)) {
		display: none;
	}
}

/* Page background behind the content box: same near-black as AHFC (magyar.org) */
body,
body.custom-background {
	background: #111111 !important;
}
