/*
 Theme Name: Kadence Child – JAC West Rand
 Theme URI: https://aggwestrand.co.za
 Description: Child theme for Kadence tailored for JAC Motors West Rand (Models CPT, VDP, CTAs, performance helpers).
 Author: OBM Digital
 Author URI: https://obmdigital.co.za
 Template: kadence
 Version: 1.0.0
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: jac-kadence-child
*/
/* /wp-content/themes/jac-kadence-child/style.css (or a child CSS file you enqueue) */
@font-face{
  font-family: "Inter";
  src:
    url("/wp-content/themes/jac-kadence-child/assets/fonts/inter/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;            /* full variable range */
  font-style: normal italic;       /* slnt/ital axis covered if present */
  font-display: swap;              /* good for CWV */
}

/* Optional: if you also have a static woff2 backup, list it before the variations src
@font-face{
  font-family:"Inter";
  src:url("/wp-content/themes/jac-kadence-child/assets/fonts/inter/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
*/
/* Fonts – global stacks */
html, body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1em;
}


/* --- VDP Layout Fixes & Additions --- */

/* 1. This new class is for the left column wrapper in single-models.php */
.vdp-left-col {
  display: flex;
  flex-direction: column;
  /* Use the margin from your colour-gallery as a gap */
  gap: 28px; 
  min-width: 0; /* Prevents grid/flexbox overflow issues */
}

/* 2. Make the right column finance card sticky */
.vdp-sticky-card {
  position: -webkit-sticky;
  position: sticky;
  top: 100px; /* Adjust as needed for sticky header + admin bar */
}

/* 3. Style for the new hero carousel caption */
.vdp-hero-carousel-slider .splide__slide {
  position: relative; /* Required for the caption overlay */
}

.vdp-hero-carousel-slider .splide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  line-height: 1.4;
  box-sizing: border-box; /* Ensures padding doesn't break width */
}
/* Hide empty captions */
.vdp-hero-carousel-slider .splide-caption:empty {
  display: none;
}

/* 4. Responsive stacking for the main 2-column grid */
@media (max-width: 1024px) {
  /* This targets the grid wrapper from jac-vdp.css */
  .vdp-hero-row {
    grid-template-columns: 1fr; /* Stack the columns */
  }

  /* Un-stick the finance card on mobile */
  .vdp-sticky-card {
    position: relative;
    top: auto;
  }
}
/* --- VDP Layout Fixes & Additions --- */

/* 1. This new class is for the left column wrapper in single-models.php */
.vdp-left-col {
  display: flex;
  flex-direction: column;
  /* Use the margin from your colour-gallery as a gap */
  gap: 28px; 
  min-width: 0; /* Prevents grid/flexbox overflow issues */
}

/* 2. Make the right column finance card sticky */
.vdp-sticky-card {
  position: -webkit-sticky;
  position: sticky;
  top: 100px; /* Adjust as needed for sticky header + admin bar */
}

/* 3. Style for the new hero carousel caption */
.vdp-hero-carousel-slider .splide__slide {
  position: relative; /* Required for the caption overlay */
}

.vdp-hero-carousel-slider .splide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  line-height: 1.4;
  box-sizing: border-box; /* Ensures padding doesn't break width */
}
/* Hide empty captions */
.vdp-hero-carousel-slider .splide-caption:empty {
  display: none;
}

/* 4. Responsive stacking for the main 2-column grid */
@media (max-width: 1024px) {
  /* This targets the grid wrapper from jac-vdp.css */
  .vdp-hero-row {
    grid-template-columns: 1fr; /* Stack the columns */
  }

  /* Un-stick the finance card on mobile */
  .vdp-sticky-card {
    position: relative;
    top: auto;
  }
}
/* --- VDP Tab Section Styles --- */
.vdp-tab-section {
  margin-top: 3rem;
  border-top: 1px solid #eee;
  padding-top: 2rem;
  /* Clear any floats that might be leaking from content above */
  clear: both;
}

/* Tab Navigation */
.vdp-tab-section .vdp-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 2rem 0;
  padding: 0;
  border-bottom: 2px solid #e5e7eb;
}
.vdp-tab-section .vdp-tabs-nav li {
  margin: 0;
  padding: 0;
}
.vdp-tab-section .vdp-tabs-nav .vdp-tab-link {
  display: block;
  padding: 0.75rem 1.5rem;
  margin-bottom: -2px;
  border: 2px solid transparent;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.2s ease;
}
.vdp-tab-section .vdp-tabs-nav .vdp-tab-link:hover {
  color: #111827;
  background-color: #f9fafb;
}
.vdp-tab-section .vdp-tabs-nav .vdp-tab-link.active {
  color: var(--global-palette1, #cd000e); /* Use theme's red */
  border-color: #e5e7eb;
  border-bottom-color: #ffffff;
}

/* Tab Panes */
.vdp-tab-section .vdp-tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}
.vdp-tab-section .vdp-tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Table & List Styles */
.vdp-tab-section .vdp-group-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}
.vdp-tab-section .vdp-group-heading:first-child {
  margin-top: 0;
}

/* === CSS FIX: Added #inner-wrap for specificity === */
#inner-wrap .vdp-tab-section .vdp-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
#inner-wrap .vdp-tab-section .vdp-data-table th,
#inner-wrap .vdp-tab-section .vdp-data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}
#inner-wrap .vdp-tab-section .vdp-data-table thead th {
  background-color: #f9fafb;
  font-weight: 600;
}
#inner-wrap .vdp-tab-section .vdp-data-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}
#inner-wrap .vdp-tab-section .vdp-data-table td:first-child {
  font-weight: 500;
  width: 40%;
}

/* === CSS FIX: Added #inner-wrap for specificity === */
#inner-wrap .vdp-tab-section .vdp-features-list {
  list-style: disc;
  padding-left: 1.5rem;
  columns: 2;
  gap: 1.5rem;
}
#inner-wrap .vdp-tab-section .vdp-features-list li {
  margin-bottom: 0.5rem;
}

/* Gallery Grid (This was working, but added #inner-wrap for consistency) */
#inner-wrap .vdp-tab-section .vdp-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
#inner-wrap .vdp-tab-section .vdp-gallery-grid a {
  display: block; /* Make the link a block to contain the image */
}
#inner-wrap .vdp-tab-section .vdp-gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}
#inner-wrap .vdp-tab-section .vdp-gallery-grid a:hover img {
  transform: scale(1.03);
}

/* Responsive */
@media (max-width: 767px) {
  #inner-wrap .vdp-tab-section .vdp-features-list {
    columns: 1;
  }
  #inner-wrap .vdp-tab-section .vdp-data-table td:first-child {
    width: auto;
  }
}