/*
Theme Name: Riwayah 2
Theme URI: https://riwayah.org/riwayah
Author: Fathur Rahman
Author URI: https://riwayah.org/
Description: A modern WordPress theme for Riwayah.
Version: 1.4.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: riwayah
*/

:root {
  --bg: #e7e7e7;
  --bg-light: #ffffff;
  --text: #000000;
  --text-2: #00674f;
  --text-3: #000000;
  --header-bg: #ffffff;
  --footer-bg: #000000;
  --cat-text: #ffffff;
  --cat-bg: #00674f;
  --nav-text: #ffffff;
  --nav-logo: #000000;
  --nav-text-hover: #00674F;
  --nav-bg-hover: #0A3C30;
  --main-logo: #00674F;
  --post-card-bg: #f9f9f9;
  --text-inverse: #ffffff;
  --border-card: #ddd;
  --button-read: #00674F;

}

body.dark {
  --bg: #06170e;
  --bg-light: #0b2819c9;
  --text: #f1f1f1;
  --text-2: #aaaaaa;
  --text-3: #00674f;
  --muted-text: #aaaaaa;
  --cat-text: #ffffff;
  --cat-bg: #333333;
  --nav-text: #ffffff;
  --header-bg: #111111;
  --footer-bg: #000000;
  --main-logo: #ffffff;
  --post-card-bg: #1a1e26;
  --text-inverse: #0a3c30;
  --border-card: #2a2e36;
  --button-read: #0a3c30;
}

* {
  font-family: var(--english-fonts);
}

.logo {
  text-transform: uppercase;
}

.site-header {
  background: var(--header-bg);
}

.forecast-footer {
  background: var(--footer-bg);
}


a {
  text-decoration: none;
  color: inherit;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

html[dir="rtl"] {
  direction: rtl;
}

html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .main-nav ul {
  flex-direction: row-reverse;
}

html[dir="rtl"] .header-icons {
  flex-direction: row-reverse;
}

html[dir="rtl"] .search-modal input {
  text-align: right;
}

html {
  scroll-behavior: smooth;
}



.mobile-only {
  display: none;
}


@media (max-width: 950px) {


  .top-bar {
    z-index: 99;
    position: relative;
  }

  .desktop-only {
    display: none;
  }

  .container-nav {
    display: none;
  }

  .mobile-only {
    display: block !important;
    font-size: 26px;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    transition: transform 0.3s ease;
  }

  header.hidden {
    transform: translateY(-100%);
  }

  #mobile-menu-toggle {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
  }

  #mobile-menu-toggle:hover .burger span {
    background: var(--button-read);
  }

  .mobile-header-actions {
    display: flex !important;
    align-items: center;
    justify-content: right;
    gap: 3px;
    margin-inline-end: 5px;
  }

  .mobile-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: var(--text-2);
    position: relative;
  }

  .mobile-icon-btn img {
    display: none;
  }

  .mobile-icon-btn::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-2px, -1px);
  }

  .mobile-icon-btn::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform: translate(6px, 5px) rotate(45deg);
  }

  .main-nav .sub-menu {
    display: none;
  }

  .site-header {
    position: relative !important;
    width: 100%;
    z-index: auto;
  }

  #mobile-nav {
    padding: 0;
  }

  #mobile-close {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: none;
    color: #ffffff;
    font-size: 28px;
    padding: 15px 20px;
    margin: 0;
    width: 100%;
    border: none;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  #mobile-nav ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
  }

  #mobile-nav li {
    list-style: none;
  }

  #mobile-nav a {
    color: #ffffff;
    font-size: 16px;
    padding: 14px 20px;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 500;
    transition: all 0.2s ease;
  }

  #mobile-nav a:hover {
    color: #ffffff;
    background: rgba(10, 60, 48, 0.7);
    padding-left: 20px;
  }

  #mobile-nav .sub-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(10, 60, 48, 0.45);
  }

  #mobile-nav .menu-item-has-children>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #mobile-nav .menu-item-has-children>a::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  #mobile-nav .menu-item-has-children.open>a::after {
    transform: rotate(225deg);
  }

  #mobile-nav .menu-item-has-children.open>.sub-menu {
    display: block;
  }

  #mobile-nav .sub-menu li a {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 400;
  }

  .mobile-menu-extra {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }

  .mobile-menu-extra button {
    width: 100%;
    padding: 14px;
    background: var(--button-read);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-menu-extra button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .media-sosial {
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {

  /* Hide top-bar on small screens to avoid overflow */
  .top-bar {
    display: none;
  }

  .top-bar .top-bar-inner .top-left {
    font-size: 12px;
  }

  .top-bar .top-bar-inner .top-right {
    font-size: 12px;
  }



  /* FOOTER CONTAINER */
  .footer-top {

    grid-template-columns: 1fr !important;
    /* Force single column */
    gap: 40px !important;
    /* Reduce gap */
    padding: 40px 20px !important;
    /* Reduce padding */
  }

  .footer-bottom {
    flex-direction: column-reverse !important;
    /* Stack vertically */
    gap: 20px !important;
    /* Add space */
    text-align: center !important;
    /* Center text */
    font-size: 16;
    padding: 20px !important;
  }

  .footer-links {
    display: flex !important;
    flex-wrap: wrap !important;
    /* Allow wrapping */
    justify-content: center !important;
    /* Center links */
    gap: 20px !important;
    /* Consistent spacing */
  }

  .footer-links ul {
    gap: 15px !important;
    /* Space between links */
  }

  .footer-links a {
    margin-left: 0 !important;
    /* Remove margins */
  }

  .category-grid {
    grid-template-columns: 1fr !important;
    /* Single column for categories */
    gap: 12px !important;
  }

  .riwayah-form {
    flex-direction: column !important;
    /* Stack form elements */
  }

  .riwayah-form button {
    padding: 12px !important;
    /* Match input */
    width: 100% !important;
    /* Full-width button */
  }

  /* Hide Category Posts on mobile */
  .riwayah-tech-grid {
    display: none !important;
  }

}














/* TOP BAR */


.top-bar {
  background: linear-gradient(90deg, #0d6efd, #8f00ff);
  color: #fff;
  font-size: 14px;
  z-index: 996;
  max-height: 36px;
  overflow: hidden;
}

.top-left {
  padding: 0 10px 0 10px;
  display: flex;
  align-items: center;
  color: #ddd;
  max-height: 23px;
  flex: 1;
  min-width: 0;
}

.top-left a {
  color: #fff;
}

/* Breaking Ticker Styles */
.breaking-ticker {
  display: flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
  height: 36px;
  font-family: inherit;
  color: #fff;
  width: 100%;
  max-width: 800px;
  min-width: 0;
}
.ticker-controls {
  display: flex;
  align-items: center;
  padding: 0;
  margin-right: 15px;
  gap: 4px;
}
.ticker-controls button {
  background: #0d6efd;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: 0.2s;
  padding: 0;
}
.ticker-controls button:hover {
  background: #0b5ed7;
  border-color: #fff;
}
.ticker-date {
  font-size: 13px;
  color: #fff;
  padding-right: 15px;
  margin-right: 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  height: 14px;
}
.ticker-date:hover {
  color: #e0e0e0;
}
.ticker-label {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 0;
  padding-right: 8px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.ticker-list-wrap {
  overflow: hidden;
  height: 36px;
  position: relative;
  flex-grow: 1;
  min-width: 0;
}
#ticker-list {
  align-items: flex-start;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap !important;
  transition: transform 0.4s ease;
  width: 100%;
}
#ticker-list li {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  flex-shrink: 0;
}
#ticker-list li a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
  text-align: left;
}
#ticker-list li a:hover {
  text-decoration: underline;
}



.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-bar ul {
  color: #fff;
  text-decoration: none;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.top-right {

  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-right .date {
  font-size: 13px;
  opacity: 0.85;
  white-space: nowrap;
}

.top-right a {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.top-right a:hover {
  opacity: 1;
}

.lang-switcher {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-switcher a {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.lang-switcher a:hover {
  opacity: 1;
}




/* HEADER */
.main-header {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin: 0;
  padding: 0;
  width: 100% !important;
}

.main-navs .current-menu-item>a {
  color: var(--nav-text) !important;
  background-color: #0A3C30 !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 997;
  background: #fff;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.site-header.hidden {
  transform: translateY(-100%);
}

.site-header.scrolled {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* HEADER CONTENT */
.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 5px 0 5px 20px;
  height: 4rem;
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-inner .logo {
  padding-left: 15px;
}

.riwayah-breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 0.85;
}

.riwayah-breadcrumbs a {
  color: var(--button-read);
}

.riwayah-breadcrumbs .sep {
  opacity: 0.5;
}

/* LOGO */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--nav-logo);
}

@media (max-width: 768px) {
  .logo-icon {
    height: 2.5rem !important;
  }
}

.logo-icon {
  display: block;
  max-height: 2.8rem;   /* fits neatly inside the header bar */
  width: auto;          /* natural width — square or rect both work */
  height: auto;         /* natural height up to max-height */
  object-fit: contain;
}


/* Navigation */
.container-nav {
  width: 100%;
  margin: 0;
  padding: 0;
  height: 4rem;
  background-color: var(--header-bg);
  display: flexbox;
  align-items: center;
  text-transform: capitalize;
}


.header-action {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* NAV */
.main-navs ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  width: 100%;
  justify-content: center;
  gap: 0;
  /* No gap for seamless blocks */
  /* Added for better responsiveness */
  box-sizing: border-box;
  position: relative;

}

.special .icon {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.special .icon img {
  width: 1rem;
  height: auto;
  margin: 0;
  padding: 0;
}

.main-navs li.special {
  flex: 1;
  /* For half-size: grows at 0.5x rate of others. Change to 0.333 for 1/3 size. */
  min-width: 0;
}

.main-navs li {
  position: relative;
  flex: auto;
  /* Allows items to grow/shrink but start at 120px basis */
  min-width: 120px;
  /* Ensures minimum width */
  box-sizing: border-box;
  /* Prevents padding from affecting width */
}

.main-navs a {
  display: flex;
  /* instead of block */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  color: var(--nav-text);
  background-color: #00674F;
  padding: 10%;
  transition: color 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  font-weight: 500;
  font-size: 90%;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  text-align: center;
  /* keeps multiline text centered */
}

.main-navs ul li button {
  display: flex;
  /* instead of block */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  color: var(--nav-text);
  background-color: #00674F;
  padding: 10%;
  transition: color 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  font-weight: 500;
  font-size: 90%;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  text-align: center;
  /* keeps multiline text centered */
}


.main-navs a:hover {
  color: var(--nav-text-hover);
  background-color: var(--nav-bg-hover);
}

/* ============================================================
   MEGA MENU — full-width panel, theme green colours
   ============================================================ */

/* The ul is the positioning context — li overrides are relative to it */
.main-navs > ul {
  position: relative;
  overflow: visible;
}

/* li stays static so the sub-menu anchors to the ul (full nav width) */
.main-navs > ul > li.menu-item-has-children {
  position: static;
  padding-bottom: 0;
}

/* Bridge: cover the gap between nav item bottom and panel top. */
.main-navs .sub-menu::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: transparent;
}

/* Restore original parent chevron indicator */
.main-navs > ul > li.menu-item-has-children > a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #0b5d44;
}

.main-navs > ul > li.menu-item-has-children:hover > a {
  background-color: #084533;
}

.main-navs li.menu-item-has-children > a::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -2px;
  opacity: 0.9;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.main-navs > ul > li.menu-item-has-children:hover > a::after,
.main-navs > ul > li.menu-item-has-children:focus-within > a::after {
  transform: rotate(225deg);
}

/* ---- Sub-menu: full-width panel ---- */
.main-navs .sub-menu {
  position: absolute;
  top: 100%;   /* sits flush below the ul */
  left: 0;
  width: 100%;
  padding: 28px 40px;
  margin: 0;
  list-style: none;

  background: #0a3c30;
  border-top: 2px solid #00674f;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);

  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  justify-content: flex-start;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.99);
  transform-origin: top center;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  z-index: 1000;
  pointer-events: none;
}

/* Open state */
.main-navs > ul > li:hover > .sub-menu,
.main-navs > ul > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---- Column (group item = direct li of .sub-menu) ---- */
.main-navs > ul > li > .sub-menu > li {
  flex: 0 1 220px;
  min-width: 180px;
  position: relative;
  padding: 0 28px;
}

.main-navs > ul > li > .sub-menu > li:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
}

