/**
 * Moduuli: 15-responsive.css
 * Description: Mobiilivalikko ja media query -määritykset.
 * Version: 1.3
 */

.mobile-header-controls {
	display: none;
	align-items: center;
	gap: 1rem;
}

.mobile-header-controls .theme-switcher-btn,
.mobile-header-controls .open-search-btn {
	color: #4c4c4c;
}

#mobile-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(255, 255, 255, 0.98);
	z-index: 1002;
	overflow-y: auto;
	padding: 6rem 2rem 2rem 2rem;
	box-sizing: border-box;
	transform: translateY(-100%);
	transition: transform 0.4s ease-in-out;
	display: block;
}

#mobile-menu-overlay.is-open {
	transform: translateY(0);
}

body.mobile-menu-open {
	overflow: hidden;
}

.mobile-menu-close {
	position: absolute;
	top: 1.5rem;
	right: 20px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	z-index: 1003;
}
.mobile-menu-close .hamburger-box {
	width: 24px;
	height: 18px;
	display: inline-block;
	position: relative;
}
.mobile-menu-close .hamburger-inner,
.mobile-menu-close .hamburger-inner::before,
.mobile-menu-close .hamburger-inner::after {
	width: 100%;
	height: 2px;
	background-color: #4c4c4c;
	position: absolute;
	transition: transform 0.25s ease-in-out;
}

.mobile-menu-close .hamburger-inner {
	background-color: transparent;
}
.mobile-menu-close .hamburger-inner::before {
	top: 50%;
	transform: translateY(-50%) rotate(45deg);
}
.mobile-menu-close .hamburger-inner::after {
	bottom: 50%;
	transform: translateY(50%) rotate(-45deg);
}


.mobile-menu-top-bar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding-bottom: 1.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid #eee;
}

.mobile-menu-top-bar .top-bar-account a {
	font-weight: 700;
}

.mobile-menu-top-bar .top-bar-social {
	gap: 1.5rem;
}

.mobile-menu-top-bar .top-bar-social-link svg {
	width: 22px;
	height: 22px;
}

.mobile-main-nav .menu {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: center;
}
.mobile-main-nav .menu-item a {
	display: block;
	padding: 0.75rem 1rem;
	font-size: 1.2rem;
	font-weight: 800;
	text-transform: uppercase;
	color: #4c4c4c;
	position: relative;
}

.mobile-main-nav .menu-item-has-children {
	position: relative;
}

.mobile-main-nav .menu-item-has-children > a {
	padding-right: 40px;
}

.submenu-toggle {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 50px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #4c4c4c;
}

.submenu-toggle span {
	display: inline-block;
	transition: transform 0.3s ease;
}

.menu-item-has-children.is-open > .submenu-toggle span {
	transform: rotate(180deg);
}

.mobile-main-nav .sub-menu {
	list-style: none;
	padding-left: 0;
	background-color: rgba(0,0,0,0.03);
	display: none;
}

.mobile-main-nav .menu-item-has-children.is-open > .sub-menu {
	display: block;
}
.mobile-main-nav .sub-menu a {
	font-size: 1rem;
	padding: 0.5rem 1rem;
	font-weight: 700;
}

.mobile-menu-toggle {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	z-index: 1003;
}
.mobile-menu-toggle .hamburger-box {
	width: 24px;
	height: 18px;
	display: inline-block;
	position: relative;
}
.mobile-menu-toggle .hamburger-inner,
.mobile-menu-toggle .hamburger-inner::before,
.mobile-menu-toggle .hamburger-inner::after {
	width: 100%;
	height: 2px;
	background-color: #4c4c4c;
	position: absolute;
	transition: transform 0.25s ease-in-out, background-color 0.25s ease-in-out;
}
.mobile-menu-toggle .hamburger-inner::before,
.mobile-menu-toggle .hamburger-inner::after {
	content: '';
	display: block;
}

.mobile-menu-toggle .hamburger-inner {
	top: 50%;
	transform: translateY(-50%);
}
.mobile-menu-toggle .hamburger-inner::before {
	top: -8px;
}
.mobile-menu-toggle .hamburger-inner::after {
	bottom: -8px;
}

/* --- TÄSSÄ PIILEE TAIKA: Mobiilinäytön säännöt --- */
@media screen and (max-width: 782px) {
	/* Piilota työpöytäpalkki mobiilissa */
	.top-bar-desktop {
		display: none;
	}

	/* Näytä mobiilipalkki, joka lisättiin PHP:ssä display:none-tilassa */
	.top-bar-mobile {
		display: flex !important;
	}

	.main-navigation {
		display: none;
	}

	.mobile-header-controls {
		display: flex;
	}

	.kalajokinen-container.has-sidebar,
	.hero-grid,
	.account-page-wrapper {
		flex-direction: column;
		display: block;
	}

	.account-page-nav {
		width: 100%;
		margin-bottom: 2rem;
	}
	.account-page-nav ul {
		display: flex;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 10px;
	}
	.account-page-nav li {
		flex-shrink: 0;
	}

	.hero-main-post,
	.hero-secondary-posts .kalajokinen-card {
		margin-bottom: 1rem;
	}

	.widget-area {
		width: 100%;
	}

	.custom-logo-link img {
		max-width: 200px;
	}

	.single .entry-title {
		font-size: 2.2rem;
	}

	.font-size-small .entry-content {
		font-size: 1rem;
	}

	.font-size-normal .entry-content {
		font-size: 1.15rem;
	}

	.font-size-large .entry-content {
		font-size: 1.35rem;
	}

	.current-weather-details,
	.current-weather-extra,
	.fmi-grid {
		grid-template-columns: 1fr;
		text-align: center;
	}
	.current-weather-main {
		justify-content: center;
	}
}

@media screen and (max-width: 900px) {
	.picks-grid,
	.personalized-feed-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.continuum-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
	.picks-grid,
	.continuum-grid,
	.archive-grid,
	.personalized-feed-grid {
		grid-template-columns: 1fr;
	}
	.search-results-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Footerin mobiililogiikka */
@media screen and (max-width: 782px) {
	/* Piilota työpöytä-footer */
	.footer-navigation.desktop-view {
		display: none !important;
	}

	/* Näytä mobiili-footer */
	.footer-navigation.mobile-view {
		display: block !important;
		width: 100%;
	}

	/* Varmista että container on täysi leveys mobiilissa */
	#pre-footer-bar {
		padding: 0;
	}
}
