/* ==========================================================================
   Luxury Car Rental Phuket — components.css
   Buttons, hero slider, and every content section. Mobile-first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-main {
  display: inline-block;
  padding: 0.5rem 2rem;
  font-family: var(--body-font);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--color-brand-strong);
  transition: background var(--ease);
}
.btn-main:hover {
  background: var(--color-brand);
  color: var(--color-white);
}

/* Section headings share the same lead-in spacing as the original */
.section-title {
  margin-bottom: 5rem;
}

/* --------------------------------------------------------------------------
   Hero slider (auto, slides horizontally to the left)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--color-surface-1);
  touch-action: pan-y; /* horizontal swipe handled by JS; vertical scroll native */
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.hero.is-dragging {
  cursor: grabbing;
}

.hero__track {
  display: flex;
  will-change: transform;
  transition: transform 1s ease;
}

.hero__slide {
  position: relative;
  flex: 0 0 100%;
  height: 100vh;
  /* Mobile-first: use the portrait image when provided, else the desktop one.
     When no mobile image is set, both branches resolve to --hero-desktop, so
     existing slides look exactly as before. */
  background-image: var(--hero-mobile, var(--hero-desktop));
  background-size: cover;
  background-position: center center;
  color: var(--color-white);
}
/* Desktop / landscape: always the wide featured image. */
@media (min-width: 768px) {
  .hero__slide {
    background-image: var(--hero-desktop);
  }
}

/* Dark scrim: strongest at the top (keeps the transparent header legible),
   fading downward — matches the original gradient. */
.hero__scrim {
  position: absolute;
  inset: 0 0 auto 0;
  height: 40rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
}

.hero__content {
  position: absolute;
  top: 26%;
  /*left: 50%;
  transform: translateX(-50%);*/
  width: 52%;
  max-width: 90rem;
}
.hero__title {
  color: var(--color-white);
  text-transform: capitalize;
}
.hero__subtitle {
  font-size: 1.3em;
  margin-top: 1.5rem;
}

@media (max-width: 991px) {
  .hero__content {
    width: 84%;
  }
}

/* Prev / next arrows */
.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-white);
  cursor: pointer;
  transition: background var(--ease);
}
.hero__arrow:hover {
  background: var(--color-brand-strong);
}
.hero__arrow--prev {
  left: 2rem;
}
.hero__arrow--next {
  right: 2rem;
}
.hero__arrow svg {
  width: 2.4rem;
  height: 2.4rem;
}

@media (max-width: 540px) {
  .hero__arrow {
    width: 4rem;
    height: 4rem;
  }
  .hero__arrow--prev {
    left: 0.6rem;
  }
  .hero__arrow--next {
    right: 0.6rem;
  }
}

@media (max-width: 540px) {
  .hero__slide {
    height: 42rem;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
  }
  .hero__scrim {
    height: 18rem;
    background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.85) 100%
    );
  }
  .hero__content {
    top: 8%;
    width: 86%;
  }
  .hero__title {
    font-size: 3.6rem;
  }
}
/*@media (max-width: 440px) {
  .hero__slide {
    height: 34rem;
  }
}*/

/* --------------------------------------------------------------------------
   About section
   Content is the "About us" page, laid out with the editor's Columns block.
   -------------------------------------------------------------------------- */
.about__body .wp-block-columns {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

/* Left column heading keeps the title font; body copy stays readable on dark. */
.about__body h1,
.about__body h2,
.about__body h3,
.about__body h4 {
  color: var(--color-heading);
}

/* Stack the columns on small screens (matches the editor's own breakpoint). */
@media (max-width: 781px) {
  .about__body .wp-block-columns {
    gap: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Rental cars
   -------------------------------------------------------------------------- */
.cars__grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(2, 1fr);
}

.car-card {
  text-align: center;
}

.car-card h4 {
  font-size: var(--fs-h5);
  margin-bottom: 0;
}
.car-card__image {
  position: relative;
  height: auto;
  overflow: auto;
  margin-bottom: 1.6rem;
}
.car-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter var(--ease);
}
.car-card__image img:hover {
  filter: brightness(1.2);
}

.car-card__price {
  color: var(--color-brand);
  margin: 0.8rem 0;
}

@media (min-width: 768px) {
  .cars__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .car-card h4 {
    font-size: var(--fs-h4);
  }
  .car-card__image {
    height: 44.5rem;
    overflow: hidden;
  }
  .car-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ease);
  }

  .car-card__image img:hover {
    transform: scale(1.1);
    filter: brightness(1);
  }
}

