/**
 * SWAPNEWS Phase 2 Styles
 *
 * - Mega Menu
 * - Search Autocomplete dropdown
 * - Author Profile Hero
 * - Topic Microsite Hero
 * - Indeks page
 * - Next Article card
 */

/* =========================================================================
 * 1. MEGA MENU
 * ====================================================================== */
.sn-megamenu-wrap {
	position: relative;
	background: var(--bg-color-dua, #fff);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.sn-megamenu {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0 auto;
	padding: 0;
	max-width: 1200px;
	font-family: 'Heebo', sans-serif;
}
.sn-megamenu > li {
	position: static;
	display: inline-block;
}
.sn-megamenu > li > a {
	display: inline-block;
	padding: 14px 18px;
	font-weight: 700;
	font-size: 15px;
	color: var(--font-color, #111);
	text-decoration: none;
	transition: color .15s, background .15s;
	border-bottom: 3px solid transparent;
}
.sn-megamenu > li > a:hover,
.sn-megamenu > li.is-open > a,
.sn-megamenu > li.current-menu-item > a {
	color: #D13438;
	border-bottom-color: #D13438;
}

/* Panel */
.sn-megamenu-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--bg-color-dua, #fff);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	padding: 24px;
	display: none;
	z-index: 99;
	animation: snFade 0.18s ease-out;
}
.sn-megamenu > li.is-open > .sn-megamenu-panel {
	display: block;
}
@keyframes snFade {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: translateY(0); }
}