/* Column heading — the direct `a` of a group parent */
.main-navs > ul > li > .sub-menu > li > a,
.main-navs > ul > li > .sub-menu > li.menu-item-has-children > a {
  display: block;
  width: 100%;
  height: auto !important;
  padding: 0 0 10px 0;
  margin-bottom: 10px;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  text-align: left;
}

/* Hide chevron on column headings */
.main-navs > ul > li > .sub-menu > li.menu-item-has-children > a::after {
  display: none;
}

/* ---- Nested sub-menu = actual items list ---- */
.main-navs .sub-menu .sub-menu {
  position: static;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  opacity: inherit;
  visibility: inherit;
  pointer-events: inherit;
}

.main-navs .sub-menu .sub-menu li {
  padding: 0;
}

/* Item links */
.main-navs .sub-menu .sub-menu > li > a {
  display: block;
  width: 100%;
  height: auto !important;
  padding: 7px 10px;
  background: transparent !important;
  color: #ffffff !important;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 6px;
  text-align: left;
  transition: background 0.2s ease;
}

.main-navs .sub-menu .sub-menu > li > a:hover {
  background: rgba(0, 103, 79, 0.50) !important;
  color: #ffffff !important;
}

/* No 3rd-level sub-menus */
.main-navs .sub-menu .sub-menu .sub-menu {
  display: none;
}



.mobile-nav ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  margin: 0;
  padding: 0;
  width: 100%;
  justify-content: center;
  gap: 0;
  /* No gap for seamless blocks */
  /* Added for better responsiveness */
  box-sizing: border-box;
}

.mobile-nav>li {
  position: relative;
  flex: 1 1 120px;
  /* Allows items to grow/shrink but start at 120px basis */
  min-width: 120px;
  /* Ensures minimum width */
  box-sizing: border-box;
  /* Prevents padding from affecting width */
}


body.menu-open #mobile-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.menu-open #mobile-nav {
  right: 0;
}

#mobile-nav a {
  display: block;
  padding: 14px 20px;
  font-size: 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

#mobile-close {
  background: none;
  border: none;
  font-size: 26px;
  margin-bottom: 0;
}

#mobile-nav {
  position: fixed;
  top: 0;
  right: -100vw;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  background: #00674f;
  z-index: 1001;
  padding: 0;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: none;
}

#mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

#mobile-nav .menu-item-has-children {
  --depth: 0;
}

#mobile-nav li>a {
  padding-inline-start: calc(20px + (var(--depth) * 16px));
}

/* From Uiverse.io by Cevorob */
.burger {
  position: relative;
  width: 30px;
  height: 20px;
  margin-right: 1rem;
  background: transparent;
  cursor: pointer;
  display: block;
}

.burger input {
  display: none;
}

.burger span {
  display: block;
  position: absolute;
  height: 4px;
  width: 100%;
  background: var(--button-read);
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.burger span:nth-of-type(1) {
  top: 0px;
  transform-origin: left center;
}

.burger span:nth-of-type(2) {
  top: 50%;
  transform: translateY(-50%);
  transform-origin: left center;
}

.burger span:nth-of-type(3) {
  top: 100%;
  transform-origin: left center;
  transform: translateY(-100%);
}

/*
.burger input:checked ~ span:nth-of-type(1) {
  transform: rotate(0deg);
}

.burger input:checked ~ span:nth-of-type(2) {
  width: 100%;
  opacity: 1;
}

.burger input:checked ~ span:nth-of-type(3) {
  transform: rotate(0deg);
}*/

@media (max-width: 1200px) {
  .special .icon {
    width: 100%;

  }

  .main-navs li.special {
    flex: 4;
    /* For half-size: grows at 0.5x rate of others. Change to 0.333 for 1/3 size. */
    min-width: 0;
  }

  .header-inner {
    position: sticky;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
  }

  .header-inner.hidden {
    transform: translateY(-100%);
  }

  .header-inner.scrolled {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  }
}

@media (max-width: 768px) {
  #search-modal {
    padding-top: 40px;
  }

  #live-search-input {
    font-size: 18px;
    padding: 16px;
  }

  .search-grid {
    grid-template-columns: 1fr;
  }
}







/* Style search and dark mode buttons like menu items */
.main-navs-btn,
.main-navs .search-btn,
.main-navs .dark-mode-btn {
  display: block;
  color: var(--nav-text);
  background-color: #00674F;
  padding: 1.2rem;
  transition: color 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: none;
  cursor: pointer;
}

.main-navs-btn img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

.main-navs-btn:hover,
.main-navs .search-btn:hover,
.main-navs .dark-mode-btn:hover {
  color: var(--nav-text-hover);
  background-color: var(--nav-bg-hover);
}

/* SEARCH MODAL */


#search-modal {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#search-modal.active {
  opacity: 1;
  pointer-events: all;
}

#search-close {
  color: var(--text);
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
}

/* CONTENT */
.search-container {
  max-width: 1200px;
  margin: 100px auto 0;
  padding: 0 20px;
}

#live-search-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-card);
  outline: none;
}

/* GRID */
.search-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.search-card img {
  width: 100%;
  border-radius: 14px;
}

.search-card h4 {
  margin-top: 10px;
  font-size: 18px;
}

.search-card .cat {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  background: #eee;
  padding: 6px 10px;
  border-radius: 8px;
}





















/*Body*/

.rec-section * {
  box-sizing: border-box;
}

.rec-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
}

/* CARDS */
.rec-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.rec-card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* IMAGES */
.rec-image {
  position: absolute;
  inset: 0;
}

.rec-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* HERO */
.rec-hero {
  grid-row: span 2;
  min-height: 520px;
}

.rec-overlay {
  position: absolute;
  inset: 0;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .7));
  color: #fff;
}

/* SIDE */
.rec-side {
  display: flex;
  min-height: 248px;
}

.rec-side .rec-image {
  width: 38%;
  position: relative;
}

.rec-content {
  padding: 20px;
  background: #fff;
  flex: 1;
}

/* GRID */
.rec-grid {
  min-height: 240px;
}

/* TAG */
.rec-tag {
  display: inline-block;
  background: #4f7cff;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* META */
.rec-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  opacity: .85;
}

.rec-meta img {
  border-radius: 50%;
}

/* MOBILE */
@media (max-width: 767px) {
  .rec-layout {
    grid-template-columns: 1fr;
  }

  .rec-hero {
    min-height: 380px;
  }

  .rec-side {
    flex-direction: column;
  }

  .rec-side .rec-image {
    width: 100%;
    height: 220px;
  }
}


/* RECOMMENDATION LAYOUT */

.recommendation-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-auto-rows: auto;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .recommendation-layout {
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    padding: 16px;
  }
}

@media (max-width: 767px) {
  .recommendation-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px;
  }
}

/* CARDS */
.rec-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-card {
    border-radius: 14px;
  }
}

.rec-card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* IMAGES */
.rec-image {
  position: absolute;
  inset: 0;
}

.rec-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* HERO */
.rec-hero {
  grid-row: span 2;
  min-height: 520px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-hero {
    min-height: 420px;
  }
}

@media (max-width: 767px) {
  .rec-hero {
    grid-row: span 1;
    min-height: 380px;
  }
}

.rec-overlay {
  position: absolute;
  inset: 0;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .7));
  color: #fff;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-overlay {
    padding: 24px;
  }
}

@media (max-width: 767px) {
  .rec-overlay {
    padding: 20px;
  }
}

/* SIDE */
.rec-side {
  display: flex;
  min-height: 248px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-side {
    min-height: 200px;
  }
}

.rec-side .rec-image {
  width: 38%;
  position: relative;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-side .rec-image {
    width: 35%;
  }
}

@media (max-width: 767px) {
  .rec-side {
    flex-direction: column;
    min-height: auto;
  }

  .rec-side .rec-image {
    width: 100%;
    height: 220px;
  }
}

.rec-content {
  padding: 20px;
  background: #fff;
  flex: 1;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-content {
    padding: 16px;
  }
}

/* GRID */
.rec-grid {
  min-height: 240px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-grid {
    min-height: 200px;
  }
}

/* TAG */
.rec-tag {
  display: inline-block;
  background: #4f7cff;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-tag {
    padding: 5px 10px;
    font-size: 11px;
    margin-bottom: 8px;
  }
}

@media (max-width: 767px) {
  .rec-tag {
    font-size: 11px;
  }
}

/* META */
.rec-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  opacity: .85;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rec-meta {
    font-size: 12px;
    gap: 6px;
  }
}

.rec-meta img {
  border-radius: 50%;
}

/* MOBILE */
@media (max-width: 767px) {
  .rec-layout {
    grid-template-columns: 1fr;
  }
}


/* HERO POST FULL CARD */

.hero-post-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  min-height: 400px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-post-card {
    min-height: 320px;
    border-radius: 16px;
  }
}

@media (max-width: 767px) {
  .hero-post-card {
    min-height: 300px;
  }
}

.hero-post-link {
  display: block;
  height: 100%;
  color: #fff;
  text-decoration: none;
}

/* IMAGE */
.hero-post-media {
  position: absolute;
  inset: 0;
}

.hero-post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* DARK GRADIENT OVERLAY */
.hero-post-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.65));
}

/* CONTENT */
.hero-post-content {
  position: relative;
  z-index: 2;
  padding: 28px;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-end;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-post-content {
    padding: 22px;
  }
}

@media (max-width: 767px) {
  .hero-post-content {
    padding: 20px;
  }
}

/* CATEGORY PILL */
.hero-post-category {
  align-self: flex-start;
  background: #5b8cff;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-post-category {
    padding: 5px 10px;
    font-size: 11px;
    margin-bottom: 10px;
  }
}

/* TITLE */
.hero-post-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 12px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-post-title {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    margin: 0 0 10px;
  }
}

/* EXCERPT */
.hero-post-excerpt {
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 90%;
  margin-bottom: 18px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-post-excerpt {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }
}

@media (max-width: 767px) {
  .hero-post-excerpt {
    font-size: 0.9rem;
    margin-bottom: 14px;
  }
}

/* META BAR */
.hero-post-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  align-items: center;
  opacity: 0.85;
  flex-wrap: wrap;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-post-meta {
    gap: 12px;
    font-size: 0.8rem;
  }
}

.hero-post-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-post-author img {
  border-radius: 50%;
}


/* Category Posts Section */
.card-posts-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .card-posts-container {
    padding: 16px;
  }
}

@media (max-width: 767px) {
  .card-posts-container {
    padding: 12px;
  }
}

.category-section {
  margin-bottom: 50px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .category-section {
    margin-bottom: 40px;
  }
}

.category-header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--main-logo);
  padding-bottom: 10px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .category-header {
    margin-bottom: 24px;
    padding-bottom: 8px;
  }
}

.category-title {
  font-size: 2em;
  margin: 0;
  color: var(--text);
}

@media (min-width: 768px) and (max-width: 1023px) {
  .category-title {
    font-size: 1.7em;
  }
}

@media (max-width: 767px) {
  .category-title {
    font-size: 1.5em;
  }
}