/* --------------------------------------------------------------------------
   Experience (video + copy) — dark band, laid out with the Columns block
   -------------------------------------------------------------------------- */
.experience {
  position: relative;
  overflow: hidden;
  padding-block: var(--section-space);
  color: var(--color-text-soft);
}

/* Video / images fill their column. */
.experience__body video,
.experience__body img,
.experience__body .wp-block-video,
.experience__body figure {
  width: 100%;
  height: auto;
  margin: 0;
  display: block;
}

/* Headings stay bright on the dark background. */
.experience__body h1,
.experience__body h2,
.experience__body h3,
.experience__body h4 {
  color: var(--color-heading);
}

.experience__body ul,
ol {
  margin: 1em;
  padding-inline-start: 3rem;
  list-style: disc;
}

/* Stack on small screens (matches the editor's own breakpoint). */
@media (max-width: 781px) {
  .experience {
    padding-block: var(--section-space);
  }
}

/* --------------------------------------------------------------------------
   Why choose us
   -------------------------------------------------------------------------- */
.why-choose {
  padding-block: var(--section-space);
}
.why-choose__body i {
  font-size: 2.4rem;
}
.why-choose h2 {
  padding-bottom: 1rem;
}
@media (min-width: 768px) {
  .why-choose h2 {
    padding-bottom: 2rem;
  }
}
@media (min-width: 1200px) {
  .why-choose h2 {
    padding-bottom: 5rem;
  }
}

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */
.services {
  color: var(--color-text-soft);
  padding-block: var(--section-space);
}
.services h2 {
  padding-bottom: 1rem;
}
@media (min-width: 768px) {
  .services h2 {
    padding-bottom: 2rem;
  }
}
@media (min-width: 1200px) {
  .services h2 {
    padding-bottom: 5rem;
  }
}

.services__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
  }
}

