/*
Theme Name: RuangBola
Theme URI: https://ruangbola.net
Author: RuangBola Team
Author URI: https://ruangbola.net
Description: Custom WordPress theme for RuangBola, portal berita sepak bola Indonesia. Editorial, mobile-first, ringan untuk server dengan resource terbatas.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: ruangbola
*/

/* ==========================================================================
   0. DESIGN TOKENS
   ========================================================================== */
:root{
  /* Palette */
  --rb-ink:        #12181A;   /* primary text */
  --rb-paper:       #FFFFFF;   /* page background */
  --rb-pitch:       #0E6B4E;   /* brand primary - pitch green */
  --rb-pitch-dark:  #073A2B;   /* header / footer */
  --rb-flare:       #FF5A36;   /* accent - live / score / cta */
  --rb-mist:        #F5F6F4;   /* alt section background */
  --rb-line:        #E2E5E1;   /* hairline borders */
  --rb-muted:       #5B6B63;   /* secondary text */
  --rb-white-on-dark: #EAF3EF;

  /* Type */
  --rb-font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --rb-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --rb-container: 1180px;
  --rb-radius-sm: 3px;
  --rb-radius-md: 6px;
  --rb-header-h: 56px;
}

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */
*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body{
  margin: 0;
  background: var(--rb-paper);
  color: var(--rb-ink);
  font-family: var(--rb-font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
img{ max-width: 100%; height: auto; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
button{ font-family: inherit; cursor: pointer; }
h1,h2,h3,h4{ font-family: var(--rb-font-display); font-weight: 700; line-height: 1.1; margin: 0; }
:focus-visible{ outline: 3px solid var(--rb-flare); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.rb-container{
  max-width: var(--rb-container);
  margin: 0 auto;
  padding: 0 16px;
}
.rb-skip-link{
  position: absolute; left: -9999px; top: 0; background: var(--rb-ink); color: #fff;
  padding: 10px 16px; z-index: 999;
}
.rb-skip-link:focus{ left: 12px; top: 12px; }
.rb-visually-hidden{
  position: absolute !important; width:1px; height:1px; overflow:hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* ==========================================================================
   2. HEADER
   ========================================================================== */
.rb-header{
  position: sticky; top: 0; z-index: 500;
  background: var(--rb-paper);
  border-top: 3px solid var(--rb-pitch);
  border-bottom: 1px solid var(--rb-line);
  transition: box-shadow .2s ease;
}
.rb-header.is-stuck{ box-shadow: 0 2px 10px rgba(7,58,43,.08); }
.rb-header__bar{
  display: flex; align-items: center; justify-content: space-between;
  height: var(--rb-header-h);
  gap: 12px;
}
.rb-logo{
  font-family: var(--rb-font-display);
  font-weight: 700; font-size: 26px; letter-spacing: .5px;
  color: var(--rb-ink);
  display: flex; align-items: baseline; gap: 2px;
}
.rb-logo span{ color: var(--rb-pitch); }
.rb-header__actions{ display: flex; align-items: center; gap: 6px; }
.rb-icon-btn{
  background: none; border: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--rb-ink); border-radius: var(--rb-radius-sm);
}
.rb-icon-btn:hover{ background: var(--rb-mist); }
.rb-icon-btn svg{ width: 22px; height: 22px; }

.rb-nav-desktop{ display: none; }
@media (min-width: 960px){
  .rb-header__bar{ height: 72px; }
  .rb-nav-desktop{ display: flex; align-items: center; gap: 26px; margin: 0 auto 0 36px; }
  /* wp_nav_menu() strips the <ul> via items_wrap, but the fallback menu
     still wraps items in one — collapse it either way so the <li>s (not a
     single <ul> box) are the actual flex items. Fixes the nav rendering as
     a single stacked block instead of a horizontal row. */
  .rb-nav-desktop ul{ display: contents; }
  .rb-nav-desktop li{ list-style: none; }
  .rb-nav-desktop a{
    font-size: 14px; font-weight: 700; color: var(--rb-ink);
    text-transform: uppercase; letter-spacing: .06em;
    padding: 8px 0; border-bottom: 2px solid transparent;
  }
  .rb-nav-desktop a:hover,
  .rb-nav-desktop .current-menu-item > a{ border-color: var(--rb-pitch); }
  .rb-header__hamburger{ display: none; }
}
.rb-header__hamburger{ display: flex; }

/* mobile drawer */
.rb-drawer{
  position: fixed; inset: 0; z-index: 600;
  visibility: hidden; pointer-events: none;
  overflow: hidden;
}
.rb-drawer.is-open{ visibility: visible; pointer-events: auto; }
.rb-drawer__backdrop{
  position: absolute; inset: 0; background: rgba(7,10,9,.5);
  opacity: 0; transition: opacity .2s ease;
}
.rb-drawer.is-open .rb-drawer__backdrop{ opacity: 1; }
.rb-drawer__panel{
  position: absolute; top: 0; left: 0; bottom: 0; width: 82%; max-width: 340px;
  background: var(--rb-paper); padding: 18px;
  transform: translateX(-100%); transition: transform .25s ease;
  overflow-y: auto;
}
.rb-drawer.is-open .rb-drawer__panel{ transform: translateX(0); }
.rb-drawer__panel li{ list-style: none; }
.rb-drawer__panel a{
  display: block; padding: 14px 4px; font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--rb-line);
}

/* search overlay */
.rb-search{
  position: fixed; inset: 0; z-index: 700; background: var(--rb-paper);
  visibility: hidden; opacity: 0; transition: opacity .18s ease;
}
.rb-search.is-open{ visibility: visible; opacity: 1; }
.rb-search__inner{ max-width: 720px; margin: 90px auto 0; padding: 0 16px; }
.rb-search input[type="search"]{
  width: 100%; font-size: 22px; padding: 12px 4px; border: 0; border-bottom: 2px solid var(--rb-ink);
  font-family: var(--rb-font-display);
}
.rb-search input[type="search"]:focus{ outline: none; }
.rb-search__close{ margin-top: 16px; }

/* ==========================================================================
   5. SECTION HEADINGS / CATEGORY CHIPS
   ========================================================================== */
.rb-section{ padding: 28px 0; }
.rb-section--alt{ background: var(--rb-mist); }
.rb-section__head{
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border-bottom: 2px solid var(--rb-ink); padding-bottom: 8px; margin-bottom: 16px;
}
.rb-section__title{ font-size: clamp(19px, 5vw, 24px); min-width: 0; }
.rb-section__more{ font-size: 13px; font-weight: 700; color: var(--rb-pitch); white-space: nowrap; flex-shrink: 0; }

.rb-chip{
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: var(--rb-radius-sm);
  background: var(--rb-pitch); color: #fff;
}
.rb-chip--flare{ background: var(--rb-flare); }
.rb-meta{ font-size: 12px; color: var(--rb-muted); }

/* ==========================================================================
   6. HERO NEWS
   ========================================================================== */
.rb-hero{ display: grid; gap: 16px; grid-template-columns: 1fr; }
.rb-hero > *{ min-width: 0; }
.rb-hero__main{ position: relative; }
.rb-hero__main img{ width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--rb-radius-md); }
.rb-hero__main .rb-chip{ position: absolute; top: 12px; left: 12px; }
.rb-hero__main h1,.rb-hero__main h2{ font-size: 26px; margin: 10px 0 6px; overflow-wrap: break-word; }
.rb-hero__excerpt{ color: var(--rb-muted); font-size: 15px; margin: 0 0 6px; }
.rb-hero__side{ display: flex; flex-direction: column; gap: 12px; }
.rb-hero__side-item{ display: flex; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--rb-line); }
.rb-hero__side-item > div{ min-width: 0; }
.rb-hero__side-item img{ width: 96px; height: 68px; object-fit: cover; border-radius: var(--rb-radius-sm); flex-shrink: 0; }
.rb-hero__side-item h3{ font-size: 17px; line-height: 1.2; margin: 4px 0 2px; overflow-wrap: break-word; }
@media (min-width: 960px){
  .rb-hero{ grid-template-columns: 2fr 1fr; }
  .rb-hero__main h1,.rb-hero__main h2{ font-size: 34px; }
}

/* ==========================================================================
   7. NEWS GRID / CARDS
   ========================================================================== */
.rb-grid{ display: grid; grid-template-columns: 1fr; gap: 18px; }
.rb-grid > *{ min-width: 0; }
@media (min-width: 640px){ .rb-grid{ grid-template-columns: repeat(2,1fr); } }
@media (min-width: 960px){ .rb-grid{ grid-template-columns: repeat(3,1fr); } }
.rb-card__img{ aspect-ratio: 4/3; overflow: hidden; border-radius: var(--rb-radius-md); margin-bottom: 8px; }
.rb-card__img img{ width: 100%; height: 100%; object-fit: cover; }
.rb-card h3{ font-size: 16px; line-height: 1.3; margin: 6px 0 4px; }
.rb-card .rb-meta{ display: flex; gap: 6px; align-items: center; }

/* ==========================================================================
   8. NEWS LIST (Terkini / archive / search / Baca Juga)
   ========================================================================== */
.rb-list{ display: flex; flex-direction: column; }
.rb-list__item{
  display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rb-line);
}
.rb-list__img{ flex: 0 0 auto; }
.rb-list__img img{ width: 104px; height: 74px; object-fit: cover; border-radius: var(--rb-radius-sm); }
.rb-list__body{ flex: 1; min-width: 0; }
.rb-list__meta{ display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; }
.rb-list__item h3{ font-size: 19px; line-height: 1.2; margin: 0; overflow-wrap: break-word; }
.rb-list__item h3 a:hover{ color: var(--rb-pitch); }
.rb-list__excerpt{ display: none; margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--rb-muted); }
@media (min-width: 600px){
  .rb-list__item{ gap: 18px; padding: 18px 0; }
  .rb-list__img img{ width: 168px; height: 120px; }
  .rb-list__item h3{ font-size: 22px; }
  .rb-list__excerpt{
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}
.rb-loadmore{
  display: block; margin: 18px auto 0; padding: 10px 26px;
  background: var(--rb-ink); color: #fff; border: 0; border-radius: var(--rb-radius-sm);
  font-weight: 700; font-size: 14px;
}
.rb-loadmore[disabled]{ opacity: .5; }

/* ==========================================================================
   11. SIDEBAR
   ========================================================================== */
.rb-layout{ display: grid; grid-template-columns: 1fr; gap: 28px; }
.rb-layout > *{ min-width: 0; }
@media (min-width: 960px){ .rb-layout{ grid-template-columns: 2.2fr 1fr; align-items: start; } }
.rb-sidebar{ display: flex; flex-direction: column; gap: 24px; }
.rb-sidebar__block{ border-top: 3px solid var(--rb-ink); padding-top: 12px; }
.rb-sidebar__title{ font-size: 15px; font-weight: 700; margin-bottom: 10px; }

/* ==========================================================================
   13. SINGLE ARTICLE
   ========================================================================== */
.rb-breadcrumb{ font-size: 13px; color: var(--rb-muted); margin: 14px 0 18px; line-height: 1.6; }
.rb-breadcrumb a{ color: var(--rb-muted); font-weight: 600; }
.rb-breadcrumb a:hover{ color: var(--rb-pitch); }
.rb-breadcrumb span{ color: var(--rb-ink); font-weight: 600; }
.rb-article__header{ max-width: 760px; margin: 0 auto 20px; }
.rb-article__title{
  overflow-wrap: break-word;
  font-size: clamp(28px, 6.5vw, 44px);
  line-height: 1.14;
  letter-spacing: -.01em;
  margin: 12px 0 14px;
}
.rb-article__excerpt{ font-size: 18px; line-height: 1.5; color: var(--rb-muted); margin: 0 0 16px; }
.rb-article__byline{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--rb-muted);
  padding-top: 14px; border-top: 1px solid var(--rb-line);
}
.rb-article__byline img{ border-radius: 50%; flex-shrink: 0; }
.rb-article__byline strong{ color: var(--rb-ink); }
.rb-article__thumb{ max-width: 760px; margin: 20px auto; }
/* Natural size, capped to the column: source images are often small
   (360-673px wide), so forcing width:100% would upscale & blur them. */
