/**
 * Authemic News - Layout & Components
 * Tema media online. Siap produksi, stabil, fleksibel monetisasi.
 */

/* ==========================================================================
   Header (fixed)
   ========================================================================== */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.site-header-fixed { position: fixed; top: 0; left: 0; right: 0; z-index: 100; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

.site-branding .site-title-link { color: var(--color-primary); font-weight: 800; font-size: 1.25rem; }
.site-branding .site-description { margin: 0; font-size: 0.8125rem; color: var(--color-text-muted); }

.main-navigation { margin-left: auto; }
.nav-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a { color: var(--color-text); font-weight: 500; padding: 0.35rem 0; display: block; }
.nav-menu > li > a:hover { color: var(--color-accent); }
.nav-menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 180px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-md); list-style: none; margin: 0; padding: 0.5rem 0; z-index: 10; }
.nav-menu .sub-menu a { display: block; padding: 0.4rem 1rem; font-size: 0.9375rem; color: var(--color-text); }
.nav-menu .sub-menu a:hover { background: var(--color-bg-alt); color: var(--color-accent); }
@media (min-width: 992px) {
  .nav-menu > li:hover .sub-menu { display: block; }
}
.menu-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 1.5rem; padding: 0.25rem; }
.menu-item-has-children .sub-menu { display: none; }
.main-navigation.toggled .menu-item-has-children .sub-menu { display: block; position: static; box-shadow: none; border: none; padding-left: 1rem; }

/* Satu tombol cari: icon saja, dropdown */
.header-search { position: relative; }
.header-search .search-toggle { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; background: none; border: none; cursor: pointer; color: var(--color-text-muted); font-size: 1.25rem; border-radius: var(--radius); }
.header-search .search-toggle:hover { color: var(--color-accent); }
.header-search .search-icon { display: block; }
.header-search .search-dropdown { position: absolute; top: 100%; right: 0; margin-top: 0.25rem; padding: 1rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-md); min-width: 280px; z-index: 20; }
.header-search .search-dropdown[hidden] { display: none !important; }
.header-search .search-form-inline { display: flex; gap: 0.5rem; }
.header-search .search-form-inline .search-field { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 0.9375rem; }
.header-search .search-submit { padding: 0.5rem 0.75rem; font-size: 0.875rem; }

.top-bar-widgets {
  background: var(--color-accent-soft);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

/* ==========================================================================
   Headline News
   ========================================================================== */
.headline-news {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
}
.headline-label {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
}
.headline-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.headline-list li { margin: 0; }
.headline-list a { color: var(--color-text); font-weight: 500; }
.headline-list a:hover { color: var(--color-accent); }
.headline-time { font-size: 0.75rem; color: var(--color-text-muted); margin-left: 0.35rem; }
@media (max-width: 767px) {
  .headline-news { flex-direction: column; align-items: flex-start; }
  .headline-list { flex-direction: column; gap: 0.35rem; }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.content-area { padding: 1.5rem 0; }
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 992px) {
  .layout-with-sidebar { grid-template-columns: 1fr 300px; }
  .main-content { min-width: 0; }
}
.content-area.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Hero (Front Page)
   ========================================================================== */
.hero-entry { margin-bottom: 2rem; }
.hero-link { display: block; color: inherit; text-decoration: none; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); transition: box-shadow 0.2s ease; }
.hero-link:hover { box-shadow: var(--shadow-md), 0 0 0 2px var(--color-accent); }
.hero-thumbnail { margin: 0; aspect-ratio: 16/9; overflow: hidden; background: var(--color-bg-alt); }
.hero-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.hero-thumbnail-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; min-height: 200px;
  font-size: 1rem; font-weight: 600; color: var(--color-text-muted);
  padding: 1rem;
}
.hero-content { padding: 1.25rem 1.5rem; background: var(--color-bg); }
.hero-category { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-accent); font-weight: 600; }
.hero-category a { color: inherit; }
.hero-title { font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 0.5em 0 0.25em; line-height: 1.25; }
.hero-meta { font-size: 0.875rem; color: var(--color-text-muted); margin-top: 0.5rem; }
.hero-excerpt { font-size: 0.9375rem; color: var(--color-text-muted); margin: 0.5em 0 0; }

/* Hero Split (1 besar + 2 kecil) */
.hero-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .hero-split { grid-template-columns: 1.4fr 1fr; gap: 1.25rem; }
}
.hero-split-main .hero-entry { margin-bottom: 0; }
.hero-split-secondary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hero-entry-small .hero-thumbnail { aspect-ratio: 16/9; }
.hero-entry-small .hero-content { padding: 0.75rem 1rem; }
.hero-entry-small .hero-title { font-size: 0.9375rem; margin: 0.25em 0 0; }
.hero-entry-small .hero-meta { font-size: 0.8125rem; margin-top: 0.25rem; }

