/* ═══════════════════════════════════════════════════════════════
   Vista Realty — WordPress glue styles
   Loaded last (after vista-tailwind.css → tw-patch.css →
   vista-cards.css). Three jobs:
     1. Tailwind utilities used by the templates but missing from the
        compiled demo build (same convention as tw-patch.css).
     2. Component styles ported from the demo pages' inline <style>
        blocks (filter bar, gallery, spec chips, forms, pagination…).
     3. WordPress-specific fixes (admin bar, block patterns helpers,
        Gutenberg content typography).
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Missing Tailwind utilities ─────────────────────────────── */
.sticky { position: sticky; }
.mt-1 { margin-top: 0.25rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-8 { margin-top: 2rem; }
.hover\:text-gold-dark:hover { color: hsl(var(--gold-dark)); }
.pb-24 { padding-bottom: 6rem; }
.pt-28 { padding-top: 7rem; }
.top-3 { top: 0.75rem; }
.h-48 { height: 12rem; }
.h-60 { height: 15rem; }
.h-64 { height: 16rem; }
.h-72 { height: 18rem; }
.h-96 { height: 24rem; }
.h-\[320px\] { height: 320px; }
.h-\[420px\] { height: 420px; }
.h-\[500px\] { height: 500px; }
.max-h-\[500px\] { max-height: 500px; }
.min-h-\[360px\] { min-height: 360px; }
.top-24 { top: 6rem; }
.top-28 { top: 7rem; }
.border-gold { border-color: hsl(var(--gold)); }
.border-gold-dark { border-color: hsl(var(--gold-dark)); }

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:min-w-\[200px\] { min-width: 200px; }
}
@media (min-width: 768px) {
  .md\:h-\[500px\] { height: 500px; }
}
@media (min-width: 1024px) {
  .lg\:order-1 { order: 1; }
  .lg\:order-2 { order: 2; }
  .lg\:sticky { position: sticky; }
  .lg\:top-28 { top: 7rem; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:grid-cols-\[2fr_1fr\] { grid-template-columns: 2fr 1fr; }
  .lg\:pt-16 { padding-top: 4rem; }
}

/* Header/footer brand logo lockup (real logo files, not the old
   text-only wordmark) — matches vista-realty-demo-v2's sizing. */
.brand-logo { display: block; height: 20px; width: auto; }
.brand-logo-footer { display: block; max-height: 200px; width: auto; margin-bottom: 0.5rem; }


.bg-gradient-hero-overlay {
  background:
    linear-gradient(5deg,
      hsl(var(--navy) / 0.78) 0%,
      hsl(var(--navy) / 0.48) 38%,
      hsl(var(--navy) / 0.12) 68%,
      hsl(var(--navy) / 0.05) 100%),
    linear-gradient(to bottom,
      hsl(var(--navy) / 0.55) 0%,
      hsl(var(--navy) / 0.65) 40%,
      hsl(var(--navy) / 0.45) 65%,
      hsl(var(--secondary-foreground) / 0.9) 100%);
}

/* Small inner-page hero (About/Services/Why Panama/Contact/Properties/
   individual service pages)*/
.bg-gradient-page-hero-overlay {
  background:
    linear-gradient(100deg,
      hsl(var(--navy) / 0.80) 0%,
      hsl(var(--navy) / 0.55) 38%,
      hsl(var(--navy) / 0.25) 68%,
      hsl(var(--navy) / 0.10) 100%),
    linear-gradient(to bottom,
      hsl(var(--navy) / 0.55) 0%,
      hsl(var(--navy) / 0.35) 25%,
      hsl(var(--navy) / 0.48) 55%,
      hsl(var(--navy) / 0.82) 100%);
}
.vista-page-hero p {
  color: hsl(var(--warm-white));
}
.vista-page-hero ol {
  text-shadow: 0px 1px 2px black !important;
}
.vista-page-hero .text-primary-foreground\/50 {
  color: hsl(var(--warm-white));
  
}
/* Soft navy text shadow as second line of defense — scoped to hero
   headings/copy only (never body text). */
#hero-slider h1,
#hero-slider p,
.vista-page-hero h1,
.vista-page-hero p,
.vista-page-hero ol {
  text-shadow: 0 2px 24px hsl(var(--navy) / 0.55), 0 1px 3px hsl(var(--navy) / 0.45);
}

/* text-shadow above does nothing for SVGs (breadcrumb chevrons) — it
   only affects text — so on a brighter patch of a hero photo the
   chevron can wash out even though the surrounding breadcrumb text
   stays legible via the shadow. drop-shadow is the SVG equivalent;
   covers any hero icon, not just today's chevrons. */
.vista-page-hero svg {
  filter: drop-shadow(0 1px 3px hsl(var(--navy) / 0.7));
}

/* ── 2b. Fixed nav (demo inline style) ─────────────────────────── */
#site-nav.nav-scrolled {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* ── 2b. Filter bar (properties page) ──────────────────────────── */
.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
  height: 44px;
  border-radius: 3px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.01em;
}
.filter-select:hover { border-color: hsl(var(--gold)); }
.filter-select:focus {
  border-color: hsl(var(--gold));
  outline: none;
  box-shadow: 0 0 0 3px rgba(163, 132, 83, 0.18);
}