.category-subtitle {
  font-size: 1.1em;
  color: var(--muted-text, #666);
  margin-top: 5px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .category-subtitle {
    font-size: 1em;
    margin-top: 4px;
  }
}

@media (max-width: 767px) {
  .category-subtitle {
    font-size: 0.95em;
  }
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.cat-post-card {
  border: 1px solid var(--border-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--post-card-bg);
  display: flex;
  flex-direction: column;
  height: 50%;
  min-height: 400px;
  position: relative;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .cat-post-card {
    border-radius: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
}

.cat-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cat-post-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.cat-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.cat-post-card:hover .cat-post-thumbnail img {
  transform: scale(1.05);
}

.cat-views-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 0.75em;
  display: flex;
  align-items: center;
  gap: 3px;
}

.cards {
  width: 100%;
  height: 100%;
}

.views-icon {
  width: 12px !important;
  aspect-ratio: 1/1;
  padding: 0;
}

.cat-post-body {
  padding: 12px 15px 12px 15px;
  height: 15%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .cat-post-body {
    padding: 12px 14px 12px 14px;
    height: 15%;
  }
}

.cat-post-title {
  font-size: 0.95em;
  margin: 0 0 4px 0;
  line-height: 1.25;
  font-weight: 600;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .cat-post-title {
    font-size: 0.9em;
    margin: 0 0 3px 0;
    line-height: 1.2;
  }
}

.cat-post-title a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s;
}

.cat-post-title a:hover {
  color: var(--nav-text-hover);
}

.cat-post-excerpt {
  margin-bottom: 0;
  color: var(--muted-text, #666);
  line-height: 1.3;
  font-size: 0.8em;
  flex-grow: 1;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .cat-post-excerpt {
    font-size: 0.75em;
    line-height: 1.25;
    margin-bottom: 0;
  }
}

.cat-post-meta {
  font-size: 0.8em;
  color: var(--muted-text, #666);
  position: absolute;
  bottom: 10px;
  left: 15px;
  right: 15px;
  padding: 0;
  background: transparent;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .cat-post-meta {
    font-size: 0.75em;
    bottom: 10px;
    left: 14px;
    right: 14px;
  }
}

.cat-read-more {
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--button-read);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 0.9em;
}

.cat-read-more:hover {
  background-color: var(--post-card-bg);
}

/* Responsive grid for posts */
@media (min-width: 600px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 900px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1200px) {
  .posts-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

/* Make sure cards don't overflow */
.cat-post-card,
.hero-post-card,
.rec-card {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Container should not overflow */
.blog-container,
.card-posts-container,
.category-section,
.recommendation-layout {
  width: 100%;
  max-width: 100%; /* Better than 100vw for scrollbar issues */
  box-sizing: border-box;
  overflow-x: hidden;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Main container for the page layout */
.blog-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-left: 33px;
  /* Stack on mobile */
  box-shadow: #000000 0px 0px 2px;
}

/* Main content area (posts) */
.blog-main {
  flex: 1;
  /* Takes up available space */
  margin-right: 0;
  /* No margin on mobile */
  padding: 3rem 0;
  /* Vertical padding */
}

/* Sidebar */
.blog-sidebar {
  flex: 0 0 300px;
  /* Fixed width for sidebar */
  margin-top: 20px;
  /* Space on mobile */
}



/* Post card styling (like demo's post previews) */
.post-card {
  border-radius: 1rem;
  padding: 15px;
  background: var(--post-card-bg);
  transition: box-shadow 0.3s ease;
  /* Smooth hover */
  display: flex;
  flex-direction: column;
  box-shadow: #06170e 2px 1px 3px;
}

.post-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  /* Subtle shadow on hover */

}

/* Post thumbnail */
.post-thumbnail {
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
}

/* Post title */
.post-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.2em;
}

.post-card h3 a {
  text-decoration: none;
  color: var(--text);
}

.post-card h3 a:hover {
  color: var(--nav-text-hover);
  /* WordPress blue for links */
}

/* Post meta (author, date, categories) */
.post-meta {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 10px;
}

/* Excerpt and read more */
.post-card p {
  margin: 0 0 10px 0;
}

.btn-read-more {
  display: inline-block;
  padding: 8px 12px;
  background: var(--main-logo);
  color: var(--text-inverse);
  text-decoration: none;
  border-radius: 1rem;
  transition: background 0.3s;
}

.btn-read-more:hover {
  background: var(--nav-bg-hover);
}

/* Featured post section (hero-like) */
.featured-post {
  background-size: cover;
  background-position: center;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  margin-bottom: 20px;
}

.featured-post h1 {
  margin: 0;
  font-size: 2em;
}

.featured-post h1 a {
  color: white;
  text-decoration: none;
}

.featured-post p {
  margin: 10px 0 0 0;
}

/* Pagination */
.pagination {
  text-align: center;
  margin-top: 20px;
}

/* Tablet: side-by-side but "zoomed out" (shrunken) */
@media (min-width: 768px) and (max-width: 1023px) {
  .blog-container {
    flex-direction: row;
  }

  .blog-main {
    margin-right: 15px;
    flex: 1;
    min-width: 0; /* Prevent content from pushing flex parent */
    overflow: hidden; /* Contain grid overflows */
  }

  .blog-sidebar {
    flex: 0 0 240px; /* Thinner sidebar on tablet for "zoom out" effect */
    margin-top: 0;
  }
}

/* PC: Standard full scale */
@media (min-width: 1024px) {
  .blog-container {
    flex-direction: row;
  }

  .blog-main {
    margin-right: 20px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .blog-sidebar {
    flex: 0 0 300px; /* Original PC width */
    margin-top: 0;
  }
}

/* Additional mobile tweaks if needed */
@media (max-width: 767px) {
  .blog-container {
    padding: 10px;
  }

  .post-card {
    padding: 10px;
  }
}











/* Basic styles for the search page - renamed to avoid conflicts */
.search-page-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  background: var(--bg);
}

@media (max-width: 768px) {
  .search-page-container {
    margin: 20px auto;
    padding: 15px;
  }
}

.search-page-header {
  margin-bottom: 40px;
  text-align: center;
  border-bottom: 2px solid var(--border-card);
  padding-bottom: 20px;
}

.search-page-title {
  font-size: 2.5em;
  margin: 0 0 10px;
  color: var(--text);
}

@media (max-width: 768px) {
  .search-page-title {
    font-size: 2em;
  }
}

.search-page-title span {
  color: var(--button-read);
  font-weight: 600;
}

.search-description {
  font-size: 1.1em;
  color: var(--muted-text, #666);
  margin: 10px 0 0;
}

.search-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

@media (max-width: 768px) {
  .search-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.search-post-card {
  background: var(--post-card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.search-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Search cards: consistent ratio + compact summary block */
.search-post-card .post-card-thumbnail {
  aspect-ratio: 16 / 9;
}

.search-post-card .post-card-content {
  min-height: auto;
  padding: 16px;
}

.search-post-card .post-card-meta {
  margin: 8px 0;
  gap: 10px;
  font-size: 0.82em;
}

.search-post-card .post-card-excerpt {
  margin: 8px 0 0;
  font-size: 0.92em;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-page-sidebar {
  display: none;
}














.single-container {
  max-width: 820px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.single-hero img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 20px;
}

.single-title {
  font-size: 34px;
  margin-bottom: 10px;
}

.single-meta {
  color: #666;
  font-size: 14px;
  margin-bottom: 25px;
}

.single-content p {
  margin-bottom: 18px;
  font-size: 18px;
}

/* ===== ARCHIVE GRID ===== */

.archive-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.archive-title {
  font-size: 32px;
  margin-bottom: 30px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ===== POST CARD ===== */

.post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.card-thumb img {
  width: 100%;
  display: block;
}

.card-body {
  padding: 18px;
}

.card-title {
  font-size: 20px;
  margin-bottom: 8px;
}

.card-meta {
  font-size: 13px;
  color: #777;
  margin-bottom: 10px;
}

.card-excerpt {
  font-size: 15px;
  color: #444;
}















::-webkit-scrollbar {
  width: 0.5rem;
  color: #06170e;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 1.3);
  background-color: #00674F;
}

::-webkit-scrollbar-thumb {
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 1.3);
  background-color: #084533;
  border-radius: 10px;
}

#toTop {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  /* Hidden by default */
  position: fixed;
  /* Fixed/sticky position */
  bottom: 20px;
  /* Place the button at the bottom of the page */
  right: 30px;
  /* Place the button 30px from the right */
  z-index: 99;
  /* Make sure it does not overlap */
  border: none;
  /* Remove borders */
  outline: none;
  /* Remove outline */
  background-color: #00674F;
  /* Set a background color */
  color: white;
  /* Text color */
  cursor: pointer;
  /* Add a mouse pointer on hover */
  padding: 16px 22px 16px 22px;
  /* Some padding */
  border-radius: 20px;
  /* Rounded corners */
  font-size: 18px;
  /* Increase font size */
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

#toTop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#toTop:hover {

  border-color: var(--border-card);
  transform: translateY(-5px);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 1);
}

.arrow {
  border: solid var(--bg);
  border-width: 0 3px 3px 0;
  display: inline-block;
  padding: 3px;
}



.up {
  transform: rotate(-135deg);
  -webkit-transform: rotate(-135deg);
}


#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#page-loader.hidden {
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
}


.loader-inner img {
  width: 120px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: 0.4;
    transform: scale(0.95);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0.4;
    transform: scale(0.95);
  }
}

/* Footer base */
.riwayah-footer {
  position: absolute;
  width: 100%;
  background: radial-gradient(circle at top, #111 0%, #00674F 60%);
  color: #ccc;
  font-family: system-ui, sans-serif;
  bottom: 1;
  border-top: 1rem solid #00674f;
  overflow-x: hidden;
}

/* Footer base */
.riwayah-footer {
  background: radial-gradient(circle at top, #111 20%, #06170e 60%);
  color: #ccc;
  font-family: system-ui, sans-serif;
  bottom: 1
}

/* Top section */
.footer-top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0px 20px 80px 20px;

}

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

.footer-logo .logo-text {
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  text-transform: capitalize;
}

/* About */
.footer-desc {
  margin-bottom: 20px;
  line-height: 1.6;
  color: #aaa;
}

/* Headings */
.footer-col h4 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 20px;
}

/* Categories */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 40px;
}

.category-grid a {
  color: #ccc;
  text-decoration: none;
}

.category-grid a:hover {
  color: #00674F;
}

/* Newsletter */
.riwayah-form {
  display: flex;
  margin: 20px 0;
}

.riwayah-form input {
  flex: 1;
  padding: 12px;
  background: #111;
  border: 1px solid #333;
  color: #fff;
}

.riwayah-form button {
  background: #00674F;
  border: none;
  color: #fff;
  padding: 0 20px;
  cursor: pointer;
}

.terms {
  font-size: 14px;
  color: #aaa;
}

/* Bottom bar */
@media (max-width: 814px) {
  .footer-bottom {
    font-size: 14px;
    gap: 20px;
  }
}

.footer-bottom {
  border-top: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.footer-links a {
  margin-left: 30px;
  color: #aaa;
  text-decoration: none;
}

.footer-links a:hover {
  color: #00674F;
}

/* ===========================
   SINGLE POST PAGE STYLES
   =========================== */

.post-article {
  background: var(--bg);
  color: var(--text);
  padding-bottom: 5rem;
}

.post-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* FEATURED IMAGE */
.post-hero {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 40px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.post-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* MAIN WRAPPER */
.post-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}

.post-wrapper-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.page-article .post-wrapper {
  grid-template-columns: 1fr;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .post-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* POST MAIN CONTENT */
.post-main {
  width: 100%;
}

.post-main h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text);
}

/* POST HEADER */
.post-header {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--border-card);
  padding: 20px;
  background: var(--post-card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* CATEGORIES */
.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.post-category-badge {
  display: inline-block;
  background: var(--button-read);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.post-category-badge:hover {
  background: var(--nav-text-hover);
  transform: translateY(-2px);
}

/* TITLE */
.post-single-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 15px 0;
  color: var(--text);
}

/* POST META INFO */
.post-meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.6;
  display: block;
  margin-bottom: 2px;
}

.meta-value {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.meta-value:hover {
  color: var(--button-read);
}

/* SOCIAL SHARE */
.post-share-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.post-share-buttons a {
  display: inline;
}

.share-label {
  font-weight: 600;
  font-size: 13px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  background: #f0f0f0;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

body.dark .share-btn {
  background: #333;
}

.share-btn:hover {
  background: var(--button-read);
  color: white;
  transform: translateY(-2px);
}

.share-facebook:hover {
  background: #1877f2;
}

.share-twitter:hover {
  background: #000;
}

.share-linkedin:hover {
  background: #0a66c2;
}

.share-whatsapp:hover {
  background: #25d366;
}

.share-telegram:hover {
  background: #0088cc;
  color: white;
}

.share-instagram:hover {
  background: #E1306C;
  color: white;
}

.share-threads:hover {
  background: #000000;
  color: white;
}

.share-tiktok:hover {
  background: #000000;
  color: white;
}

/* TABLE OF CONTENTS */
.post-toc {
  background: var(--post-card-bg);
  border-left: 4px solid var(--button-read);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.toc-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.toc-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: none;
  padding: 4px;
  color: var(--text);
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  .post-toc {
    padding: 15px;
    margin-bottom: 25px;
  }

  .toc-header {
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
  }

  .toc-header h3 {
    font-size: 15px;
    margin: 0;
    flex: 1;
  }

  .toc-toggle {
    display: inline-block !important;
  }

  .toc-list {
    max-height: 400px;
    overflow-y: auto;
  }
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list>li {
  margin: 8px 0;
}

.toc-list li a {
  color: var(--button-read);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.toc-list li a:hover {
  color: var(--nav-text-hover);
  text-decoration: underline;
}

/* TOC Hierarchy levels — h2 is the root, h3–h6 indent progressively */
.toc-level-2 {
  margin-left: 0;
  font-weight: 600;
  font-size: 14px;
}

.toc-level-3 {
  margin-left: 16px;
  font-size: 13.5px;
  opacity: 0.9;
}

.toc-level-4 {
  margin-left: 32px;
  font-size: 13px;
  opacity: 0.8;
}

.toc-level-5 {
  margin-left: 48px;
  font-size: 12.5px;
  opacity: 0.7;
}

.toc-level-6 {
  margin-left: 64px;
  font-size: 12px;
  opacity: 0.6;
}

/* Subtle bullet indicator for deeper levels */
.toc-level-3 a::before,
.toc-level-4 a::before,
.toc-level-5 a::before,
.toc-level-6 a::before {
  content: '–';
  margin-right: 6px;
  opacity: 0.5;
}

/* POST CONTENT */
.post-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  margin: 30px 10px;
}

.post-content p {
  margin-bottom: 20px;
}

.post-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 40px 0 20px;
  color: var(--text);
  padding-top: 20px;
}

.post-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 30px 0 15px;
  color: var(--text);
  padding-top: 15px;
}

.post-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text);
}

.post-content strong {
  font-weight: 700;
  color: var(--text);
}

.post-content em {
  font-style: italic;
  color: var(--text);
}

.post-content a {
  color: var(--button-read);
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-content a:hover {
  text-decoration: underline;
  color: var(--nav-text-hover);
}

.post-content blockquote {
  border-left: 4px solid var(--button-read);
  padding: 15px 20px;
  margin: 30px 0;
  background: var(--post-card-bg);
  font-style: normal;
  opacity: 0.9;
}

.post-content ul,
.post-content ol {
  margin: 20px 0 20px 30px;
  padding: 0;
}

.post-content li {
  margin-bottom: 10px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 30px 0;
  border-radius: 8px;
}

.post-content code {
  background: var(--post-card-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.post-content pre {
  background: #f4f4f4;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
}

body.dark .post-content pre {
  background: #2a2a2a;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* COMING SOON CONTENT */
.coming-soon-container {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--post-card-bg) 0%, var(--bg) 100%);
  border-radius: 12px;
  margin: 40px 0;
}

.coming-soon-content {
  text-align: center;
  max-width: 500px;
}

.coming-soon-title {
  font-size: 3.5em;
  margin: 0 0 20px;
  color: var(--text);
  font-weight: 700;
  animation: bounce 2s infinite;
}

.coming-soon-subtitle {
  font-size: 1.5em;
  color: var(--button-read);
  margin-bottom: 20px;
  font-weight: 600;
}

.coming-soon-text {
  font-size: 1.1em;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 40px;
}

.coming-soon-cta {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.coming-soon-btn {
  display: inline-block;
  padding: 14px 30px;
  background: var(--button-read);
  color: white !important;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.coming-soon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  opacity: 0.95;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

body.dark .coming-soon-container {
  background: linear-gradient(135deg, var(--post-card-bg) 0%, #0a0a0a 100%);
}

body.dark .coming-soon-title {
  color: var(--text);
}

body.dark .coming-soon-text {
  color: var(--text);
}

/* PAGE PAGINATION */
.post-pagination {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 40px 0;
  flex-wrap: wrap;
}

.post-pagination span {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--post-card-bg);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-pagination a {
  background: var(--button-read);
  color: white;
}

.post-pagination a:hover {
  background: var(--nav-text-hover);
}

.post-pagination .page-numbers.current {
  background: var(--button-read);
  color: white;
}

/* POST TAGS */
.post-tags {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border-card);
}

.post-tags strong {
  display: block;
  margin-bottom: 15px;
  font-size: 14px;
  text-transform: uppercase;
  opacity: 0.7;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-badge {
  display: inline-block;
  background: var(--post-card-bg);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tag-badge:hover {
  background: var(--button-read);
  color: white;
  transform: translateY(-2px);
}

/* POST NAVIGATION */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid var(--border-card);
}

@media (max-width: 768px) {
  .post-navigation {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

.nav-link {
  display: block;
  padding: 20px;
  background: var(--post-card-bg);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-link:hover {
  background: var(--button-read);
  color: white;
  border-color: var(--button-read);
  transform: translateX(5px);
}

.nav-next-link:hover {
  transform: translateX(-5px);
}

.nav-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 8px;
}

.nav-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

/* SIDEBAR */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sidebar-widget {
  background: var(--post-card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text);
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-card);
}

/* AUTHOR WIDGET */
.author-widget .author-info {
  text-align: center;
}

.author-bio-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 15px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.author-details h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 10px 0;
  color: var(--text);
}

.author-details p {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
  margin-bottom: 15px;
}

.author-link {
  display: inline-block;
  background: var(--button-read);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.author-link:hover {
  background: var(--nav-text-hover);
  transform: translateY(-2px);
}

/* RELATED POSTS WIDGET */
.related-posts-list,
.popular-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-post-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-card);
}

.related-post-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.related-post-link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.related-post-link:hover {
  color: var(--button-read);
}

.related-post-link .arrow {
  opacity: 0;
  transition: all 0.2s ease;
}

.related-post-link:hover .arrow {
  opacity: 1;
}

.post-date {
  display: block;
  font-size: 12px;
  opacity: 0.6;
  margin-top: 5px;
}

/* POPULAR POSTS WIDGET */
.popular-post-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-card);
}

.popular-post-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.post-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  background: var(--button-read);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 14px;
}

.post-info {
  flex: 1;
}

.post-link {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  transition: all 0.2s ease;
}

.post-link:hover {
  color: var(--button-read);
}

.post-views {
  display: block;
  font-size: 12px;
  opacity: 0.6;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
  .post-container {
    padding: 30px 15px;
  }

  .post-hero {
    margin-bottom: 30px;
  }

  .post-single-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
  }

  .post-meta-info {
    gap: 15px;
    font-size: 13px;
  }

  .post-share-buttons {
    gap: 8px;
  }

  .share-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .post-content {
    font-size: 15px;
  }

  .post-content h2 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
  }

  .post-content h3 {
    font-size: 1.2rem;
    margin: 25px 0 12px;
  }
}