/* Zona iklan homepage */
.home-ad-zone { margin: 1.5rem 0; min-height: 50px; text-align: center; }
.home-ad-zone .widget { margin: 0; }

/* Section kategori (kanal) */
.home-category-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.home-category-section .section-title {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}
.home-category-section .section-title a { color: var(--color-primary); }
.home-category-section .section-title a:hover { color: var(--color-accent); }
.home-category-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}
.home-category-list li { margin: 0 0 0.35rem; padding: 0.25rem 0; border-bottom: 1px solid var(--color-bg-alt); }
.home-category-list li:last-child { border-bottom: none; }
.home-category-list a { font-weight: 500; }
.home-category-list .item-time { font-size: 0.75rem; color: var(--color-text-muted); margin-left: 0.5rem; }
.home-category-section .section-more { margin: 0; font-size: 0.875rem; }
.home-category-section .section-more a { font-weight: 600; }

/* ==========================================================================
   News Grid & Cards
   ========================================================================== */
.section-title { font-size: 1.25rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--color-accent); }
.news-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}
@media (min-width: 576px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }

.news-card { margin: 0; }
.card-link { display: block; color: inherit; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--color-bg); border: 1px solid var(--color-border); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.card-link:hover { border-color: var(--color-accent); box-shadow: var(--shadow-sm); }
.card-thumbnail { margin: 0; aspect-ratio: 16/9; overflow: hidden; background: var(--color-bg-alt); }
.card-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.card-thumbnail-placeholder { min-height: 140px; }
.card-body { padding: 1rem; }
.card-category { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-accent); font-weight: 600; }
.card-category a { color: inherit; }
.card-title { font-size: 1rem; margin: 0.35em 0 0.25em; line-height: 1.35; font-weight: 600; }
.card-meta { font-size: 0.8125rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* ==========================================================================
   Single Article
   ========================================================================== */
.single-article .entry-header { margin-bottom: 1rem; }
.single-article .entry-categories { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-accent); font-weight: 600; }
.single-article .entry-title { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0.35em 0 0.5em; line-height: 1.3; }
.single-article .entry-meta { font-size: 0.875rem; color: var(--color-text-muted); }
.single-article .entry-meta .reading-time { margin-left: 0.5rem; }
.single-article .entry-thumbnail { margin: 1rem 0; border-radius: var(--radius); overflow: hidden; }
.single-article .entry-thumbnail img { width: 100%; height: auto; }
.single-article .entry-content { font-size: 1.0625rem; line-height: 1.75; }
.single-article .entry-content img { max-width: 100%; height: auto; }
.single-article .entry-footer { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--color-border); font-size: 0.875rem; color: var(--color-text-muted); }
.ad-zone { margin: 1.5rem 0; min-height: 50px; }

/* ==========================================================================
   Archive
   ========================================================================== */
.archive-header { margin-bottom: 1.5rem; }
.archive-title { font-size: 1.5rem; margin-bottom: 0.25rem; }
.archive-description { font-size: 0.9375rem; color: var(--color-text-muted); }

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */
.sidebar .widget { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--color-border); }
.sidebar .widget:last-child { border-bottom: none; }
.widget-title { font-size: 1rem; margin-bottom: 0.75rem; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin-bottom: 0.35rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--color-primary); color: #e2e8f0; margin-top: 2rem; padding: 2rem 0 1rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-widgets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 576px) { .footer-widgets { grid-template-columns: 1fr 1fr; } }
@media (min-width: 768px) { .footer-widgets { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand-col .site-title { font-size: 1rem; margin-bottom: 0.25rem; }
.footer-brand-col .site-description { font-size: 0.8125rem; opacity: 0.9; margin: 0; }
.footer-nav { margin-bottom: 1rem; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 0 1rem; list-style: none; margin: 0; padding: 0; font-size: 0.875rem; }
.footer-bottom { padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8125rem; opacity: 0.9; }
.footer-credit { margin-left: 0.5rem; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination { margin-top: 2rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.25rem; }
.pagination a, .pagination span { display: inline-block; padding: 0.4rem 0.75rem; font-size: 0.875rem; border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); }
.pagination a:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ==========================================================================
   Search Form
   ========================================================================== */
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; max-width: 400px; }
.search-form .search-field { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 1rem; }

/* ==========================================================================
   Mobile Menu
   ========================================================================== */
@media (max-width: 991px) {
  .menu-toggle { display: block; }
  .main-navigation .nav-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 1rem; flex-direction: column; }
  .main-navigation.toggled .nav-menu { display: flex; }
}