.filter-input {
  height: 44px;
  border-radius: 3px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.01em;
  min-width: 200px;
}
.filter-input:hover { border-color: hsl(var(--gold)); }
.filter-input:focus {
  border-color: hsl(var(--gold));
  outline: none;
  box-shadow: 0 0 0 3px rgba(163, 132, 83, 0.18);
}

#basic-search-form a,
#basic-search-form button,
#filter-form a,
#filter-form button {
  height: 44px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── 2c. Pagination (server links + REST buttons) ──────────────── */
.pagination-nav {
  margin-top: 4.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid hsl(var(--border));
  flex-wrap: wrap;
}
.pagination-nav a,
.pagination-nav span.current,
.pagination-nav span.dots,
.pagination-nav button {
  min-width: 42px;
  height: 42px;
  border-radius: 3px;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}
.pagination-nav a:hover,
.pagination-nav button:hover:not([disabled]) {
  border-color: hsl(var(--gold));
  color: hsl(var(--gold));
}
.pagination-nav span.current,
.pagination-nav button.page-btn-active {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
}
.pagination-nav button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ── 2d. Property detail components ────────────────────────────── */
/* overflow-x-auto isn't in the compiled Tailwind bundle (never used by
   the ported demo content), so the class name on this element in the
   markup is inert — the actual clip/scroll behavior has to come from
   here instead, or the thumbnails spill out unclipped and drag the
   whole page's scrollWidth out past the viewport. */
#gallery-thumbs {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
  cursor: pointer;
  transition: opacity 0.2s ease, outline 0.2s ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
  scroll-snap-align: start;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { outline-color: hsl(var(--gold)); opacity: 1; }
.gallery-thumb:not(.active) { opacity: 0.6; }

#gallery-main { transition: opacity 0.25s ease; }
#gallery-main.fading { opacity: 0; }

#gallery-expand { display: block; border: 0; padding: 0; background: none; }

.vista-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vista-lightbox[hidden] { display: none; }
body.vista-lightbox-open { overflow: hidden; }

.vista-lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.vista-lightbox-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}
.vista-lightbox-counter { color: rgba(255, 255, 255, 0.7); font-size: 0.875rem; }
.vista-lightbox-actions { display: flex; align-items: center; gap: 0.75rem; }

.vista-lightbox-btn,
.vista-lightbox-nav {
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
}
.vista-lightbox-btn:hover,
.vista-lightbox-nav:hover { color: #fff; }

.vista-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.vista-lightbox-prev { left: 0.75rem; }
.vista-lightbox-next { right: 0.75rem; }

.spec-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  border-left: 1px solid hsl(var(--border));
}
.spec-chip:first-child {
  border-left: none;
  padding-left: 0;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}
.feature-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: hsl(var(--gold));
  margin-top: 1px;
}

.form-input {
  width: 100%;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  transition: border-color 0.2s ease;
  outline: none;
}
.form-input:focus { border-color: hsl(var(--gold)); }
.form-input::placeholder { color: hsl(var(--muted-foreground)); }

