/*
Theme Name: Portal Berita
Theme URI: https://example.com/portal-berita
Author: Portal Berita
Description: Tema WordPress portal berita modern dengan slider utama, ticker breaking news, daftar artikel terbaru, dan sidebar terpopuler mingguan. Ringan, responsif, tanpa plugin tambahan.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
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: portal-berita
Tags: news, blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, translation-ready
*/

:root {
  --pb-red: #e02b20;
  --pb-red-dark: #b81f16;
  --pb-dark: #1d1d1f;
  --pb-text: #2b2b2b;
  --pb-muted: #8a8a8a;
  --pb-line: #e6e6e6;
  --pb-bg-soft: #f1f1f1;
  --pb-radius: 4px;
  --pb-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--pb-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--pb-text);
  background: #fff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--pb-red); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; color: var(--pb-dark); }
.screen-reader-text {
  position: absolute !important; clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px; overflow: hidden;
}

.pb-container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---------- Top bar ---------- */
.pb-topbar { background: #fff; }
.pb-topbar-inner {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 320px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}
.pb-logo a { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--pb-dark); display: inline-block; }
.pb-logo a span { color: var(--pb-red); }
.pb-logo img { max-height: 48px; width: auto; }
.pb-search { position: relative; }
.pb-search input[type="search"] {
  width: 100%; padding: 8px 40px 8px 16px;
  border: 1px solid var(--pb-line); border-radius: 999px;
  background: #f7f7f7; font: inherit; font-size: 13px; outline: none;
}
.pb-search input[type="search"]:focus { border-color: var(--pb-red); background: #fff; }
.pb-search button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; color: var(--pb-muted);
}
.pb-date { text-align: right; font-size: 13px; font-weight: 600; color: var(--pb-red); }

