/*
Theme Name: KirikThemes Sawo
Theme URI: https://example.com/kirikthemessawo
Update URI: false
Author: KirikThemes
Author URI: https://example.com
Description: Fast-loading news and magazine theme with a rotating headline carousel, three category blocks and a sticky right sidebar, finished in a deep sawo brown. Built to stay quick on mobile connections without giving up a full-width editorial layout.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kirikthemessawo
Tags: news, blog, grid-layout, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   1. DESIGN SYSTEM & CSS VARIABLES
   ============================================================ */
:root {
  --clr-primary: #663300;
  --clr-primary-hover: #442200;
  --clr-primary-light: #884400;
  --clr-primary-alpha: rgba(102, 51, 0, 0.1);
  --clr-bg: #ffffff;
  --clr-bg-alt: #fcf9f5;
  --clr-border: #e8e3dd;
  --clr-border-dark: #d5ccbf;
  --clr-text: #111111;
  --clr-text-muted: #222222;
  --clr-link: #663300;
  --clr-link-hover: #442200;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  /* Judul = satu-satunya font web yang diunduh. Teks isi memakai font bawaan
     sistem (nol unduhan) — dulu di sini ada 'Open Sans' sebagai keluarga kedua. */
  --font-heading: 'Roboto Slab', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================
   2. BASE RESETS & TYPOGRAPHY
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clr-text);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}
a:hover, a:focus {
  color: var(--clr-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--clr-primary);
  color: #ffffff;
  padding: 12px 20px;
  z-index: 99999;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

/* ============================================================
   3. LAYOUT CONTAINERS & GRIDS
   ============================================================ */
.kirik-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.kirik-section-wrap {
  padding: 40px 0;
  border-bottom: 1px solid var(--clr-border);
}

.kirik-grid-70-30 {
  display: grid;
  grid-template-columns: 70% 30%;
  gap: 32px;
}

.kirik-grid-66-33 {
  display: grid;
  grid-template-columns: 66% 33%;
  gap: 24px;
}

.kirik-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.kirik-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ============================================================
   4. ANIMATIONS & CARD LAYOUT STYLING
   ============================================================ */
.title-animation-underline {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--clr-primary), var(--clr-primary));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 2px;
  transition: background-size 0.3s ease;
}
.title-animation-underline:hover {
  background-size: 100% 2px;
  color: var(--clr-primary) !important;
  text-decoration: none;
}

/* Category Text Links */
.kirik-cat-link,
.terms-wrapper a,
.term-item {
  color: var(--clr-primary) !important;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: none !important;
  padding: 0 !important;
  display: inline-block;
  margin-bottom: 4px;
}
.terms-wrapper a:hover,
.kirik-cat-link:hover {
  color: var(--clr-primary-hover) !important;
  text-decoration: underline;
}

/* Smooth Image Container */
.kirik-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #f0eae1;
}
.kirik-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.kirik-image-wrapper:hover img {
  transform: scale(1.04);
}

/* ALL POST CARD LAYOUT SPECIFIC STYLES */
.post-wrapper.card-layout {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e8e8ed;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-wrapper.card-layout:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.09);
}

.post-wrapper.card-layout .post-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.post-wrapper.card-layout .image-outer-wrapper {
  position: relative;
}

.post-wrapper.card-layout .image-wrapper {
  height: 210px;
  border-radius: 12px;
  overflow: hidden;
  background: #eeeeee;
  position: relative;
}

.post-wrapper.card-layout .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-wrapper.card-layout .content-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
}

.post-wrapper.card-layout .title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 8px 0;
}

.post-wrapper.card-layout .meta-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #333333;
  font-weight: 600;
  margin-bottom: 12px;
}

.post-wrapper.card-layout .excerpt {
  font-size: 13px;
  color: #222222;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.post-wrapper.card-layout .footer-wrap {
  border-top: 1px dashed #cccccc;
  padding-top: 12px;
  margin-top: auto;
}

.post-wrapper.card-layout .footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: #333333;
  font-weight: 700;
}

/* ============================================================
   5. HEADER & STICKY NAVIGATION STYLING
   ============================================================ */
