/*
Theme Name: Warta Pulsa
Theme URI: https://example.com/warta-pulsa
Author: Your Name
Author URI: https://example.com
Description: Tema berita portal responsif dengan header sticky, menu off-canvas, breadcrumb, daftar isi otomatis, tombol share, sidebar populer, dan navigasi bawah khusus mobile. Dibangun dari nol terinspirasi pengalaman baca portal berita modern.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: warta-pulsa
Tags: news, blog, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* -------------------------------------------------------------------- */
/* 1. Design tokens                                                     */
/* -------------------------------------------------------------------- */
:root {
  --wp-primary: #d5321f;
  --wp-primary-dark: #ac2717;
  --wp-primary-tint: #fbe9e7;
  --wp-ink: #1c1c1e;
  --wp-body: #3a3a3d;
  --wp-muted: #767680;
  --wp-line: #e6e6ea;
  --wp-surface: #ffffff;
  --wp-bg: #f6f6f8;
  --wp-radius-sm: 6px;
  --wp-radius-md: 12px;
  --wp-radius-lg: 20px;
  --wp-shadow: 0 1px 2px rgba(20, 20, 25, 0.06), 0 6px 20px rgba(20, 20, 25, 0.06);
  --wp-header-h: 60px;
  --wp-max: 1180px;
  --wp-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wp-font-display: Georgia, "Times New Roman", serif;
}

/* -------------------------------------------------------------------- */
/* 2. Reset & base                                                      */
/* -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--wp-font-body);
  color: var(--wp-body);
  background: var(--wp-bg);
  line-height: 1.6;
  padding-bottom: 0;
}
body.has-mobile-nav { padding-bottom: 64px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--wp-font-display); color: var(--wp-ink); line-height: 1.25; margin: 0 0 .5em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--wp-primary); outline-offset: 2px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.wp-container { max-width: var(--wp-max); margin: 0 auto; padding: 0 16px; }

/* -------------------------------------------------------------------- */
/* 3. Site header                                                       */
/* -------------------------------------------------------------------- */
.wp-site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--wp-surface);
  border-bottom: 1px solid var(--wp-line);
  height: var(--wp-header-h);
}
.wp-header-row {
  height: 100%;
  display: flex; align-items: center; gap: 14px;
}
.wp-menu-toggle {
  border: 0; background: none; padding: 8px; margin-left: -8px;
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--wp-radius-sm);
}
.wp-menu-toggle span { display: block; width: 20px; height: 2px; background: var(--wp-ink); border-radius: 2px; }
.wp-menu-toggle:hover { background: var(--wp-bg); }

.wp-logo { display: flex; align-items: center; gap: 8px; font-family: var(--wp-font-display); font-weight: 700; font-size: 22px; color: var(--wp-primary); white-space: nowrap; max-width: 55vw; }
.wp-logo a { display: flex; align-items: center; color: inherit; gap: 8px; }
.wp-logo img,
.wp-logo svg {
  display: block;
  height: 34px;      /* fixed logo slot height regardless of the uploaded file's native size */
  width: auto;
  max-width: 180px;  /* safety cap so an unusually wide logo can't overflow the header */
  object-fit: contain;
}

.wp-header-search { flex: 1; max-width: 420px; margin-left: auto; }
.wp-header-search form { display: flex; align-items: center; background: var(--wp-bg); border-radius: 999px; padding: 0 12px; height: 38px; }
.wp-header-search input[type="search"] { flex: 1; border: 0; background: none; padding: 0 8px; font-size: 14px; color: var(--wp-ink); }
.wp-header-search input[type="search"]:focus { outline: none; }
.wp-header-search button { border: 0; background: none; display: flex; color: var(--wp-muted); }
.wp-header-search svg { width: 18px; height: 18px; }

.wp-primary-nav { display: none; }
@media (min-width: 960px) {
  .wp-primary-nav { display: flex; gap: 22px; margin-left: 8px; }
  .wp-primary-nav a { font-size: 14px; font-weight: 600; color: var(--wp-body); padding: 8px 0; border-bottom: 2px solid transparent; }
  .wp-primary-nav a:hover, .wp-primary-nav .current-menu-item a { color: var(--wp-primary); border-color: var(--wp-primary); }
  .wp-menu-toggle { display: none; }
}

/* -------------------------------------------------------------------- */
/* 4. Off-canvas menu                                                   */
/* -------------------------------------------------------------------- */
.wp-offcanvas-overlay {
  position: fixed; inset: 0; background: rgba(20,20,25,.45);
  opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 300;
}
.wp-offcanvas-overlay.is-open { opacity: 1; visibility: visible; }
.wp-offcanvas {
  position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 320px;
  background: var(--wp-surface); z-index: 310; transform: translateX(-100%);
  transition: transform .25s ease; overflow-y: auto; padding: 18px;
}
.wp-offcanvas.is-open { transform: translateX(0); }
.wp-offcanvas-close { border: 0; background: var(--wp-bg); width: 34px; height: 34px; border-radius: 50%; font-size: 18px; color: var(--wp-muted); margin-bottom: 16px; }
.wp-offcanvas-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--wp-muted); margin: 18px 0 8px; }
.wp-offcanvas a { display: block; padding: 10px 4px; font-size: 15px; font-weight: 600; color: var(--wp-ink); border-bottom: 1px solid var(--wp-line); }
.wp-offcanvas a:hover { color: var(--wp-primary); }

