﻿/*
Theme Name: Cerita Rehatku
Author: Antigravity
Description: Custom WordPress Theme
Version: 1.0.1
*/
/* ================================================
   BACA REHATKU â€” Premium CSS
   ================================================ */

/* --- CSS VARIABLES --- */
:root {
  --brand-primary: #2c3e50;
  --brand-accent: #e67e22;
  --brand-accent-light: #f39c12;
  --brand-secondary: #8e44ad;
  --text-primary: #1a1a2e;
  --text-secondary: #555e6e;
  --text-muted: #8a9ab0;
  --bg-body: #f5f6fa;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --border-light: #e8eaf0;
  --border-medium: #d0d5e0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.13);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
  --header-h: 68px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* --- UTILITY --- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ================================================
   HEADER
   ================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.logo-accent {
  color: var(--brand-accent);
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--brand-primary);
  background: var(--bg-body);
}

.nav-link.active {
  color: var(--brand-accent);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--brand-accent);
  border-radius: 2px;
}

/* Nav separator styling via CSS */
.main-nav .nav-link + .nav-link::before {
  content: '|';
  color: var(--border-medium);
  margin-right: 4px;
  pointer-events: none;
}

.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.nav-search-btn:hover {
  background: var(--bg-body);
  color: var(--brand-accent);
}

/* Header Search Bar */
.header-search-bar {
  background: var(--bg-body);
  border-top: 1px solid var(--border-light);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.header-search-bar.open {
  max-height: 80px;
  padding: 12px 0;
}

.header-search-form {
  display: flex;
  gap: 10px;
}

.header-search-form input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg-white);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search-form input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(230,126,34,0.12);
}

.header-search-form button {
  padding: 10px 22px;
  background: var(--brand-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition), transform var(--transition);
}

.header-search-form button:hover {
  background: var(--brand-accent-light);
  transform: translateY(-1px);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  height: 2.5px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ================================================
   HERO â€” FEATURED BOOKS
   ================================================ */
.hero-section {
  background: var(--bg-white);
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border-light);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.featured-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3/4;
  display: block;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  background: #1a1a2e;
}

.featured-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: var(--shadow-lg);
}

.featured-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-card:hover .featured-cover {
  transform: scale(1.05);
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.featured-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
}