/* DARK MODE ADJUSTMENTS */
body.dark .header-inner {
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

body.dark .post-header {
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

body.dark .post-toc {
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

body.dark .sidebar-widget {
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

body.dark .tag-badge {
  background: #333;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.03);
}

body.dark .nav-link {
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

body.dark #mobile-nav {
  background: #00674f;
  box-shadow: none;
}

body.dark #mobile-nav a {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

body.dark #mobile-nav a:hover {
  background: rgba(10, 60, 48, 0.7);
  color: #ffffff;
}

body.dark #mobile-nav ul {
  list-style: none;
}

body.dark #mobile-nav .sub-menu {
  background: rgba(10, 60, 48, 0.45);
}

body.dark #mobile-nav .sub-menu li a {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body.dark #mobile-nav .menu-item-has-children>a::after {
  color: #ffffff;
}

body.dark #mobile-close {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

body.dark .mobile-menu-extra {
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark .mobile-menu-extra button {
  background: var(--button-read);
}

body.dark .mobile-menu-extra button:hover {
  opacity: 0.9;
}

body.dark .mobile-menu-extra button {
  background: var(--button-read);
}

body.dark .mobile-menu-extra button:hover {
  opacity: 0.9;
}

body.dark #mobile-close {
  color: var(--text);
}

body.dark .burger span {
  background: var(--text);
}

body.dark .post-category-badge {
  background: var(--button-read);
}

/* TABLE OF CONTENTS - NO DUPLICATE SECTION NEEDED */
/* AUTHOR PAGE STYLES */
.author-page-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .author-page-container {
    margin: 20px auto;
    padding: 15px;
  }
}

.author-header {
  display: flex;
  align-items: center;
  gap: 0px;
  padding: 30px;
  margin-bottom: 40px;
  background: var(--post-card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 950px) {
  .author-header {
    position: relative !important;
    top: auto !important;
    z-index: 1; /* Ensure it stays below the site header if necessary */
  }
}

@media (max-width: 768px) {
  .author-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 20px;
  }
}

.author-header-content {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  width: 100%;
}

@media (max-width: 768px) {
  .author-header-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
}

.author-avatar {
  flex-shrink: 0;
}

.author-avatar .author-avatar-img {
  display: block;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 4px solid var(--button-read);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .author-avatar .author-avatar-img {
    width: 100px;
    height: 100px;
  }
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 2.5em;
  margin: 0 0 10px;
  color: var(--text);
}

@media (max-width: 768px) {
  .author-name {
    font-size: 2em;
  }
}

