/*
  AbbySells.ca main stylesheet
  Organized by: tokens, base, header, hero, sections, components, responsive
  Notes:
  - Keep all color/spacing tokens in :root
  - Keep only ONE mobile breakpoint block for max-width: 900px
*/

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

/* =========================
   1) DESIGN TOKENS
   ========================= */
:root {
  --bg-dark: #050608;

  --brand-gold: #d4aa4a;
  --ui-accent: #989898;

  --accent: #174c8f;
  --text-main: #111216;
  --text-muted: #5b6170;

  --section-padding: 80px;
  --content-width: 1100px;
  --radius-lg: 18px;

  /* Shadows */
  --shadow-card: 0 8px 28px rgba(15, 16, 30, 0.1);
  --shadow-card-strong: 0 9px 40px rgba(15, 16, 30, 0.14);
}

/* =========================
   2) BASE RESET + TYPO
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text-main);
  background: #f5f5f7;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Accessible focus state for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(212, 170, 74, 0.9);
  outline-offset: 3px;
  border-radius: 8px;
}

/* =========================
   3) HEADER / NAV
   ========================= */
header {
  position: sticky;
  top: 0;
  z-index: 2000;

  /* slightly lighter glass */
  background: rgba(5, 6, 8, 0.88);

  /* reduce blur for clarity */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  /* warmer, intentional divider */
  border-bottom: 1px solid rgba(212, 170, 74, 0.14);

  transition:
    background 0.25s ease,
    box-shadow 0.25s ease;
}

header.is-scrolled {
  background: rgba(5, 6, 8, 0.94);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Brand link: clickable logo, same styling as non-link brand */
.brand-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.brand span {
  color: var(--brand-gold);
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: #c6cad4;
}

.nav-links a:hover {
  color: #fff;
}

.btn-nav {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--brand-gold);
  color: var(--brand-gold);
  background: transparent;

  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.35px;
  white-space: nowrap;
}

.btn-nav:hover {
  background: var(--brand-gold);
  color: #111;
}

/* Brand link becomes icon + text side-by-side, but text keeps its line break */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

/* Keep the brand text stacked exactly like before */
.brand-text {
  display: inline-block;
  line-height: 1.1;
}

/* Icon */
.brand-home-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  opacity: 0.9;
  transform: translateY(1px);
}

.brand-home-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Hover/tap to gold (brand only) */
.brand-link:hover,
.brand-link:active {
  color: var(--gold);
  text-decoration: none;
}

/* Brand layout stays the same */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* Explicit colors */
.brand-name {
  color: var(--gold);
}

.brand-text small {
  color: #e6e2d8; /* warm white */
}

/* Icon stays white */
.brand-home-icon {
  color: #e6e2d8;
  opacity: 0.9;
}

/* Prevent hover from recoloring everything */
.brand-link:hover,
.brand-link:active {
  color: inherit;
  text-decoration: none;
}

/* =========================
   4) HERO
   ========================= */
.hero {
  position: relative;
  min-height: 70vh;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Background watermark image layer */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/logo2.png") center/cover no-repeat;
  opacity: 0.78;
  z-index: 0;
  pointer-events: none;
}

/* Dark gradient overlay layer */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.75));
  z-index: 0;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 120px 20px 100px;
  text-align: left;
}

.hero-kicker {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 18px;
  color: #e0e4f0;
}

.hero-layout {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 26px;
}

.hero-text-block {
  max-width: 600px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease-out forwards;
  animation-delay: 0.25s;
}

.hero-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 0.95;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: #e6e2d8;
  font-weight: 500;
  text-shadow: 0 2px 18px rgba(212, 170, 74, 0.18);
}

.hero-title-accent {
  font-weight: 700;
  opacity: 0.95;
}

.hero-subtitle {
  font-size: 18px;
  margin-bottom: 12px;
}

.hero-text {
  max-width: 520px;
  font-size: 15px;
  color: #d4d8e5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease-out forwards;
  animation-delay: 0.5s;
}

/* City pages: SEO h1 + visual headline */
.seo-h1 {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Visual hero headline (used instead of showing the H1) */
.hero-visual-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(42px, 5vw, 66px);
  line-height: 1.05;
  margin: 0;
  color: #f2f2f2;
}

/* Optional: keeps accent styling consistent */
.hero-visual-title .hero-title-accent {
  color: #f2f2f2;
}

/* =========================
   5) BUTTONS
   ========================= */
