/**
 * Moduuli: 04-header.css
 * Description: Yläpalkki (Top Bar), Logo, ja Headerin elementit. Mobile-ticker lisätty.
 * Version: 1.1
 */

#site-header-sticky-wrapper {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 1000;
	background-color: #fff;
	box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
body.admin-bar #site-header-sticky-wrapper {
	top: var(--wp-admin--admin-bar--height);
}

#top-helper-bar {
	height: 32px;
	background-color: #024f91;
	color: #ffffff;
	font-size: 0.8rem;
	/* Tärkeä: estää elementtejä pursuamasta yli */
	overflow: hidden;
}

.top-bar-desktop {
	height: 100%;
}

.top-bar-container {
	display: flex;
	height: 100%;
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 20px;
	align-items: center;
	justify-content: space-between;
}

.top-bar-section {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.top-bar-left {
	justify-content: flex-start;
	flex: 1;
}

.top-bar-center {
	justify-content: center;
	flex: 1;
}

.top-bar-right {
	justify-content: flex-end;
	gap: 1rem;
}

#top-helper-bar a {
	color: #ffffff;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

#top-helper-bar a:hover {
	text-decoration: none;
	opacity: 0.8;
}

.top-bar-nameday strong,
.top-bar-flagday strong {
	font-weight: 700;
}

.top-bar-left .separator {
    color: rgba(255,255,255,0.5);
}

.top-bar-weather {
	margin-left: 0.5rem;
}

.weather-link .weather-temp {
	font-weight: 700;
}

.top-bar-account {
	margin-right: 0.5rem;
}

.top-bar-social {
	display: flex;
	gap: 0.75rem;
}

.top-bar-social-link {
	opacity: 0.8;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-bar-social-link:hover {
	opacity: 1;
	transform: scale(1.15);
}

.top-bar-social-link svg {
	display: block;
	width: 18px;
	height: 18px;
}

.top-bar-social-link[title="Puhelin"] svg {
	width: 16px;
	height: 16px;
}

.theme-switcher-btn,
.open-search-btn {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 0;
	opacity: 0.8;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.theme-switcher-btn:hover,
.open-search-btn:hover {
	opacity: 1;
	transform: scale(1.15);
}
.theme-switcher-btn svg,
.open-search-btn svg {
	width: 16px;
	height: 16px;
	display: block;
}

/* --- MOBIILIPALKKI (UUSI) --- */
.top-bar-mobile {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	width: 100%;
}

.mobile-ticker-container {
	width: 100%;
	text-align: center;
	position: relative;
	height: 1.2em; /* Varataan tila tekstille */
}

.mobile-ticker-item {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease-in-out;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 10px;
	box-sizing: border-box;
}

.mobile-ticker-item.is-visible {
	opacity: 1;
	visibility: visible;
}

/* Ajankohtaista-palkki */
.ajankohtaista-palkki {
	background-color: #fcc049;
	padding: 0.5rem 0;
	border-bottom: 1px solid #f5c6cb;
	overflow: hidden;
}
.ajankohtaista-palkki .kalajokinen-container {
	display: flex;
	align-items: center;
	gap: 1rem;
}
.ajankohtaista-otsikko {
	font-weight: 700;
	color: #3b3b3c;
	white-space: nowrap;
}
.ajankohtaista-linkit {
	position: relative;
	flex: 1;
	min-height: 1.2em;
}
.ajankohtaista-linkit a {
	color: #4c4c4c;
	font-weight: 700;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

.ajankohtaista-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}
.ajankohtaista-slide.is-visible {
	opacity: 1;
	visibility: visible;
}

/* Site Header */
.site-header {
	padding: 1.5rem 0;
}

.header-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 2rem;
}

.site-branding {
	margin-bottom: 0;
}

.custom-logo-link img {
	max-width: 250px;
	height: auto;
}

.site-title {
	font-size: 2.5rem;
	margin: 0;
	text-align: left;
}

.site-title a {
	color: #4c4c4c;
	text-decoration: none;
}

.site-description {
	font-size: 1rem;
	margin-top: 0.5rem;
	text-align: left;
}

.header-ad-container {
    margin: 1.5rem 0;
    text-align: center;
}
