/* ============================================
   JJC Kitchens — custom refinements
   Tailwind handles layout. This file covers
   animations, navbar, accordion, focus, and
   polish that is easier in plain CSS.
   ============================================ */

:root {
  --navy: #1b365d;
  --navy-dark: #12243f;
  --gold: #c4a35a;
  --gold-dark: #a8873e;
  --cream: #f7f3ec;
  --sand: #ede6d9;
  --charcoal: #2c2a26;
  --muted: #6b655c;
  --header-h: 5.25rem;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  color: var(--charcoal);
  background: #fbfaf7;
}

/* Visible keyboard focus */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Header ---------- */
.site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(27, 54, 93, 0.08);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

.mobile-panel {
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s ease, visibility 0.35s ease;
}

.mobile-panel.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.mobile-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.icon-btn .icon-close {
  display: none;
}

.icon-btn.is-open .icon-open {
  display: none;
}

.icon-btn.is-open .icon-close {
  display: block;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 24px rgba(27, 54, 93, 0.18);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(27, 54, 93, 0.22);
}

.btn-gold {
  background: var(--gold);
  color: var(--navy-dark);
  box-shadow: 0 10px 24px rgba(196, 163, 90, 0.28);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-gold:hover {
  background: var(--gold-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-outline:hover {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}

/* ---------- Cards ---------- */
.service-card,
.reason-card,
.testimonial-card,
.faq-item {
  box-shadow: 0 10px 30px rgba(27, 54, 93, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover,
.reason-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(27, 54, 93, 0.12);
}

.gallery-item img {
  transition: transform 0.7s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ---------- Process line ---------- */
.process-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 2.15rem;
  left: calc(50% + 2.2rem);
  width: calc(100% - 4.4rem);
  height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(196, 163, 90, 0.15));
}

@media (max-width: 767px) {
  .process-step:not(:last-child)::after {
    display: none;
  }
}

/* ---------- FAQ ---------- */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s ease;
}

.faq-answer > div {
  overflow: hidden;
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-icon {
  transition: transform 0.25s ease;
}

/* ---------- Form ---------- */
.field-error {
  color: #9b2c2c;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  display: none;
}

.field-error.is-visible {
  display: block;
}

.input-error {
  border-color: #c53030 !important;
}

.form-success {
  display: none;
}

.form-success.is-visible {
  display: block;
}

.form-shell.is-sent .contact-form {
  display: none;
}

/* ---------- Hero overlay ---------- */
.hero-overlay {
  background:
    linear-gradient(90deg, rgba(18, 36, 63, 0.78) 0%, rgba(18, 36, 63, 0.42) 52%, rgba(18, 36, 63, 0.18) 100%),
    linear-gradient(180deg, rgba(18, 36, 63, 0.2) 0%, rgba(18, 36, 63, 0.45) 100%);
}

@media (max-width: 767px) {
  .hero-overlay {
    background:
      linear-gradient(180deg, rgba(18, 36, 63, 0.55) 0%, rgba(18, 36, 63, 0.78) 100%);
  }
}

/* ---------- Utilities ---------- */
.gold-rule {
  width: 3.5rem;
  height: 2px;
  background: var(--gold);
}

.section-label {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold-dark);
  font-weight: 600;
}

/* Prevent accidental horizontal overflow */
img,
video,
iframe {
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .service-card,
  .reason-card,
  .gallery-item img,
  .btn-primary,
  .btn-gold,
  .mobile-panel,
  .faq-answer,
  .faq-icon {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