#kirik-site-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  background: #ffffff !important;
  border-bottom: 2px solid var(--clr-primary) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06) !important;
}

.kirik-header-nav-wrapper ul,
ul.kirik-primary-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
}
.kirik-header-nav-wrapper a,
ul.kirik-primary-menu a {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--clr-text);
  letter-spacing: 0.05em;
  padding: 8px 0;
  display: block;
}
.kirik-header-nav-wrapper a:hover,
ul.kirik-primary-menu a:hover {
  color: var(--clr-primary) !important;
  text-decoration: none;
}

.popup-search-opener {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: var(--clr-bg-alt);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  transition: all 0.25s ease;
}
.popup-search-opener:hover {
  background: var(--clr-primary);
  color: #ffffff;
  border-color: var(--clr-primary);
}

.popup-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 17, 17, 0.95);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.popup-search-overlay.active {
  display: flex;
}
.popup-search-modal {
  width: 100%;
  max-width: 600px;
  text-align: center;
  color: #ffffff;
}
.popup-search-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  font-weight: 700;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   6. PAGINATION & CONTENT LAYOUT
   ============================================================ */
nav.kirik-pagination,
.kirik-pagination {
  margin-top: 36px !important;
  margin-bottom: 20px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

nav.kirik-pagination a,
nav.kirik-pagination span,
.kirik-pagination a,
.kirik-pagination span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px !important;
  height: 42px !important;
  padding: 0 14px !important;
  background-color: #ffffff !important;
  border: 1px solid var(--clr-border-dark) !important;
  border-radius: 4px !important;
  color: var(--clr-text) !important;
  font-family: var(--font-body) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out !important;
}

nav.kirik-pagination span.current,
.kirik-pagination span.current {
  background-color: var(--clr-primary) !important;
  color: #ffffff !important;
  border-color: var(--clr-primary) !important;
}

nav.kirik-pagination a:hover,
.kirik-pagination a:hover {
  background-color: var(--clr-primary) !important;
  color: #ffffff !important;
  border-color: var(--clr-primary) !important;
}

/* Single Post Content Width Layout (840px) */
.kirik-single-article,
.kirik-single-content,
.entry-content {
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   7. FOOTER SECTION STYLING (teks putih di atas --clr-primary #663300 = 10,30:1
      — jauh di atas ambang WCAG AA 4,5:1. Angka 12,4:1 yang tertulis di sini
      sebelumnya keliru; dihitung ulang dengan rumus luminansi relatif WCAG.)
   ============================================================ */
#kirik-footer,
footer#kirik-footer,
.kirik-footer-wrap {
  background-color: var(--clr-primary) !important;
  color: #ffffff !important;
  padding: 48px 0 24px 0 !important;
}

#kirik-footer p,
#kirik-footer span,
#kirik-footer div,
#kirik-footer li,
#kirik-footer strong,
#kirik-footer b,
#kirik-footer a,
#kirik-footer h1,
#kirik-footer h2,
#kirik-footer h3,
#kirik-footer h4,
#kirik-footer h5,
#kirik-footer h6,
.kirik-footer-bottom,
.kirik-footer-bottom p,
.kirik-footer-bottom strong {
  color: #ffffff !important;
}

#kirik-footer a {
  text-decoration: underline;
  transition: opacity 0.2s ease-in-out;
}

#kirik-footer a:hover {
  opacity: 0.85;
}

.kirik-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.3) !important;
  padding-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #ffffff !important;
}

/* ============================================================
   8. MOBILE RESPONSIVE STYLING (HIDE SECTIONS 2-7 ON MOBILE)
   ============================================================ */