/* -------------------------------------------------------------------- */
/* 5. Layout                                                            */
/* -------------------------------------------------------------------- */
.wp-layout { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 24px 0 48px; }
@media (min-width: 960px) {
  .wp-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

/* -------------------------------------------------------------------- */
/* 6. Post cards / archive grid                                         */
/* -------------------------------------------------------------------- */
.wp-post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.wp-card { background: var(--wp-surface); border-radius: var(--wp-radius-md); overflow: hidden; box-shadow: var(--wp-shadow); }
.wp-card-thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--wp-line); }
.wp-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wp-card-body { padding: 14px; }
.wp-card-cat { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--wp-primary); margin-bottom: 6px; }
.wp-card-title { font-size: 16px; margin: 0 0 6px; line-height: 1.35; }
.wp-card-title a:hover { color: var(--wp-primary); }
.wp-card-meta { font-size: 12px; color: var(--wp-muted); }

.wp-hero-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
@media (min-width: 720px) {
  .wp-hero-grid { grid-template-columns: 1.4fr 1fr; }
}
.wp-hero-main .wp-card-thumb { aspect-ratio: 16/9; }
.wp-hero-main .wp-card-title { font-size: 24px; }
.wp-hero-side { display: flex; flex-direction: column; gap: 12px; }
.wp-hero-side .wp-card { display: flex; flex-direction: row; }
.wp-hero-side .wp-card-thumb { width: 110px; flex-shrink: 0; aspect-ratio: 1/1; }
.wp-hero-side .wp-card-body { padding: 10px 12px; }
.wp-hero-side .wp-card-title { font-size: 14px; }

.wp-section-title {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--wp-ink);
  margin: 32px 0 16px; font-weight: 800;
}
.wp-section-title::before { content: ""; width: 4px; height: 18px; background: var(--wp-primary); border-radius: 2px; }

/* -------------------------------------------------------------------- */
/* 7. Breadcrumb                                                        */
/* -------------------------------------------------------------------- */
.wp-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--wp-muted); margin-bottom: 14px; }
.wp-breadcrumb a { color: var(--wp-muted); }
.wp-breadcrumb a:hover { color: var(--wp-primary); }
.wp-breadcrumb span[aria-hidden] { color: var(--wp-line); }
.wp-breadcrumb .is-current { color: var(--wp-ink); font-weight: 600; }

/* -------------------------------------------------------------------- */
/* 8. Single article                                                    */
/* -------------------------------------------------------------------- */
.wp-article-title { font-size: clamp(24px, 4vw, 34px); margin-bottom: 14px; }

.wp-article-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.wp-article-meta img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.wp-article-meta .wp-author-name { font-weight: 700; font-size: 14px; color: var(--wp-ink); }
.wp-article-meta .wp-article-date { font-size: 12.5px; color: var(--wp-muted); }

.wp-article-cover { border-radius: var(--wp-radius-md); overflow: hidden; margin-bottom: 20px; }

.wp-share-row { display: flex; gap: 8px; margin: 18px 0; border-top: 1px solid var(--wp-line); border-bottom: 1px solid var(--wp-line); padding: 12px 0; flex-wrap: wrap; }
.wp-share-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--wp-line); font-size: 13px; font-weight: 600;
  background: var(--wp-surface); color: var(--wp-body);
}
.wp-share-btn:hover { border-color: var(--wp-primary); color: var(--wp-primary); }
.wp-share-btn svg { width: 15px; height: 15px; }

.wp-toc { background: var(--wp-primary-tint); border: 1px solid #f3cfc9; border-radius: var(--wp-radius-md); padding: 16px 18px; margin: 20px 0; }
.wp-toc-title { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 14px; color: var(--wp-primary-dark); cursor: pointer; }
.wp-toc-list { margin-top: 10px; display: none; }
.wp-toc.is-open .wp-toc-list { display: block; }
.wp-toc-list li { padding: 4px 0; font-size: 13.5px; }
.wp-toc-list a { color: var(--wp-body); }
.wp-toc-list a:hover { color: var(--wp-primary); }

.wp-article-content { font-size: 17px; line-height: 1.85; color: var(--wp-body); }
.wp-article-content p { margin: 0 0 1.2em; }
.wp-article-content h2 { font-size: 21px; margin-top: 1.6em; }
.wp-article-content h3 { font-size: 18px; margin-top: 1.4em; }
.wp-article-content img { border-radius: var(--wp-radius-sm); }
.wp-article-content blockquote {
  margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--wp-primary);
  background: var(--wp-bg); font-style: italic; color: var(--wp-ink);
}
.wp-article-content a { color: var(--wp-primary); text-decoration: underline; }