/* ---------- Navigation ---------- */
.pb-nav { background: var(--pb-red); position: sticky; top: 0; z-index: 50; }
.pb-nav-inner { display: flex; align-items: center; justify-content: center; }
.pb-menu { display: flex; flex-wrap: wrap; justify-content: center; }
.pb-menu > li { position: relative; }
.pb-menu > li > a {
  display: block; padding: 10px 18px; color: #fff;
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
}
.pb-menu > li > a:hover,
.pb-menu > li.current-menu-item > a { background: var(--pb-red-dark); color: #fff; }
.pb-menu .sub-menu {
  position: absolute; left: 0; top: 100%; min-width: 190px;
  background: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s; z-index: 10;
}
.pb-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.pb-menu .sub-menu a { display: block; padding: 9px 16px; font-size: 13px; border-bottom: 1px solid var(--pb-line); }
.pb-menu-toggle {
  display: none; background: transparent; border: 0; color: #fff;
  padding: 10px 0; font: inherit; font-weight: 600; cursor: pointer; width: 100%; text-align: left;
}

/* ---------- Breaking news ---------- */
.pb-ticker { background: #fff; border-bottom: 1px solid var(--pb-line); }
.pb-ticker-inner { display: flex; align-items: center; height: 34px; overflow: hidden; gap: 12px; }
.pb-ticker-label {
  flex: 0 0 auto; background: var(--pb-red); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 3px 10px; text-transform: uppercase;
}
.pb-ticker-track { flex: 1; overflow: hidden; position: relative; height: 100%; }
.pb-ticker-list { display: flex; gap: 40px; position: absolute; white-space: nowrap; height: 100%; align-items: center; animation: pb-marquee 40s linear infinite; }
.pb-ticker-list:hover { animation-play-state: paused; }
.pb-ticker-list a { font-size: 12px; font-weight: 500; }
.pb-ticker-list a::before { content: "\2022"; color: var(--pb-red); margin-right: 8px; }
@keyframes pb-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Layout ---------- */
.pb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 24px 0 40px;
  align-items: start;
}

/* ---------- Hero slider ---------- */
.pb-hero { position: relative; overflow: hidden; border-radius: var(--pb-radius); background: #111; }
.pb-hero-slides { position: relative; aspect-ratio: 16 / 9; }
.pb-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s; }
.pb-slide.is-active { opacity: 1; visibility: visible; }
.pb-slide img, .pb-slide .pb-noimg { width: 100%; height: 100%; object-fit: cover; }
.pb-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 60%);
}
.pb-slide-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 28px 28px; z-index: 2; color: #fff; }
.pb-slide-body h2 { color: #fff; font-size: 24px; font-weight: 700; margin: 8px 0 6px; max-width: 90%; }
.pb-slide-body .pb-meta { color: #ddd; }
.pb-slide-cat {
  position: absolute; left: 0; top: 0; z-index: 3; background: var(--pb-red); color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 6px 14px; letter-spacing: .5px;
}
.pb-slide-link { position: absolute; inset: 0; z-index: 2; }
.pb-slide-body { pointer-events: none; }
.pb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.85); color: #222; font-size: 14px; line-height: 1;
}
.pb-arrow:hover { background: #fff; }
.pb-arrow.prev { left: 10px; }
.pb-arrow.next { right: 10px; }
.pb-dots { position: absolute; right: 16px; bottom: 14px; z-index: 4; display: flex; gap: 5px; }
.pb-dots button { width: 14px; height: 4px; border: 0; padding: 0; background: rgba(255,255,255,.5); cursor: pointer; }
.pb-dots button.is-active { background: var(--pb-red); }

.pb-hero-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 28px; }
.pb-hero-thumbs a { display: block; }
.pb-hero-thumbs img, .pb-hero-thumbs .pb-noimg { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 2px; }
.pb-hero-thumbs span { display: block; font-size: 11px; line-height: 1.35; margin-top: 5px; color: #444; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pb-hero-thumbs a.is-active span { color: var(--pb-red); }

.pb-noimg { background: linear-gradient(135deg, #d8d8d8, #bdbdbd); }

/* ---------- Section heading ---------- */
.pb-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: #444; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--pb-line);
}
.pb-section-title::before { content: ""; width: 4px; height: 14px; background: var(--pb-red); display: inline-block; }

/* ---------- Post list ---------- */
.pb-list-item { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--pb-line); }
.pb-list-item:first-child { padding-top: 0; }
.pb-list-thumb img, .pb-list-thumb .pb-noimg { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 2px; }
.pb-cat { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--pb-red); display: block; margin-bottom: 3px; }
.pb-list-item h3 { font-size: 17px; font-weight: 700; line-height: 1.35; margin-bottom: 6px; }
.pb-list-item p { margin: 0 0 6px; font-size: 13px; color: #666; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pb-meta { font-size: 10.5px; color: var(--pb-muted); font-weight: 500; }

/* ---------- Sidebar / popular ---------- */
.pb-widget { background: var(--pb-bg-soft); padding: 14px 16px 6px; margin-bottom: 24px; }
.pb-widget .pb-section-title { border-bottom-color: #dcdcdc; }
.pb-popular li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid #e0e0e0; }
.pb-popular li:last-child { border-bottom: 0; }
.pb-popular .pb-num { font-size: 34px; font-weight: 800; color: #c9c9c9; line-height: 1; }
.pb-popular h4 { font-size: 13px; font-weight: 600; line-height: 1.4; }
.pb-popular li.is-first { display: block; padding-top: 0; }
.pb-popular li.is-first .pb-pop-img { margin: 0 -16px 10px; }
.pb-popular li.is-first .pb-pop-img img, .pb-popular li.is-first .pb-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pb-popular li.is-first .pb-first-row { display: grid; grid-template-columns: 34px 1fr; gap: 8px; }
.pb-widget-plain { background: transparent; padding: 0; }
.pb-widget-plain ul li { padding: 6px 0; border-bottom: 1px solid var(--pb-line); font-size: 14px; }

/* ---------- Single ---------- */
.pb-single .pb-cat { font-size: 11px; }
.pb-single h1 { font-size: 30px; font-weight: 800; margin: 6px 0 10px; }
.pb-single .pb-meta { font-size: 12px; margin-bottom: 16px; }
.pb-single-thumb { margin-bottom: 20px; }
.pb-single-thumb img { width: 100%; border-radius: var(--pb-radius); }
.pb-content { font-size: 16px; line-height: 1.8; }
.pb-content p { margin: 0 0 1.2em; }
.pb-content h2 { font-size: 22px; margin: 1.6em 0 .6em; }
.pb-content h3 { font-size: 18px; margin: 1.4em 0 .5em; }
.pb-content a { color: var(--pb-red); text-decoration: underline; }
.pb-content ul, .pb-content ol { margin: 0 0 1.2em 1.4em; }
.pb-content ul { list-style: disc; }
.pb-content blockquote { margin: 1.4em 0; padding: 8px 20px; border-left: 4px solid var(--pb-red); background: #fafafa; color: #555; font-style: italic; }
.pb-tags { margin: 24px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pb-tags a { background: var(--pb-bg-soft); padding: 3px 12px; font-size: 12px; border-radius: 999px; }
.pb-tags a:hover { background: var(--pb-red); color: #fff; }
.pb-related { margin-top: 36px; }
.pb-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pb-related-grid img, .pb-related-grid .pb-noimg { width: 100%; aspect-ratio: 3/2; object-fit: cover; margin-bottom: 6px; }
.pb-related-grid h4 { font-size: 13px; font-weight: 600; }

/* ---------- Archive header ---------- */
.pb-archive-head { margin-bottom: 18px; }
.pb-archive-head h1 { font-size: 24px; font-weight: 800; }
.pb-archive-head p { color: var(--pb-muted); margin: 4px 0 0; font-size: 14px; }

/* ---------- Pagination ---------- */
.pagination, .navigation.pagination { margin-top: 24px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { padding: 6px 14px; border: 1px solid var(--pb-line); font-size: 13px; font-weight: 600; }
.page-numbers.current, a.page-numbers:hover { background: var(--pb-red); border-color: var(--pb-red); color: #fff; }

/* ---------- Comments ---------- */
.pb-comments { margin-top: 36px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { padding: 14px 0; border-bottom: 1px solid var(--pb-line); font-size: 14px; }
.comment-list .children { list-style: none; margin-left: 28px; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--pb-line); font: inherit; margin-bottom: 10px;
}
.comment-respond .submit, .pb-btn {
  background: var(--pb-red); color: #fff; border: 0; padding: 10px 22px; font: inherit; font-weight: 600; cursor: pointer;
}
.comment-respond .submit:hover, .pb-btn:hover { background: var(--pb-red-dark); }

/* ---------- Footer ---------- */
.pb-footer { background: #1b1b1d; color: #bbb; margin-top: 20px; }
.pb-footer-inner { padding: 32px 0 20px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.pb-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.pb-footer a:hover { color: #fff; }
.pb-footer li { padding: 3px 0; font-size: 13px; }
.pb-footer p { font-size: 13px; margin: 0; }
.pb-copy { border-top: 1px solid #333; padding: 14px 0; font-size: 12px; text-align: center; }

/* ---------- WP core ---------- */
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.aligncenter { margin: 0 auto 1em; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { font-size: 12px; color: var(--pb-muted); margin-top: 4px; }
.sticky, .bypostauthor, .gallery-caption {}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .pb-layout { grid-template-columns: 1fr; }
  .pb-topbar-inner { grid-template-columns: 1fr; text-align: center; gap: 10px; }
  .pb-date { text-align: center; }
  .pb-logo a { font-size: 24px; }
}
@media (max-width: 720px) {
  .pb-menu-toggle { display: block; }
  .pb-nav-inner { flex-direction: column; align-items: stretch; }
  .pb-menu { display: none; flex-direction: column; }
  .pb-menu.is-open { display: flex; }
  .pb-menu > li > a { border-top: 1px solid rgba(255,255,255,.15); }
  .pb-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: var(--pb-red-dark); }
  .pb-menu .sub-menu a { color: #fff; border-color: rgba(255,255,255,.1); }
  .pb-slide-body h2 { font-size: 17px; }
  .pb-slide-body { padding: 14px; }
  .pb-hero-thumbs { grid-template-columns: repeat(2, 1fr); }
  .pb-list-item { grid-template-columns: 110px 1fr; gap: 12px; }
  .pb-list-item h3 { font-size: 14px; }
  .pb-list-item p { display: none; }
  .pb-single h1 { font-size: 23px; }
  .pb-related-grid { grid-template-columns: 1fr; }
  .pb-footer-inner { grid-template-columns: 1fr; }
}