.map-placeholder {
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.sim-card:hover .sim-card-img { transform: scale(1.06); }
.sim-card-img { transition: transform 0.6s ease; }

/* ── 3a. Admin bar / fixed nav coexistence ─────────────────────── */
body.admin-bar #site-nav { top: var(--wp-admin--admin-bar--height, 2rem); }

/* ── 3b. Block-pattern helpers ─────────────────────────────────── */
/* Hero slider: each slide is an editable Gutenberg image block */
.vista-hero-slide { margin: 0; }
.vista-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: none;
}

/* Generic "cover" image block inside a fixed-height wrapper */
.vista-cover-img { margin: 0; height: 100%; }
.vista-cover-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

/* Inner page hero — clears the fixed nav. 50px */
.vista-page-hero { margin-top: 50px; }
.vista-hero-bg { position: absolute; inset: 0; }

.vista-caption-img { height: 20rem; }
.vista-caption-img .vista-cover-img { height: 100%; }

/* Service card image zoom parity with demo */
.group:hover .vista-cover-img img { transform: scale(1.1); }

/* ── 3c. Gutenberg content typography (Tailwind preflight resets
        everything, so plain content pages need it back) ─────────── */
.entry-content > p,
.entry-content > ul,
.entry-content > ol {
  color: hsl(var(--muted-foreground));
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.entry-content > ul { list-style: disc; padding-left: 1.5rem; }
.entry-content > ol { list-style: decimal; padding-left: 1.5rem; }
.entry-content > h2,
.entry-content > h3,
.entry-content > h4 {
  font-family: var(--wp--preset--font-family--serif, "Cormorant Garamond", Georgia, serif);
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 2rem 0 1rem;
  line-height: 1.25;
}
.entry-content > h2 { font-size: 1.875rem; }
.entry-content > h3 { font-size: 1.5rem; }
.entry-content > h4 { font-size: 1.25rem; }
.entry-content a:not([class]) { color: hsl(var(--gold-dark)); text-decoration: underline; }
.entry-content a:not([class]):hover { color: hsl(var(--gold)); }

/* Full-width section pages: sections handle their own spacing */
.entry-content.is-full-width > p:empty { display: none; }

/* Property description (post_content rendered inside #property-observations) */
#property-observations p { margin-bottom: 1rem; }

/* ── 3d. Misc ───────────────────────────────────────────────────── */
.screen-reader-text,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sim-card-img,
  #gallery-main,
  .vista-cover-img img { transition: none; }
}

/* ── 4. Dropdown-capable nav (Services submenu) ────────────────── */
.vista-dropdown-panel {
  position: absolute;
  left: 0;
  top: 145%;
  min-width: 220px;
  background: hsl(var(--primary));
  border: 1px solid hsl(var(--primary-foreground) / 0.1);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.25), 0 10px 10px -5px rgba(0,0,0,0.1);
  margin-top: -0.5rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.vista-nav-item-has-children:hover .vista-dropdown-panel,