.sn-megamenu-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 32px;
}
.sn-megamenu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px 24px;
}
.sn-megamenu-list a {
	display: block;
	padding: 8px 0;
	color: var(--font-color, #444);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	transition: color .15s, padding-left .15s;
}
.sn-megamenu-list a:hover {
	color: #D13438;
	padding-left: 6px;
}

.sn-megamenu-preview p.sn-megamenu-preview__title {
	margin: 0 0 12px;
	font-weight: 800;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #D13438;
}
.sn-megamenu-preview ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sn-megamenu-preview li {
	margin-bottom: 12px;
}
.sn-megamenu-preview a {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	color: var(--font-color, #111);
	text-decoration: none;
	transition: color .15s;
}
.sn-megamenu-preview a:hover { color: #D13438; }
.sn-megamenu-preview img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}
.sn-megamenu-preview span {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}

@media (max-width: 768px) {
	.sn-megamenu-inner { grid-template-columns: 1fr; }
	.sn-megamenu-list { grid-template-columns: 1fr; }
	.sn-megamenu > li > a { padding: 12px 14px; font-size: 14px; }
	.sn-megamenu-panel {
		position: static;
		box-shadow: none;
		padding: 12px;
	}
}

/* =========================================================================
 * 2. SEARCH AUTOCOMPLETE
 * ====================================================================== */
.sn-search-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: var(--bg-color-dua, #fff);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
	z-index: 100;
	max-height: 70vh;
	overflow-y: auto;
	display: none;
	font-family: 'Heebo', sans-serif;
}
.sn-search-dropdown.is-show { display: block; }
.sn-search-dropdown__loading,
.sn-search-dropdown__empty {
	padding: 20px;
	text-align: center;
	color: #999;
	font-size: 14px;
}
.sn-search-section {
	padding: 12px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.sn-search-section:last-child { border-bottom: none; }
.sn-search-section__title {
	margin: 0 16px 8px;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #888;
}
.sn-search-section ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sn-search-section li { margin: 0; }
.sn-search-section a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	color: var(--font-color, #111);
	text-decoration: none;
	transition: background .12s;
}
.sn-search-section a:hover {
	background: rgba(209, 52, 56, 0.06);
}
.sn-search-section img {
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}
.sn-search-result__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.sn-search-result__cat {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	color: #D13438;
	letter-spacing: 0.5px;
}
.sn-search-result__title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--font-color, #111);
}
.sn-search-result__date {
	font-size: 12px;
	color: #999;
}

.sn-search-tags {
	display: flex !important;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 16px 8px !important;
}
.sn-search-tags li { display: inline-block; }
.sn-search-tags a {
	display: inline-block !important;
	padding: 6px 12px !important;
	background: rgba(0, 0, 0, 0.06);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}
.sn-search-tags a:hover { background: #D13438; color: #fff; }
.sn-search-tags small { opacity: 0.7; }

/* =========================================================================
 * 3. AUTHOR PROFILE HERO
 * ====================================================================== */
.sn-author-hero {
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
	color: #fff;
	padding: 40px 20px;
	margin-bottom: 30px;
}
.sn-author-hero__inner {
	max-width: 900px;
	margin: 0 auto;
	display: flex;
	gap: 28px;
	align-items: flex-start;
	flex-wrap: wrap;
}
.sn-author-hero__avatar img {
	width: 128px;
	height: 128px;
	border-radius: 50%;
	border: 4px solid rgba(255, 255, 255, 0.15);
	display: block;
}
.sn-author-hero__main { flex: 1; min-width: 280px; }
.sn-author-hero__role {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: #f56565;
	margin: 0 0 6px;
}
.sn-author-hero__name {
	font-size: 32px;
	font-weight: 800;
	margin: 0 0 12px;
	color: #fff;
	line-height: 1.1;
}
.sn-author-hero__bio {
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 18px;
	color: rgba(255, 255, 255, 0.85);
	max-width: 560px;
}
.sn-author-hero__stats {
	display: flex;
	gap: 30px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.sn-author-stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.sn-author-stat__num {
	font-size: 28px;
	font-weight: 800;
	color: #fff;
	line-height: 1;
}
.sn-author-stat__label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: rgba(255, 255, 255, 0.6);
	font-weight: 600;
}
.sn-author-stat__cats {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 4px;
}
.sn-author-stat__cats a {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	padding: 4px 10px;
	border-radius: 999px;
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	transition: background .15s;
}
.sn-author-stat__cats a:hover { background: #D13438; }

.sn-author-hero__social {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.sn-author-hero__social a {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	padding: 6px 14px;
	border-radius: 6px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	transition: background .15s;
}
.sn-author-hero__social a:hover { background: #D13438; }

@media (max-width: 600px) {
	.sn-author-hero__inner { flex-direction: column; align-items: center; text-align: center; }
	.sn-author-hero__name { font-size: 24px; }
	.sn-author-hero__stats { justify-content: center; }
	.sn-author-hero__social { justify-content: center; }
}

/* =========================================================================
 * 4. TOPIC MICROSITE HERO
 * ====================================================================== */
.sn-topic-hero {
	background: linear-gradient(135deg, #2a4365 0%, #1a365d 100%);
	background-size: cover;
	background-position: center;
	color: #fff;
	padding: 60px 20px;
	margin-bottom: 30px;
	position: relative;
}
.sn-topic-hero__inner {
	max-width: 900px;
	margin: 0 auto;
}
.sn-topic-hero__label {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: #f56565;
	margin: 0 0 8px;
}
.sn-topic-hero__title {
	font-size: 42px;
	font-weight: 800;
	margin: 0 0 14px;
	color: #fff;
	line-height: 1.05;
}
.sn-topic-hero__desc {
	font-size: 16px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.9);
	margin: 0 0 18px;
	max-width: 600px;
}
.sn-topic-hero__meta {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.85);
	margin: 0;
}

.sn-topic-follow {
	background: #fff;
	color: #1a365d;
	border: none;
	padding: 8px 18px;
	border-radius: 999px;
	font-family: 'Heebo', sans-serif;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all .15s;
}
.sn-topic-follow:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.sn-topic-follow .sn-topic-follow__on { display: none; }
.sn-topic-follow.is-followed {
	background: #D13438;
	color: #fff;
}
.sn-topic-follow.is-followed .sn-topic-follow__off { display: none; }
.sn-topic-follow.is-followed .sn-topic-follow__on { display: inline; }

@media (max-width: 600px) {
	.sn-topic-hero { padding: 40px 16px; }
	.sn-topic-hero__title { font-size: 28px; }
}

/* =========================================================================
 * 5. INDEKS BERITA — Daily Archive
 * ====================================================================== */
.sn-indeks-wrap {
	max-width: 1024px;
	margin: 30px auto;
	padding: 0 20px;
	font-family: 'Heebo', sans-serif;
}
.sn-indeks-header {
	display: flex;
	gap: 16px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}
.sn-indeks-header h1 {
	margin: 0;
	font-size: 26px;
	font-weight: 800;
}
.sn-indeks-datepicker {
	display: inline-flex;
	gap: 8px;
	align-items: center;
}
.sn-indeks-datepicker input[type="date"] {
	padding: 8px 12px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
}
.sn-indeks-datepicker button {
	padding: 8px 16px;
	background: #D13438;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-weight: 700;
	cursor: pointer;
}
.sn-indeks-datepicker button:hover { background: #b02a2e; }

.sn-indeks-day-section {
	margin-bottom: 30px;
}
.sn-indeks-day-section h2 {
	font-size: 18px;
	font-weight: 800;
	color: #D13438;
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(209, 52, 56, 0.2);
}
.sn-indeks-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sn-indeks-list li {
	display: flex;
	gap: 14px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.sn-indeks-list li:last-child { border-bottom: none; }
.sn-indeks-time {
	flex: 0 0 80px;
	color: #999;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}
.sn-indeks-content { flex: 1; min-width: 0; }
.sn-indeks-cat {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	color: #D13438;
	letter-spacing: 0.5px;
	margin-right: 8px;
}
.sn-indeks-content a {
	color: var(--font-color, #111);
	text-decoration: none;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	transition: color .15s;
}
.sn-indeks-content a:hover { color: #D13438; }

/* =========================================================================
 * 6. NEXT ARTICLE CARD (after single post)
 * ====================================================================== */
.sn-next-article {
	margin: 40px 0 0;
	padding: 30px 0;
	border-top: 3px double rgba(0, 0, 0, 0.1);
}
.sn-next-article__label {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: #D13438;
	margin-bottom: 14px;
}
.sn-next-article__card {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 20px;
	background: var(--bg-color-dua, #fff);
	padding: 16px;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
	text-decoration: none;
	color: var(--font-color, #111);
	transition: transform .2s, box-shadow .2s;
}
.sn-next-article__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.sn-next-article__thumb img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}
.sn-next-article__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.sn-next-article__cat {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #D13438;
	margin-bottom: 6px;
}
.sn-next-article__title {
	font-size: 20px;
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 8px;
}
.sn-next-article__excerpt {
	font-size: 14px;
	line-height: 1.55;
	color: #666;
	margin: 0 0 10px;
}
.sn-next-article__cta {
	font-size: 13px;
	font-weight: 700;
	color: #D13438;
}

@media (max-width: 600px) {
	.sn-next-article__card { grid-template-columns: 1fr; }
	.sn-next-article__thumb img { height: 200px; }
	.sn-next-article__title { font-size: 17px; }
}

/* Sentinel (invisible) */
.sn-next-article-sentinel {
	height: 1px;
	margin-top: 50vh;
}

/* =========================================================================
 * Dark Mode tweaks
 * ====================================================================== */
[data-theme="dark"] .sn-megamenu-wrap,
[data-theme="dark"] .sn-megamenu-panel {
	background: #1a1a1a;
	border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .sn-megamenu-list a {
	border-bottom-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .sn-search-dropdown {
	background: #1a1a1a;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .sn-search-section a:hover {
	background: rgba(209, 52, 56, 0.15);
}
[data-theme="dark"] .sn-next-article__card {
	background: #1a1a1a;
	border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .sn-next-article__excerpt { color: #aaa; }
[data-theme="dark"] .sn-search-tags a {
	background: rgba(255, 255, 255, 0.08);
	color: #ddd;
}
