/*
Theme Name: aiti-theme
Theme URI: https://aiti-solutions.com/read/aiti-theme.html
Author: flashponsel
Author URI: https://aiti-solutions.com
Description: High-performance, SEO-optimized, and fully responsive WordPress theme for heavy equipment rental services. Featuring native Dark/Light mode, WebP/AVIF support, local assets, and security-hardened AJAX search.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aiti-solutions
Tags: two-columns, custom-menu, featured-images, full-width-template, sticky-post, theme-options, translation-ready, dark-mode, seo-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* Adaptive Utilities for Light/Dark Mode */
.text-dark {
  transition: color 0.3s ease;
}

[data-bs-theme="dark"] .text-dark {
  color: #f8f9fa !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: #212529 !important;
  color: #dee2e6 !important;
}

[data-bs-theme="dark"] .bg-dark {
  background-color: #0b0c0d !important;
}

/* Ensure text-white stays visible on dark backgrounds and doesn't get 
   overridden by global dark mode text colors in some edge cases */
.text-white {
  color: #fff !important;
}

[data-bs-theme="light"] .bg-dark {
  background-color: #212529 !important;
  color: #fff !important;
}

[data-bs-theme="light"] .text-dark {
  color: #212529 !important;
}

/* Font loading optimization */
@font-face {
  font-family: "bootstrap-icons";
  font-display: swap;
  src: url("assets/css/fonts/bootstrap-icons.woff2") format("woff2"),
       url("assets/css/fonts/bootstrap-icons.woff") format("woff");
}

body:not(.admin-bar) {
  padding-top: 0 !important;
  margin: 0 !important;
}

/* Navbar Transition Styles */
.navbar {
  transition:
    background-color 0.4s ease,
    padding 0.4s ease,
    backdrop-filter 0.4s ease;
  padding: 1.2rem 1rem;
}

/* Logo SVG Styles */
.brand-logo-bg {
  fill: #fff;
  transition: fill 0.3s ease;
}

.brand-logo-text {
  fill: #212529;
  transition: fill 0.3s ease;
}

/* Specific Logo Styles for Light Theme */
[data-bs-theme="light"] .brand-logo-bg {
  fill: #2c3e50;
}

[data-bs-theme="light"] .brand-logo-text {
  fill: #fff;
}

/* Specific Logo Styles for Dark Theme */
[data-bs-theme="dark"] .brand-logo-bg {
  fill: #fff;
}

[data-bs-theme="dark"] .brand-logo-text {
  fill: #212529;
}

/* When navbar is scrolled in light theme, we want it to stay consistent or change */
[data-bs-theme="light"] .navbar.scrolled .brand-logo-bg {
  fill: #2c3e50;
}
[data-bs-theme="light"] .navbar.scrolled .brand-logo-text {
  fill: #fff;
}

/* Default (Light Mode) */
.site-icon-footer,
.site-icon-nav {
  height: 1.5em;
  width: auto;
  background-color: #111;
  padding: 3px;
  border-radius: 0.5rem;
}

/* Dark Mode */
[data-bs-theme="dark"] .site-icon-footer,
.site-icon-nav {
  background-color: #111; /* warna gelap */
  padding: 3px;
  border-radius: 0.5rem;
}

/* Header & Footer Colors - Light Mode */
[data-bs-theme="light"] footer {
  background-color: #ecf0f1 !important;
  color: #2c3e50 !important;
}

[data-bs-theme="light"] .navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #2c3e50 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

[data-bs-theme="light"] .navbar.scrolled .navbar-brand,
[data-bs-theme="light"] .navbar.scrolled .btn-outline-light,
[data-bs-theme="light"] footer h4,
[data-bs-theme="light"] footer h5,
[data-bs-theme="light"] footer strong {
  color: #444 !important;
}

[data-bs-theme="light"] .navbar.scrolled .btn-outline-light {
  border-color: #2c3e50 !important;
  color: #ccc !important;
}

.btn-toggle {
  border-color: rgb(44, 62, 80) !important;
  background-color: rgb(44, 62, 80) !important;
  color: #fff !important;
}

.btn-toggle:hover {
  background-color: rgb(52, 73, 94) !important;
  border-color: rgb(52, 73, 94) !important;
  color: #fff !important;
}

/* Fix btn-outline-dark for adaptive dark/light mode readability */
[data-bs-theme="light"] .btn-outline-dark {
  color: #212529 !important;
  border-color: #212529 !important;
  background-color: transparent !important;
}

