/*
Theme Name: Rapi
Theme URI: https://wordpress.org/themes/
Author: Rapi
Description: A lightweight, fast, and clean blog theme built to pass Google AdSense review: policy-compliant ad slots, automatic ads.txt, AdSense verification meta tag, automatic table of contents, author box (E-E-A-T), breadcrumbs, JSON-LD schema, a required pages generator (About, Contact, Privacy Policy with GDPR/CCPA, Disclaimer, Terms), and an AdSense readiness checker in the dashboard.
Version: 1.1.0
Requires at least: 6.0
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: rapi
Domain Path: /languages
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Variabel
   ========================================================================== */
:root {
	--accent: #0f766e;
	--accent-hover: color-mix(in srgb, var(--accent) 80%, #000);
	--accent-soft: color-mix(in srgb, var(--accent) 10%, #fff);
	--text: #1f2937;
	--text-muted: #5b6472;
	--bg: #ffffff;
	--surface: #f6f8fa;
	--border: #e5e7eb;
	--radius: 10px;
	--container: 1160px;
	--content: 740px;
	--gap: 32px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.7;
	overflow-wrap: break-word;
}

img, video, iframe { max-width: 100%; height: auto; }
iframe { border: 0; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover, a:focus { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 { line-height: 1.3; margin: 1.6em 0 0.6em; font-weight: 700; color: #111827; }
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, dl, blockquote, pre, table, figure { margin: 0 0 1.25em; }

blockquote {
	margin-left: 0;
	padding: 0.75em 1.25em;
	border-left: 4px solid var(--accent);
	background: var(--surface);
	border-radius: 0 var(--radius) var(--radius) 0;
}

pre, code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
pre { background: #0f172a; color: #e2e8f0; padding: 1em 1.25em; border-radius: var(--radius); overflow-x: auto; }
:not(pre) > code { background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 0.95em; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 0.55em 0.75em; text-align: left; }
th { background: var(--surface); }

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

input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select {
	width: 100%;
	padding: 0.65em 0.8em;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	color: var(--text);
	font: inherit;
}
textarea { min-height: 150px; resize: vertical; }

button, .button, input[type="submit"] {
	display: inline-block;
	padding: 0.65em 1.25em;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}
button:hover, .button:hover, input[type="submit"]:hover { background: var(--accent-hover); color: #fff; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link:focus {
	position: fixed !important;
	top: 8px; left: 8px;
	z-index: 1000;
	width: auto; height: auto;
	clip: auto;
	padding: 0.75em 1em;
	background: #fff;
	color: var(--accent);
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   3. Header & navigasi
   ========================================================================== */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: relative; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 0 1 auto; }
.site-branding .custom-logo { max-height: 48px; width: auto; display: block; }
.site-title { margin: 0; font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.site-title a { color: #111827; text-decoration: none; }
.site-description { margin: 2px 0 0; max-width: 260px; font-size: 0.8rem; color: var(--text-muted); line-height: 1.3; }

.menu-toggle { display: none; flex-shrink: 0; white-space: nowrap; padding: 0.5em 0.9em; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.menu-toggle:hover { background: var(--border); color: var(--text); }

.main-navigation { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex: 1 1 auto; min-width: 0; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation > div > ul, .main-navigation > ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.main-navigation li { position: relative; }
.main-navigation a { display: block; padding: 0.45em 0.65em; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.93rem; white-space: nowrap; border-radius: 6px; }
.main-navigation a:hover, .main-navigation .current-menu-item > a, .main-navigation .current-cat > a { color: var(--accent); background: var(--accent-soft); }
.main-navigation .sub-menu, .main-navigation .children {
	display: none;
	position: absolute;
	top: 100%; left: 0;
	min-width: 220px;
	padding: 6px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}
.main-navigation li:hover > .sub-menu, .main-navigation li:focus-within > .sub-menu { display: block; }
.main-navigation .sub-menu .sub-menu { top: 0; left: 100%; }

.header-search { flex-shrink: 0; }
.header-search .search-form { display: flex; }
.header-search .search-field { width: 150px; padding: 0.4em 0.7em; font-size: 0.9rem; }
.header-search .search-submit { padding: 0.4em 0.9em; font-size: 0.9rem; }

@media (max-width: 900px) {
	.menu-toggle { display: inline-block; }
	.main-navigation { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 20px 20px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08); }
	.main-navigation.is-open { display: flex; }
	.main-navigation > div > ul, .main-navigation > ul { flex-direction: column; }
	.main-navigation a { white-space: normal; }
	.main-navigation .sub-menu, .main-navigation .children { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; }
	.header-search .search-field { width: 100%; }
}

/* ==========================================================================
   4. Tata letak
   ========================================================================== */
.site-content { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); padding-top: 28px; padding-bottom: 48px; }
.no-sidebar .site-content { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--content) + 40px); }
.site-main { min-width: 0; }

@media (max-width: 960px) {
	.site-content { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   5. Breadcrumb
   ========================================================================== */
.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: #9ca3af; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ==========================================================================
   6. Daftar artikel (kartu)
   ========================================================================== */
.page-header { margin-bottom: 24px; }
.page-title { margin: 0 0 6px; font-size: 1.6rem; }
.archive-description { color: var(--text-muted); }
.archive-description p:last-child { margin-bottom: 0; }

.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.no-sidebar .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .post-list { grid-template-columns: minmax(0, 1fr) !important; } }

.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); }
.card-thumb { display: block; aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-title { margin: 6px 0 8px; font-size: 1.15rem; line-height: 1.4; }
.card-title a { color: #111827; text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 12px; }
.card-excerpt p { margin: 0; }
.card .entry-meta { margin-top: auto; }

.cat-label { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); text-decoration: none; }
.cat-label:hover { text-decoration: underline; }

.entry-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.entry-meta a { color: var(--text-muted); }
.entry-meta .sep { color: #cbd5e1; }

/* Paginasi */
.navigation.pagination { margin-top: 36px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.page-numbers { display: inline-block; min-width: 40px; padding: 0.4em 0.75em; text-align: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; }
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   7. Artikel tunggal
   ========================================================================== */
.entry-header { margin-bottom: 20px; }
.entry-title { margin: 6px 0 12px; font-size: 2.1rem; line-height: 1.25; }
@media (max-width: 640px) { .entry-title { font-size: 1.65rem; } }

.post-thumbnail { margin: 0 0 24px; }
.post-thumbnail img { width: 100%; border-radius: var(--radius); display: block; }
.post-thumbnail figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

.entry-content { max-width: var(--content); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content img { border-radius: 6px; }
.entry-content .wp-block-image figcaption { font-size: 0.85rem; color: var(--text-muted); text-align: center; }
.entry-content h2, .entry-content h3 { scroll-margin-top: 20px; }
.entry-content .alignwide { max-width: none; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; display: block; }
.entry-content .alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.entry-content::after { content: ""; display: table; clear: both; }

.entry-footer { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.tags-links { display: flex; flex-wrap: wrap; gap: 6px; }
.tags-links a { font-size: 0.85rem; padding: 0.2em 0.7em; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; }
.tags-links a:hover { border-color: var(--accent); color: var(--accent); }

/* Daftar isi */
.rapi-toc { margin: 0 0 1.75em; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rapi-toc summary { font-weight: 700; cursor: pointer; }
.rapi-toc ol { margin: 10px 0 0; padding-left: 1.3em; }
.rapi-toc ol ol { margin-top: 2px; }
.rapi-toc li { margin: 3px 0; }
.rapi-toc a { text-decoration: none; }
.rapi-toc a:hover { text-decoration: underline; }

/* Bagikan */
.share-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-links .share-label { font-weight: 700; font-size: 0.9rem; margin-right: 4px; }
.share-links a, .share-links button { font-size: 0.85rem; font-weight: 600; padding: 0.4em 0.9em; border-radius: 999px; color: #fff; text-decoration: none; border: 0; line-height: 1.4; }
.share-wa { background: #128c4b; }
.share-fb { background: #1664d9; }
.share-x { background: #111; }
.share-tg { background: #1b84c4; }
.share-links button.share-copy { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.share-links a:hover, .share-links button:hover { opacity: 0.9; color: #fff; }
.share-links button.share-copy:hover { color: var(--text); background: var(--border); }

/* Kotak penulis */
.author-box { display: flex; gap: 16px; margin-top: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.author-box img { border-radius: 50%; flex-shrink: 0; }
.author-box .author-name { margin: 0 0 4px; font-size: 1.05rem; }
.author-box .author-name a { color: #111827; text-decoration: none; }
.author-box p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }
.author-box .author-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

/* Artikel terkait */
.related-posts { margin-top: 40px; }
.related-posts > h2 { font-size: 1.3rem; margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .related-grid { grid-template-columns: minmax(0, 1fr); } }
.related-item { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--text); }
.related-item img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.related-item span { font-weight: 600; font-size: 0.95rem; line-height: 1.4; }
.related-item:hover span { color: var(--accent); }

/* Navigasi artikel */
.post-navigation { margin-top: 36px; }
.post-navigation .nav-links { justify-content: space-between; gap: 16px; }
.post-navigation .nav-previous, .post-navigation .nav-next { flex: 1 1 45%; }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.post-navigation a:hover { border-color: var(--accent); }
.post-navigation .nav-subtitle { display: block; font-size: 0.8rem; color: var(--text-muted); }
.post-navigation .nav-title { font-weight: 600; }

/* ==========================================================================
   8. Slot iklan — jarak aman agar tidak memancing klik tak sengaja
   ========================================================================== */
.ad-slot { clear: both; margin: 28px auto; text-align: center; min-height: 90px; }
.ad-slot--header { margin: 16px auto 0; }
.ad-slot--sidebar { margin-top: 0; }
.ad-label { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8a94a3; margin-bottom: 4px; }
.ad-slot .ad-unit { margin: 0 auto; }

/* ==========================================================================
   9. Sidebar & widget
   ========================================================================== */
.widget-area { min-width: 0; }
.widget { margin-bottom: 28px; font-size: 0.95rem; }
.widget-title, .widget .wp-block-heading { margin: 0 0 12px; font-size: 1.05rem; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--text); text-decoration: none; }
.widget a:hover { color: var(--accent); }

.search-form { display: flex; gap: 6px; }
.search-form label { flex: 1; }
.search-submit { flex-shrink: 0; }

/* ==========================================================================
   10. Komentar
   ========================================================================== */
.comments-area { margin-top: 44px; }
.comments-title, .comment-reply-title { font-size: 1.3rem; }
.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 var(--border); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 0.8rem; }
.comment-metadata a { color: var(--text-muted); }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }

/* ==========================================================================
   11. Formulir kontak
   ========================================================================== */
.rapi-contact { max-width: 640px; }
.rapi-contact p { margin-bottom: 14px; }
.rapi-contact label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.rapi-contact .rapi-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rapi-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.rapi-notice--ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.rapi-notice--err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.site-footer { background: #0f172a; color: #cbd5e1; font-size: 0.95rem; }
.site-footer a { color: #e2e8f0; }
.site-footer a:hover { color: #fff; }
.footer-widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); padding-top: 40px; padding-bottom: 12px; }
@media (max-width: 800px) { .footer-widgets { grid-template-columns: minmax(0, 1fr); } }
.site-footer .widget-title, .site-footer .widget .wp-block-heading { color: #fff; border-color: #1e293b; }
.site-footer .widget li { border-color: #1e293b; }
.site-footer .widget a { color: #cbd5e1; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid #1e293b; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-menu a { text-decoration: none; font-size: 0.9rem; }
.footer-menu a:hover { text-decoration: underline; }
.site-info { margin: 0; font-size: 0.85rem; color: #94a3b8; }

/* ==========================================================================
   13. 404 & hasil kosong
   ========================================================================== */
.error-404 .page-title, .no-results .page-title { font-size: 1.8rem; }
.error-404 .search-form, .no-results .search-form { margin: 20px 0 32px; max-width: 520px; }

/* ==========================================================================
   14. Kelas bawaan WordPress
   ========================================================================== */
.sticky .card { border-color: var(--accent); }
.bypostauthor > .comment-body .fn::after { content: " ✓"; color: var(--accent); }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-size: 0.85rem; color: var(--text-muted); }
.alignnone { margin: 0 0 1em; }