.rb-article__thumb img{ width: auto; max-width: 100%; height: auto; margin: 0 auto; border-radius: var(--rb-radius-md); }
.rb-article__thumb figcaption{ font-size: 12px; color: var(--rb-muted); margin-top: 8px; }
.rb-article__body{
  max-width: 720px; margin: 0 auto; font-size: 17px; line-height: 1.75;
  overflow-wrap: anywhere;
}
.rb-article__body p{ margin: 0 0 20px; }
.rb-article__body h2{ font-size: 24px; line-height: 1.25; margin: 34px 0 14px; }
.rb-article__body h3{ font-size: 20px; line-height: 1.3; margin: 28px 0 12px; }
.rb-article__body ul{ list-style: disc; margin: 0 0 20px; padding-left: 22px; }
.rb-article__body ol{ list-style: decimal; margin: 0 0 20px; padding-left: 22px; }
.rb-article__body li{ margin-bottom: 8px; }
.rb-article__body img{ max-width: 100%; height: auto; border-radius: var(--rb-radius-md); margin: 24px auto; display: block; }
.rb-article__body figure{ margin: 24px 0; max-width: 100%; }
.rb-article__body iframe, .rb-article__body video, .rb-article__body embed{ max-width: 100%; }
.rb-article__body figcaption{ font-size: 13px; color: var(--rb-muted); text-align: center; margin-top: 8px; }
.rb-article__body table{ display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 20px 0; -webkit-overflow-scrolling: touch; }
.rb-article__body th, .rb-article__body td{ padding: 8px; border: 1px solid var(--rb-line); font-size: 14px; text-align: left; }
.rb-article__body pre{
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
  background: var(--rb-mist); padding: 12px; border-radius: var(--rb-radius-sm); font-size: 14px;
}
.rb-article__body a{ color: var(--rb-pitch); text-decoration: underline; text-decoration-color: var(--rb-line); text-underline-offset: 2px; }
.rb-article__body a:hover{ text-decoration-color: currentColor; }
.rb-article__body blockquote{
  border-left: 3px solid var(--rb-pitch); margin: 24px 0; padding: 4px 0 4px 18px;
  font-style: italic; color: var(--rb-muted);
}
.rb-share{ display: flex; align-items: center; gap: 10px; margin: 24px auto; max-width: 720px; }
.rb-share a{
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rb-line);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.rb-share a:hover{ background: var(--rb-mist); border-color: var(--rb-pitch); }
.rb-share a svg{ width: 18px; height: 18px; }
.rb-prevnext{ display: grid; grid-template-columns: 1fr; gap: 12px; max-width: 900px; margin: 32px auto; }
@media (min-width: 600px){ .rb-prevnext{ grid-template-columns: 1fr 1fr; } }
.rb-prevnext a{ border: 1px solid var(--rb-line); border-radius: var(--rb-radius-md); padding: 14px; display: block; }
.rb-prevnext a:hover{ border-color: var(--rb-pitch); }
.rb-prevnext .rb-meta{ display: block; margin-bottom: 4px; }
.rb-prevnext__next{ text-align: right; }
.rb-related{ max-width: 760px; margin: 0 auto; }
.rb-tags{ max-width: 720px; margin: 24px auto; display: flex; gap: 8px; flex-wrap: wrap; }
.rb-chip--tag{ background: var(--rb-mist); color: var(--rb-ink); font-size: 12px; padding: 5px 10px; }
.rb-chip--tag:hover{ background: var(--rb-line); }
.rb-comments{ margin-top: 30px; }

