﻿/* ==========================================================================
   Reusable UI components
   Layout lives in Tailwind utility classes; these classes hold the
   brand-specific look so it stays consistent across sections.
   ========================================================================== */

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: Lato, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--c-gold);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}
.eyebrow--center::after {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.gold-rule {
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;               /* comfortable touch target */
  padding: 0 2rem;
  font-family: Lato, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out),
              border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out),
              box-shadow 0.4s var(--ease-out);
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.4s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn .wa-icon { width: 20px; height: 20px; }
.btn:hover .wa-icon { transform: none; }

.btn--primary {
  background: var(--c-green);
  color: var(--c-cream);
  box-shadow: 0 12px 30px -12px rgba(31, 58, 48, 0.6);
}
.btn--primary:hover {
  background: var(--c-gold-dark);
  transform: translateY(-2px);
}

.btn--gold {
  background: linear-gradient(135deg, var(--c-gold-light), var(--c-gold) 45%, var(--c-gold-dark));
  color: var(--c-green-deep);
  box-shadow: 0 12px 30px -12px rgba(154, 112, 56, 0.7);
}
.btn--gold:hover { transform: translateY(-2px); filter: brightness(1.05); }

.btn--outline {
  border: 1px solid var(--c-gold);
  color: var(--c-green);
  background: transparent;
}
.btn--outline:hover {
  background: var(--c-gold);
  color: var(--c-cream);
}

.link-underline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 4px;
  color: var(--c-green);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--c-gold);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.link-underline:hover::after { transform: scaleX(0.4); }

/* ---------- Navigation ---------- */
.site-nav {
  height: var(--nav-h);
  background: rgba(251, 247, 239, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(196, 154, 90, 0.25);
  transition: box-shadow 0.4s ease, background-color 0.4s ease;
}
.site-nav.is-scrolled {
  background: rgba(251, 247, 239, 0.95);
  box-shadow: 0 10px 30px -18px rgba(23, 32, 28, 0.35);
}

.nav-link {
  position: relative;
  padding: 0.5rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-green);
  transition: color 0.3s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: 0;
  height: 1px;
  background: var(--c-gold);
  transition: left 0.4s var(--ease-out), right 0.4s var(--ease-out);
}
.nav-link:hover { color: var(--c-gold-dark); }
.nav-link:hover::after { left: 0; right: 0; }

/* Mobile menu: full-height sheet sliding from the top */
.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--c-cream);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), visibility 0s linear 0.4s;
  overflow-y: auto;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), visibility 0s;
}
.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(196, 154, 90, 0.25);
  font-family: "Playfair Display", serif;
  font-size: 1.6rem;
  color: var(--c-green);
}
.mobile-menu__link svg { width: 20px; height: 20px; color: var(--c-gold); }

/* ---------- Icon badge (services, contact, footer socials) ---------- */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(196, 154, 90, 0.5);
  color: var(--c-gold-dark);
  background: radial-gradient(circle at 30% 25%, #fff, var(--c-cream) 70%);
  transition: background 0.5s var(--ease-out), color 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
}
.icon-badge svg { width: 24px; height: 24px; }
.icon-badge--sm { width: 44px; height: 44px; }
.icon-badge--sm svg { width: 18px; height: 18px; }
.icon-badge--dark {
  background: rgba(255, 255, 255, 0.04);
  color: var(--c-gold-light);
  border-color: rgba(196, 154, 90, 0.4);
}

/* ---------- Project / gallery card ---------- */
.project-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--c-tan);
  text-align: left;
}
.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.project-card__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem;
  color: var(--c-cream);
  background: linear-gradient(to top, rgba(20, 40, 32, 0.92), rgba(20, 40, 32, 0.4) 60%, transparent);
  transition: padding 0.5s var(--ease-out);
}
.project-card__meta {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-gold-light);
}
.project-card__count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--c-green);
  background: rgba(251, 247, 239, 0.9);
  border-radius: 999px;
}
.project-card__count svg { width: 14px; height: 14px; }

@media (hover: hover) {
  .project-card:hover img { transform: scale(1.06); }
  .project-card:hover .project-card__caption { padding-bottom: 2rem; }
}