.badge-novel { background: #e67e22; color: #fff; }
.badge-dongeng { background: #27ae60; color: #fff; }
.badge-cerpen { background: #8e44ad; color: #fff; }

.featured-title {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ================================================
   MAIN CONTENT LAYOUT
   ================================================ */
.main-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 48px;
  flex: 1;
}

/* ================================================
   CONTENT SECTIONS (Left Column)
   ================================================ */
.content-section {
  margin-bottom: 36px;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand-accent);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.section-heading-icon {
  font-size: 1.1rem;
}

.section-more-link {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-accent);
  border: 1.5px solid var(--brand-accent);
  border-radius: 20px;
  padding: 3px 12px;
  transition: background var(--transition), color var(--transition);
}

.section-more-link:hover {
  background: var(--brand-accent);
  color: #fff;
}

/* --- Book List --- */
.book-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.book-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  border-radius: var(--radius-sm);
}

.book-item:last-child { border-bottom: none; }

.book-item:hover {
  background: rgba(230,126,34,0.04);
}

.book-item-cover-link {
  flex-shrink: 0;
}

.book-item-cover {
  width: 68px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.book-item:hover .book-item-cover {
  transform: scale(1.04);
}

.book-cover-placeholder {
  width: 68px;
  height: 96px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.book-item:hover .book-cover-placeholder {
  transform: scale(1.04);
}

.book-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.book-item-title {
  font-family: var(--font-serif);
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1.3;
  transition: color var(--transition);
}

.book-item-title:hover {
  color: var(--brand-accent);
}

.book-item-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.meta-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-body);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.meta-views {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ================================================
   SIDEBAR (Right Column)
   ================================================ */
.content-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.widget-heading {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Most Read */
.most-read-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.most-read-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.most-read-item:last-child { border-bottom: none; }

.mr-rank {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--brand-accent);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.most-read-item:nth-child(1) .mr-rank { color: #f39c12; font-size: 1rem; }
.most-read-item:nth-child(2) .mr-rank { color: #bdc3c7; }
.most-read-item:nth-child(3) .mr-rank { color: #cd7f32; }

.mr-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.35;
  transition: color var(--transition);
}

.mr-title:hover { color: var(--brand-accent); }

/* Sidebar Search */
.sidebar-search-wrap {
  display: flex;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sidebar-search-wrap:focus-within {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(230,126,34,0.12);
}

#sidebar-search-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  background: transparent;
}

#sidebar-search-input::placeholder { color: var(--text-muted); }

#sidebar-search-btn {
  padding: 10px 14px;
  background: var(--brand-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

#sidebar-search-btn:hover { background: var(--brand-accent-light); }

/* Kategori */
.kategori-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.kategori-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: color var(--transition), padding-left var(--transition);
}

.kategori-list li:last-child .kategori-link { border-bottom: none; }

.kategori-link:hover {
  color: var(--brand-accent);
  padding-left: 6px;
}

.kat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-body);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 1px 8px;
}

/* Ad Space */
.ad-space {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  transition: border-color var(--transition);
}

.ad-space:hover { border-color: var(--brand-accent); }

.ad-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.ad-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.ad-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ================================================
   FOOTER
   ================================================ */
.site-footer {
  background: var(--brand-primary);
  color: rgba(255,255,255,0.85);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.75);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.footer-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.featured-card {
  animation: fadeInUp 0.5s ease both;
}
.featured-card:nth-child(1) { animation-delay: 0.0s; }
.featured-card:nth-child(2) { animation-delay: 0.08s; }
.featured-card:nth-child(3) { animation-delay: 0.16s; }
.featured-card:nth-child(4) { animation-delay: 0.24s; }

.book-item {
  animation: fadeInUp 0.4s ease both;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .content-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 20px;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    z-index: 99;
    gap: 2px;
  }
  .main-nav.open { display: flex; }
  .main-nav .nav-link + .nav-link::before { display: none; }
  .nav-link { padding: 12px 14px; font-size: 1rem; }
  .hamburger { display: flex; }
  .content-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-title { font-size: 0.85rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* WP Nav & Submenu Styling */
.wp-nav-menu-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.wp-nav-menu-list > li {
  position: relative;
  display: flex;
  align-items: center;
}
.wp-nav-menu-list > li + li::before {
  content: '|';
  color: var(--border-medium);
  margin-right: 4px;
  pointer-events: none;
}
.wp-nav-menu-list ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
}
.wp-nav-menu-list li:hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.wp-nav-menu-list ul.sub-menu li {
    display: block;
}
.wp-nav-menu-list ul.sub-menu li::before {
    display: none;
}
.wp-nav-menu-list ul.sub-menu a {
    display: block;
    padding: 8px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 400;
    transition: background 0.2s, color 0.2s;
    border-radius: 0;
}
.wp-nav-menu-list ul.sub-menu a:hover {
    background-color: var(--bg-body);
    color: var(--brand-accent);
}


/* ================================================
   SINGLE POST LAYOUT
   ================================================ */
.single-post-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 48px;
}
.single-post-content {
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.single-post-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}
.single-post-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1.3;
  margin-bottom: 12px;
}
.single-post-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.single-post-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.single-post-meta a {
  color: var(--brand-accent);
  transition: color var(--transition);
}
.single-post-meta a:hover {
  color: var(--brand-accent-light);
}
.single-post-thumbnail {
  margin-bottom: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.single-post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}
.single-post-body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}
.single-post-body h2, .single-post-body h3, .single-post-body h4 {
  font-family: var(--font-serif);
  color: var(--brand-primary);
  margin-top: 24px;
  margin-bottom: 12px;
}
.single-post-body p {
  margin-bottom: 16px;
}
.single-post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
@media (max-width: 900px) {
  .single-post-container {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .single-post-title {
    font-size: 1.8rem;
  }
  .single-post-content {
    padding: 20px;
  }
}