/* Comments — generic styling for WordPress core comment markup. The theme
   has no comments.php, so comments_template() falls back to WP core's
   default template; these rules only target stable, long-standing core
   classnames/IDs and don't touch comment logic/markup. */
#comments{ max-width: 720px; margin: 30px auto 0; }
#comments .comments-title,
#comments #reply-title{ font-family: var(--rb-font-display); font-size: 22px; margin: 0 0 16px; }
.comment-list{ margin: 0 0 24px; }
.comment-list .children{ padding-left: 20px; }
.comment-list article{ padding: 14px 0; border-bottom: 1px solid var(--rb-line); }
.comment-author img{ border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-author .fn{ font-weight: 700; font-style: normal; }
.comment-metadata{ font-size: 12px; color: var(--rb-muted); margin-bottom: 6px; }
.comment-metadata a{ color: inherit; }
.comment-content p{ margin: 6px 0; font-size: 15px; line-height: 1.6; }
.comment-reply-link{ font-size: 12px; font-weight: 700; color: var(--rb-pitch); }
.comment-respond{ margin-top: 20px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
  width: 100%; font-family: inherit; font-size: 15px;
  padding: 10px 12px; border: 1px solid var(--rb-line); border-radius: var(--rb-radius-sm);
  margin-bottom: 12px; background: var(--rb-paper); color: var(--rb-ink);
}
.comment-form textarea{ min-height: 120px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus{ outline: none; border-color: var(--rb-pitch); }
.comment-form .form-submit input,
#commentform #submit{
  display: inline-block; background: var(--rb-ink); color: #fff; border: 0;
  padding: 11px 24px; border-radius: var(--rb-radius-sm); font-weight: 700; font-size: 14px; cursor: pointer;
}
.comment-form .form-submit input:hover,
#commentform #submit:hover{ background: var(--rb-pitch); }

/* ==========================================================================
   14. FOOTER
   ========================================================================== */
.rb-footer{ background: var(--rb-pitch-dark); color: var(--rb-white-on-dark); margin-top: 40px; padding: 36px 0 20px; }
.rb-footer__grid{ display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 760px){ .rb-footer__grid{ grid-template-columns: 2fr 1fr 1fr; } }
.rb-footer__title{ font-family: var(--rb-font-display); font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.rb-footer__desc{ font-size: 13px; opacity: .8; max-width: 320px; }
.rb-footer h4{ font-size: 13px; color: #fff; margin-bottom: 10px; }
.rb-footer ul li{ margin-bottom: 8px; }
.rb-footer a{ font-size: 13px; opacity: .85; }
.rb-footer a:hover{ opacity: 1; text-decoration: underline; }
.rb-footer__bottom{
  border-top: 1px solid rgba(255,255,255,.15); margin-top: 26px; padding-top: 16px;
  font-size: 12px; opacity: .7; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ==========================================================================
   15. ARCHIVE / CATEGORY / SEARCH / 404
   ========================================================================== */
.rb-archive__head{ padding: 24px 0 6px; border-bottom: 2px solid var(--rb-ink); margin-bottom: 20px; }
.rb-archive__head h1{ font-size: 28px; }
.rb-archive__head p{ color: var(--rb-muted); font-size: 14px; }
.rb-archive__head h1{ overflow-wrap: break-word; }
.rb-archive__search{ margin: 14px 0 4px; }
.rb-feed{ max-width: 860px; margin-left: auto; margin-right: auto; }
.rb-feed__empty{ padding: 12px 0; }
.rb-list--top{ margin-top: 12px; }
.rb-lead{ padding: 20px 0 8px; }
.rb-terkini{ scroll-margin-top: 80px; }
.rb-section__page{ font-family: var(--rb-font-body); font-size: 14px; font-weight: 600; color: var(--rb-muted); margin-left: 6px; }
.rb-searchform{ display: flex; gap: 8px; }
.rb-searchform input[type="search"]{
  flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--rb-line); border-radius: var(--rb-radius-sm); background: var(--rb-paper); color: var(--rb-ink);
}
.rb-searchform input[type="search"]:focus{ outline: none; border-color: var(--rb-pitch); }
.rb-searchform button{
  flex: 0 0 auto; min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--rb-radius-sm);
  background: var(--rb-ink); color: #fff; font-weight: 700; font-size: 14px;
}
.rb-searchform button:hover{ background: var(--rb-pitch); }
.rb-pagination{ display: flex; justify-content: center; gap: 6px; margin: 30px 0; flex-wrap: wrap; }
.rb-pagination a, .rb-pagination span{
  min-width: 40px; height: 40px; padding: 0 6px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rb-line); border-radius: var(--rb-radius-sm); font-size: 13px; font-weight: 600;
}
.rb-pagination .current{ background: var(--rb-ink); color: #fff; border-color: var(--rb-ink); }
.rb-404{ text-align: center; padding: 60px 0; }
.rb-404 h1{ font-size: 64px; color: var(--rb-line); }

/* ==========================================================================
   16. UTIL
   ========================================================================== */
.rb-mt-0{ margin-top:0; } .rb-mb-0{ margin-bottom:0; }
.rb-hide-mobile{ display:none; }
@media (min-width:960px){ .rb-hide-mobile{ display:initial; } .rb-hide-desktop{ display:none; } }
