/*
Theme Name: Lalu Pro
Theme URI: https://lalu.pro
Author: Lalu
Description: Tema klasik bergaya editorial untuk catatan teknisi lab komputer dan operator sekolah. Huruf serif, proporsi rasio emas, catatan uji sebagai catatan tepi. Tanpa JavaScript, tanpa dependensi, mode gelap otomatis.
Version: 1.2.1
Requires at least: 6.0
Tested up to: 6.8
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: lalupro
*/

/* ---------- Token ---------- */
:root {
	--bg: #F7F8F9;
	--fg: #1B2A41;
	--muted: #566474;
	--line: #D5DBE1;
	--soft: #EDF0F3;
	--accent: #2D6A4F;
	--accent-fg: #FFFFFF;
	--warn: #8A5A00;
	--field-line: #7A8794;
	--phi: 1.618;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #11181F;
		--fg: #E3E8EE;
		--muted: #9BA8B5;
		--line: #2A3641;
		--soft: #1A242D;
		--accent: #6CCB9A;
		--accent-fg: #0E1A14;
		--warn: #E0B45A;
		--field-line: #5E6D7C;
	}
}

/* ---------- Dasar ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--serif);
	font-size: 1.1875rem;
	line-height: 1.75;
	overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4 { line-height: 1.25; margin: 2em 0 0.6em; letter-spacing: -0.015em; font-weight: 600; }
h1 { margin-top: 0; }

p, ul, ol, pre, table, figure, blockquote { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

blockquote {
	margin-left: 0;
	padding: 0.1em 1.2em;
	border-left: 3px solid var(--accent);
	color: var(--muted);
	font-style: italic;
}

code, kbd, pre { font-family: var(--mono); font-size: 0.88em; }
code, kbd { background: var(--soft); padding: 0.1em 0.35em; border-radius: 4px; }
pre {
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 16px 20px;
	overflow-x: auto;
	line-height: 1.6;
	font-size: 0.9rem;
	-webkit-overflow-scrolling: touch;
}
pre code { background: none; padding: 0; font-size: inherit; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }

table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-family: var(--sans); font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 0.5em 0.75em; text-align: left; vertical-align: top; }
th { background: var(--soft); }

figcaption, .wp-caption-text, .wp-element-caption { color: var(--muted); font-family: var(--sans); font-size: 0.875rem; margin-top: 0.5em; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: var(--bg); clip: auto !important; clip-path: none; color: var(--fg);
	display: block; font-size: 1rem; height: auto; left: 8px; padding: 0.8em 1em;
	top: 8px; width: auto; z-index: 100000; border: 2px solid var(--accent);
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
	left: 8px; top: 8px; z-index: 100000; background: var(--accent); color: var(--accent-fg);
	padding: 0.6em 1em; border-radius: 6px; text-decoration: none; font-family: var(--sans);
}

/* ---------- Tata letak ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.custom-logo { width: auto; max-height: 36px; }
.site-title { margin: 0; font-size: 1.5625rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.site-title a { color: var(--fg); }

.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 28px; font-family: var(--sans); font-size: 0.9375rem; }
.primary-nav li { margin: 0; }
.primary-nav a { display: inline-block; padding: 10px 0; color: var(--fg); }
.header-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.header-tools .search-form { max-width: none; flex: 0 1 12rem; }
.header-tools .search-form label { display: block; }
.header-tools .search-form input[type="search"] { min-height: 44px; padding: 0.4em 0.75em; font-size: 0.9375rem; }
.header-tools .search-form button { display: none; }
@media (max-width: 640px) { .header-tools { width: 100%; } .header-tools .search-form { flex: 1 1 100%; } }
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-cat > a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.3em; }

.site-main { padding: 64px 0 96px; min-height: 55vh; }
.home:not(.paged) .site-main { padding: 0; }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-family: var(--sans); font-size: 0.875rem; line-height: 1.7; }
.site-footer p { margin: 0 0 0.5em; max-width: 46em; }
.footer-nav ul { list-style: none; margin: 0 0 1em; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.footer-nav li { margin: 0; }
.footer-nav a { display: inline-block; padding: 10px 0; color: var(--muted); text-decoration: underline; }

/* ---------- Beranda ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 56px; padding: 104px 0 88px; }
.hero-main { flex: var(--phi) 1 420px; min-width: 0; }
.hero-side { flex: 1 1 260px; min-width: 0; padding-top: 14px; }
.hero h1 { margin: 0 0 32px; font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 1.05; letter-spacing: -0.025em; }
.hero-intro { margin: 0; max-width: 30em; font-size: 1.3125rem; line-height: 1.65; color: var(--muted); }

.side-title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.topic-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.topic-list li { margin: 0; border-bottom: 1px solid var(--line); }
.topic-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; font-size: 1.1875rem; }
.topic-list .count { font-family: var(--sans); font-size: 0.9375rem; color: var(--muted); }

.latest { border-top: 1px solid var(--line); }
.latest-grid { display: flex; flex-wrap: wrap; gap: 56px; padding: 72px 0 104px; }
.featured { flex: var(--phi) 1 420px; min-width: 0; }
.latest-side { flex: 1 1 260px; min-width: 0; }
.featured h2 { margin: 18px 0 24px; font-size: clamp(1.875rem, 4vw, 2.875rem); line-height: 1.14; letter-spacing: -0.02em; }
.featured-excerpt { margin: 0 0 24px; max-width: 32em; font-size: 1.25rem; line-height: 1.7; color: var(--muted); }
.read-link { display: inline-block; padding: 10px 0; font-size: 1.125rem; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.latest-list { border-top: 1px solid var(--line); }
.compact { padding: 20px 0; border-bottom: 1px solid var(--line); }
.compact .topic { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--accent); }
.compact h3 { margin: 6px 0 8px; font-size: 1.3125rem; line-height: 1.3; letter-spacing: -0.005em; }
.compact .date { display: flex; flex-wrap: wrap; gap: 2px 14px; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }
.latest-pager { flex: 1 1 100%; }
.latest-pager .pagination { margin-top: 0; }
.all-link { display: inline-block; margin-top: 10px; padding: 10px 0; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--accent); }

/* ---------- Metadata ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; font-family: var(--sans); font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.meta a { color: var(--muted); }
.meta .cat-label { color: var(--accent); font-weight: 600; }
.meta .byline strong { color: var(--fg); font-weight: 600; }

/* ---------- Daftar tulisan (arsip, pencarian, halaman 2 dst.) ---------- */
.archive-header { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.archive-header h1 { margin: 0 0 0.25em; font-size: clamp(2.125rem, 4.4vw, 3.25rem); line-height: 1.1; letter-spacing: -0.025em; }
.archive-description { color: var(--muted); font-size: 1.125rem; max-width: 36em; }
.archive-description p:last-child { margin-bottom: 0; }

.entry-list { border-top: 1px solid var(--line); }
.entry-row { padding: 28px 0; border-bottom: 1px solid var(--line); max-width: 52rem; }
.row-title { margin: 10px 0 8px; font-size: 1.625rem; line-height: 1.25; letter-spacing: -0.015em; }
.row-excerpt { margin: 0; max-width: 40em; font-size: 1.0625rem; line-height: 1.65; color: var(--muted); }
.sticky .row-title::before { content: "Disematkan: "; font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--accent); }

