/*
Theme Name: Kadence Child — Vista Group
Theme URI:
Description: Child theme for Vista Group property listing site. Brand tokens live here; edit CSS custom properties to restyle everything.
Author: Vista Group
Template: kadence
Version: 1.0.9
*/

/* ============================================================
   Brand tokens — change these to restyle the entire site
   ============================================================ */
:root {
  /* Colors */
  --color-primary:        #1a1a2e;   /* deep charcoal — primary brand dark */
  --color-accent:         #d4a96a;   /* warm coastal gold */
  --color-text:           #2d2d2d;
  --color-text-muted:     #6b7280;
  --color-bg:             #faf9f7;   /* warm off-white */
  --color-surface:        #ffffff;
  --color-border:         #e8e4dd;
  --color-available:      #16a34a;   /* green — available status */
  --color-leased:         #6b7280;   /* muted — leased status */

  /* Typography */
  --font-heading:         'Playfair Display', Georgia, serif;
  --font-body:            'Inter', system-ui, -apple-system, sans-serif;
  --font-label:           'Inter', system-ui, -apple-system, sans-serif;
  --font-size-base:       17px;
  --line-height-base:     1.7;

  /* Spacing */
  --section-padding-y:    80px;

  /* Cards */
  --radius-card:          12px;
  --radius-btn:           6px;
  --shadow-card:          0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-card-hover:    0 8px 24px rgba(0, 0, 0, 0.14);
  --transition:           0.18s ease;
}

/* ============================================================
   Override Kadence palette variables to align with our tokens.
   Kadence's customizer injects these on :root via inline <style>;
   setting them on body wins via inheritance in most contexts, and
   the !important below handles the few spots that still slip through.
   ============================================================ */
body {
  --global-palette1:           var(--color-accent);
  --global-palette2:           #c49458;
  --global-palette3:           var(--color-primary);
  --global-palette4:           var(--color-text);
  --global-palette5:           var(--color-text-muted);
  --global-palette6:           var(--color-border);
  --global-palette7:           var(--color-bg);
  --global-palette8:           var(--color-surface);
  --global-palette9:           #ffffff;
  --global-body-font-family:   var(--font-body);
}

/* ============================================================
   Base overrides — !important needed because Kadence's
   component CSS (content.min.css etc.) loads after this file.
   ============================================================ */
