/*
Theme Name: South Bay Life
Theme URI: https://southbaylife.com
Author: Custom Development
Author URI: https://southbaylife.com
Description: A custom WordPress theme for South Bay Life & Real Estate featuring Manhattan Beach and Hermosa Beach neighborhoods. Clean, coastal editorial design with ACF integration for easy content management.
Version: 1.0.22
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: southbay-life
Tags: real-estate, blog, custom-template, neighborhood-guide, events

South Bay Life WordPress Theme, Copyright 2025
South Bay Life is distributed under the terms of the GNU GPL.
*/

/* ===== CSS Variables & Design Tokens ===== */
:root {
  --ink: #0E2A47;
  --navy: #0F2A43;
  --text: #111827;
  --muted: #5b6472;
  --line: #e6e9ee;
  --foam: #F6F8FA;
  --sand: #F2ECE3;
  --sand-dark: #E7D7C1;
  --accent: #0B9CB3;
  --max: 1200px;
  --content: 760px;
  --radius: 18px;
}

/* ===== CSS Reset & Base Styles ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

body {
  color: var(--text);
  background: #fff;
  font: 17px/1.7 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  color: var(--ink);
  line-height: 1.2;
}

h1 {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 8px;
}

h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 12px;
}

h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.28;
  margin: 0 0 6px;
}

p {
  margin: 0 0 18px;
}

/* ===== Links ===== */
a {
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:not(.btn):not(.btn--light):not(.brand):not(.chip) {
  border-bottom: px solid rgba(14, 42, 71, 0.35);
}

a:not(.btn):not(.btn--light):not(.brand):not(.chip):hover {
  border-bottom-color: var(--ink);
}

/* ===== Layout Utilities ===== */
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 28px;
  overflow: visible;
}

.section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
  overflow: visible;
}

.section:first-of-type {
  border-top: none;
}

.grid {
  display: grid;
  gap: 24px;
}

/* ===== Background Utilities ===== */
.is-ink {
  background: #0b1d32;
  color: #fff;
}

.is-foam {
  background: var(--foam);
}

.is-sand {
  background: var(--sand);
}

/* ===== Accessibility ===== */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: #fff;
  padding: 16px 26px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: all 0.24s ease;
}

.btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn--light {
  border: 1px solid #fff;
  color: #fff;
  background: transparent;
}

.btn--light:hover {
  background: #fff;
  color: #0b1d32;
  border-color: #0b1d32;
}

.btn--primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn--primary:hover {
  background: #fff;
  color: var(--ink);
}

/* ===== Hero Sections ===== */
.hero {
  position: relative;
  background: #0b1d32;
  color: #fff;
}

.hero .bg {
  position: absolute;
  inset: 0;
}

.hero .bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.84;
  filter: saturate(0.92) contrast(1.05);
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 16, 28, 0.78),
    rgba(8, 16, 28, 0.52) 42%,
    rgba(8, 16, 28, 0.78)
  );
}

.hero .wrap {
  position: relative;
  z-index: 1;
  padding-top: 120px;
  padding-bottom: 120px;
}

.hero .kicker {
  margin-bottom: 16px;
}

.hero h1 {
  color: #fff;
  margin-bottom: 16px;
}

.hero .lead {
  margin-top: 0;
}

/* Hero filter chips (white on dark background) */
.hero .chips {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.hero .chip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.hero .chip:hover {
  background: #fff;
  color: #0b1d32;
  border: 1px solid #fff !important;
}

.hero .chip.is-active {
  background: #fff;
  color: #0b1d32;
  border: 1px solid #fff !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* CTA band (light box with border) */
.cta {
  background: var(--foam);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.cta h3 {
  margin: 0 0 8px;
  font: 700 20px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

/* ===== Kicker/Label ===== */
.kicker {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.lead {
  font-size: 1.06rem;
  line-height: 1.7;
}

/* ===== Cards ===== */
.card {
  background: #fff;
  border: 1px solid #e9edf4;
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(17, 24, 39, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.12);
  border-color: #dfe4ea;
}

.card a,
.card a:hover {
  border-bottom: none !important;
}

.card-link {
  display: block;
  height: 100%;
  text-decoration: none;
}

.card {
  position: relative;
}

.card > a.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.imgwrap {
  position: relative;
  overflow: hidden;
  background: #f2f4f7;
  aspect-ratio: 16/9;
}

/* Remove default figure margin for card images */
.card figure.imgwrap {
  margin: 0;
}

.imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.label {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(3px);
  color: #0b1d32;
  border: 1px solid rgba(14, 42, 71, 0.15);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
}

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

/* Mobile - reduce gap between image and content */
@media (max-width: 640px) {
  .body {
    padding: 16px 18px;
    gap: 6px;
  }
  
  .card {
    gap: 0 !important;
  }
}

/* ===== Meta Information ===== */
.meta {
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 99px;
  background: var(--muted);
  display: inline-block;
}

/* ===== Filter Chips ===== */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d6dbe3;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--ink);
}

.chip.is-active {
  background: #0b1d32;
  color: #fff;
  border-color: #0b1d32;
}

/* ===== Responsive Design ===== */
@media (max-width: 980px) {
  .section {
    padding: 72px 0;
  }
  
  .hero .wrap {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 48px 0;
  }
  
  h1 {
    font-size: clamp(28px, 8vw, 40px);
    line-height: 1.12;
  }
  
  .hero .wrap {
    padding-top: 64px;
    padding-bottom: 64px;
  }
  
  .hero .kicker {
    margin-bottom: 20px;
  }
  
  .hero h1 {
    margin-bottom: 20px;
  }
  
  .meta {
    font-size: 0.9rem;
  }
}

/* ===== WordPress Core Alignment ===== */
.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1em;
}

/* ===== WordPress Gallery ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1em;
}

/* ===== Progressive Rendering ===== */
@supports (content-visibility: auto) {
  .card {
    content-visibility: auto;
    contain-intrinsic-size: 400px;
  }
}

/* ===== Neighborhoods Grid ===== */
.grid.hoods {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 24px;
}

/* Neighborhood card specific styling */
.hoods .card .body {
  padding: 20px 22px; /* Equal top and bottom padding for Issue #13 */
}

.hoods .card .body h3 {
  font-size: 1.44rem; /* 20% larger than default 1.2rem (1.2 * 1.2 = 1.44) - Issue #12 */
  margin: 0 0 8px;
}

.hoods .card .label {
  padding: 9px 15px; /* 50% more padding (was 6px 10px) - Issue #14 */
}

@media (max-width: 780px) {
  .grid.hoods {
    grid-template-columns: 1fr !important;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===== Footer Styles ===== */
#footer .grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 60px;
}

#footer .foot-col strong {
  display: block;
  margin-bottom: 20px;
  font-size: 1.125rem;
}

#footer .foot-subhead {
  margin-top: 24px;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

#footer .contact-list,
#footer nav ul,
#footer .legal ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#footer .contact-list li,
#footer nav ul li,
#footer .legal ul li {
  margin-bottom: 2px;
}

#footer .office {
  font-style: normal;
}