.pagination { margin-top: 2.5rem; font-family: var(--sans); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.pagination .page-numbers { display: inline-flex; align-items: center; min-height: 44px; padding: 0.35em 1em; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); font-size: 0.9375rem; }
.pagination .page-numbers.current { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.pagination a.page-numbers:hover { border-color: var(--accent); text-decoration: none; }
.pagination .dots { border: 0; }

/* ---------- Tulisan tunggal: rasio emas, catatan tepi ---------- */
/* Layar sempit: satu kolom; catatan uji turun ke bawah tulisan. */
.article-main { min-width: 0; }
.article-note { min-width: 0; margin-top: 56px; }
@media (min-width: 1000px) {
	.article-layout { display: flex; gap: 64px; }
	.article-main { flex: var(--phi) 1 0%; }
	.article-note { flex: 1 1 0%; margin-top: 0; padding-top: 6px; }
}

.entry-header h1 { margin: 20px 0 28px; font-size: clamp(2.125rem, 5vw, 3.375rem); line-height: 1.1; letter-spacing: -0.025em; }
.lead { margin: 0 0 40px; font-size: 1.4375rem; line-height: 1.6; font-style: italic; color: var(--muted); }
.entry-thumb { margin: 0 0 40px; }
.entry-thumb img { width: 100%; border-radius: 6px; }

.entry-content { font-size: 1.1875rem; line-height: 1.8; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { margin: 48px 0 16px; font-size: 1.75rem; line-height: 1.25; }
.entry-content h3 { margin: 36px 0 12px; font-size: 1.4rem; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }
.entry-content a:hover { text-decoration-thickness: 2px; }
.entry-content img { border-radius: 4px; }
.entry-content .wp-block-image img { margin-inline: auto; }
.entry-content::after { content: ""; display: block; clear: both; }

.entry-footer { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-list li { margin: 0; }
.tag-list a { display: inline-flex; align-items: center; min-height: 40px; padding: 0.1em 1em; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.85rem; }
.tag-list a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* Catatan uji sebagai catatan tepi */
.nota-uji { border-left: 3px solid var(--accent); padding: 2px 0 2px 20px; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.6; }
.nota-uji h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.nota-uji dl { margin: 0; }
.nota-uji dt { font-weight: 600; }
.nota-uji dd { margin: 0 0 10px; color: var(--muted); }
.nota-uji p { margin: 12px 0 0; color: var(--muted); }
.nota-uji .nota-berkala { color: var(--warn); }
@media (min-width: 1000px) { .article-note .nota-uji { position: sticky; top: 24px; } }

/* Ringkasan satu baris di bawah judul (hanya layar sempit) */
.nota-ringkas { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0 0 32px; padding: 10px 14px; background: var(--soft); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; font-family: var(--sans); font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.nota-ringkas .jenis { font-weight: 600; color: var(--fg); }
.nota-ringkas .jenis-berkala { color: var(--warn); }
/* Harus setelah aturan .nota-ringkas di atas, kalau tidak kalah urutan. */
@media (min-width: 1000px) { .nota-ringkas { display: none; } }

/* Penanda kesegaran di daftar */
.fresh-kind { font-weight: 600; }
.fresh-berkala { color: var(--warn); }

.post-nav { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 64px; font-family: var(--sans); }
.post-nav a { flex: 1 1 240px; display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 6px; font-size: 1rem; line-height: 1.4; }
.post-nav a:hover { border-color: var(--accent); text-decoration: none; }
.post-nav .nav-next { text-align: right; }
.post-nav .label { display: block; margin-bottom: 4px; font-size: 0.8125rem; color: var(--muted); }

.page-column { max-width: 46rem; }

/* ---------- Komentar ---------- */
.comments-area { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--sans); font-size: 1rem; line-height: 1.65; }
.comments-title { font-family: var(--serif); font-size: 1.3rem; margin-top: 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.2rem; border-left: 2px solid var(--line); }
.comment-body { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 0.85rem; color: var(--muted); }
.comment-author .avatar { display: inline-block; border-radius: 50%; vertical-align: middle; margin-right: 0.5em; }
.comment-reply-link { display: inline-block; padding: 10px 0; font-size: 0.88rem; }

input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea {
	width: 100%; padding: 0.6em 0.75em; font: inherit; font-family: var(--sans); color: var(--fg); background: var(--bg);
	border: 1px solid var(--field-line); border-radius: 6px;
}
textarea { min-height: 8rem; }
button, input[type="submit"] {
	font: inherit; font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; cursor: pointer; padding: 0.6em 1.3em;
	background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 6px;
}
button:hover, input[type="submit"]:hover { filter: brightness(1.08); }

.search-form { display: flex; gap: 0.5rem; max-width: 30rem; }
.search-form label { flex: 1; }

/* ---------- Perataan konten WordPress ---------- */
.alignleft { float: left; margin: 0.3em 1.2em 0.8em 0; }
.alignright { float: right; margin: 0.3em 0 0.8em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.wp-caption { max-width: 100%; }
.gallery { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
.gallery-item { margin: 0; }

/* ---------- Layar kecil, gerak, cetak ---------- */
@media (max-width: 640px) {
	body { font-size: 1.125rem; }
	.hero { padding: 64px 0 56px; gap: 40px; }
	.latest-grid { padding: 48px 0 64px; gap: 40px; }
	.article-layout { gap: 40px; }
	.site-main { padding: 40px 0 64px; }
	.alignleft, .alignright { float: none; margin: 0 auto 1em; display: block; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	:root { --bg: #fff; --fg: #000; --muted: #333; --line: #bbb; --soft: #fff; --accent: #000; }
	.site-header, .site-footer, .post-nav, .comments-area, .pagination, .skip-link { display: none; }
	.nota-uji { position: static; }
	.entry-content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
}