.vista-nav-item-has-children:focus-within .vista-dropdown-panel,
.vista-nav-item-has-children.is-open .vista-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.vista-nav-item-has-children {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  align-self: stretch;
}
.vista-nav-item-has-children--mobile {
  flex-direction: column;
  align-items: stretch;
}
.vista-nav-toggle {
  display: inline-flex;
  align-items: center;
  /* Full opacity, not the ~80% the link text sits at — it's a small
     icon, so it needs the contrast just to read as a chevron at all. */
  color: hsl(var(--primary-foreground));
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
/* Not scoped to .vista-dropdown-panel specifically — the mobile call
   renders these same links inside .vista-dropdown-panel--mobile instead,
   on the same dark nav background, so the styling applies either way. */
.vista-dropdown-link {
  display: block;
  padding: 0.6rem 1.25rem;
  white-space: nowrap;
  color: hsl(var(--primary-foreground) / 0.8);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.vista-dropdown-link:hover {
  color: hsl(var(--gold));
  background: hsl(var(--primary-foreground) / 0.05);
}
.vista-nav-toggle-chevron {
  transition: transform 0.2s ease;
}
.vista-nav-item-has-children:hover .vista-nav-toggle-chevron,
.vista-nav-item-has-children:focus-within .vista-nav-toggle-chevron,
.vista-nav-item-has-children.is-open .vista-nav-toggle-chevron {
  transform: rotate(180deg);
}

/* Mobile: children render indented under their parent, always visible
   (no extra collapse state — simplest robust option for one 5-item
   submenu inside the existing slide-down mobile panel). */
.vista-dropdown-panel--mobile {
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ── 5. Active nav state (shows which page you're on) ──────────────
   .is-current-section marks a top-level item whose child page is
   active (e.g. Services while viewing a sub-service page);
   aria-current="page" marks the exact current page — both set by
   Vista_Nav_Walker from WordPress's own current-menu-* item classes.
   Same gold as the page-hero breadcrumb's current-page convention.
   ID-scoped so it always outranks the plain/hover link-color
   utilities regardless of stylesheet load order. */
#site-nav a[aria-current="page"],
#site-nav a.is-current-section,
#mobile-menu-panel a[aria-current="page"],
#mobile-menu-panel a.is-current-section,
#footer-nav a[aria-current="page"],
#footer-nav a.is-current-section {
  color: hsl(var(--gold));
}

/* ── 6. Team grid (About Us, [vista_team_grid] shortcode) ──────────
   Each rule is a straight translation of the Tailwind utility string
   it replaces (kept as a comment above the rule) — this is the single
   place to restyle a team card; inc/team-cpt.php only outputs these
   class names. */

/* was: grid sm:grid-cols-2 lg:grid-cols-3 gap-10 */
.team-grid {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 640px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* was: text-center */
.team-card {
  text-align: center;
}

/* was: aspect-square overflow-hidden mb-6, wrapping a
   vista-cover-img grayscale figure */
.team-card-photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin: 0 0 1.5rem;
}
.team-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

/* was: w-8 h-px bg-gold mx-auto mb-3 */
.team-card-separator {
  width: 2rem;
  height: 1px;
  background-color: hsl(var(--gold));
  margin: 0 auto 0.75rem;
}

/* was: font-serif text-lg font-semibold text-foreground tracking-wide uppercase */
.team-card-title {
  font-family: var(--wp--preset--font-family--serif, "Cormorant Garamond", Georgia, serif);
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

/* was: text-gold text-xs font-medium tracking-[0.15em] uppercase mt-2 */
.team-card-role {
  color: hsl(var(--gold));
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* was: text-muted-foreground text-xs mt-1 */
.team-card-intro {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  line-height: 1rem;
  margin-top: 0.25rem;
}

/* ── 7. Home services accordion ─────────────────────────────────────
   Right column of the "Our Services" home section. One item open at a
   time (toggled in vista-common.js via .is-open); the panel's height
   animates with the grid-template-rows 0fr→1fr technique so it works
   for arbitrary content height with no JS measuring. */
.service-accordion-item {
  border-bottom: 1px solid hsl(var(--border));
}
.service-accordion-item:first-child {
  border-top: 1px solid hsl(var(--border));
}
.service-accordion-heading {
  margin: 0;
}
.service-accordion-trigger {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.5rem 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.service-accordion-num {
  font-family: var(--wp--preset--font-family--serif, "Cormorant Garamond", Georgia, serif);
  font-style: italic;
  font-size: 2rem;
  color: hsl(var(--gold) / 1);
  flex-shrink: 0;
  margin-top: -0.35rem;
}
.service-accordion-title {
  flex: 1;
  font-family: var(--wp--preset--font-family--serif, "Cormorant Garamond", Georgia, serif);
  font-size: 1.25rem;
  line-height: 2rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  transition: color 0.2s ease;
}
.service-accordion-item.is-open .service-accordion-title {
  color: hsl(var(--gold-dark));
}
.service-accordion-chevron {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: hsl(var(--muted-foreground));
  transition: transform 0.25s ease, color 0.25s ease;
}
.service-accordion-item.is-open .service-accordion-chevron {
  color: hsl(var(--gold));
  transform: rotate(180deg);
}
.service-accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.service-accordion-item.is-open .service-accordion-panel {
  grid-template-rows: 1fr;
}
.service-accordion-panel-inner {
  overflow: hidden;
}
.service-accordion-text {
  max-width: 34rem;
  padding-bottom: 1.5rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}

.service-accordion .service-cta {
  margin-bottom: 1.5rem;
}