@media (max-width: 768px) {
  /* HIDE SECTIONS 2 UNTIL 7 ON MOBILE DEVICES AS REQUESTED */
  #kirik-hero,
  #kirik-sec-cat1,
  #kirik-sec-cat2,
  #kirik-sec-cats-3-4-5,
  #kirik-sec-cat3,
  #kirik-sec-cat4,
  #kirik-sec-cat5 {
    display: none !important;
  }

  /* SECTION 1 (HEADER) MOBILE ADJUSTMENTS */
  #kirik-site-header .kirik-container > div {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
  }

  .kirik-header-nav-wrapper {
    width: 100% !important;
  }

  .kirik-header-nav-wrapper ul,
  ul.kirik-primary-menu {
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
    justify-content: center !important;
  }

  /* SECTION 8 (ALL POST) MOBILE ADJUSTMENTS */
  .kirik-grid-70-30 {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .post-wrapper.card-layout .post-inner {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .post-wrapper.card-layout .image-wrapper {
    height: 180px !important;
  }

  .post-wrapper.card-layout .title {
    font-size: 18px !important;
  }

  /* SECTION 9 (FOOTER) MOBILE ADJUSTMENTS */
  #kirik-footer .kirik-container > div {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    text-align: center !important;
  }
}

/* ============================================================
   10. ISI ARTIKEL (.entry-content)
   Sebelumnya .entry-content HANYA diatur lebarnya — tidak ada satu pun aturan
   untuk h2/h3/ul/ol/blockquote/tabel, jadi artikel panjang tampil datar tanpa
   hierarki. Blok ini yang memberi bentuk pada isi tulisan.
   ============================================================ */
.entry-content > *:first-child { margin-top: 0; }

.entry-content p {
  margin: 0 0 1.25em 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.3;
  color: var(--clr-text);
  margin: 1.8em 0 0.6em 0;
}
.entry-content h2 { font-size: 25px; border-bottom: 2px solid var(--clr-border); padding-bottom: 8px; }
.entry-content h3 { font-size: 21px; }
.entry-content h4 { font-size: 18px; }
.entry-content h5 { font-size: 16px; }
.entry-content h6 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Reset global *{margin:0;padding:0} mencabut indentasi bullet, jadi
   dikembalikan eksplisit di sini. */
