/* ========================================================================== */
/* Giovanni's Tree Service — HOME V32 premium refinement + service flip cards */
/* Layered over V31. Front faces remain visually unchanged.                    */
/* ========================================================================== */

:root {
  --v32-strip-clearance: 18px;
  --v32-flip-speed: 720ms;
  --v32-flip-ease: cubic-bezier(.2,.72,.18,1);
}

/* Stronger service statement without introducing a new color family. */
.hero-copy .hero-service-note {
  position: relative;
  isolation: isolate;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 9px 14px 9px 17px !important;
  border: 1px solid rgba(242, 165, 26, 0.76) !important;
  border-left-width: 4px !important;
  border-radius: 9px !important;
  color: #fffaf0 !important;
  background:
    linear-gradient(90deg, rgba(139, 90, 43, 0.82), rgba(15, 59, 29, 0.96) 62%, rgba(4, 17, 10, 0.98)) !important;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  font-size: 12.5px !important;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.54);
}

.hero-copy .hero-service-note::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border: 1px solid rgba(255, 250, 240, 0.08);
  border-radius: 6px;
}

/* A short viewport needs a denser hero, not a smaller logo. */
@media (min-width: 901px) and (max-height: 760px) {
  .hero-copy {
    align-content: start !important;
    gap: 8px !important;
    padding: 18px 24px calc(var(--v31-strip-height) + var(--v32-strip-clearance)) 45px !important;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 3.55vw, 48px) !important;
    line-height: 1 !important;
  }

  .hero-copy p:not(.hero-service-note) {
    font-size: 13px !important;
    line-height: 1.48 !important;
  }

  .hero-actions .cta {
    min-height: 54px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .hero-trust > span {
    min-height: 40px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
}

/* Gallery: a measured +12px increase at each breakpoint. */
.gallery-card,
.gallery-large,
.video-card {
  height: 234px !important;
  min-height: 234px !important;
}

.video-frame {
  min-height: 234px !important;
}

/* Premium flip architecture. The front reproduces V31 dimensions and styling. */
.service-grid .service-card.service-flip-card,
[data-theme="dark"] .service-grid .service-card.service-flip-card,
[data-theme="light"] .service-grid .service-card.service-flip-card {
  position: relative;
  display: block !important;
  min-height: 218px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  perspective: 1300px;
  cursor: pointer;
  outline: none;
}

.service-flip-inner {
  position: relative;
  width: 100%;
  min-height: 218px;
  transform-style: preserve-3d;
  transition: transform var(--v32-flip-speed) var(--v32-flip-ease);
  will-change: transform;
}

.service-face {
  position: absolute;
  inset: 0;
  min-height: 218px;
  border: 1px solid var(--service-card-border);
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.service-face-front {
  display: grid;
  grid-template-rows: 108px auto 1fr;
  justify-items: center;
  align-content: start;
  gap: 9px;
  padding: 17px 15px 16px;
  text-align: center;
  background: var(--service-card-bg);
  box-shadow: 0 8px 20px rgba(7, 27, 16, 0.07);
}

.service-face-front::after,
.service-face-back::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(242, 165, 26, 0.14);
  border-radius: 8px;
  pointer-events: none;
}

.service-face-back {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 8px;
  padding: 18px 17px 15px;
  transform: rotateY(180deg);
  text-align: left;
  color: #fffaf0;
  background:
    radial-gradient(circle at 88% 10%, rgba(242, 165, 26, 0.24), transparent 27%),
    linear-gradient(145deg, #123f21 0%, #071b10 58%, #04110a 100%);
  box-shadow: 0 18px 34px rgba(4, 17, 10, 0.22);
}

.service-face-back::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--v31-green), var(--v31-gold), var(--v31-green));
}

.service-face-back .service-back-kicker {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(242, 165, 26, 0.45);
  border-radius: 999px;
  color: #ffe3a5 !important;
  background: rgba(242, 165, 26, 0.1);
  font-family: var(--font-body);
  font-size: 9.5px !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1 !important;
  text-transform: uppercase;
}

.service-face-back strong {
  color: #fffaf0 !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px !important;
  line-height: 1.1 !important;
}

.service-face-back p {
  position: relative;
  z-index: 1;
  margin: 0;
  overflow: auto;
  color: rgba(255, 250, 240, 0.84);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.42;
  scrollbar-width: thin;
}

.service-flip-back {
  position: relative;
  z-index: 2;
  min-height: 30px;
  width: fit-content;
  border: 1px solid rgba(242, 165, 26, 0.62);
  border-radius: 999px;
  padding: 5px 12px;
  color: #fffaf0;
  background: rgba(242, 165, 26, 0.14);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.service-flip-back:hover,
.service-flip-back:focus-visible {
  color: #071b10;
  background: #f2a51a;
  outline: none;
}

.service-flip-card:focus-visible .service-face-front,
.service-flip-card:focus-within .service-face-back {
  outline: 3px solid rgba(242, 165, 26, 0.76);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .service-flip-card:hover .service-flip-inner {
    transform: rotateY(180deg);
  }
}

.service-flip-card.is-flipped .service-flip-inner {
  transform: rotateY(180deg);
}

/* Keep the approved icon face exactly as V31. */
.service-grid .service-face-front img {
  width: 104px !important;
  height: 104px !important;
  max-width: 100%;
  object-fit: contain !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  filter: var(--service-icon-filter) !important;
}

.service-grid .service-flip-card:hover {
  transform: none !important;
  box-shadow: none !important;
}

.service-grid .service-flip-card:hover img {
  transform: none !important;
}

@media (max-width: 900px) {
  .gallery-card,
  .gallery-large,
  .video-card {
    height: 208px !important;
    min-height: 208px !important;
  }

  .video-frame {
    min-height: 208px !important;
  }

  .service-grid .service-card.service-flip-card,
  .service-flip-inner,
  .service-face {
    min-height: 190px !important;
  }

  .service-face-front {
    grid-template-rows: 80px auto 1fr;
    gap: 7px;
    padding: 13px 10px 14px;
  }

  .service-grid .service-face-front img {
    width: 74px !important;
    height: 74px !important;
  }

  .service-face-back {
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
    padding: 13px 12px 11px;
  }

  .service-face-back strong {
    padding-right: 31px;
    font-size: 15px !important;
  }

  .service-face-back p {
    padding-right: 2px;
    font-size: 10.35px;
    line-height: 1.28;
  }

  .service-flip-back {
    position: absolute;
    right: 9px;
    top: 9px;
    width: 27px;
    min-height: 27px;
    overflow: hidden;
    padding: 0;
    border-radius: 50%;
    color: transparent;
    font-size: 0;
  }

  .service-flip-back::before {
    content: "↩";
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #fffaf0;
    font-size: 15px;
    line-height: 1;
  }
}

@media (max-width: 520px) {
  .gallery-card,
  .gallery-large,
  .video-card {
    height: 188px !important;
    min-height: 188px !important;
  }

  .video-frame {
    min-height: 188px !important;
  }

  .service-grid .service-card.service-flip-card,
  .service-flip-inner,
  .service-face {
    min-height: 184px !important;
  }

  .service-face-front {
    grid-template-rows: 72px auto 1fr;
    gap: 6px;
  }

  .service-grid .service-face-front img {
    width: 68px !important;
    height: 68px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-flip-inner {
    transition-duration: 1ms !important;
  }
}
