/* Meeha News — homepage: topic boxes (4-col) + tabbed sidebar section */

/* ============================================
   Topic boxes
============================================ */
.meeha-topicboxes {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 14px;
	margin: 28px 0;
}

.meeha-topicbox {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 10px;
	background-color: var( --meeha-topicbox-color, #333 );
	background-size: cover;
	background-position: center;
	color: #fff;
	text-decoration: none;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.1 );
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.meeha-topicbox:hover {
	transform: translateY( -3px );
	box-shadow: 0 10px 22px rgba( 0, 0, 0, 0.18 );
}

.meeha-topicbox__overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px 12px 12px;
	background: rgba( 0, 0, 0, 0.62 );
	-webkit-backdrop-filter: blur( 6px );
	backdrop-filter: blur( 6px );
}

.meeha-topicbox__label {
	display: inline-block;
	background: var( --meeha-topicbox-color, #333 );
	font-family: var( --meeha-font-utility );
	font-size: 11px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 3px;
	margin-bottom: 6px;
	color: #fff;
}

.meeha-topicbox__title {
	font-family: var( --meeha-font-display );
	font-weight: 700;
	font-size: 14px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 1px 3px rgba( 0, 0, 0, 0.5 ); /* extra safety on top of the blurred backdrop */
	color: #fff;
}

/* backdrop-filter isn't supported everywhere - fall back to a plain darker,
   larger overlay so text is still readable without it */
@supports not ( backdrop-filter: blur( 1px ) ) {
	.meeha-topicbox__overlay {
		background: rgba( 0, 0, 0, 0.82 );
	}
}

@media ( min-width: 768px ) {
	.meeha-topicboxes {
		grid-template-columns: repeat( 4, 1fr );
	}
}

/* ============================================
   Tabbed sidebar + category section
============================================ */
.meeha-tabbed-section {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
	margin: 32px 0;
}

.meeha-tabbed-section__sidebar {
	border: 1px solid var( --meeha-border );
	border-radius: 10px;
	padding: 16px;
	background: var( --meeha-bg-soft, #FAFAF8 );
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.05 );
}

.meeha-tabbed-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var( --meeha-border );
	margin-bottom: 10px;
}

.meeha-tabbed-tab {
	font-family: var( --meeha-font-utility );
	font-size: 14px;
	font-weight: 700;
	color: var( --meeha-ink-soft );
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 8px 10px;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.meeha-tabbed-tab:hover {
	color: var( --meeha-accent );
}
.meeha-tabbed-tab.is-active {
	color: var( --meeha-accent );
	border-bottom-color: var( --meeha-accent );
}

.meeha-tabbed-list {
	list-style: none;
	margin: 0;
	padding: 0;
	transition: opacity 0.15s ease;
}

.meeha-tabbed-list li {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 9px 4px;
	border-bottom: 1px solid var( --meeha-border );
	border-radius: 4px;
	transition: background 0.15s ease;
}
.meeha-tabbed-list li:hover {
	background: #fff;
}
.meeha-tabbed-list li:last-child {
	border-bottom: none;
}

.meeha-tabbed-list__rank {
	flex-shrink: 0;
	font-family: var( --meeha-font-display );
	font-weight: 700;
	font-size: 16px;
	color: var( --meeha-accent );
	opacity: 0.55;
	min-width: 18px;
}

.meeha-tabbed-list a {
	font-family: var( --meeha-font-body );
	font-size: 14px;
	font-weight: 600;
	color: var( --meeha-ink );
	text-decoration: none;
	line-height: 1.4;
}
.meeha-tabbed-list a:hover {
	color: var( --meeha-accent );
}

.meeha-tabbed-list__empty {
	font-size: 14px;
	color: var( --meeha-ink-soft );
	padding: 12px 0;
}

@media ( min-width: 900px ) {
	.meeha-tabbed-section {
		grid-template-columns: 300px 1fr;
	}
}

/* ============================================
   Area-based news filter section (reuses the
   existing .meeha-area-widget sidebar markup,
   just laid out full-width/horizontal here)
============================================ */

/* Base widget styling duplicated from meeha-single.css, which isn't loaded
   on the homepage - without this the selects/button would render unstyled */
.meeha-area-widget select,
.meeha-area-widget input[type="text"] {
	width: 100%;
	padding: 8px 10px;
	margin-bottom: 8px;
	border: 1px solid var( --meeha-border );
	border-radius: 8px;
	font-family: var( --meeha-font-body );
	font-size: 13px;
	box-sizing: border-box;
}

.meeha-area-widget__search {
	width: 100%;
	font-family: var( --meeha-font-body );
	font-weight: 600;
	font-size: 13px;
	color: #fff;
	background: var( --meeha-accent );
	border: none;
	border-radius: 8px;
	padding: 10px;
	cursor: pointer;
	transition: background 0.15s ease;
}
.meeha-area-widget__search:hover {
	background: var( --meeha-accent-dk );
}

.meeha-area-widget__results {
	margin-top: 12px;
}

.meeha-area-widget__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.meeha-area-widget__list a {
	font-size: 13px;
	color: var( --meeha-ink );
	text-decoration: none;
	line-height: 1.4;
	display: block;
}
.meeha-area-widget__list a:hover {
	color: var( --meeha-accent );
}

.meeha-area-section .meeha-area-widget {
	background: var( --meeha-bg-soft, #FAFAF8 );
	border: 1px solid var( --meeha-border );
	border-radius: 10px;
	padding: 18px 20px;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.05 );
}

/* .meeha-area-widget's children, in DOM order, are: .meeha-section__head,
   3x <select>, the search <button>, then .meeha-area-widget__results -
   no wrapper div exists around just the selects, so the heading and the
   results block are each forced onto their own full-width row via
   flex-basis, while the selects+button share one flex row between them */
@media ( min-width: 700px ) {
	.meeha-area-section .meeha-area-widget {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-end;
		gap: 10px;
	}
	.meeha-area-section .meeha-area-widget .meeha-section__head,
	.meeha-area-section .meeha-area-widget__results {
		flex-basis: 100%;
	}
	.meeha-area-section .meeha-area-widget select {
		width: auto;
		flex: 1;
		margin-bottom: 0;
	}
	.meeha-area-section .meeha-area-widget__search {
		width: auto;
		flex-shrink: 0;
		padding: 10px 22px;
	}
}