.wp-also-read {
  display: flex; gap: 12px; align-items: center; background: var(--wp-bg);
  border-radius: var(--wp-radius-md); padding: 12px; margin: 22px 0; border: 1px solid var(--wp-line);
}
.wp-also-read img { width: 68px; height: 68px; border-radius: var(--wp-radius-sm); object-fit: cover; flex-shrink: 0; }
.wp-also-read .wp-also-eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--wp-primary); letter-spacing: .05em; }
.wp-also-read .wp-also-title { font-size: 14px; font-weight: 700; color: var(--wp-ink); margin-top: 2px; }

.wp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.wp-tags a {
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  background: var(--wp-bg); color: var(--wp-body); border: 1px solid var(--wp-line);
}
.wp-tags a:hover { border-color: var(--wp-primary); color: var(--wp-primary); }

.wp-author-box { display: flex; gap: 14px; background: var(--wp-bg); border-radius: var(--wp-radius-md); padding: 16px; margin: 24px 0; }
.wp-author-box img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
.wp-author-box .wp-author-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--wp-muted); }
.wp-author-box .wp-author-name { font-size: 15px; font-weight: 800; color: var(--wp-ink); margin: 2px 0 4px; }
.wp-author-box .wp-author-bio { font-size: 13px; color: var(--wp-muted); }

/* Preferred-source style button (Google) */
.wp-preferred-source {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px;
  background: var(--wp-surface); border: 1px solid var(--wp-line); border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--wp-ink); box-shadow: var(--wp-shadow); margin: 6px 0 20px;
}

/* -------------------------------------------------------------------- */
/* 9. Sidebar                                                           */
/* -------------------------------------------------------------------- */
.wp-sidebar-widget { background: var(--wp-surface); border-radius: var(--wp-radius-md); box-shadow: var(--wp-shadow); padding: 16px; margin-bottom: 20px; }
.wp-widget-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--wp-ink); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.wp-widget-title::before { content: ""; width: 4px; height: 16px; background: var(--wp-primary); border-radius: 2px; }

.wp-popular-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--wp-line); }
.wp-popular-item:last-child { border-bottom: 0; }
.wp-popular-rank { font-family: var(--wp-font-display); font-weight: 800; font-size: 22px; color: var(--wp-line); width: 26px; flex-shrink: 0; }
.wp-popular-title { font-size: 13.5px; font-weight: 700; color: var(--wp-ink); line-height: 1.4; }
.wp-popular-title a:hover { color: var(--wp-primary); }
.wp-popular-meta { font-size: 11.5px; color: var(--wp-muted); margin-top: 3px; }

/* -------------------------------------------------------------------- */
/* 10. Bottom mobile nav                                                */
/* -------------------------------------------------------------------- */
.wp-mobile-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 250;
  display: flex; background: var(--wp-surface); border-top: 1px solid var(--wp-line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
@media (min-width: 960px) { .wp-mobile-nav { display: none; } body.has-mobile-nav { padding-bottom: 0; } }
.wp-mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--wp-muted); padding: 6px 0; }
.wp-mobile-nav a.is-active, .wp-mobile-nav a:hover { color: var(--wp-primary); }
.wp-mobile-nav svg { width: 20px; height: 20px; }

/* -------------------------------------------------------------------- */
/* 11. Footer                                                           */
/* -------------------------------------------------------------------- */
.wp-site-footer { background: var(--wp-ink); color: #c9c9cf; padding: 40px 0 24px; margin-top: 24px; }
.wp-footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 720px) { .wp-footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.wp-footer-brand { font-family: var(--wp-font-display); font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.wp-footer-col h4 { color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.wp-footer-col a { display: block; font-size: 13.5px; padding: 4px 0; color: #c9c9cf; }
.wp-footer-col a:hover { color: #fff; }
.wp-footer-bottom { border-top: 1px solid #2f2f33; margin-top: 28px; padding-top: 18px; font-size: 12.5px; color: #8a8a91; }

/* -------------------------------------------------------------------- */
/* 12. Pagination, search, 404, comments                                */
/* -------------------------------------------------------------------- */
.wp-pagination { display: flex; gap: 8px; justify-content: center; margin: 28px 0; }
.wp-pagination a, .wp-pagination span { min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--wp-radius-sm); background: var(--wp-surface); box-shadow: var(--wp-shadow); font-size: 13.5px; font-weight: 700; }
.wp-pagination .current { background: var(--wp-primary); color: #fff; }

.wp-empty-state { text-align: center; padding: 60px 16px; color: var(--wp-muted); }
.wp-empty-state h1 { font-size: 22px; }

.wp-comments { margin-top: 32px; }