/* ---------- Form fields ---------- */
.field { position: relative; }

.field__label {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-green);
}
.field__label .req { color: var(--c-gold-dark); }
.field__hint {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(23, 32, 28, 0.45);
}

.field__input {
  width: 100%;
  min-height: 50px;
  padding: 0 1rem;
  font-size: 1rem;                 /* 16px prevents iOS zoom-on-focus */
  color: var(--c-ink);
  background: #fff;
  border: 1px solid rgba(154, 112, 56, 0.28);
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(23, 32, 28, 0.04);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
textarea.field__input {
  min-height: 128px;
  padding: 0.85rem 1rem;
  line-height: 1.55;
  resize: vertical;
}
.field__input::placeholder { color: rgba(23, 32, 28, 0.38); }
.field__input:hover { border-color: rgba(154, 112, 56, 0.5); }
.field__input:focus {
  outline: none;
  border-color: var(--c-gold-dark);
  box-shadow: 0 0 0 3px rgba(196, 154, 90, 0.22);
}
.field__input[aria-invalid="true"] {
  border-color: #b4442f;
  background: #fffaf8;
}
.field__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 68, 47, 0.16); }
.field__input:read-only { background: #faf7f1; }

.field__error {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #a53b27;
}
.field__error.is-visible { display: flex; }
.field__error svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Banner for submission errors */
.form-alert {
  display: none;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #7d2c1d;
  background: #fbefea;
  border: 1px solid rgba(180, 68, 47, 0.25);
  border-left: 3px solid #b4442f;
  border-radius: 4px;
}
.form-alert.is-visible { display: flex; animation: alert-in 0.35s var(--ease-out); }
.form-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-4px); } }

/* Button loading state */
.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading .btn__icon { display: none; }
.btn:disabled { cursor: progress; opacity: 0.85; transform: none; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Input with a fixed prefix, e.g. +91 country code */
.field__group { position: relative; }
.field__prefix {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  padding-right: 0.7rem;
  border-right: 1px solid rgba(154, 112, 56, 0.3);
  font-size: 1rem;
  line-height: 1.2;
  color: var(--c-green);
  pointer-events: none;
}
.field__group .field__input { padding-left: 4.1rem; }

/* ---------- WhatsApp ----------
   Kept in the site palette: forest-green disc, gold glyph and ring.
   The glyph comes from the #icon-whatsapp sprite in index.html. */
.wa-icon { display: block; fill: currentColor; }

.wa-fab {
  position: fixed;
  z-index: 35;                      /* below the header (50) and mobile menu (40) */
  right: max(1.1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--c-gold-light);
  background: linear-gradient(145deg, var(--c-green), var(--c-green-deep));
  border-radius: 50%;
  box-shadow:
    0 0 0 1.5px var(--c-gold),
    0 10px 20px -8px rgba(20, 40, 32, 0.55);
  /* Hidden state: low and small. Only transform + opacity animate, so it runs on the GPU
     compositor and stays smooth while the page is scrolling. */
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 32px, 0) scale(0.7);
  will-change: transform, opacity;
  backface-visibility: hidden;
  /* EXIT: short and accelerating, so it leaves quickly and quietly */
  transition:
    transform 0.4s cubic-bezier(0.5, 0, 0.9, 0.4),
    opacity 0.3s ease-in,
    color 0.35s ease,
    visibility 0s linear 0.4s;
}
.wa-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  /* ENTRY: longer, decelerating. Where supported the easing is a soft spring
     (see --wa-spring); otherwise it falls back to a smooth ease-out. */
  --wa-spring: cubic-bezier(0.16, 1, 0.3, 1);
  transition:
    transform 1.1s var(--wa-spring),
    opacity 0.6s ease-out,
    color 0.35s ease,
    visibility 0s;
}
@supports (transition-timing-function: linear(0, 1)) {
  .wa-fab.is-visible {
    --wa-spring: linear(0, 0.0407, 0.1381, 0.2631, 0.3957, 0.5231, 0.6377, 0.7356, 0.816, 0.8795, 0.9277, 0.963, 0.9875, 1.0036, 1.0132, 1.0182, 1.0199, 1.0194, 1.0177, 1.0153, 1.0126, 1.0101, 1.0077, 1.0057, 1.004, 1.0027, 1.0016, 1.0009, 1.0003, 1, 0.9998, 0.9997, 1);
  }
}
.wa-fab .wa-icon { width: 28px; height: 28px; }
/* Hover tint is a cross-fading overlay (gradients can't be transitioned directly) */
.wa-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--c-gold-light), var(--c-gold));
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: -1;
}
.wa-fab { isolation: isolate; }
.wa-fab:hover::before { opacity: 1; }
.wa-fab:hover { color: var(--c-green-deep); }