[data-bs-theme="light"] .btn-outline-dark:hover,
[data-bs-theme="light"] .btn-outline-dark:focus,
[data-bs-theme="light"] .btn-outline-dark:active,
[data-bs-theme="light"] .btn-outline-dark.active {
  color: #fff !important;
  border-color: #212529 !important;
  background-color: #212529 !important;
}

[data-bs-theme="dark"] .btn-outline-dark {
  color: #e9ecef !important;
  border-color: rgba(233, 236, 239, 0.75) !important;
  background-color: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover,
[data-bs-theme="dark"] .btn-outline-dark:focus,
[data-bs-theme="dark"] .btn-outline-dark:active,
[data-bs-theme="dark"] .btn-outline-dark.active {
  color: #111 !important;
  border-color: #f8f9fa !important;
  background-color: #f8f9fa !important;
}

[data-bs-theme="dark"] .btn-toggle:hover {
  border-color: rgba(255, 255, 255, 0.9) !important;
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: rgb(44, 62, 80) !important;
}

[data-bs-theme="dark"] .btn-toggle {
  background-color: rgb(255, 255, 255) !important;
  border-color: rgb(255, 255, 255) !important;
  color: rgb(44, 62, 80) !important;
}

/* Force Social Media Buttons to stay white */
footer .btn,
footer .btn i,
footer .btn span,
footer .btn * {
  color: #fff !important;
}

/* Header & Footer Colors - Dark Mode */
[data-bs-theme="dark"] footer {
  background-color: #1a1e21 !important;
}

[data-bs-theme="dark"] .navbar.scrolled {
  background-color: rgba(26, 30, 33, 0.35) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.navbar.scrolled {
  padding: 0.8rem 1rem;
}

/* Hero & Parallax Section */
.carousel-height {
  display: block;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  object-fit: cover;
}

#heroCarousel .carousel-inner,
#heroCarousel .carousel-item {
  height: 60vh;
  min-height: 400px;
}

#heroCarousel .carousel-item {
  overflow: hidden;
}

#heroCarousel .carousel-item .carousel-height {
  height: 100%;
  min-height: 100%;
}

.parallax-header {
  height: 60vh;
  min-height: 400px;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.parallax-header {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.parallax-content {
  position: relative;
  z-index: 2;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
}

.carousel-img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 1;
}

/* Stronger hero overlay on front page so text stays readable on bright images */
body.home #heroCarousel .carousel-img-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.36) 45%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

body.home #heroCarousel .carousel-caption {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

@media (max-width: 575.98px) {
  #mainNav {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    padding-bottom: 0.65rem;
  }

  body.home #heroCarousel .carousel-item {
    min-height: 330px;
    height: 330px;
  }

  body.home #heroCarousel .carousel-height {
    height: 330px;
    min-height: 330px;
  }

  body.home #heroCarousel .carousel-inner {
    height: 330px;
    min-height: 330px;
  }

  body.home #heroCarousel .carousel-caption {
    padding-top: calc(3.75rem + env(safe-area-inset-top, 0px));
    padding-bottom: 2.75rem;
  }

  body.home #heroCarousel .carousel-caption h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
    line-height: 1.15;
    margin-bottom: 0.75rem !important;
  }

  body.home #heroCarousel .carousel-caption .lead {
    font-size: 0.95rem;
    margin-bottom: 0.75rem !important;
  }

  body.home #heroCarousel .carousel-caption .btn {
    position: relative;
    z-index: 3;
  }

  body.home #heroCarousel .carousel-img-overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.7) 0%,
      rgba(0, 0, 0, 0.48) 45%,
      rgba(0, 0, 0, 0.78) 100%
    );
  }
}

/* Index/blog carousel readability */
body.blog #heroCarousel .carousel-img-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.36) 45%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

body.blog #heroCarousel .carousel-caption {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

/* Single + Product parallax readability */
body.single .parallax-overlay,
body.page-template-product .parallax-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.66) 0%,
    rgba(0, 0, 0, 0.45) 50%,
    rgba(0, 0, 0, 0.74) 100%
  );
}

@media (max-width: 575.98px) {
  body.blog #heroCarousel .carousel-img-overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.52) 45%,
      rgba(0, 0, 0, 0.8) 100%
    );
  }

  body.single .parallax-overlay,
  body.page-template-product .parallax-overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.74) 0%,
      rgba(0, 0, 0, 0.56) 50%,
      rgba(0, 0, 0, 0.82) 100%
    );
  }
}

.carousel-caption {
  z-index: 2;
  color: #fff !important;
}

.carousel-caption h1,
.carousel-caption p,
.carousel-caption .lead {
  color: #fff !important;
}

