/*
Theme Name: Warta
Theme URI: https://example.com/warta
Author: erahajj
Description: Tema blog dua-kolom (grid artikel + sidebar) dengan filter kategori, hero pencarian, dan footer 4 kolom. Warna hijau-emas, gampang diganti lewat CSS variable.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: warta
Tags: blog, two-columns, custom-menu, custom-logo, featured-images, translation-ready
*/

:root {
  --green-900: #14532d;
  --green-700: #15803d;
  --green-600: #16a34a;
  --gold-500: #ca8a04;
  --gold-100: #fef3c7;
  --bg: #ffffff;
  --bg-soft: #f7faf7;
  --fg: #1a1a18;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --radius: .6rem;
  --wrap: 76rem;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green-600); outline-offset: 2px;
}

.wrap { width: min(100% - 3rem, var(--wrap)); margin-inline: auto; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--green-700); color: #fff; text-decoration: none;
  padding: .6rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 600;
  border: 0; cursor: pointer;
}
.btn:hover { background: var(--green-900); text-decoration: none; }
.btn-outline { background: #fff; color: var(--green-900); border: 1px solid var(--line); }
.btn-outline:hover { background: var(--bg-soft); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 0; flex-wrap: wrap;
}
.site-branding { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.site-branding img { max-height: 42px; width: auto; }
.site-title { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--green-900); line-height: 1.1; }
.site-title a { color: inherit; }
.site-description { margin: 0; font-size: .72rem; color: var(--gold-500); font-weight: 600; }
.primary-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.4rem; margin: 0; padding: 0; }
.primary-nav a { color: var(--fg); font-size: .92rem; font-weight: 500; }
.primary-nav .current-menu-item > a, .primary-nav a:hover { color: var(--green-700); }
.primary-nav .menu-item-cta a {
  background: var(--green-700); color: #fff; padding: .55rem 1rem; border-radius: 999px; font-weight: 600;
}
.primary-nav .menu-item-cta a:hover { background: var(--green-900); text-decoration: none; }
.menu-toggle { display: none; }