/* One soft gold ring after it has settled, to be noticed without nagging */
.wa-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--c-gold);
  opacity: 0;
  pointer-events: none;
}
.wa-fab.is-visible::after { animation: wa-ring 1.8s 0.9s ease-out 1; }
@keyframes wa-ring {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.7); }
}

/* Tooltip label (desktop hover / keyboard focus) */
.wa-fab__label {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  padding: 0.55rem 0.9rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-cream);
  background: var(--c-green-deep);
  border: 1px solid rgba(196, 154, 90, 0.5);
  border-radius: 999px;
  opacity: 0;
  transform: translate(8px, -50%);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
  pointer-events: none;
}
@media (hover: hover) {
  .wa-fab:hover .wa-fab__label,
  .wa-fab:focus-visible .wa-fab__label { opacity: 1; transform: translate(0, -50%); }
}

/* Reduced motion: no movement, just a gentle fade in and out */
@media (prefers-reduced-motion: reduce) {
  .wa-fab,
  .wa-fab.is-visible { transform: none; }
  .wa-fab { transition: opacity 0.5s ease, visibility 0s linear 0.5s; }
  .wa-fab.is-visible { transition: opacity 0.7s ease, visibility 0s; }
  .wa-fab.is-visible::after { animation: none; }
}

/* ---------- Date field + calendar (Flatpickr, themed) ---------- */
.field__wrap { position: relative; }
.field__input--date { padding-right: 2.9rem; cursor: pointer; }
.field__input--date:read-only { background: #fff; }
.field__input--date:read-only:hover { border-color: rgba(154, 112, 56, 0.5); }
.field__icon {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--c-gold-dark);
  pointer-events: none;
}
.field__note {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(23, 32, 28, 0.55);
}

.flatpickr-calendar {
  font-family: Lato, sans-serif;
  background: var(--c-cream);
  border: 0;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(196, 154, 90, 0.55), 0 30px 60px -20px rgba(20, 40, 32, 0.5);
}
.flatpickr-calendar.arrowTop::before { border-bottom-color: rgba(196, 154, 90, 0.55); }
.flatpickr-calendar.arrowTop::after { border-bottom-color: var(--c-cream); }
.flatpickr-calendar.arrowBottom::before { border-top-color: rgba(196, 154, 90, 0.55); }
.flatpickr-calendar.arrowBottom::after { border-top-color: var(--c-cream); }

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  color: var(--c-green);
  fill: var(--c-green);
}
.flatpickr-current-month {
  padding-top: 9px;
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  font-weight: 600;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { font-family: "Playfair Display", serif; font-weight: 600; }
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month { color: var(--c-gold-dark); fill: var(--c-gold-dark); }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--c-green); }
.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,
.flatpickr-months .flatpickr-next-month.flatpickr-disabled { display: none; }

span.flatpickr-weekday {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-gold-dark);
  background: transparent;
}

.flatpickr-day {
  color: var(--c-ink);
  font-weight: 400;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.flatpickr-day:hover,
.flatpickr-day:focus { background: rgba(196, 154, 90, 0.2); border-color: transparent; }
.flatpickr-day.today { border-color: var(--c-gold); }
.flatpickr-day.today:hover,
.flatpickr-day.today:focus { background: rgba(196, 154, 90, 0.2); border-color: var(--c-gold); color: var(--c-ink); }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus,
.flatpickr-day.selected.today {
  background: var(--c-green);
  border-color: var(--c-green);
  color: var(--c-cream);
  font-weight: 700;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover { color: rgba(23, 32, 28, 0.28); background: transparent; cursor: not-allowed; }
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: rgba(23, 32, 28, 0.35); }