body {
  font-family:   var(--font-body)          !important;
  font-size:     var(--font-size-base)     !important;
  line-height:   var(--line-height-base)   !important;
  color:         var(--color-text)         !important;
  background:    var(--color-bg)           !important;
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading {
  font-family:    var(--font-heading)      !important;
  color:          var(--color-primary)     !important;
  line-height:    1.2;
  letter-spacing: -0.01em;
}

/* Cover block headings are always on a dark overlay — keep them white.
   Our base h1/h2 rule uses !important which beats the inline style="color:#fff"
   the block editor writes, so we must explicitly restore white here. */
.wp-block-cover h1,
.wp-block-cover h2,
.wp-block-cover h3,
.wp-block-cover h4,
.wp-block-cover h5,
.wp-block-cover h6,
.wp-block-cover .wp-block-heading {
  color: #ffffff !important;
}

a {
  color: var(--color-accent);
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn,
.wp-block-button__link,
.btn-primary {
  display:          inline-block;
  background:       var(--color-accent);
  color:            var(--color-primary) !important;
  font-family:      var(--font-label);
  font-weight:      600;
  font-size:        0.9rem;
  letter-spacing:   0.04em;
  text-transform:   uppercase;
  padding:          0.75rem 1.75rem;
  border-radius:    var(--radius-btn);
  border:           none;
  text-decoration:  none;
  cursor:           pointer;
  transition:       background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:hover,
.wp-block-button__link:hover,
.btn-primary:hover {
  background:   #c49458;
  transform:    translateY(-1px);
  box-shadow:   0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-outline {
  background:     transparent;
  color:          var(--color-accent) !important;
  border:         2px solid var(--color-accent);
}

.btn-outline:hover {
  background:  var(--color-accent);
  color:       var(--color-primary) !important;
}

/* ============================================================
   Property archive — filter bar
   ============================================================ */
.property-filters {
  display:      flex;
  gap:          0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap:    wrap;
}

.property-filters select {
  appearance:       none;
  background:       var(--color-surface);
  border:           1.5px solid var(--color-border);
  border-radius:    999px;
  padding:          0.5rem 1.25rem;
  font-family:      var(--font-body);
  font-size:        0.9rem;
  color:            var(--color-text);
  cursor:           pointer;
  transition:       border-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.property-filters select:focus {
  outline:       none;
  border-color:  var(--color-accent);
}

.property-filters .btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

/* ============================================================
   Property archive — grid
   ============================================================ */
.properties-grid {
  display:                grid;
  grid-template-columns:  repeat(2, 1fr);
  gap:                    2rem;
}

/* Homepage "Current Listings" — 3 across on desktop */
.property-grid {
  display:                grid;
  grid-template-columns:  repeat(3, 1fr);
  gap:                    2rem;
  margin-bottom:          2.5rem;
}

@media (max-width: 768px) {
  .properties-grid,
  .property-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Property card
   ============================================================ */
.property-card {
  background:     var(--color-surface);
  border-radius:  var(--radius-card);
  box-shadow:     var(--shadow-card);
  overflow:       hidden;
  transition:     transform var(--transition), box-shadow var(--transition);
  display:        flex;
  flex-direction: column;
}

.property-card:hover {
  transform:   translateY(-4px);
  box-shadow:  var(--shadow-card-hover);
}

/* Photo area */
.property-card__photo {
  position:     relative;
  aspect-ratio: 16 / 9;
  overflow:     hidden;
}

.property-card__photo img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
  transition: transform 0.3s ease;
}

.property-card:hover .property-card__photo img {
  transform: scale(1.04);
}

/* Placeholder when no photo */
.property-card__photo-placeholder {
  width:       100%;
  height:      100%;
  background:  linear-gradient(135deg, var(--color-border) 0%, #d0ccc4 100%);
  display:     flex;
  align-items: center;
  justify-content: center;
  color:       var(--color-text-muted);
  font-size:   2rem;
}

/* Status badge */
.property-card__status {
  position:     absolute;
  top:          0.75rem;
  right:        0.75rem;
  padding:      0.25rem 0.75rem;
  border-radius: 999px;
  font-family:  var(--font-label);
  font-size:    0.72rem;
  font-weight:  700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.property-card__status--available {
  background: var(--color-available);
  color:      #ffffff;
}

.property-card__status--leased {
  background: var(--color-leased);
  color:      #ffffff;
}

/* Card body */
.property-card__body {
  padding:  1.5rem;
  flex:     1;
  display:  flex;
  flex-direction: column;
  gap:      0.75rem;
}

.property-card__address {
  font-family:  var(--font-heading);
  font-size:    1.15rem;
  color:        var(--color-primary);
  font-weight:  700;
  line-height:  1.3;
  margin:       0;
}

.property-card__divider {
  height:     1px;
  background: var(--color-border);
  margin:     0;
}

/* Stats row */
.property-card__stats {
  display:     flex;
  gap:         1.25rem;
  flex-wrap:   wrap;
}

.property-card__stat {
  display:     flex;
  align-items: center;
  gap:         0.3rem;
  font-family: var(--font-label);
  font-size:   0.85rem;
  color:       var(--color-text-muted);
}

.property-card__stat-icon {
  font-size:  0.9rem;
  color:      var(--color-accent);
}

.property-card__price {
  font-family: var(--font-heading);
  font-size:   1.3rem;
  font-weight: 700;
  color:       var(--color-primary);
}

.property-card__avail {
  font-family: var(--font-label);
  font-size:   0.82rem;
  color:       var(--color-text-muted);
  letter-spacing: 0.02em;
}

.property-card__avail strong {
  color:       var(--color-available);
  font-weight: 600;
}

.property-card__cta {
  margin-top: auto;
}

.property-card__cta .btn {
  width:        100%;
  text-align:   center;
  padding-top:   0.7rem;
  padding-bottom: 0.7rem;
}

/* ============================================================
   Single property page
   ============================================================ */
.property-single {
  max-width:  1100px;
  margin:     0 auto;
  padding:    0 1.5rem;
}

.property-single__hero {
  position:     relative;
  aspect-ratio: 16 / 7;
  border-radius: var(--radius-card);
  overflow:     hidden;
  margin-bottom: 2.5rem;
}

.property-single__hero img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.property-single__hero-badge {
  position:  absolute;
  bottom:    1.25rem;
  left:      1.25rem;
}

.property-single__title {
  font-size:    2rem;
  font-weight:  700;
  margin-bottom: 0.25rem;
}

.property-single__meta {
  display:  flex;
  gap:      1.5rem;
  flex-wrap: wrap;
  color:    var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.property-single__details-grid {
  display:   grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap:       1.5rem;
  background: var(--color-surface);
  border:    1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding:   2rem;
  margin-bottom: 2rem;
}

.property-single__detail-label {
  font-family:    var(--font-label);
  font-size:      0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color:          var(--color-text-muted);
  margin-bottom:  0.25rem;
}

.property-single__detail-value {
  font-size:   1.05rem;
  font-weight: 600;
  color:       var(--color-primary);
}

/* ============================================================
   Contact page
   ============================================================ */
.contact-page {
  max-width: 680px;
  margin:    0 auto;
  padding:   var(--section-padding-y) 1.5rem;
}

.contact-page h1 {
  font-size:     2.25rem;
  margin-bottom: 0.5rem;
}

.contact-page .lead {
  color:         var(--color-text-muted);
  margin-bottom: 2.5rem;
  font-size:     1.05rem;
}

/* CF7 form styling */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea,
.wpcf7 select {
  width:         100%;
  border:        1.5px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding:       0.65rem 0.9rem;
  font-family:   var(--font-body);
  font-size:     1rem;
  color:         var(--color-text);
  background:    var(--color-surface);
  transition:    border-color var(--transition);
  box-sizing:    border-box;
}

.wpcf7 input:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
  outline:      none;
  border-color: var(--color-accent);
}

.wpcf7 .wpcf7-submit {
  background:     var(--color-accent);
  color:          var(--color-primary);
  font-family:    var(--font-label);
  font-weight:    700;
  font-size:      0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding:        0.75rem 2rem;
  border:         none;
  border-radius:  var(--radius-btn);
  cursor:         pointer;
  transition:     background var(--transition);
}

.wpcf7 .wpcf7-submit:hover {
  background: #c49458;
}

/* ============================================================
   Section spacing
   ============================================================ */
.site-section {
  padding: var(--section-padding-y) 0;
}

.site-section--alt {
  background: var(--color-bg);
}

/* Constrain page content to the same width as Kadence header container so
   the left edge of page content aligns with the site title / logo. */
.vista-wrap {
  max-width: var(--global-content-width);
  margin-left:  auto;
  margin-right: auto;
  padding-left:  var(--global-content-edge-padding);
  padding-right: var(--global-content-edge-padding);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer,
footer.wp-block-template-part {
  background: var(--color-primary);
  color:      rgba(255, 255, 255, 0.8);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
}

.site-footer a:hover {
  color: var(--color-accent);
}

/* ============================================================
   Header — brand polish
   ============================================================ */
#masthead {
  border-bottom: 1px solid var(--color-border) !important;
}

/* Site logo image — set via Appearance > Customize > Site Identity > Logo
   When a logo is uploaded, WordPress outputs it here and hides the site title text.
   Max-height controls how tall the logo appears in the header. Adjust to taste once
   the real PNG is available. Width auto-scales to maintain aspect ratio. */
.site-branding .custom-logo-link {
  display: block;
}
.site-branding .custom-logo-link img.custom-logo {
  max-height: 52px;
  width: auto;
  display: block;
}

/* Site title text (shown only when no logo is set).
   To switch between logo and text: Appearance > Customize > Site Identity.
   Upload a logo to show the image; remove it to fall back to this text. */
.site-branding .site-title,
.site-branding .site-title a {
  font-family:     var(--font-heading) !important;
  font-size:       1.45rem !important;
  font-weight:     700 !important;
  color:           var(--color-primary) !important;
  text-decoration: none;
  letter-spacing:  -0.01em;
}

/* When a custom logo is active, WordPress adds .wp-custom-logo to <body>.
   Hide the text title so only the logo shows. */
.wp-custom-logo .site-branding .site-title {
  display: none !important;
}

/* Nav link color uses our palette */
.main-navigation .primary-menu-container > ul > li.menu-item > a {
  color: var(--color-text-muted) !important;
}

.main-navigation .primary-menu-container > ul > li.menu-item > a:hover,
.main-navigation .primary-menu-container > ul > li.menu-item.current-menu-item > a {
  color: var(--color-primary) !important;
}

/* Active nav underline in accent */
.main-navigation .primary-menu-container > ul > li.menu-item.current-menu-item > a {
  position:      relative;
  border-bottom: 2px solid var(--color-accent);
}

/* ============================================================
   Homepage — collapse Kadence's content-area margins so the
   full-width hero cover bleeds directly below the header.
   Remove entry-content-wrap padding so alignfull blocks work.
   ============================================================ */
.home .content-area {
  margin-top:    0 !important;
  margin-bottom: 0 !important;
}

.home .entry.single-entry {
  box-shadow:  none !important;
  background:  transparent !important;
  border:      none !important;
  border-radius: 0 !important;
}

.home .entry-content-wrap {
  padding: 0 !important;
}

/* Kadence adds negative margins to alignwide blocks to escape
   entry-content-wrap padding. Since we removed that padding on
   the homepage, force margins back to 0 at all specificity levels. */
.home .wp-block-columns.alignwide,
.home .wp-site-blocks .entry-content .wp-block-columns.alignwide,
.home .content-style-boxed .wp-site-blocks .entry-content .alignwide {
  margin-left:  0 !important;
  margin-right: 0 !important;
  max-width:    100%;
}

/* Tighten column card padding on smaller viewports */
@media (max-width: 900px) {
  .home .wp-block-columns .wp-block-column {
    padding: 1.25rem;
  }
}

/* Homepage sections — constrain width and center */
.home .wp-block-group:not(.alignfull) {
  max-width:    1100px;
  margin-left:  auto !important;
  margin-right: auto !important;
  padding-left:  1.5rem;
  padding-right: 1.5rem;
}

/* "Why Vista Group?" feature columns — card treatment */
.home .wp-block-columns .wp-block-column {
  padding:       1.75rem;
  background:    var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow:    var(--shadow-card);
  border-top:    3px solid var(--color-accent);
}

.home .wp-block-columns .wp-block-column h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* "Current Listings" section — alt background */
.home .wp-block-group.has-background {
  background: var(--color-bg) !important;
}

/* ============================================================
   Kadence entry box shadow — remove on non-single pages
   ============================================================ */
.post-type-archive-property .entry.loop-entry,
.page-template-default .entry.single-entry {
  box-shadow: none !important;
}

/* ============================================================
   Archive page — tighten spacing
   ============================================================ */
.post-type-archive-property .content-area {
  margin-top:    2rem !important;
  margin-bottom: 3rem !important;
}

.post-type-archive-property .entry-content-wrap {
  padding: 0 1.5rem !important;
}

/* ============================================================
   Single property page — tighten spacing
   ============================================================ */
.single-property .content-area {
  margin-top:    2rem !important;
  margin-bottom: 3rem !important;
}

.single-property .entry-content-wrap {
  padding: 0 !important;
}

/* ============================================================
   Contact page — tighten spacing
   ============================================================ */
.page-template-page-contact .content-area {
  margin-top:    2rem !important;
  margin-bottom: 3rem !important;
}

.page-template-page-contact .entry-content-wrap {
  padding: 0 !important;
}

/* ============================================================
   About / generic pages — reasonable padding
   ============================================================ */
.page .content-area {
  margin-top:    3rem !important;
  margin-bottom: 4rem !important;
}

/* ============================================================
   Accent divider line on archive / section headers
   ============================================================ */
.property-archive-header {
  position:    relative;
  padding-bottom: 1.25rem;
  margin-bottom:  2rem;
  border-bottom:  2px solid var(--color-border);
}

.property-archive-header::after {
  content:    '';
  position:   absolute;
  bottom:     -2px;
  left:       0;
  width:      60px;
  height:     2px;
  background: var(--color-accent);
}
