/* Reagan Equine — site styles */

:root {
  --green: #0f2c24;
  --green-mid: #1a3c34;
  --green-soft: #243f36;
  --cream: #f8f1e3;
  --cream-dark: #efe6d4;
  --gold: #c5a46e;
  --gold-dark: #a88a52;
  --ink: #1f1f1f;
  --muted: #5a564e;
}

html {
  scroll-behavior: smooth;
}

body {
  font-feature-settings: "kern", "ss01";
  color: var(--ink);
  background: var(--cream);
}

.font-display {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

/* Hero — clinic exterior */
.hero {
  /* Tall banner so more of the clinic photo shows */
  min-height: clamp(30rem, 78vh, 58rem);
  height: min(84vw, 58rem);
  max-height: 58rem;
}

.hero-image {
  /* Fill the frame without letterboxing; keep flags + entrance in view */
  object-fit: cover;
  object-position: 36% 42%;
}

@media (min-width: 640px) {
  .hero-image {
    object-position: 40% 40%;
  }
}

@media (min-width: 1024px) {
  .hero {
    min-height: clamp(34rem, 84vh, 62rem);
    height: min(74vw, 62rem);
    max-height: 62rem;
  }

  .hero-image {
    object-position: 42% 38%;
  }
}

/* Section labels */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.section-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--green);
}

/* Nav */
.nav-link {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--gold-dark);
}

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

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

/* Desktop nav dropdowns (Services / Team / Forms)
   Opened via .is-open only (JS) — no CSS :hover open, so the menu
   cannot flicker closed while the cursor travels to a link. */

/* Stretch the desktop link row to the full bar height */
#navbar .gap-x-8 {
  align-self: stretch;
}

.nav-dropdown {
  position: relative;
  /* Stretch full nav height so the hit target reaches the menu edge */
  align-self: stretch;
  display: flex;
  align-items: center;
}

.nav-dropdown-trigger {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  /* Extra vertical padding enlarges the easy click/hover zone */
  padding: 1.1rem 0.15rem;
  margin: 0;
}

.nav-dropdown-chevron {
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-panel {
  position: absolute;
  /* Flush under the nav item — no dead gap to cross */
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 15.5rem;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid #e8dfc9;
  border-radius: 0.9rem;
  box-shadow:
    0 12px 28px -10px rgba(15, 44, 36, 0.18),
    0 4px 10px -6px rgba(15, 44, 36, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.12s ease,
    transform 0.12s ease,
    visibility 0.12s ease;
  z-index: 60;
}

/* Only JS .is-open (and keyboard focus-within) show the panel */
.nav-dropdown.is-open .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  color: #3f3f3f;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  white-space: nowrap;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible {
  background: var(--cream);
  color: var(--green);
  outline: none;
}

.nav-dropdown-item-all {
  margin-top: 0.2rem;
  border-top: 1px solid #e8dfc9;
  border-radius: 0 0 0.6rem 0.6rem;
  color: var(--green);
  font-weight: 600;
}

/* Staff category pages */
.page-hero {
  background:
    linear-gradient(135deg, var(--green) 0%, var(--green-mid) 55%, var(--green-soft) 100%);
  color: #fff;
  padding: 3.5rem 0 3rem;
}

.page-hero .section-label {
  color: var(--gold);
}

.staff-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Center the category bubbles on team place-card pages */
.staff-cat-nav[aria-label="Team categories"] {
  justify-content: center;
}

.staff-cat {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid #e8dfc9;
  background: #fff;
  color: #3f3f3f;
  font-size: 0.8125rem;
  font-weight: 600;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.staff-cat:hover {
  background: var(--cream);
  color: var(--green);
  border-color: #d4c9aa;
}

.staff-cat.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Full-size staff cards on category pages (not the compact homepage row) */
.staff-page-grid .team-photo {
  aspect-ratio: 4 / 5;
}

.staff-page-grid .team-card {
  border-radius: 1.25rem;
}

/* Veterinarian cards ~25% smaller than default staff cards */
.staff-page-grid--compact {
  max-width: 60rem; /* 75% of max-w-7xl (80rem) */
  margin-inline: auto;
  gap: 1.15rem;
}

.staff-page-grid--compact .team-card {
  border-radius: 1rem;
}

.staff-page-grid--compact .team-card > div {
  padding: 0.95rem 1rem 1.05rem;
}

.staff-page-grid--compact .team-card h2 {
  font-size: 1rem; /* was text-lg (~1.125rem) */
  line-height: 1.35;
}

.staff-page-grid--compact .team-card p.text-xs {
  font-size: 0.65rem;
}

.staff-page-grid--compact .team-card p.mt-3 {
  margin-top: 0.55rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

#navbar.scrolled {
  box-shadow:
    0 1px 0 0 rgba(15, 44, 36, 0.06),
    0 8px 24px -8px rgba(15, 44, 36, 0.12);
}

/* Service cards */
.service-card {
  background: #fff;
  border: 1px solid rgba(197, 164, 110, 0.18);
  border-radius: 1.25rem;
  padding: 1.75rem;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s ease,
    border-color 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(197, 164, 110, 0.4);
  box-shadow:
    0 20px 25px -5px rgb(15 44 36 / 0.08),
    0 8px 10px -6px rgb(15 44 36 / 0.05);
}

.service-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 44, 36, 0.06);
  color: var(--green);
  margin-bottom: 1.15rem;
}

/* Team cards */
.team-card {
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(197, 164, 110, 0.15);
  box-shadow: 0 1px 2px rgb(15 44 36 / 0.04);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 25px -5px rgb(15 44 36 / 0.1),
    0 8px 10px -6px rgb(15 44 36 / 0.06);
}

.team-photo {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  object-position: top center;
  background: var(--cream-dark);
}

/* Compact 6-across veterinarian row */
.vets-grid .team-card {
  border-radius: 0.85rem;
}

.vets-grid .team-photo {
  aspect-ratio: 3 / 4;
}

.team-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, var(--green) 0%, var(--green-mid) 55%, var(--green-soft) 100%);
  color: var(--gold);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Social feeds (Facebook + Instagram) */
.fb-feed-card,
.ig-feed-card {
  min-height: 320px;
}

.fb-feed-frame {
  width: 100%;
  min-height: 480px;
  display: flex;
  justify-content: center;
}

.fb-feed-frame iframe,
.ig-feed-frame iframe {
  display: block;
  background: #fff;
  border-radius: 0.75rem;
}

.ig-feed-frame {
  position: relative;
  width: 100%;
  min-height: 480px;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}

.ig-feed-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(240, 148, 51, 0.12), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(188, 24, 136, 0.1), transparent 45%),
    #fff;
  border-radius: 1rem;
  text-align: center;
  z-index: 1;
}

.ig-feed-fallback-inner {
  max-width: 20rem;
}

.ig-feed-icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  box-shadow: 0 10px 24px -8px rgba(188, 24, 136, 0.45);
}

/* Forms */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #3f3f3f;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #d4c9aa;
  background: #fff;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 44, 36, 0.1);
}

/* Modal */
#success-modal.flex {
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

img {
  max-width: 100%;
  height: auto;
}

/* Brand flag video (About) — portrait frame so both flags show fully */
#flag-video {
  object-fit: cover;
  object-position: center 40%;
}

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

  .service-card,
  .team-card,
  .nav-link::after {
    transition: none;
  }
}
