/*
Theme Name: One Scroll News
Description: Tema berita satu layar penuh per kategori. Di komputer geser ke kanan (2 berita terbaru tiap kategori tampil penuh berdampingan), di HP geser ke atas (1 berita per layar).
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: onescroll-news
*/

/* =========================================================
   Dasar
   ========================================================= */
:root {
	--os-bg: #0b0d10;
	--os-fg: #ffffff;
	--os-muted: rgba(255, 255, 255, .72);
	--os-accent: #e63946;
	--os-header-h: 60px;
	--os-top: 0px;
	--os-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--os-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

.admin-bar { --os-top: 32px; }
@media (max-width: 782px) { .admin-bar { --os-top: 46px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--os-bg);
	color: var(--os-fg);
	font-family: var(--os-font);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--os-accent); outline-offset: 2px; }

body.os-front,
body.os-menu-open { overflow: hidden; }

/* Halaman dalam (artikel, arsip) memakai tema terang agar nyaman dibaca */
body.os-inner {
	--os-bg: #fafaf8;
	--os-fg: #16181d;
	--os-muted: #5a606b;
}

/* =========================================================
   Header
   ========================================================= */
.os-header {
	position: fixed;
	top: var(--os-top);
	left: 0; right: 0;
	z-index: 50;
	height: var(--os-header-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 clamp(16px, 3vw, 36px);
	color: #fff;
	background: linear-gradient(to bottom, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0));
	pointer-events: none;
}
.os-header > * { pointer-events: auto; }
.os-inner .os-header {
	position: sticky;
	color: var(--os-fg);
	background: var(--os-bg);
	border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.os-brand__name {
	font-family: var(--os-serif);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: .01em;
}
.os-brand .custom-logo { max-height: 38px; width: auto; }

.os-menu-btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid currentColor;
	background: rgba(10, 12, 16, .25);
	color: inherit;
	font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
	cursor: pointer;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.os-inner .os-menu-btn { background: transparent; }
.os-menu-btn__bars,
.os-menu-btn__bars::before {
	display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px;
}
.os-menu-btn__bars { position: relative; }
.os-menu-btn__bars::before { content: ""; position: absolute; top: -5px; left: 0; }

/* Panel menu */
.os-drawer {
	position: fixed; inset: 0; z-index: 100000;
	background: rgba(8, 10, 13, .96);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	color: #fff;
	opacity: 0; visibility: hidden;
	transition: opacity .25s ease, visibility 0s linear .25s;
	overflow-y: auto;
}
.admin-bar .os-drawer { top: var(--os-top); }
.os-drawer.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.os-drawer__inner {
	max-width: 560px; margin: 0 auto;
	padding: 72px 24px 48px;
	position: relative;
}
.os-drawer__close {
	position: absolute; top: 14px; right: 18px;
	width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .35);
	background: transparent; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.os-drawer__label {
	margin: 28px 0 8px;
	font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--os-muted);
}
.os-drawer__cats, .os-drawer__pages { list-style: none; margin: 0; padding: 0; }
.os-drawer__cats a, .os-drawer__pages a {
	display: flex; justify-content: space-between; align-items: baseline;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
	font-family: var(--os-serif); font-size: 1.35rem;
}
.os-drawer__cats a:hover, .os-drawer__pages a:hover { color: var(--os-accent); }
.os-drawer__cats small { font-family: var(--os-font); font-size: .75rem; color: var(--os-muted); }
.os-drawer__home { margin-top: 28px; }
.os-drawer__home a { color: var(--os-muted); }

.os-search { display: flex; gap: 8px; }
.os-search input[type="search"] {
	flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); color: #fff; font-size: 1rem;
}
.os-search button {
	padding: 0 20px; border-radius: 999px; border: 0;
	background: var(--os-accent); color: #fff; font-weight: 600; cursor: pointer;
}

/* =========================================================
   Halaman depan - jalur geser (desktop: ke kanan)
   ========================================================= */
.os-track {
	position: fixed;
	top: var(--os-top); right: 0; bottom: 0; left: 0;
	display: flex;
	overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior: contain;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	outline: none;
}
.os-track::-webkit-scrollbar { display: none; }

