/* ==========================================================================
   Cannon & Cannon Properties — Layout
   Container, grids, hero, footer, and responsive breakpoints
   ========================================================================== */

/* =========================================================================
   CONTAINER
   ========================================================================= */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1400px;
}


/* =========================================================================
   GRID SYSTEM
   ========================================================================= */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}


/* =========================================================================
   SPLIT LAYOUT — Two-column with alignment
   ========================================================================= */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.split--gallery {
  /* Gallery on left takes more space, details column is compact. */
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
}

.split > * {
  min-width: 0;
}

.split--reverse {
  direction: rtl;
}

.split--reverse > * {
  direction: ltr;
}


/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  min-height: var(--hero-min-h); /* Capped at 640px — no awkward short-viewport stretching */
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: var(--section-py-hero) 0;
}

.hero--overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(45, 26, 44, 0.75) 0%,
    rgba(81, 46, 79, 0.55) 100%
  );
  z-index: 1;
}

.hero--overlay > * {
  position: relative;
  z-index: 2;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__content {
  max-width: 640px;
}

.hero__content h1 {
  color: var(--color-white);
  margin-bottom: var(--space-md);
}

.hero__content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-lg);
  margin-bottom: var(--space-xl);
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}


/* =========================================================================
   FOOTER
   ========================================================================= */
/* Footer — 3-column layout with brand column given visual weight.
   Columns align at the top via a consistent "heading area" height. */
.footer {
  background-color: var(--color-purple-dark);
  color: rgba(255, 255, 255, 0.85);  /* WCAG AA on dark purple */
  font-size: var(--text-sm);
  margin-top: auto;
}

.footer a {
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--color-gold-light);
  text-decoration: none;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.3fr;
  gap: var(--space-3xl);
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-2xl);
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Brand column — logo + name on same baseline */
.footer__brand-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-white);
}

.footer__brand-link:hover {
  color: var(--color-gold-light);
}

.footer__logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.footer__brand-name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.1;
}

.footer__tagline {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: rgba(255, 255, 255, 0.7);
  max-width: 32ch;
}

/* Section headings — aligned with brand-link baseline via matching height */
.footer__heading {
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  /* Match the height of the 48px logo so headings align with brand column */
  min-height: 48px;
  display: flex;
  align-items: center;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

.footer__links li {
  margin: 0;
  list-style: none;
}

.footer__links a,
.footer__links span {
  font-size: var(--text-sm);
  display: inline-block;
  line-height: 1.4;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.85);
}

.footer__links a:hover {
  color: var(--color-gold-light);
}

.footer__cta {
  display: inline-block !important;
  margin-top: var(--space-xs);
  color: var(--color-gold-light) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.footer__cta:hover {
  color: var(--color-gold) !important;
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.footer__social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  transition:
    background-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

.footer__social a:hover {
  background-color: var(--color-gold);
  color: var(--color-purple-dark);
  transform: translateY(-2px);
}

/* Bottom bar — darker for separation + quieter contrast */
.footer__bottom {
  background-color: rgba(0, 0, 0, 0.2);
  padding: var(--space-md) 0;
}

.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copy {
  margin: 0;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
}

.footer__legal {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__legal li {
  margin: 0;
  padding: 0;
  position: relative;
}

.footer__legal li + li::before {
  content: '·';
  position: absolute;
  left: calc(-1 * var(--space-md) / 2 - 2px);
  color: rgba(255, 255, 255, 0.4);
}

.footer__legal a,
.footer__legal span {
  color: rgba(255, 255, 255, 0.6);
}

.footer__legal a:hover {
  color: var(--color-gold-light);
}

@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  .footer__brand-col {
    grid-column: 1 / -1;
  }
  /* On mobile, remove the alignment min-height so headings are compact */
  .footer__heading {
    min-height: 0;
    margin-bottom: var(--space-xs);
  }
}

@media (max-width: 480px) {
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .footer__bottom-inner {
    justify-content: center;
    text-align: center;
  }
  .footer__legal {
    justify-content: center;
  }
}


/* =========================================================================
   UTILITY CLASSES
   ========================================================================= */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.mt-0  { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }


/* =========================================================================
   RESPONSIVE — Tablet (max-width: 1024px)
   ========================================================================= */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  /* Hide desktop nav, show toggle */
  .nav-menu {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }
}


/* =========================================================================
   RESPONSIVE — Small Tablet / Large Mobile (max-width: 768px)
   ========================================================================= */
@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .split {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .split--reverse {
    direction: ltr;
  }

  .hero {
    min-height: auto; /* Let content determine height on mobile */
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-bar__inner {
    gap: var(--space-xl);
  }

  /* Remove stat dividers on smaller screens */
  .stat-item:not(:last-child)::after {
    display: none;
  }

  /* Heading sizes scale via clamp() in variables.css — no overrides needed */
}


/* =========================================================================
   RESPONSIVE — Mobile (max-width: 480px)
   ========================================================================= */
@media (max-width: 480px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .container {
    padding-inline: var(--space-md);
  }

  /* Heading + section scaling now handled by fluid clamp() tokens
     in variables.css — no per-breakpoint overrides needed. */

  .footer__inner {
    grid-template-columns: 1fr;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .stats-bar__inner {
    gap: var(--space-lg);
  }

  .stat-item {
    flex: 0 0 calc(50% - var(--space-lg) / 2);
    text-align: center;
  }

  .testimonial__quote {
    font-size: var(--text-xl);
  }
}