/* Hero */
.blog-hero {
  background: linear-gradient(120deg, var(--bg-soft), #fff);
  padding: 3rem 0 2.5rem; border-bottom: 1px solid var(--line);
}
.blog-hero h1 { margin: 0 0 .5rem; font-size: 2.1rem; color: var(--green-900); }
.blog-hero h1 .accent { color: var(--gold-500); }
.blog-hero p { margin: 0 0 1.3rem; color: var(--muted); max-width: 38rem; }
.search-form { display: flex; max-width: 32rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: .3rem; }
.search-form input[type=search] { flex: 1; border: 0; background: none; padding: .5rem 1rem; }
.search-form button { background: var(--green-700); color: #fff; border: 0; border-radius: 999px; width: 2.4rem; height: 2.4rem; cursor: pointer; }

/* Layout: grid utama + sidebar */
.content-wrap { display: grid; grid-template-columns: minmax(0,2.2fr) minmax(0,1fr); gap: 2.5rem; padding: 2.5rem 0; align-items: start; }
@media (max-width: 60rem) { .content-wrap { grid-template-columns: 1fr; } }

/* Filter kategori (pill) */
.cat-filter { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2rem; padding: 0; }
.cat-filter li a {
  display: inline-block; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg); font-size: .85rem; font-weight: 500;
}
.cat-filter li a:hover { border-color: var(--green-600); text-decoration: none; }
.cat-filter li.current-cat a, .cat-filter li a.is-active {
  background: var(--green-700); border-color: var(--green-700); color: #fff;
}

/* Grid kartu artikel */
.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
@media (max-width: 40rem) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card .entry-thumb { position: relative; aspect-ratio: 16/10; background: var(--bg-soft); margin: 0; }
.post-card .entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .cat-badge {
  position: absolute; left: .7rem; top: .7rem;
  background: var(--green-700); color: #fff; font-size: .72rem; font-weight: 600;
  padding: .25rem .6rem; border-radius: 999px;
}
.post-card .entry-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.entry-meta { font-size: .78rem; color: var(--muted); }
.entry-title { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.entry-title a { color: var(--fg); }
.entry-title a:hover { color: var(--green-700); text-decoration: none; }
.entry-summary { font-size: .88rem; color: var(--muted); margin: 0; flex: 1; }
.more-link { font-size: .85rem; font-weight: 600; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.widget-title { margin: 0 0 .9rem; font-size: 1rem; color: var(--green-900); border-bottom: 2px solid var(--gold-100); padding-bottom: .6rem; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin-bottom: .7rem; font-size: .88rem; }
.widget .cat-count { float: right; color: var(--muted); font-size: .78rem; }
.widget_recent_entries li a, .widget_categories li a, .widget_pages li a, .widget_archive li a { color: var(--fg); }
.widget_recent_entries li a:hover, .widget_categories li a:hover { color: var(--green-700); }
.widget-cta { background: var(--green-900); color: #fff; text-align: left; }
.widget-cta .widget-title { color: #fff; border-color: rgba(255,255,255,.25); }
.widget-cta p { font-size: .88rem; opacity: .9; margin: 0 0 1rem; }
.widget-cta .btn { background: #fff; color: var(--green-900); }
.widget-cta .btn:hover { background: var(--gold-100); }

/* Pagination (markup dari WordPress paginate_links) */
.page-numbers { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 2.5rem 0 0; }
.page-numbers li { display: inline-flex; }
.page-numbers a, .page-numbers span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.3rem; height: 2.3rem; padding: 0 .5rem;
  border: 1px solid var(--line); border-radius: .4rem; font-size: .85rem; color: var(--fg);
}
.page-numbers a:hover { border-color: var(--green-600); text-decoration: none; }
.page-numbers .current { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* Single / halaman */
.entry-content { max-width: 42rem; }
.entry-content h2 { color: var(--green-900); margin-top: 2rem; }
.entry-content blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--gold-500); color: var(--muted); font-style: italic; }
.entry-content pre { background: var(--bg-soft); border: 1px solid var(--line); border-radius: .5rem; padding: 1rem; overflow-x: auto; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; }
.post-navigation { display: flex; justify-content: space-between; gap: 1.5rem; margin: 2.5rem 0; font-size: .9rem; }

/* Komentar */
.comments-area { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 2rem; max-width: 42rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list ol.children { list-style: none; padding-left: 1.5rem; }
.comment-body { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.comment-meta { font-size: .8rem; color: var(--muted); }
.comment-form label { display: block; font-size: .85rem; margin-top: .8rem; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  width: 100%; padding: .55rem .7rem; margin-top: .3rem;
  border: 1px solid var(--line); border-radius: .4rem; background: #fff; color: var(--fg);
}
.comment-form .submit { margin-top: 1rem; }

/* Footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; padding: 3rem 0 2rem; }
@media (max-width: 55rem) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
.footer-grid h2 { font-size: .95rem; color: var(--green-900); margin: 0 0 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .55rem; font-size: .88rem; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--green-700); }
.footer-about p { font-size: .85rem; color: var(--muted); max-width: 18rem; }
.social-links { display: flex; gap: .7rem; margin-top: 1rem; padding: 0; list-style: none; }
.social-links a {
  width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--fg);
}
.newsletter-form { display: flex; gap: .5rem; margin-top: .5rem; }
.newsletter-form input[type=email] { flex: 1; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .4rem; }
.footer-bottom { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); }

/* Kelas wajib WordPress */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 20; background: #fff; padding: .6rem 1rem; border-radius: .4rem; border: 1px solid var(--line); }
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide { width: min(100vw - 3rem, 60rem); margin-inline: calc(50% - min(50vw - 1.5rem, 30rem)); max-width: none; }
.alignfull { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; }
.wp-caption-text, .wp-element-caption { font-size: .8rem; color: var(--muted); }
.sticky .entry-title::before { content: "\2605 "; color: var(--gold-500); }