/* Primary CTA – dark glass, tuned for black backgrounds */
/* Primary CTA default (LIGHT backgrounds) */
.btn-primary {
  background: #f4f1eb; /* warm off-white instead of pure white */
  color: #111111;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid rgba(212, 170, 74, 0.55);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

/* Primary CTA on DARK hero only (glass style) */
.hero .btn-primary {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(212, 170, 74, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Contact form: ensure primary button is visible on light background */
.contact .btn-primary {
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(212, 170, 74, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* MLS search panel: visible primary button on light background */
.mls-search-panel .btn-primary {
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(212, 170, 74, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Light background buttons (cards, sidebars, info pages) */
.info-main .btn-primary,
.info-side .btn-primary {
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(212, 170, 74, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.btn-primary:hover {
  background: #e1b85b;
}

.btn-ghost {
  border-radius: 999px;
  padding: 11px 22px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 14px;
  color: #f3f4fb;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* =========================
   6) ANIMATIONS
   ========================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   7) GENERIC SECTION LAYOUT
   ========================= */
section {
  padding: var(--section-padding) 20px;
}

.section-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.section-title {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* =========================
   8) GLOBAL CARD SYSTEM
   ========================= */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 20px 22px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.card-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

/* Clickable card behavior (used by services and linked city cards) */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

/* Premium hover state */
.card-link:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1.5px rgba(212, 170, 74, 0.55),
    0 10px 26px rgba(0, 0, 0, 0.12),
    0 0 10px rgba(212, 170, 74, 0.28);
}

/* Mobile/touch fix:
   Touch devices do NOT trigger :hover.
   This adds gold outline + feedback on tap using :active
   so buttons and linked cards feel responsive on mobile. */
.card-link:active,
.btn-primary:active,
.btn-ghost:active,
.btn-nav:active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1.5px rgba(212, 170, 74, 0.75),
    0 6px 16px rgba(0, 0, 0, 0.18);
}

.card-link:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1.5px rgba(212, 170, 74, 0.65),
    0 10px 26px rgba(0, 0, 0, 0.12),
    0 0 10px rgba(212, 170, 74, 0.32);
}

/* =========================
   9) AREAS + MLS PANEL
   ========================= */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* City card uses global .card look, but needs different padding and image block */
.area-card.card {
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card-strong);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

/* FIX: allow gold outline on linked city cards */
.area-card.card.card-link:hover {
  box-shadow:
    0 0 0 1.5px rgba(212, 170, 74, 0.55),
    0 10px 26px rgba(0, 0, 0, 0.12),
    0 0 10px rgba(212, 170, 74, 0.28);
}

/* Linked city cards behave like clickable cards */
.area-card.card-link {
  color: inherit;
  text-decoration: none;
}

/* Non-linked city cards should not look clickable */
.areas-grid .area-card:not(a) {
  cursor: default;
}

.area-media {
  background: #222;
  height: 120px;
  background-size: cover;
  background-position: center;
}

.area-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.area-name {
  font-weight: 600;
  font-size: 16px;
}

/* MLS search panel */
.mls-search-panel {
  margin-top: 32px;
  padding: 20px 20px 22px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.mls-search-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  margin-bottom: 8px;
}

.mls-search-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.mls-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.mls-search-input {
  flex: 1 1 220px;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid #d0d4e3;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
}

.mls-search-button {
  white-space: nowrap;
}

.mls-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================
   10) ABOUT
   ========================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
}

.about-text p {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.about-badge {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 8px;
}

.about-photo {
  border-radius: 22px;
  overflow: hidden;
  background: #ccc;
  min-height: 260px;
  background-size: cover;
  background-position: center;
}

.about-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* =========================
   11) SERVICES
   ========================= */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* Services cards layout: 4 in a row on desktop, wraps only when needed */
.cards-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* Optional: keep cards visually balanced in height */
.cards-4 .card {
  height: 100%;
}

/* If your text is long, reduce padding slightly so 4 fit easier */
.cards-4 .card {
  padding: 22px; /* was likely larger */
}

/* Responsive breakpoints */
@media (max-width: 1100px) {
  .cards-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cards-4 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   12) TESTIMONIALS
   ========================= */
.testimonials {
  background: #0b0c10;
  color: #f6f7ff;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.testimonial {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.testimonial-name {
  margin-top: 10px;
  font-weight: 500;
  font-size: 14px;
  color: #e5e8ff;
}

/* =========================
   13) CONTACT
   ========================= */
.contact {
  background: #ffffff;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 28px;
  align-items: start;
}

.contact-form label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d0d4e3;
  padding: 10px 11px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 12px;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* =========================
   14) FOOTER
   ========================= */
footer {
  padding: 18px 20px 28px;
  background: #050608;
  color: #9ba0b2;
  font-size: 13px;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

/* =========================
   15) FEATURED GRID (scoped so it cannot break the global .card style)
   ========================= */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

/* Use these classes inside a featured section without overwriting .card globally */
.featured-grid .media {
  display: block;
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.featured-grid .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-grid .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  color: #fff;
}

.featured-grid .body {
  padding: 14px;
}
.featured-grid .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.featured-grid .title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}
.featured-grid .price {
  font-weight: 700;
}
.featured-grid .sub {
  margin-top: 6px;
  opacity: 0.85;
  font-size: 13px;
}
.featured-grid .meta {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.featured-grid .btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* =========================
   16) RESPONSIVE (MOBILE)
   One breakpoint only
   ========================= */
@media (max-width: 900px) {
  /* Header */
  header {
    position: static;
  }
  .nav-links {
    display: none;
  }

  /* Stacks */
  .areas-grid,
  .cards-3,
  .testimonial-grid,
  .about-grid,
  .contact-grid,
  .featured-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Section spacing */
  section {
    padding: 56px 16px;
  }

  /* Hero spacing + center align */
  .hero-inner {
    padding: 90px 16px 72px;
    text-align: center;
  }

  .hero-layout {
    flex-direction: column;
    text-align: center;
  }

  .hero-text-block {
    margin: 0 auto;
  }

  /* Mobile hero text readability */
  .hero-subtitle,
  .hero-text {
    color: #ffffff;
  }

  /* MLS panel form layout */
  .mls-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .mls-search-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .mls-search-input {
    flex: 0 0 auto;
    height: 44px;
    border-radius: 999px;
  }

  /* Mobile hero background logo placement */
  .hero::before {
    background-size: 110% auto;
    background-position: center -135px;
    opacity: 0.8;
  }
}