.author-description {
  font-size: 1.1em;
  color: var(--muted-text, #555);
  line-height: 1.6;
  margin-bottom: 15px;
}

.author-meta {
  display: flex;
  gap: 20px;
  font-size: 0.9em;
  color: var(--muted-text, #666);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .author-meta {
    justify-content: center;
    gap: 15px;
  }
}

.author-website {
  color: var(--main-logo);
  text-decoration: none;
  transition: color 0.2s ease;
}

.author-website:hover {
  color: var(--nav-text-hover);
}

.author-posts-title {
  font-size: 2em;
  margin-bottom: 30px;
  color: var(--text);
  text-align: center;
  border-bottom: 2px solid var(--main-logo);
  padding-bottom: 10px;
}

@media (max-width: 768px) {
  .author-posts-title {
    font-size: 1.8em;
    margin-bottom: 20px;
  }
}

.author-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

@media (max-width: 768px) {
  .author-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.author-post-card {
  background: var(--post-card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.author-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.post-card-thumbnail {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-content {
  padding: 18px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.post-card-categories .post-category-badge {
  background: var(--cat-bg);
  color: var(--cat-text);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  text-decoration: none;
}

.post-card-title {
  font-size: 1.4em;
  margin-bottom: 10px;
  line-height: 1.3;
  color: var(--text);
}

.post-card-title a {
  text-decoration: none;
  color: inherit;
}

.post-card-title a:hover {
  color: var(--nav-text-hover);
}

.post-card-meta {
  font-size: 0.85em;
  color: var(--muted-text, #666);
  margin-bottom: 15px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.post-card-excerpt {
  font-size: 0.95em;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 15px;
  flex-grow: 1;
}



/* Pagination */
.wp-pagenavi {
  margin-top: 40px;
  text-align: center;
}

.wp-pagenavi a,
.wp-pagenavi span {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 4px;
  border: 1px solid var(--border-card);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  background: var(--post-card-bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-pagenavi a:hover {
  background-color: var(--nav-bg-hover);
  color: var(--nav-text);
}

.wp-pagenavi .current {
  background-color: var(--main-logo);
  color: var(--nav-text);
  border-color: var(--main-logo);
}

/* Dark mode adjustments for author page */
body.dark .author-page-container {
  background: var(--header-bg);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

body.dark .author-avatar img {
  border-color: var(--button-read);
}

body.dark .author-posts-title {
  border-color: var(--button-read);
}

body.dark .author-post-card {
  background: var(--post-card-bg);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.05);
}

body.dark .wp-pagenavi a {
  background: #1a1a1a;
  border-color: #333;
  color: #f1f1f1;
}

body.dark .wp-pagenavi a:hover {
  background-color: var(--button-read);
  color: #fff;
}

body.dark .wp-pagenavi .current {
  background-color: var(--button-read);
  border-color: var(--button-read);
  color: #fff;
}

/* FEATURED POST SECTION (INDEX PAGE) */
.featured-post-section {
  margin-bottom: 50px;
}

.featured-post-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--post-card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.featured-post-image {
  overflow: hidden;
  border-radius: 12px;
}

.featured-post-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .3s ease;
}

.featured-post-wrapper:hover .featured-post-img {
  transform: scale(1.05);
}

.featured-post-content {
  padding: 30px;
}

.featured-post-title {
  font-size: 2em;
  margin: 15px 0;
  color: var(--text);
}

.featured-post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color .2s ease;
}

.featured-post-title a:hover {
  color: var(--button-read);
}

.featured-post-excerpt {
  font-size: 1em;
  line-height: 1.8;
  color: var(--muted-text, #555);
  margin: 15px 0;
}

@media (max-width: 950px) {
  .featured-post-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .featured-post-content {
    padding: 20px;
  }

  .featured-post-title {
    font-size: 1.5em;
  }
}

/* Dark mode for featured post */
body.dark .featured-post-wrapper {
  background: var(--post-card-bg);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.05);
}

/* CATEGORY PAGE STYLES */
.category-page-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 40px;
  border-radius: 20px;
  background: var(--bg);
}

@media (max-width: 768px) {
  .category-page-container {
    margin: 20px auto;
    padding: 15px;
  }
}

.category-page-header {
  margin-bottom: 40px;
  text-align: center;
  border-bottom: 2px solid var(--border-card);
  padding-bottom: 20px;
}

.category-page-title {
  font-size: 2.5em;
  margin: 0 0 10px;
  color: var(--text);
}

@media (max-width: 768px) {
  .category-page-title {
    font-size: 2em;
  }
}

.category-page-description {
  font-size: 1.1em;
  color: var(--muted-text, #555);
  margin: 10px 0 0;
  line-height: 1.6;
}

.category-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

@media (max-width: 768px) {
  .category-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.category-post-card {
  position: relative;
  background: var(--post-card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Make entire card clickable via stretched title link */
.category-post-card .post-card-title a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* Ensure other interactive elements stay clickable */
.category-post-card .post-card-categories a,
.category-post-card .post-card-thumbnail,
.category-post-card .read-more-link {
  position: relative;
  z-index: 2;
}

.category-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Dark mode for category page */
body.dark .category-page-container {
  background: var(--header-bg);
}

body.dark .category-page-header {
  border-color: var(--button-read);
}

body.dark .category-post-card {
  background: var(--post-card-bg);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.05);
}

/* POST CARD COMPONENTS */
.post-card-thumbnail {
  overflow: hidden;
  background: #f0f0f0;
  aspect-ratio: 16/9;
  border-radius: 12px 12px 0 0;
}

.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.category-post-card:hover .post-card-img {
  transform: scale(1.05);
}

.post-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-categories {
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.post-category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--button-read);
  color: #fff;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .2s ease;
}

.post-category-badge:hover {
  opacity: 0.9;
}

.post-card-title {
  font-size: 1.2em;
  font-weight: 700;
  margin: 10px 0;
  line-height: 1.4;
  color: var(--text);
}

.post-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color .2s ease;
}

.post-card-title a:hover {
  color: var(--button-read);
}

.post-card-meta {
  font-size: 0.9em;
  color: var(--muted-text, #666);
  margin: 12px 0;
  display: flex;
  gap: 15px;
  align-items: center;
}

.meta-author,
.meta-date,
.meta-reading-time {
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-card-excerpt {
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--muted-text, #555);
  margin: 12px 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-link {
  display: inline-block;
  color: var(--main-logo);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  margin-top: auto;
  transition: color .2s ease;
}

.read-more-link:hover {
  color: var(--text);
}

/* Dark mode for post cards */
body.dark .post-card-title a {
  color: #f1f1f1;
}

body.dark .post-card-excerpt {
  color: #bbb;
}

/* ==========================================================================
   GUTENBERG BLOCK PATTERNS & PHP GRIDS - FRONT PAGE REDESIGN
   ========================================================================== */

/* --- General Section Heading --- */
.riwayah-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 30px;
    padding-bottom: 12px;
    
}
.riwayah-section-heading h2 { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--text) !important; }
.riwayah-section-heading .view-all { 
    color: var(--main-logo); text-decoration: none; font-size: 0.9rem; font-weight: 600; 
}
.riwayah-section-heading.dark-mode { border-bottom-color: #374151; }
.riwayah-section-heading.dark-mode h2 { color: #f9fafb; }

.riwayah-section-heading-consistent {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 10px;
}
.riwayah-section-heading-consistent h2 { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--cat-text) !important; }
.riwayah-section-heading-consistent .view-all { 
    color: var(--main-logo); text-decoration: none; font-size: 0.9rem; font-weight: 600; 
}
.riwayah-section-heading-consistent.dark-mode { border-bottom-color: #374151; }
.riwayah-section-heading-consistent.dark-mode h2 { color: #f9fafb; }
/* --- Global Reset for Lists in Sections --- */
.riwayah-hero-grid ul,
.riwayah-tech-grid ul,
.riwayah-discover-grid ul,
.riwayah-most-read-grid ul {
    list-style: none; padding: 0; margin: 0;
}

/* --- THE "1 TYPE OF CARD" STANDARDIZED DESIGN (Sleek & Animated) --- */
/* Section Headings */
.riwayah-section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; border-bottom: 2px solid #e5e7eb; padding-bottom: 10px; }
.riwayah-section-heading h2 { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--text) !important; }
.riwayah-section-heading .view-all { color: var(--main-logo); font-weight: 700; font-size: 0.9rem; text-decoration: none; display: flex; align-items: center; gap: 5px; }
.riwayah-section-heading .view-all:hover { color: var(--text-3); }
.riwayah-section-heading.dark-mode { border-color: #374151; }
.riwayah-section-heading.dark-mode h2 { color: #f9fafb; }

.riwayah-hero-grid .wp-block-post,
.riwayah-tech-grid .wp-block-post,
.riwayah-discover-grid .wp-block-post,
.riwayah-most-read-grid .wp-block-post {
    display: flex; flex-direction: column; height: 100%;
    background: transparent; border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.riwayah-hero-grid .wp-block-post:hover,
.riwayah-tech-grid .wp-block-post:hover,
.riwayah-discover-grid .wp-block-post:hover,
.riwayah-most-read-grid .wp-block-post:hover {
    transform: translateY(-4px);
}

/* Image Reset & Hover Zoom */
.wp-block-post-featured-image { margin: 0 0 15px 0; border-radius: 12px; overflow: hidden; }
.wp-block-post-featured-image img {
    border-radius: 12px; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
    transition: transform 0.5s ease;
}
.wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.05); }

/* Content Padding */
.riwayah-card-content { display: flex; flex-direction: column; flex-grow: 1; justify-content: flex-start; }

/* Badge with Sleek Tail */
.riwayah-badge.wp-block-post-terms { margin: 0 0 10px 0; }
.riwayah-badge.wp-block-post-terms a {
    display: inline-block; padding: 4px 10px;
    background: #FF478F; color: #fff; font-size: 0.75rem; font-weight: 700; text-decoration: none;
    border-radius: 4px; position: relative; text-transform: capitalize;
}
.riwayah-badge.wp-block-post-terms a::after {
    content: ''; position: absolute; left: 10px; bottom: -5px;
    border-width: 5px 5px 0; border-style: solid; border-color: #FF478F transparent transparent;
}
ul > li:nth-child(even) .riwayah-badge.wp-block-post-terms a { background: #0EA5E9; }
ul > li:nth-child(even) .riwayah-badge.wp-block-post-terms a::after { border-color: #0EA5E9 transparent transparent; }
ul > li:nth-child(3n) .riwayah-badge.wp-block-post-terms a { background: #10B981; }
ul > li:nth-child(3n) .riwayah-badge.wp-block-post-terms a::after { border-color: #10B981 transparent transparent; }

/* Titles */
.riwayah-card-content .wp-block-post-title { margin: 0 0 8px 0; font-size: 1.05rem; line-height: 1.4; font-weight: 800; }
.riwayah-card-content .wp-block-post-title a { color: #111827; text-decoration: none; transition: 0.2s; }
.riwayah-card-content .wp-block-post-title a:hover { color: var(--button-read); }

/* Excerpt */
.riwayah-card-content .wp-block-post-excerpt { font-size: 0.85rem; color: #4B5563; margin-bottom: 15px; flex-grow: 1; }

/* Meta data flexbox */
.riwayah-meta { 
    font-size: 0.75rem; color: #6B7280; display: flex; justify-content: flex-start; gap: 15px; align-items: center; margin-top: auto; font-weight: 500;
}
.riwayah-meta .wp-block-post-author-name { display: flex; align-items: center; gap: 6px; color: #374151; font-weight: 600;}
.riwayah-meta .wp-block-post-author-name img { border-radius: 50%; width: 22px; height: 22px; }


/* ==========================================================================
   LAYOUT 1: HERO GRID (1 SMALL SQUARE LEFT, 2 WIDE LIST-TYPE RIGHT)
   ========================================================================== */
.riwayah-hero-grid { 
  margin-bottom: 50px; 
}

/* 2-column grid: 1 narrow left column for square card, 3x wider right column for list cards */
.riwayah-hero-grid ul { 
    display: grid; 
    grid-template-columns: 1fr 3fr;
    grid-template-rows: minmax(160px, auto) minmax(160px, auto);
    gap: 20px; 
}

/* Left Square Card */
.riwayah-hero-grid .wp-block-query > ul > li:first-child {
    grid-column: 1; grid-row: 1 / span 2;
    position: relative; overflow: hidden; border-radius: 12px;
    /* Square enforced by making height = width via aspect-ratio.
       Since the column is 1fr of a 4fr total, this won't overflow rows. */
    aspect-ratio: 1 / 1;
    align-self: start; /* don't stretch — keep square shape */
}
.riwayah-hero-grid .wp-block-query > ul > li:first-child .wp-block-post-featured-image {
    position: absolute; inset: 0; margin: 0; z-index: 1; border-radius: 12px;
}
.riwayah-hero-grid .wp-block-query > ul > li:first-child .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.riwayah-hero-grid .wp-block-query > ul > li:first-child .riwayah-card-content {
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); position: relative; z-index: 2; margin-top: auto; padding: 18px; min-height: 100%; justify-content: flex-end;
}
.riwayah-hero-grid .wp-block-query > ul > li:first-child .wp-block-post-title a { color: #fff; font-size: 1.2rem; }
.riwayah-hero-grid .wp-block-query > ul > li:first-child .riwayah-meta { color: #d1d5db; font-size: 0.7rem; }
.riwayah-hero-grid .wp-block-query > ul > li:first-child .riwayah-meta .wp-block-post-author-name { color: #f9fafb; }
.riwayah-hero-grid .wp-block-query > ul > li:first-child .wp-block-post-excerpt { display: none; }

/* Right Wide List Cards — explicitly placed in column 2, rows 1 and 2 */
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(2) { grid-column: 2; grid-row: 1; }
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(3) { grid-column: 2; grid-row: 2; }

.riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) {
    display: flex; flex-direction: row; align-items: center; gap: 20px; 
    background: #fff; padding: 16px; border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s, transform 0.3s;
}
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2):hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); transform: translateY(-3px);
}
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) .wp-block-post-featured-image {
    width: 120px; height: 120px; flex-shrink: 0; margin: 0; border-radius: 10px;
}
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) .wp-block-post-featured-image img {
    height: 100%; width: 100%; object-fit: cover; border-radius: 10px;
}
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) .riwayah-card-content { justify-content: center; padding: 0; flex: 1; }
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) .wp-block-post-title a { font-size: 1.15rem; color: #111; }
.riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) .wp-block-post-excerpt { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.85rem; color: #6b7280; margin-top: 6px; }


/* ==========================================================================
   LAYOUT 2: DISCOVER CATEGORIES (4 COLUMN)
   ========================================================================== */
.riwayah-discover-grid { margin-bottom: 50px; background: var(--bg-light); padding: 30px; border-radius: 12px; }
.riwayah-discover-grid ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.riwayah-discover-grid .wp-block-post { position: relative; border-radius: 12px; overflow: hidden; background: #fff; aspect-ratio: 1 / 1;}
.riwayah-discover-grid .wp-block-post:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.1); transform: translateY(-4px); }
.riwayah-discover-grid .wp-block-post-featured-image { margin: 0; border-radius: 12px; position: absolute; inset: 0; width: 100%; height: 100%;}
.riwayah-discover-grid .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.riwayah-discover-grid .riwayah-card-content {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); width: 85%; padding: 0; text-align: center;
}
.riwayah-discover-grid .riwayah-badge-bubble a {
    display: block; background: #fff; padding: 12px; border-radius: 8px; color: #111; font-size: 1rem; font-weight: 800; text-decoration: none; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: background 0.3s, color 0.3s;
}
.riwayah-discover-grid .wp-block-post:hover .riwayah-badge-bubble a { background: var(--button-read); color: #fff;}
.riwayah-discover-grid .wp-block-post:hover .riwayah-badge-bubble a .count { color: #fecaca; }
.riwayah-discover-grid .riwayah-badge-bubble a .count { display: block; font-size: 0.8rem; color: #777; font-weight: 500; margin-top: 4px; }


/* ==========================================================================
   LAYOUT 3: MOST READ GRID (DARK MODE 5-POST MATRIX)
   ========================================================================== */
/* Most Read Grid Base (Mobile stack by default) */
.riwayah-most-read-grid { background: #0f1218 !important; padding: 40px; margin: 50px 0; border-radius: 12px; }
.riwayah-most-read-grid ul { display: grid; grid-template-columns: 1fr; gap: 20px; margin: 0; padding: 0; list-style: none; }

/* Desktop Matrix Placement (1024px+) */
@media (min-width: 1024px) {
    .riwayah-most-read-grid ul {
        grid-template-columns: 1fr 1.8fr 1fr;
        grid-template-rows: repeat(2, 200px);
        gap: 16px;
    }

    /* Left column: items 2 and 3 */
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(2) { grid-column: 1; grid-row: 1; }
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(3) { grid-column: 1; grid-row: 2; }

    /* Centre: item 1 — spans both rows (Highest Views) */
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(1) {
        grid-column: 2; grid-row: 1 / span 2;
    }

    /* Right column: items 4 and 5 */
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(4) { grid-column: 3; grid-row: 1; }
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(5) { grid-column: 3; grid-row: 2; }
}

/* Tablet Stacking (768px-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .riwayah-most-read-grid ul { grid-template-columns: 1fr 1fr; }
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(1) { grid-column: 1 / -1; }
}

/* Card Styling for Most Read */
.riwayah-most-read-grid .wp-block-post { 
    position: relative; 
    border-radius: 12px; 
    min-height: 180px; 
    height: 100%;
    overflow: hidden; 
    background: transparent;
    display: flex;
    flex-direction: column;
}

.riwayah-most-read-grid .wp-block-post-featured-image { position: absolute; inset: 0; margin: 0; z-index: 1; border-radius: 12px; }
.riwayah-most-read-grid .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; margin: 0; }

.riwayah-most-read-grid .riwayah-card-content { 
    background: linear-gradient(to top, rgba(26,30,38,0.95) 10%, rgba(26,30,38,0.5) 50%, transparent); 
    position: relative; 
    z-index: 2; 
    margin-top: auto; 
    padding: 20px 15px 15px; 
    min-height: 100%; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
}

.riwayah-most-read-grid .wp-block-post-title { font-size: 0.95rem; margin: 0 0 8px 0; }
.riwayah-most-read-grid .wp-block-post-title a { color: #f9fafb; text-decoration: none; }
.riwayah-most-read-grid .wp-block-post-excerpt { display: none; }
.riwayah-most-read-grid .riwayah-meta { color: #9ca3af; font-size: 0.75rem; display: flex; align-items: center; gap: 10px; }
.riwayah-most-read-grid .riwayah-meta .wp-block-post-author-name { display: none; }

/* Larger title for the center mega card (item 1 - Highest Views) */
@media (min-width: 1024px) {
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(1) .wp-block-post-title {
        font-size: 1.25rem;
    }
}

/* ---- Stretched Link: entire card is clickable ---- */
/* Most Read Grid */
.riwayah-most-read-grid .wp-block-post { isolation: isolate; }
.riwayah-most-read-grid .wp-block-post-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
}
.riwayah-most-read-grid .wp-block-post { cursor: pointer; }

/* Tech Grid (category loops) */
.riwayah-tech-grid .wp-block-post { isolation: isolate; }
.riwayah-tech-grid .wp-block-post-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
}
.riwayah-tech-grid .wp-block-post { cursor: pointer; }





/* ==========================================================================
   LAYOUT 4: TECH GRID (GUTENBERG PATTERN)
   ========================================================================== */
.riwayah-tech-grid { margin-bottom: 50px; background: transparent; padding: 40px 0; }
body.dark .riwayah-tech-grid { background: #0f1218 !important; padding: 40px; border-radius: 12px; }
.riwayah-tech-grid .wp-block-query > ul {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 20px;
}

/* Small Cards (Overlaid) */
.riwayah-tech-grid .wp-block-post { position: relative; min-height: 220px; border-radius: 12px; overflow: hidden; background: transparent; }
.riwayah-tech-grid .wp-block-post-featured-image { position: absolute; inset: 0; margin: 0; z-index: 1; border-radius: 12px; }
.riwayah-tech-grid .wp-block-post-featured-image img { height: 100%; border-radius: 12px; aspect-ratio: auto; margin-bottom: 0;}
.riwayah-tech-grid .riwayah-card-content { 
    background: linear-gradient(to top, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.4) 50%, transparent); 
    position: relative; z-index: 2; margin-top: auto; padding: 20px 15px 15px; min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; 
}
.riwayah-tech-grid .wp-block-post-title { font-size: 0.95rem; }
.riwayah-tech-grid .wp-block-post-title a { color: #fff; }
.riwayah-tech-grid .wp-block-post-excerpt { display: none; }
.riwayah-tech-grid .riwayah-meta { display: flex; align-items: center; gap: 12px; color: #e2e8f0; font-size: 0.75rem; font-weight: 500;}
.riwayah-tech-grid .riwayah-meta .wp-block-post-author-name { display: none; }

/* Mega Left Post (Stacked Layout) */
.riwayah-tech-grid .wp-block-query > ul > li:first-child {
    grid-column: 1 / 2; grid-row: 1 / span 2; position: relative; background: #fff; border-radius: 12px; overflow: hidden; min-height: auto;
}
.riwayah-tech-grid .wp-block-query > ul > li:first-child .wp-block-post-featured-image { position: relative; inset: auto; z-index: auto; border-radius: 12px 12px 0 0; }
.riwayah-tech-grid .wp-block-query > ul > li:first-child .wp-block-post-featured-image img { height: auto; border-radius: 12px 12px 0 0; aspect-ratio: 16 / 10;}
.riwayah-tech-grid .wp-block-query > ul > li:first-child .riwayah-card-content {
    background: var(--bg-light); min-height: auto; padding: 25px; border: 1px solid var(--border-card); border-top: none; border-radius: 0 0 12px 12px; justify-content: flex-start; margin-top: 0;
}
body.dark .riwayah-tech-grid .wp-block-query > ul > li:first-child .riwayah-card-content { background: #1a1e26; border-color: #1a1e26; }

.riwayah-tech-grid .wp-block-query > ul > li:first-child .wp-block-post-title { font-size: 1.5rem; }
.riwayah-tech-grid .wp-block-query > ul > li:first-child .wp-block-post-title a { color: var(--text); }
.riwayah-tech-grid .wp-block-query > ul > li:first-child .wp-block-post-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); font-size: 0.85rem; margin-bottom: 20px; margin-top: 10px;}
.riwayah-tech-grid .wp-block-query > ul > li:first-child .riwayah-meta { color: var(--text-2); gap: 15px; }
.riwayah-tech-grid .wp-block-query > ul > li:first-child .riwayah-meta .wp-block-post-author-name { display: flex; color: var(--text-2); align-items: center; }

/* Compact styling right cards (Overlaid Layout naturally applies) */

.riwayah-tech-grid .wp-block-query > ul > li:not(:first-child) .wp-block-post-title { font-size: 1.05rem; margin-bottom: 6px; }
.riwayah-tech-grid .wp-block-query > ul > li:not(:first-child) .riwayah-meta { margin-top: 8px; }


/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .riwayah-hero-grid ul { grid-template-columns: 1fr 2.5fr; gap: 15px; }
    .riwayah-hero-grid .wp-block-query > ul > li:first-child { grid-column: 1 / -1; grid-row: auto; min-width: 0; }
    
    /* Fixed Table most read - 2 columns */
    .riwayah-most-read-grid ul { grid-template-columns: 1fr 1fr; }
    .riwayah-most-read-grid .wp-block-query > ul > li:nth-child(3) { grid-column: 1 / -1; min-height: 350px; }

    .riwayah-tech-grid ul { grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 15px; }
    .riwayah-tech-grid .wp-block-query > ul > li:first-child { grid-column: 1 / -1; min-height: 250px; }
}

@media (min-width: 1024px) {
    /* PC values remain exactly as before */
    .riwayah-hero-grid ul { grid-template-columns: 1fr 3fr; gap: 20px; }
    .riwayah-most-read-grid ul { grid-template-columns: 1fr 1.8fr 1fr; gap: 20px; }
    .riwayah-tech-grid ul { grid-template-columns: 1.2fr 1fr 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    .riwayah-hero-grid ul, .riwayah-tech-grid ul, .riwayah-most-read-grid ul { grid-template-columns: 1fr; }
    .riwayah-discover-grid ul { grid-template-columns: 1fr 1fr; }
    
    /* Revert list style on mobile */
    .riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) { flex-direction: column; background: transparent; padding: 0; box-shadow: none;}
    .riwayah-hero-grid .wp-block-query > ul > li:nth-child(n+2) .wp-block-post-featured-image { width: 100%; height: auto; }
}
@media (max-width: 480px) {
    .riwayah-discover-grid ul { grid-template-columns: 1fr; }
}/* =============================================================
   MOBILE / TABLET HERO CAROUSEL — JS-driven, 3-up infinite loop
   ============================================================= */

/* Hidden on desktop */
.riwayah-hero-carousel { display: none; }

/* Radio inputs removed — no longer needed */
.hero-slide-input { display: none !important; }

@media (max-width: 1024px) {

    /* Hide desktop grid */
    .riwayah-hero-grid { display: none !important; }

    /* Carousel wrapper */
    .riwayah-hero-carousel {
        display: block;
        width: 100%;
        margin-bottom: 36px;
        user-select: none;
        -webkit-user-select: none;
    }

    /* Viewport clips overflow */
    .hero-carousel-viewport {
        overflow: hidden;
        width: 100%;
    }

    /* Track — JS applies transform here */
    .hero-carousel-track {
        display: flex;
        gap: 12px;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }
    .hero-carousel-track.no-transition {
        transition: none !important;
    }

    /* 3 slides visible: width = (100% - 2 gaps) / 3 */
    .hero-carousel-slide {
        flex: 0 0 calc((100% - 24px) / 3);
        min-width: 0;
    }

    /* Card shell */
    .carousel-slide-link {
        display: flex;
        flex-direction: column;
        border-radius: 10px;
        overflow: hidden;
        background: var(--post-card-bg, #f9f9f9);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        text-decoration: none;
        color: inherit;
        height: 100%;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .carousel-slide-link:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
    }

    /* Image with badge overlay */
    .carousel-slide-image {
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background: #111;
        flex-shrink: 0;
    }
    .carousel-slide-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.45s ease;
    }
    .carousel-slide-link:hover .carousel-slide-image img {
        transform: scale(1.06);
    }

    /* Badge overlays image */
    .carousel-badge {
        position: absolute;
        top: 7px;
        left: 7px;
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 3px 7px;
        border-radius: 20px;
        background: var(--cat-bg, #00674f);
        color: var(--cat-text, #fff);
        z-index: 1;
        white-space: nowrap;
    }

    /* Text content below image */
    .carousel-slide-content {
        padding: 9px 11px 12px;
        flex: 1;
    }
    .carousel-slide-title {
        font-size: 0.8rem;
        font-weight: 700;
        line-height: 1.35;
        margin: 0 0 6px;
        color: var(--text, #000);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .carousel-slide-meta {
        font-size: 9px;
        color: var(--text-2, #666);
        display: flex;
        flex-direction: column;
        gap: 1px;
    }
    .carousel-author { font-weight: 600; }
    .carousel-date   { opacity: 0.7; }

    /* Dot nav */
    .hero-carousel-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 14px 0 4px;
    }
    .hero-carousel-dots .dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #ccc;
        cursor: pointer;
        transition: background 0.3s ease, transform 0.3s ease;
        flex-shrink: 0;
    }
    .hero-carousel-dots .dot.active {
        background: var(--cat-bg, #00674f);
        transform: scale(1.4);
    }

    /* Dark mode */
    body.dark .carousel-slide-link {
        background: var(--post-card-bg);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    }
    body.dark .carousel-slide-title {
        color: var(--text);
    }
}

/* Small phones: show 1-up full-width */
@media (max-width: 600px) {
    .hero-carousel-slide {
        flex: 0 0 calc(100% - 24px); /* 1 per view, with slight peek */
    }
}

/* =============================================================
   SEARCH OVERLAY — thumbnail fix (no stretch on any screen size)
   ============================================================= */

/* Fixed-ratio image container */
.search-card-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

/* Image fills the wrapper without distorting */
.search-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

/* Make cards stack image above content properly */
.search-card a,
.search-card-link {
    display: flex;
    flex-direction: column;
}

/* =========================================================
   NEW HERO GRID SECTION
========================================================= */

.riwayah-hero-grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 auto 40px auto;
  padding: 0;
}

/* Main Card Styles */
.main-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.main-card img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.main-card-footer {
  position: relative;
  z-index: 10;
  margin-top: auto;
  padding: 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: white;
}

.main-card-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
  line-height: 1.3;
}

.main-card-excerpt {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin: 0.25rem 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.main-card-price {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 10px;
  color: #e2e8f0;
  margin: 0;
}

.main-card-footer .btn {
  background: white;
  color: black;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-decoration: none;
  white-space: nowrap;
}

.main-card-footer .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Side Cards Styles */
.side-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.side-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--post-card-bg, white);
  border-radius: 12px;
  border: 1px solid var(--border-card, #e2e8f0);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.side-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

body.dark .side-card:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.side-card img {
  width: 80px !important;
  height: 80px !important;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
}

.side-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.side-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-card-description {
  font-size: 0.8rem;
  color: #475569;
  margin: 0;
  font-weight: 500;
}

body.dark .side-card-description {
  color: #cbd5e1;
}

/* Responsive Design */
@media (min-width: 640px) {
  .main-card {
    min-height: 300px;
  }
  
  .main-card-info h3 {
    font-size: 1.125rem;
  }
  
  .main-card-price {
    font-size: 0.875rem;
  }
}

/* PC Layout (already defined above for desktop defaults) */
@media (min-width: 1024px) {
  .riwayah-hero-grid-container {
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    padding: 0;
  }
}

/* Tablet Scaling */
@media (min-width: 768px) and (max-width: 1023px) {
  .riwayah-hero-grid-container {
    grid-template-columns: 1.5fr 1fr; /* PC-like but more compact */
    gap: 1rem;
    padding: 0;
  }
  
  .main-card {
    height: 280px; /* Scaled down from 350px */
  }

  .side-card img {
    width: 70px !important;
    height: 70px !important;
  }

  .side-card-title {
    font-size: 0.8rem;
  }
}

/* From Uiverse.io by anand_4957 */ 
.loader {
  position: absolute;
  top: 50%;
  margin-left: -50px;
  left: 50%;
  animation: speeder 0.4s linear infinite;
}
.loader > span {
  height: 5px;
  width: 35px;
  background: #000;
  position: absolute;
  top: -19px;
  left: 60px;
  border-radius: 2px 10px 1px 0;
}
.base span {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-right: 100px solid #000;
  border-bottom: 6px solid transparent;
}
.base span:before {
  content: "";
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: #000;
  position: absolute;
  right: -110px;
  top: -16px;
}
.base span:after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-top: 0 solid transparent;
  border-right: 55px solid #000;
  border-bottom: 16px solid transparent;
  top: -16px;
  right: -98px;
}
.face {
  position: absolute;
  height: 12px;
  width: 20px;
  background: #000;
  border-radius: 20px 20px 0 0;
  transform: rotate(-40deg);
  right: -125px;
  top: -15px;
}
.face:after {
  content: "";
  height: 12px;
  width: 12px;
  background: #000;
  right: 4px;
  top: 7px;
  position: absolute;
  transform: rotate(40deg);
  transform-origin: 50% 50%;
  border-radius: 0 0 0 2px;
}
.loader > span > span:nth-child(1),
.loader > span > span:nth-child(2),
.loader > span > span:nth-child(3),
.loader > span > span:nth-child(4) {
  width: 30px;
  height: 1px;
  background: #000;
  position: absolute;
  animation: fazer1 0.2s linear infinite;
}
.loader > span > span:nth-child(2) {
  top: 3px;
  animation: fazer2 0.4s linear infinite;
}
.loader > span > span:nth-child(3) {
  top: 1px;
  animation: fazer3 0.4s linear infinite;
  animation-delay: -1s;
}
.loader > span > span:nth-child(4) {
  top: 4px;
  animation: fazer4 1s linear infinite;
  animation-delay: -1s;
}
@keyframes fazer1 {
  0% {
    left: 0;
  }
  100% {
    left: -80px;
    opacity: 0;
  }
}
@keyframes fazer2 {
  0% {
    left: 0;
  }
  100% {
    left: -100px;
    opacity: 0;
  }
}
@keyframes fazer3 {
  0% {
    left: 0;
  }
  100% {
    left: -50px;
    opacity: 0;
  }
}
@keyframes fazer4 {
  0% {
    left: 0;
  }
  100% {
    left: -150px;
    opacity: 0;
  }
}
@keyframes speeder {
  0% {
    transform: translate(2px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -3px) rotate(-1deg);
  }
  20% {
    transform: translate(-2px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 3px) rotate(-1deg);
  }
  60% {
    transform: translate(-1px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-2px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(2px, 1px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}
.longfazers {
  position: absolute;
  width: 100%;
  height: 100%;
}
.longfazers span {
  position: absolute;
  height: 2px;
  width: 20%;
  background: #000;
}
.longfazers span:nth-child(1) {
  top: 20%;
  animation: lf 0.6s linear infinite;
  animation-delay: -5s;
}
.longfazers span:nth-child(2) {
  top: 40%;
  animation: lf2 0.8s linear infinite;
  animation-delay: -1s;
}
.longfazers span:nth-child(3) {
  top: 60%;
  animation: lf3 0.6s linear infinite;
}
.longfazers span:nth-child(4) {
  top: 80%;
  animation: lf4 0.5s linear infinite;
  animation-delay: -3s;
}
@keyframes lf {
  0% {
    left: 200%;
  }
  100% {
    left: -200%;
    opacity: 0;
  }
}
@keyframes lf2 {
  0% {
    left: 200%;
  }
  100% {
    left: -200%;
    opacity: 0;
  }
}
@keyframes lf3 {
  0% {
    left: 200%;
  }
  100% {
    left: -100%;
    opacity: 0;
  }
}
@keyframes lf4 {
  0% {
    left: 200%;
  }
  100% {
    left: -100%;
    opacity: 0;
  }
}

/* Dark mode overrides for loader */
body.dark .loader > span,
body.dark .base span:before,
body.dark .face,
body.dark .face:after,
body.dark .loader > span > span:nth-child(1),
body.dark .loader > span > span:nth-child(2),
body.dark .loader > span > span:nth-child(3),
body.dark .loader > span > span:nth-child(4),
body.dark .longfazers span {
  background: #fff;
}

body.dark .base span {
  border-right-color: #fff;
}

body.dark .base span:after {
  border-right-color: #fff;
}

/* ==========================================================================
   COMMENTS & REPLY AREA (NATIVE DARK MODE SUPPORT)
   ========================================================================== */
.comments-area { margin-top: 50px; padding-top: 30px; border-top: 2px solid var(--border-card); }
.comments-title, .comment-reply-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-body { background: var(--post-card-bg); padding: 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 1px solid transparent; }
.comment-meta { font-size: 0.85rem; color: var(--text-2); margin-bottom: 10px; }
.comment-meta a { color: var(--text-2); }
.comment-author cite { font-weight: 600; color: var(--text); font-style: normal; font-size: 1rem; }
.comment-author img { border-radius: 50%; margin-right: 15px; vertical-align: middle; }
.comment-content { color: var(--text); font-size: 0.95rem; line-height: 1.6; }
.reply a { display: inline-block; margin-top: 10px; font-size: 0.85rem; font-weight: 600; color: var(--button-read); }
.comment-respond { background: var(--post-card-bg); padding: 25px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-top: 40px; border: 1px solid transparent; }
.loader > span > span:nth-child(3),
.loader > span > span:nth-child(4) {
  width: 30px;
  height: 1px;
  background: #000;
  position: absolute;
  animation: fazer1 0.2s linear infinite;
}
.loader > span > span:nth-child(2) {
  top: 3px;
  animation: fazer2 0.4s linear infinite;
}
.loader > span > span:nth-child(3) {
  top: 1px;
  animation: fazer3 0.4s linear infinite;
  animation-delay: -1s;
}
.loader > span > span:nth-child(4) {
  top: 4px;
  animation: fazer4 1s linear infinite;
  animation-delay: -1s;
}
@keyframes fazer1 {
  0% {
    left: 0;
  }
  100% {
    left: -80px;
    opacity: 0;
  }
}
@keyframes fazer2 {
  0% {
    left: 0;
  }
  100% {
    left: -100px;
    opacity: 0;
  }
}
@keyframes fazer3 {
  0% {
    left: 0;
  }
  100% {
    left: -50px;
    opacity: 0;
  }
}
@keyframes fazer4 {
  0% {
    left: 0;
  }
  100% {
    left: -150px;
    opacity: 0;
  }
}
@keyframes speeder {
  0% {
    transform: translate(2px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -3px) rotate(-1deg);
  }
  20% {
    transform: translate(-2px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 3px) rotate(-1deg);
  }
  60% {
    transform: translate(-1px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-2px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(2px, 1px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}
.longfazers {
  position: absolute;
  width: 100%;
  height: 100%;
}
.longfazers span {
  position: absolute;
  height: 2px;
  width: 20%;
  background: #000;
}
.longfazers span:nth-child(1) {
  top: 20%;
  animation: lf 0.6s linear infinite;
  animation-delay: -5s;
}
.longfazers span:nth-child(2) {
  top: 40%;
  animation: lf2 0.8s linear infinite;
  animation-delay: -1s;
}
.longfazers span:nth-child(3) {
  top: 60%;
  animation: lf3 0.6s linear infinite;
}
.longfazers span:nth-child(4) {
  top: 80%;
  animation: lf4 0.5s linear infinite;
  animation-delay: -3s;
}
@keyframes lf {
  0% {
    left: 200%;
  }
  100% {
    left: -200%;
    opacity: 0;
  }
}
@keyframes lf2 {
  0% {
    left: 200%;
  }
  100% {
    left: -200%;
    opacity: 0;
  }
}
@keyframes lf3 {
  0% {
    left: 200%;
  }
  100% {
    left: -100%;
    opacity: 0;
  }
}
@keyframes lf4 {
  0% {
    left: 200%;
  }
  100% {
    left: -100%;
    opacity: 0;
  }
}

/* Dark mode overrides for loader */
body.dark .loader > span,
body.dark .base span:before,
body.dark .face,
body.dark .face:after,
body.dark .loader > span > span:nth-child(1),
body.dark .loader > span > span:nth-child(2),
body.dark .loader > span > span:nth-child(3),
body.dark .loader > span > span:nth-child(4),
body.dark .longfazers span {
  background: #fff;
}

body.dark .base span {
  border-right-color: #fff;
}

body.dark .base span:after {
  border-right-color: #fff;
}

/* ==========================================================================
   COMMENTS & REPLY AREA (NATIVE DARK MODE SUPPORT)
   ========================================================================== */
.comments-area { margin-top: 50px; padding-top: 30px; border-top: 2px solid var(--border-card); }
.comments-title, .comment-reply-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-body { background: var(--post-card-bg); padding: 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 1px solid transparent; }
.comment-meta { font-size: 0.85rem; color: var(--text-2); margin-bottom: 10px; }
.comment-meta a { color: var(--text-2); }
.comment-author cite { font-weight: 600; color: var(--text); font-style: normal; font-size: 1rem; }
.comment-author img { border-radius: 50%; margin-right: 15px; vertical-align: middle; }
.comment-content { color: var(--text); font-size: 0.95rem; line-height: 1.6; }
.reply a { display: inline-block; margin-top: 10px; font-size: 0.85rem; font-weight: 600; color: var(--button-read); }
.comment-respond { background: var(--post-card-bg); padding: 25px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-top: 40px; border: 1px solid transparent; }

.comment-form-comment label, .comment-form-author label, .comment-form-email label, .comment-form-url label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border-card); background: var(--bg); color: var(--text); border-radius: 6px; margin-bottom: 15px; }
.comment-form input[type="text"]:focus, .comment-form input[type="email"]:focus, .comment-form input[type="url"]:focus, .comment-form textarea:focus { outline: none; border-color: var(--button-read); }
.comment-form input[type="submit"] { background: var(--button-read); color: #fff; border: none; padding: 12px 25px; border-radius: 25px; font-weight: 600; cursor: pointer; transition: background 0.3s; }
.comment-form input[type="submit"]:hover { background: var(--nav-text-hover); }

/* Remove shadow entirely in Dark Mode for generic cards and widgets */
body.dark .post-header,
body.dark .sidebar-widget,
body.dark .nav-link,
body.dark .tag-badge,
body.dark .comment-body,
body.dark .comment-respond {
    box-shadow: none;
    border-color: var(--border-card);
}

body.dark .nav-link:hover {
    border-color: var(--button-read);
}

/* ============================================================
   LOAD MORE BUTTON — Category Loop Sections
   ============================================================ */
.riwayah-load-more-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 32px;
    padding-bottom: 8px;
}

.riwayah-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--button-read, #00674f);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 0.01em;
}

.riwayah-load-more-btn:hover:not(:disabled) {
    background: #004d3a;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 103, 79, 0.25);
}

.riwayah-load-more-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

body.dark .riwayah-load-more-btn {
    background: #0a3c30;
}

body.dark .riwayah-load-more-btn:hover:not(:disabled) {
    background: #0f5240;
}

/* Spinner */
.riwayah-load-more-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 103, 79, 0.25);
    border-top-color: var(--button-read, #00674f);
    border-radius: 50%;
    animation: riwayah-spin 0.7s linear infinite;
}

@keyframes riwayah-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   MOBILE REELS FEED — Full-screen snap-scroll (≤950px only)
   ============================================================ */
.riwayah-mobile-insta-feed {
    display: none; /* hidden on desktop */
}

@media (max-width: 950px) {

    /* ---- Outer wrapper ---- */
    .riwayah-mobile-insta-feed {
        display: block;
        background: #000;
        position: relative;
    }

    /* ---- Snap-scroll container ---- */
    .insta-feed-reel {
        height: 92vh;
        overflow-y: scroll;
        scroll-snap-type: y mandatory;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;  /* Firefox */
    }
    .insta-feed-reel::-webkit-scrollbar { display: none; } /* Chrome/Safari */

    /* ---- Each card = 1 full screen ---- */
    .insta-feed-item {
        display: block;
        position: relative;
        width: 100%;
        height: 92vh;
        overflow: hidden;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        -webkit-tap-highlight-color: transparent;
        text-decoration: none;
    }

    /* ---- Full-bleed background image ---- */
    .insta-reel-bg {
        position: absolute;
        inset: 0;
        z-index: 1;
    }
    .insta-reel-bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.5s ease;
    }
    .insta-feed-item:active .insta-reel-bg img {
        transform: scale(1.03);
    }

    /* ---- Dark gradient overlay ---- */
    .insta-reel-overlay {
        position: absolute;
        inset: 0;
        z-index: 2;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.88) 0%,
            rgba(0, 0, 0, 0.45) 40%,
            rgba(0, 0, 0, 0.1)  70%,
            transparent         100%
        );
    }

    /* ---- Content panel (bottom) ---- */
    .insta-reel-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 3;
        padding: 20px 18px 32px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Category badge */
    .insta-reel-cat {
        display: inline-block;
        background: var(--button-read, #00674f);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        padding: 4px 10px;
        border-radius: 20px;
        letter-spacing: 0.03em;
        align-self: flex-start;
        text-transform: capitalize;
    }

    /* Title */
    .insta-reel-title {
        margin: 0;
        color: #ffffff;
        font-size: 1.25rem;
        font-weight: 800;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    }

    /* Excerpt */
    .insta-reel-excerpt {
        margin: 0;
        color: rgba(255,255,255,0.82);
        font-size: 0.88rem;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Meta row */
    .insta-reel-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 4px;
        color: rgba(255,255,255,0.65);
        font-size: 0.8rem;
    }

    /* Read more pill */
    .insta-reel-read {
        background: rgba(255,255,255,0.15);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        color: #fff;
        padding: 6px 16px;
        border-radius: 20px;
        font-weight: 700;
        font-size: 0.82rem;
        border: 1px solid rgba(255,255,255,0.3);
        transition: background 0.2s;
    }
    .insta-feed-item:hover .insta-reel-read,
    .insta-feed-item:active .insta-reel-read {
        background: var(--button-read, #00674f);
        border-color: var(--button-read, #00674f);
    }

    /* Scroll progress dots on right edge */
    .insta-reel-progress {
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
        z-index: 4;
        width: 3px;
        height: 40px;
        border-radius: 4px;
        background: rgba(255,255,255,0.2);
    }

    /* ---- Load More area (below the reel container) ---- */
    .insta-load-more-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 16px;
        background: #000;
    }

    .insta-load-more-btn {
        width: 100%;
        max-width: 340px;
        padding: 13px 0;
        background: transparent;
        color: #fff;
        border: 1.5px solid rgba(255,255,255,0.3);
        border-radius: 8px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        transition: border-color 0.2s, background 0.2s;
    }
    .insta-load-more-btn:hover:not(:disabled) {
        border-color: var(--button-read);
        background: var(--button-read);
    }
    .insta-load-more-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    /* Spinner */
    .insta-load-more-spinner {
        width: 22px;
        height: 22px;
        border: 2.5px solid rgba(255,255,255,0.2);
        border-top-color: #fff;
        border-radius: 50%;
        animation: riwayah-spin 0.7s linear infinite;
        flex-shrink: 0;
    }

    /* Fade-in for newly loaded cards */
    .insta-feed-item.insta-new {
        animation: instaFadeIn 0.35s ease forwards;
    }
    @keyframes instaFadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}
/* ============================================================
   ABOUT PAGE (TENTANG KAMI)
   ============================================================ */



.section-title {
  padding-top: 2rem;
  padding-bottom: 2rem;
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 60px;
  color: var(--text);
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--button-read);
  margin: 20px auto 0;
  border-radius: 2px;
}

.team-section {
  margin-top: 60px;
}

.page-template-template-about .post-container {
  max-width: 960px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding-bottom: 4rem;
}

.team-card {
  perspective: 1000px;
  height: 95%;
}

.team-card-inner {
  background: var(--bg-light);
  border-radius: 24px;
  padding: 30px;
  padding-bottom: 90px;
  text-align: center;
  border: 1px solid var(--border-card);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
}

.team-card:hover .team-card-inner {
  transform: translateY(-15px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--button-read);
}

.member-avatar {
  margin-bottom: -5px;
  display: flex;
  justify-content: center;
}

.member-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.team-card:hover .member-avatar img {
  transform: scale(1.05);
}

.member-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.member-name {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* this is the correct one */
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  height: 60px;
}

.member-role {
  font-size: 0.9rem;
  color: var(--button-read);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.member-bio {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-meta {
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-3);
}

.member-socials {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-card);
}

.social-link:hover {
  color: #fff;
  transform: rotate(10deg);
}

.social-link.ig:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%); }
.social-link.yt:hover { background: #FF0000; }
.social-link.wa:hover { background: #25D366; }
.social-link.fb:hover { background: #1877F2; }

.member-action .view-posts-btn {
  display: block;
  position: absolute;
  bottom: 2rem;
  padding: 12px 24px;
  background: var(--button-read);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  width: 80%;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
}

.member-action .view-posts-btn:hover {
  background: var(--bg-hover);
  color: #004d3a;
  opacity: 0.9;
  transform: scale(1.02);
}

/* Dark Mode Overrides */
body.dark .team-card-inner {
  background: rgba(26, 30, 38, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark .member-avatar img {
  border-color: var(--border-card);
}

@media (max-width: 768px) {
  .about-title {
    font-size: 2.5rem;
  }
  
  .team-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .team-section {
    margin-top: 40px;
    gap: 30px;
  }

  .team-card {
    padding: 0;
  }
}