.carousel-caption h1 {
  text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.5);
}

/* Card Hover Effect */
.transition-hover {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.transition-hover:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Hilangkan admin bar margin jika tidak login */
html:not(.wp-admin):not(.admin-bar) {
  margin-top: 0 !important;
}

/* Footer Specific Styles */
.tag-cloud-link {
  font-size: 0.8rem;
  color: #ced4da;
  transition: all 0.3s ease;
  display: inline-block;
  margin-bottom: 5px;
}

.tag-cloud-link:hover {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary) !important;
  color: #fff;
}

.footer-pages li {
  margin-bottom: 0.5rem;
}

.footer-pages a {
  color: #ced4da;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.footer-pages a:hover {
  color: var(--bs-primary);
}

/* Footer page links: keep readable in Light mode */
[data-bs-theme="light"] footer .footer-pages li,
[data-bs-theme="light"] footer .footer-pages a {
  color: rgb(44, 62, 80) !important;
}

[data-bs-theme="light"] footer .footer-pages a:hover {
  color: rgb(30, 44, 57) !important;
}

#productContainer {
  transition: opacity 0.3s ease-in-out;
}

.opacity-0 {
  opacity: 0 !important;
}

.aiti-wa-float {
  min-height: 44px;
}

@media (max-width: 575.98px) {
  .aiti-wa-float {
    width: 52px;
    height: 52px;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center;
    gap: 0 !important;
  }

  .aiti-wa-float i {
    font-size: 1.3rem;
    line-height: 1;
  }
}

.aiti-map-embed {
  position: relative;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.7));
}

.aiti-map-load {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.aiti-map-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 25%, rgba(255, 255, 255, 0.2) 37%, rgba(255, 255, 255, 0.08) 63%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.7));
  background-size: 300% 100%, cover;
  animation: aitiSkeletonShimmer 1.3s ease-in-out infinite;
  z-index: 3;
}

@keyframes aitiSkeletonShimmer {
  0% {
    background-position: 100% 0, 0 0;
  }
  100% {
    background-position: 0 0, 0 0;
  }
}

/* Fix spacing for cards section */
#offers {
  padding-top: 5rem;
}

/* Custom Accordion Styling */
.accordion {
  border-radius: 1rem !important;
  overflow: hidden !important;
  border: 1px solid rgba(0, 0, 0, 0.125) !important;
}

.accordion-item {
  border: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125) !important;
  margin-bottom: 0 !important;
  border-radius: 0 !important;
}

.accordion-item:last-of-type {
  border-bottom: none !important;
}

.accordion-item:first-of-type,
.accordion-item:first-of-type .accordion-button {
  border-top-left-radius: 1rem !important;
  border-top-right-radius: 1rem !important;
}

.accordion-item:last-of-type,
.accordion-item:last-of-type .accordion-button.collapsed,
.accordion-item:last-of-type .accordion-collapse {
  border-bottom-left-radius: 1rem !important;
  border-bottom-right-radius: 1rem !important;
}

[data-bs-theme="dark"] .accordion {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .accordion-item {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Title Initials Placeholder */
.aiti-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa; /* Light mode default */
  color: #6c757d;
  font-weight: 800;
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  user-select: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .aiti-placeholder {
  background-color: #2b3035 !important;
  color: #adb5bd !important;
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

/* Related cards (Product/Article): horizontal, swipeable, no button */
.related-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}

.related-scroll::-webkit-scrollbar {
  display: none;
}

.related-item {
  flex: 0 0 min(360px, 92%);
  scroll-snap-align: start;
}

.card-terkait {
  display: flex;
  flex-direction: row;
  min-height: 112px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.card-terkait:hover {
  border-color: rgba(148, 163, 184, 0.75);
}

.card-terkait-media {
  flex: 0 0 130px;
  max-width: 130px;
}

.card-terkait-thumb {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  display: block;
}

.card-terkait-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.75rem 0.9rem;
}

[data-bs-theme="light"] .card-terkait {
  background-color: #fff;
}

[data-bs-theme="dark"] .card-terkait {
  background-color: rgba(20, 30, 40, 0.78);
}

[data-bs-theme="dark"] .card-terkait .h6 {
  color: #f8fafc;
}

[data-bs-theme="dark"] .card-terkait .text-muted {
  color: #cbd5e1 !important;
}

@media (max-width: 575.98px) {
  #features .card {
    height: 220px !important;
  }

  #features .card .card-body {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem;
  }

  #features .card .card-body h5 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  #features .card .card-body p {
    margin-bottom: 0 !important;
  }
}