#footer .office-line {
  display: block;
  margin-bottom: 6px;
}

#footer .legal .copyright {
  margin-top: 16px;
  margin-bottom: 8px;
}

#footer .legal span {
  opacity: 0.8;
}

/* Ensure ALL footer text is same size on desktop */
#footer,
#footer .foot-col,
#footer .contact-list,
#footer .contact-list li,
#footer .contact-list a,
#footer nav ul,
#footer nav ul li,
#footer nav a,
#footer .legal,
#footer .legal ul,
#footer .legal ul li,
#footer .legal a,
#footer .copyright,
#footer .legal span,
#footer .office,
#footer .office-line {
  font-size: 1rem;
  line-height: 1.9;
}

/* Footer Responsive */
@media (max-width: 768px) {
  #footer .grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  /* Ensure ALL footer text is same size on mobile */
  #footer,
  #footer .foot-col,
  #footer .contact-list,
  #footer .contact-list li,
  #footer .contact-list a,
  #footer nav ul,
  #footer nav ul li,
  #footer nav a,
  #footer .legal,
  #footer .legal ul,
  #footer .legal ul li,
  #footer .legal a,
  #footer .copyright,
  #footer .legal span,
  #footer .office,
  #footer .office-line {
    font-size: 1rem !important;
    line-height: 1.9 !important;
  }
  
  #footer .legal ul li {
    margin-bottom: 8px;
  }
  
  #footer .legal .copyright {
    margin-top: 14px;
    margin-bottom: 8px;
  }
}

/* Mobile Landscape: Ensure ALL footer text is same size */
@media (max-width: 1024px) and (orientation: landscape) {
  /* Force all footer text to be the same size on mobile landscape */
  #footer,
  #footer *,
  #footer .foot-col,
  #footer .foot-col strong,
  #footer .contact-list,
  #footer .contact-list li,
  #footer .contact-list a,
  #footer .contact-list li a,
  #footer nav ul,
  #footer nav ul li,
  #footer nav a,
  #footer nav ul li a,
  #footer .legal,
  #footer .legal ul,
  #footer .legal ul li,
  #footer .legal a,
  #footer .legal ul li a,
  #footer .copyright,
  #footer .copyright *,
  #footer .legal span,
  #footer .office,
  #footer .office *,
  #footer .office-line,
  #footer address,
  #footer address * {
    font-size: 1rem !important;
    line-height: 1.9 !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }
}

/* Mobile landscape (smaller screens) - even more aggressive */
@media (max-width: 900px) and (orientation: landscape) {
  #footer,
  #footer *,
  #footer .foot-col,
  #footer .foot-col strong,
  #footer .contact-list,
  #footer .contact-list li,
  #footer .contact-list a,
  #footer nav ul,
  #footer nav ul li,
  #footer nav a,
  #footer .legal,
  #footer .legal ul,
  #footer .legal ul li,
  #footer .legal a,
  #footer .copyright,
  #footer .copyright *,
  #footer .legal span,
  #footer .office,
  #footer .office *,
  #footer .office-line {
    font-size: 0.95rem !important;
    line-height: 1.8 !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }
}

/* ========================================
   LANDSCAPE ORIENTATION FIX
   ======================================== */

/* Mobile landscape: Reduce hero padding for better visibility */
@media (max-height: 500px) and (orientation: landscape) {
  .hero .wrap {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
  }
  
  .hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem) !important;
    margin-bottom: 12px !important;
  }
  
  .hero .lead {
    font-size: 1rem !important;
  }
  
  .hero .kicker {
    margin-bottom: 10px !important;
  }
  
  .hero .chips {
    margin-top: 12px !important;
  }
}

/* Tablet landscape: Moderate reduction */
@media (max-height: 700px) and (min-width: 768px) and (orientation: landscape) {
  .hero .wrap {
    padding-top: 70px !important;
    padding-bottom: 70px !important;
  }
}