.os-cat {
	position: relative;
	flex: 0 0 100%;
	width: 100%; height: 100%;
	display: flex;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.os-cat__head {
	position: absolute; z-index: 5;
	top: calc(var(--os-header-h) + 6px); left: 50%; transform: translateX(-50%);
	display: flex; align-items: center; gap: 12px;
	padding: 8px 8px 8px 16px;
	border-radius: 999px;
	background: rgba(10, 12, 16, .6);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	color: #fff; white-space: nowrap;
	font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.os-cat__no { color: var(--os-muted); font-weight: 500; letter-spacing: .08em; }
.os-cat__title { padding: 4px 14px; border-radius: 999px; background: var(--os-accent); }
.os-cat__title:hover { filter: brightness(1.1); }

/* Kartu berita layar penuh */
.os-card {
	position: relative; isolation: isolate;
	flex: 1 1 0; min-width: 0;
	overflow: hidden;
	background: #14181d;
	color: #fff;
}
.os-card + .os-card { border-left: 1px solid rgba(255, 255, 255, .2); }
.os-card__img {
	position: absolute; inset: 0; z-index: -2;
	width: 100%; height: 100%; object-fit: cover;
	transition: transform 1.4s cubic-bezier(.2, .7, .2, 1);
}
.os-card:hover .os-card__img { transform: scale(1.04); }
.os-card::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(to top,
		rgba(5, 7, 10, .94) 0%, rgba(5, 7, 10, .62) 36%,
		rgba(5, 7, 10, .12) 68%, rgba(5, 7, 10, .4) 100%);
}
.os-card--noimg.os-card--v0 { background: radial-gradient(120% 90% at 20% 10%, #243b55, #0f1620 70%); }
.os-card--noimg.os-card--v1 { background: radial-gradient(120% 90% at 80% 10%, #4a2c4f, #140f1a 70%); }
.os-card--noimg.os-card--v2 { background: radial-gradient(120% 90% at 50% 0%, #1f4d45, #0c1715 70%); }

.os-card__cover { position: absolute; inset: 0; z-index: 1; }
.os-card__body {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
	padding: clamp(20px, 4vw, 56px);
	padding-bottom: 96px;
	pointer-events: none;
}
.os-card__body a { pointer-events: auto; }
.os-cat .os-card:first-of-type .os-card__body { padding-left: max(clamp(20px, 4vw, 56px), 84px); }
.os-cat .os-card:last-of-type .os-card__body { padding-right: max(clamp(20px, 4vw, 56px), 84px); }

.os-card__chip {
	display: inline-block; margin-bottom: 14px;
	padding: 4px 12px; border-radius: 999px;
	background: var(--os-accent); color: #fff;
	font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.os-card__title {
	margin: 0 0 12px;
	font-family: var(--os-serif);
	font-size: clamp(1.6rem, 2.7vw, 3rem);
	line-height: 1.14; font-weight: 700;
	text-wrap: balance;
	text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.os-card__title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.os-card__excerpt {
	margin: 0 0 14px; max-width: 56ch;
	font-size: clamp(.95rem, 1.1vw, 1.1rem); color: rgba(255, 255, 255, .85);
}
.os-card__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; color: var(--os-muted); }
.os-card__more { margin-left: auto; color: #fff; font-weight: 600; }

@media (max-height: 640px) and (min-width: 769px) {
	.os-card__excerpt { display: none; }
}

/* Panel akhir */
.os-end { align-items: center; justify-content: center; text-align: center; background: #0b0d10; }
.os-end__inner { padding: 24px; max-width: 560px; }
.os-end__title { margin: 0 0 12px; font-family: var(--os-serif); font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.1; }
.os-end p { color: var(--os-muted); }
.os-end__copy { margin-top: 40px; font-size: .8rem; }

.os-btn {
	display: inline-block; padding: 10px 22px; border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff;
	font-weight: 600; cursor: pointer;
}
.os-btn:hover { background: #fff; color: #111; }
.os-btn--solid { background: var(--os-accent); border-color: var(--os-accent); color: #fff; }
.os-btn--solid:hover { background: var(--os-fg); color: var(--os-bg); border-color: var(--os-fg); }

/* Panah & titik kategori */
.os-arrow {
	position: fixed; top: 50%; transform: translateY(-50%); z-index: 40;
	width: 48px; height: 48px; border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .4);
	background: rgba(10, 12, 16, .45); color: #fff; font-size: 1.3rem; cursor: pointer;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	transition: opacity .2s, background .2s;
}
.os-arrow--prev { left: 16px; }
.os-arrow--next { right: 16px; }
.os-arrow:hover { background: rgba(10, 12, 16, .85); }
.os-arrow[disabled] { opacity: 0; pointer-events: none; }

.os-dots {
	position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40;
	display: flex; gap: 4px; padding: 6px;
	max-width: calc(100% - 150px);
	overflow-x: auto; scrollbar-width: none;
	border-radius: 999px;
	background: rgba(10, 12, 16, .6);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.os-dots::-webkit-scrollbar { display: none; }
.os-dot {
	flex: 0 0 auto; padding: 6px 14px; border-radius: 999px;
	font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
	color: rgba(255, 255, 255, .7);
	transition: background .2s, color .2s;
}
.os-dot:hover { color: #fff; }
.os-dot.is-active { background: #fff; color: #111; }

/* =========================================================
   HP / layar sempit: scroll ke atas, 1 berita = 1 layar penuh
   ========================================================= */
@media (max-width: 768px) {
	:root { --os-header-h: 54px; }

	.os-track {
		display: block;
		overflow-x: hidden; overflow-y: auto;
		scroll-snap-type: y mandatory;
	}
	.os-cat {
		display: block; height: auto;
		scroll-snap-align: none; scroll-snap-stop: normal;
	}
	.os-cat__head, .os-arrow { display: none; }

	.os-card {
		display: block;
		height: calc(100vh - var(--os-top));
		height: calc(100dvh - var(--os-top));
		scroll-snap-align: start; scroll-snap-stop: always;
	}
	.os-card + .os-card { border-left: 0; }
	.os-card__body,
	.os-cat .os-card:first-of-type .os-card__body,
	.os-cat .os-card:last-of-type .os-card__body {
		padding: 24px 56px calc(28px + env(safe-area-inset-bottom)) 20px;
	}
	.os-card__title { font-size: clamp(1.55rem, 7vw, 2.2rem); }
	.os-card__more { display: none; }

	.os-end { display: flex; min-height: calc(100vh - var(--os-top)); min-height: calc(100dvh - var(--os-top)); scroll-snap-align: start; }

	/* titik kategori: kolom vertikal di tepi kanan */
	.os-dots {
		left: auto; right: 6px; bottom: auto; top: 50%;
		transform: translateY(-50%);
		flex-direction: column; gap: 0; padding: 8px 4px;
		max-width: none; max-height: 70vh; overflow: visible;
		background: rgba(10, 12, 16, .35);
	}
	.os-dot {
		position: relative; display: grid; place-items: center;
		width: 22px; height: 22px; padding: 0; border-radius: 50%; background: none;
	}
	.os-dot::before {
		content: ""; width: 7px; height: 7px; border-radius: 50%;
		background: rgba(255, 255, 255, .5); transition: transform .2s, background .2s;
	}
	.os-dot.is-active { background: none; }
	.os-dot.is-active::before { background: #fff; transform: scale(1.5); }
	.os-dot__label {
		position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.os-card__img, .os-dot, .os-drawer { transition: none; }
	.os-card:hover .os-card__img { transform: none; }
}

/* =========================================================
   Halaman dalam: artikel, halaman, arsip
   ========================================================= */
.os-main { max-width: 760px; margin: 0 auto; padding: 40px 20px 72px; }
.os-main--list { max-width: 1180px; }
.os-pagehead { margin-bottom: 32px; }
.os-pagehead h1 { margin: 0; font-family: var(--os-serif); font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; }
.os-pagehead__desc { margin-top: 8px; color: var(--os-muted); }

.os-article__head { margin-bottom: 24px; }
.os-article__title { margin: 12px 0; font-family: var(--os-serif); font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.12; }
.os-article__meta { margin: 0; color: var(--os-muted); font-size: .9rem; }
.os-article__hero { margin: 0 -20px 32px; }
.os-article__hero img { width: 100%; max-height: 70vh; object-fit: cover; }
@media (min-width: 800px) { .os-article__hero { margin: 0 0 32px; } .os-article__hero img { border-radius: 14px; } }

.entry-content { font-size: 1.1rem; line-height: 1.8; }
.entry-content > * + * { margin-top: 1.2em; }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: var(--os-serif); line-height: 1.25; margin-top: 1.8em; }
.entry-content a { color: var(--os-accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { margin-left: 0; padding-left: 1.2em; border-left: 4px solid var(--os-accent); color: var(--os-muted); font-style: italic; }
.entry-content img, .entry-content video, .entry-content iframe { max-width: 100%; }
.entry-content .alignleft { float: left; margin: .3em 1.2em .6em 0; }
.entry-content .alignright { float: right; margin: .3em 0 .6em 1.2em; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
.entry-content figcaption, .wp-caption-text { font-size: .85rem; color: var(--os-muted); text-align: center; }
.entry-content pre { overflow-x: auto; padding: 16px; background: rgba(0, 0, 0, .05); border-radius: 8px; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 8px 10px; border: 1px solid rgba(0, 0, 0, .12); }

.os-tags a { display: inline-block; margin: 0 6px 6px 0; padding: 2px 10px; border: 1px solid rgba(0, 0, 0, .15); border-radius: 999px; font-size: .85rem; }

.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(0, 0, 0, .1); }
.post-navigation a { font-family: var(--os-serif); font-size: 1.1rem; }
.post-navigation a:hover { color: var(--os-accent); }

/* Grid arsip */
.os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.os-tile { display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.os-tile__thumb { display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #d9dee5, #eef0f3); }
.os-tile__thumb img { width: 100%; height: 100%; object-fit: cover; }
.os-tile__body { padding: 18px 20px 22px; }
.os-tile__cat { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--os-accent); }
.os-tile__title { margin: 6px 0 8px; font-family: var(--os-serif); font-size: 1.3rem; line-height: 1.25; }
.os-tile__title a:hover { color: var(--os-accent); }
.os-tile__excerpt { margin: 0 0 10px; color: var(--os-muted); font-size: .95rem; }
.os-tile__meta { margin: 0; font-size: .8rem; color: var(--os-muted); }

.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .15); }
.pagination .current { background: var(--os-fg); color: var(--os-bg); border-color: var(--os-fg); }

/* Komentar */
.os-comments { margin-top: 56px; }
.os-comments__title { font-family: var(--os-serif); }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid rgba(0, 0, 0, .2); border-radius: 8px; font: inherit;
}
.comment-form .submit { padding: 10px 22px; border: 0; border-radius: 999px; background: var(--os-accent); color: #fff; font-weight: 600; cursor: pointer; }

.os-footer { padding: 32px 20px; text-align: center; color: var(--os-muted); font-size: .85rem; border-top: 1px solid rgba(0, 0, 0, .08); }