.entry-content ul,
.entry-content ol {
  margin: 0 0 1.25em 0;
  padding-left: 1.6em;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content li > ul,
.entry-content li > ol { margin-top: 0.5em; margin-bottom: 0.5em; }

.entry-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--clr-primary);
  background: var(--clr-bg-alt);
  font-style: italic;
  color: var(--clr-text);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 14px;
}
.entry-content th,
.entry-content td {
  border: 1px solid var(--clr-border);
  padding: 10px 12px;
  text-align: left;
}
.entry-content th {
  background: var(--clr-primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
}
.entry-content tbody tr:nth-child(even) { background: var(--clr-bg-alt); }

/* Tabel lebar tidak boleh bikin seluruh halaman geser ke samping di HP. */
.entry-content .wp-block-table { overflow-x: auto; }

.entry-content img,
.entry-content figure { margin: 1.5em 0; border-radius: var(--radius-md); }
.entry-content figcaption {
  font-size: 13px;
  color: #666666;
  text-align: center;
  margin-top: 8px;
}

.entry-content pre {
  background: #1e1e1e;
  color: #f5f5f5;
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 13px;
}
.entry-content code {
  background: var(--clr-bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.92em;
}
.entry-content pre code { background: none; padding: 0; }

.entry-content hr {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: 2em 0;
}

/* --- LINK DI DALAM ARTIKEL ---------------------------------
   Aturan global `a { color: var(--clr-text); text-decoration: none }` bikin
   tautan di dalam tulisan tampil hitam polos — tidak terbaca sebagai link
   sama sekali. Ini penting karena tautan dalam artikel adalah isi utamanya. */
.entry-content a {
  color: var(--clr-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.entry-content a:hover,
.entry-content a:focus {
  color: var(--clr-primary-hover);
  text-decoration: underline;
}
/* Gambar & tombol jangan ikut digarisbawahi. */
.entry-content a:has(img),
.entry-content .wp-block-button__link {
  text-decoration: none;
}

/* ============================================================
   11. FORM (Contact Form 7 / WPForms / form bawaan)
   Tanpa blok ini form plugin tampil mentah: input sempit, tombol mungil.
   ============================================================ */
.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content input[type="url"],
.entry-content input[type="tel"],
.entry-content input[type="number"],
.entry-content input[type="date"],
.entry-content input[type="search"],
.entry-content input[type="password"],
.entry-content textarea,
.entry-content select,
.kirik-comments input[type="text"],
.kirik-comments input[type="email"],
.kirik-comments input[type="url"],
.kirik-comments textarea {
  width: 100%;
  max-width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--clr-border-dark);
  border-radius: var(--radius-md);
  background: #ffffff;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--clr-text);
  box-sizing: border-box;
  margin-bottom: 4px;
}
.entry-content textarea,
.kirik-comments textarea { min-height: 150px; line-height: 1.6; }

.entry-content input:focus,
.entry-content textarea:focus,
.entry-content select:focus,
.kirik-comments input:focus,
.kirik-comments textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-alpha);
}

.entry-content label,
.kirik-comments label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.entry-content input[type="submit"],
.entry-content button[type="submit"],
.entry-content .wpcf7-submit,
.kirik-comments input[type="submit"],
.kirik-comments .kirik-comment-submit {
  display: inline-block;
  width: auto;
  background: var(--clr-primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.entry-content input[type="submit"]:hover,
.entry-content button[type="submit"]:hover,
.entry-content .wpcf7-submit:hover,
.kirik-comments input[type="submit"]:hover,
.kirik-comments .kirik-comment-submit:hover {
  background: var(--clr-primary-hover);
}

.wpcf7-response-output {
  border: 1px solid var(--clr-border-dark) !important;
  border-radius: var(--radius-md);
  padding: 12px 16px !important;
  margin: 16px 0 0 0 !important;
  font-size: 14px;
}
.wpcf7-not-valid-tip {
  color: #b3261e;
  font-size: 13px;
  margin-top: 4px;
}

/* ============================================================
   12. WIDGET SIDEBAR
   DIBATASI ke .kirik-sidebar-wrapper saja — footer punya gaya gelap sendiri
   dan tidak boleh ikut kena aturan kartu putih di bawah ini.
   ============================================================ */
.kirik-sidebar-wrapper .widget {
  background: #ffffff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.kirik-sidebar-wrapper .widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kirik-sidebar-wrapper .widget li {
  padding: 9px 0;
  border-bottom: 1px solid var(--clr-border);
  font-size: 14px;
  line-height: 1.45;
}
.kirik-sidebar-wrapper .widget li:last-child { border-bottom: none; }
.kirik-sidebar-wrapper .widget li a { color: var(--clr-text); }
.kirik-sidebar-wrapper .widget li a:hover { color: var(--clr-primary); }

/* Blok ikon sosial tidak cocok diberi garis pemisah baris. */
.kirik-sidebar-wrapper .wp-block-social-links li {
  border-bottom: none;
  padding: 0;
}

.kirik-sidebar-wrapper .widget select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--clr-border-dark);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
}

/* ============================================================
   13. KOMENTAR
   ============================================================ */
.kirik-comments-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 2px solid var(--clr-primary);
  padding-bottom: 8px;
  margin: 0 0 20px 0;
}

.kirik-comment-list,
.kirik-comment-list .children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kirik-comment-list .children { margin-left: 28px; padding-top: 16px; }

.kirik-comment-list li.comment,
.kirik-comment-list li.pingback {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  background: #ffffff;
}
.kirik-comment-list .comment-author img {
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}
.kirik-comment-list .comment-author .fn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-style: normal;
}
.kirik-comment-list .comment-metadata {
  font-size: 12px;
  color: #777777;
  margin: 4px 0 10px 0;
}
.kirik-comment-list .comment-metadata a { color: #777777; }
.kirik-comment-list .reply a {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--clr-primary);
}
.kirik-comments-closed { font-size: 14px; color: #666666; }

.kirik-comments .comment-reply-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  margin: 24px 0 14px 0;
}
.kirik-comments .comment-form p { margin-bottom: 14px; }

/* ============================================================
   14. PENYESUAIAN MOBILE UNTUK BLOK DI ATAS
   ============================================================ */
@media (max-width: 768px) {
  .entry-content h2 { font-size: 22px; }
  .entry-content h3 { font-size: 19px; }
  .kirik-comment-list .children { margin-left: 12px; }
}