.service-card {
  position: relative;
  padding: 2.4rem;
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0.25rem 0.5rem rgba(0, 0, 0, 0.05),
    0 1rem 2.2rem rgba(0, 0, 0, 0.1);
}
.service-card__icon {
  position: absolute;
  top: 2.4rem;
  left: 2.4rem;
  width: 5rem;
  height: 5rem;
  padding: 0.7rem;
  background: var(--color-brand-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.service-card__body {
  padding-left: 7rem;
}
.service-card__body h4,
.service-card__body strong {
  color: var(--color-heading);
}

@media (min-width: 1024px) {
  .service-card__icon {
    width: 6rem;
    height: 6rem;
    padding: 0.8rem;
  }
  .service-card__body {
    padding-left: 9rem;
  }
}

/* --------------------------------------------------------------------------
   Why rent, not buy — full-bleed parallax image with dark overlay
   -------------------------------------------------------------------------- */
.why-rent-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: var(--section-space);
  /* Fixed background image (like the original site): the image stays pinned to
     the viewport while the content scrolls over it. --why-rent-bg is set inline
     from the page's Featured Image; the solid colour is the fallback. */
  background-color: var(--color-surface-dark);
  background-image: var(--why-rent-bg);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
/* Layer order: fixed background (0) -> dark overlay (1) -> content (2) */
/* background-attachment: fixed is unreliable on mobile (iOS especially), so
   fall back to a normal scrolling background on small screens. */
@media (max-width: 768px) {
  .why-rent-section {
    background-attachment: scroll;
  }
}
.why-rent-section .overlay {
  z-index: 1;
}
.why-rent-section .container {
  position: relative;
  z-index: 2;
}

.why-rent {
  width: 100%;
  margin: 0 auto;
}
.why-rent h2 {
  padding-bottom: 1rem;
}
.why-rent-content {
  padding-left: 1.2rem;
}
/* Numbered rows inside the CMS content */
.col-flex {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.col-flex h1 {
  align-self: flex-start;
  color: var(--color-brand);
  font-family: var(--body-font);
  font-size: 7.6rem;
  font-weight: 500;
  font-style: italic;
}
@media (min-width: 540px) {
  .why-rent {
    width: 100%;
  }
}
@media (min-width: 768px) {
  .why-rent {
    width: 86%;
  }
  .why-rent h2 {
    padding-bottom: 2rem;
  }
}
@media (min-width: 1200px) {
  .why-rent {
    width: 56%;
  }
  .why-rent h2 {
    padding-bottom: 5rem;
  }
  .why-rent-content {
    padding-left: 3rem;
  }
  .col-flex {
    gap: var(--gap);
  }
}

.why-rent-content hr {
  margin: 2rem 0 3.6rem;
}

/* --------------------------------------------------------------------------
   Reviews carousel
   -------------------------------------------------------------------------- */
.reviews {
  margin-top: 5rem;
  overflow: hidden;
}

/* Reviews heading: "…saying | about us" — one line on mobile, split on tablet+ */
.reviews-section h2 .h2-break {
  display: inline;
}
@media (min-width: 768px) {
  .reviews-section h2 .h2-break {
    display: block;
  }
}

.reviews__viewport {
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y; /* vertical page scroll stays native; JS handles horizontal */
  -webkit-user-select: none;
  user-select: none;
}
.reviews__viewport.is-dragging {
  cursor: grabbing;
}
.reviews__track {
  display: flex;
  will-change: transform;
  transition: transform var(--ease-slow);
}
.reviews__track img {
  -webkit-user-drag: none;
  user-drag: none;
}

.review-card {
  flex: 0 0 100%;
  padding: 0 4rem 4rem;
  border-left: 1px solid #353535;
}
.review-card:first-child {
  border-left: none;
}

@media (min-width: 768px) {
  .review-card {
    flex-basis: 50%;
  }
}
@media (min-width: 992px) {
  .review-card {
    flex-basis: 33.3333%;
  }
}

.review-card__stars i {
  margin: 0 0.2rem;
  font-size: 1.6rem;
  color: var(--color-brand);
}
.review-card__client {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.6rem;
}
.review-card__client h6 {
  margin: 0;
  color: var(--color-brand);
}
.review-card__flag {
  max-width: 2rem;
  height: 2rem;
}
.review-card__flag img {
  width: 100%;
  height: auto;
  padding-bottom: 0.5rem;
}
.review-card__role {
  color: var(--color-text-soft);
}

@media (max-width: 540px) {
  .review-card {
    border-left: none;
    padding: 0 2rem 3rem;
  }
}

/* --------------------------------------------------------------------------
   Photo gallery (masonry via CSS columns)
   -------------------------------------------------------------------------- */
.gallery h2 {
  padding-bottom: 1rem;
}
@media (min-width: 768px) {
  .gallery h2 {
    padding-bottom: 2rem;
  }
}
@media (min-width: 1200px) {
  .gallery h2 {
    padding-bottom: 5rem;
  }
}

.gallery__grid {
  columns: 300px;
  column-gap: 2em;
}
.gallery__grid li {
  margin-bottom: 1.3em;
  break-inside: avoid;
  overflow: hidden;
}
.gallery__grid img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--ease);
}
.gallery__grid img:hover {
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact {
  padding: 0;
}
.contact__grid {
  display: grid;
  gap: var(--gap);
  align-items: stretch;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .contact__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Text side gets vertical breathing room; the map stays flush to the edges. */
.contact__grid > .container {
  padding-block: var(--section-space);
}

.contact__map {
  align-self: stretch;
}
.contact__map iframe {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 45rem;
  border: 0;
  display: block;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}
.contact-list i {
  font-size: 2.8rem;
  color: var(--color-brand);
  line-height: 1;
}
.contact-list__icon {
  width: 2.8rem;
  color: var(--color-brand);
}

.contact-tel a {
  font-size: 2.6rem;
  font-weight: 500;
}
.contact-tel a:hover {
  text-decoration: underline;
}

.contact-email a {
  color: var(--color-text);
}
.contact-email a:hover {
  color: var(--color-brand);
}

/* Social buttons */
.social {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.4rem;
}
.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  color: var(--color-white);
  background: var(--color-brand-strong);
}
.social a i {
  font-size: 2.6rem;
}
.social a:hover {
  color: var(--color-black);
  background: var(--color-white);
}

/* =========================================================================
   Back-to-top button
   -------------------------------------------------------------------------
   Injected by main.js on every page. Matches the hero arrows: a round,
   gold-accented control. Hidden until the visitor scrolls past ~400px
   (toggled via the .is-visible class), and respects reduced-motion.
   ========================================================================= */
.to-top {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--color-brand);
  cursor: pointer;
  opacity: 0;
  transform: translateY(1.2rem);
  pointer-events: none;
  transition:
    opacity var(--ease),
    transform var(--ease),
    background var(--ease),
    color var(--ease);
}
.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.to-top:hover {
  background: var(--color-brand-strong);
  color: var(--color-white);
}
.to-top svg {
  width: 2.2rem;
  height: 2.2rem;
}

@media (max-width: 540px) {
  .to-top {
    width: 4.2rem;
    height: 4.2rem;
    right: 1.2rem;
    bottom: 1.2rem;
  }
  .to-top svg {
    width: 1.9rem;
    height: 1.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: opacity var(--ease);
    transform: none;
  }
  .to-top.is-visible {
    transform: none;
  }
}
