/* Ramirez Living -- one stylesheet for the whole site. */

:root {
  --ink: #1f2522;
  --ink-soft: #4f5753;
  --paper: #fbf8f3;
  --card: #ffffff;
  --sand: #f2ebe0;
  --line: #e4dccf;
  --accent: #a24e2d;        /* brick: white text on it passes WCAG AA */
  --accent-dark: #843e22;
  --alert: #8f2d1f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 37, 34, 0.06), 0 8px 24px rgba(31, 37, 34, 0.06);
  --wrap: 1120px;
  --gutter: 24px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }

/* A fact the site cannot know (a phone number, an address) is written in empty and hidden until its
   RelayReef block fills it: the line holding it goes with it. */
.if-filled:has(.fact:empty) { display: none; }
.fact { font-weight: 500; }
.fact-large { font-size: 1.2rem; }
.fact span { display: block; }

/* ---- buttons ---------------------------------------------------------------------------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: #fff;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.button-small { min-height: 40px; padding: 8px 18px; font-size: 0.95rem; }
.button-light { background: #fff; border-color: #fff; color: var(--ink); }
.button-light:hover { background: var(--sand); border-color: var(--sand); color: var(--ink); }
.button-outline { background: transparent; color: var(--accent); }
.button-outline:hover { background: var(--accent); color: #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.actions-center { justify-content: center; }

.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow-light { color: #f6d9c9; }
.lede { font-size: 1.125rem; color: var(--ink-soft); max-width: 62ch; }

/* ---- header ----------------------------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 243, 0.94);
  -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }

.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-roof { width: 58px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.02em; line-height: 1; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.button) { color: var(--ink); font-weight: 500; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.button):hover, .site-nav a[aria-current="page"]:not(.button) { border-bottom-color: var(--accent); }

.menu-toggle { display: none; width: 48px; height: 48px; margin-right: -8px; border: 0; background: none; cursor: pointer; color: var(--ink); }
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 24px; height: 2px; margin: 0 auto; background: currentColor; border-radius: 2px;
  transition: transform 0.2s, background-color 0.2s;
}
.menu-toggle-bars { position: relative; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -7px; }
.menu-toggle-bars::after { top: 7px; }
.nav-open .menu-toggle-bars { background: transparent; }
.nav-open .menu-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .menu-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ---- hero ------------------------------------------------------------------------------------- */

.hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: min(78vh, 720px); color: #fff; overflow: hidden; }
.hero-image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20, 24, 22, 0.15) 0%, rgba(20, 24, 22, 0.35) 45%, rgba(20, 24, 22, 0.78) 100%);
}
.hero-content { padding-top: 96px; padding-bottom: 72px; }
.hero h1 { max-width: 16ch; color: #fff; }
.hero-lede { max-width: 54ch; font-size: 1.15rem; color: rgba(255, 255, 255, 0.92); }

/* ---- sections --------------------------------------------------------------------------------- */

.section { padding: 88px 0; }
.section-tight { padding: 40px 0 88px; }
.section-tint { background: var(--sand); }

.page-head { padding: 64px 0 8px; }
.page-head .lede { margin-bottom: 0; }
.page-head-center { text-align: center; padding: 96px 0; }
.page-head-center .lede { margin: 0 auto 16px; }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.split-image { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.prose p { color: var(--ink-soft); font-size: 1.05rem; }

.cards { display: grid; gap: 20px; margin: 32px 0 28px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.3rem; }
.card p:last-child { margin-bottom: 0; }
.card-icon { width: 34px; height: 34px; margin-bottom: 14px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card-quiet { background: transparent; box-shadow: none; }
.card-alert { border-color: #e7c3b3; background: #fff8f4; }
.card-alert h2 { color: var(--alert); }

.callout { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.callout .lede { margin-bottom: 0; }
.callout .actions { flex-shrink: 0; margin-top: 0; }

/* ---- available homes -------------------------------------------------------------------------- */

.homes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
/* A home is listed by giving it a title block; the rest of its card is optional. */
.home-card:has(.home-title:empty) { display: none; }
.homes-grid:not(:has(.home-title:not(:empty))) { display: none; }
.homes-grid:has(.home-title:not(:empty)) ~ .homes-empty { display: none; }

.home-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.home-photo-frame { aspect-ratio: 4 / 3; background: var(--sand); }
.home-photo-frame:not(:has(img[src])) { display: none; }
.home-photo { width: 100%; height: 100%; object-fit: cover; }
.home-body { display: flex; flex-direction: column; gap: 8px; padding: 22px; flex: 1; }
.home-body .button { align-self: flex-start; margin-top: auto; }
.home-title { font-size: 1.35rem; margin: 0; }
.home-rent { margin: 0; font-weight: 600; font-size: 1.1rem; color: var(--accent); }
.home-details { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.home-details span { padding: 3px 10px; border-radius: 999px; background: var(--sand); font-size: 0.9rem; }
.home-text { margin: 0 0 8px; color: var(--ink-soft); }
.home-rent:empty, .home-details:empty, .home-text:empty { display: none; }

.homes-empty { max-width: 640px; }
.eho-note { margin-top: 32px; color: var(--ink-soft); font-size: 0.9rem; }

/* ---- residents -------------------------------------------------------------------------------- */

.residents-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.portal-panel { min-height: 640px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.residents-aside { display: grid; gap: 16px; }
.residents-aside .card { padding: 22px; }

/* ---- contact ---------------------------------------------------------------------------------- */

.contact-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.form-card { padding: 32px; }
.form-fallback { margin: 0; color: var(--ink-soft); }
.contact-aside { display: grid; gap: 22px; }
.contact-aside h2 { font-size: 1.1rem; margin-bottom: 4px; }
.contact-aside p { margin: 0; }

/* The form RelayReef draws from the "contact" form's fields (embed.js). */
.relayreef-form { gap: 18px !important; }
.relayreef-form-field label, .relayreef-form-field legend { font-weight: 500; }
.relayreef-form input:not([type="checkbox"]):not([type="radio"]), .relayreef-form select, .relayreef-form textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid #cfc6b8; border-radius: 10px; background: #fff; color: var(--ink);
  font: 400 1rem/1.4 var(--sans);
}
.relayreef-form textarea { min-height: 140px; resize: vertical; }
.relayreef-form input:focus, .relayreef-form select:focus, .relayreef-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(162, 78, 45, 0.18); }
.relayreef-form-help { color: var(--ink-soft); font-size: 0.9rem; }
.relayreef-form-submit {
  justify-self: start; min-height: 48px; padding: 12px 26px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: 600 1rem/1.2 var(--sans); cursor: pointer;
}
.relayreef-form-submit:hover { background: var(--accent-dark); }
.relayreef-form-submit:disabled { opacity: 0.6; cursor: default; }
.relayreef-form-status { padding: 12px 14px; border-radius: 10px; background: var(--sand); }

/* ---- footer ----------------------------------------------------------------------------------- */

.site-footer { background: var(--ink); color: rgba(255, 255, 255, 0.82); padding: 64px 0 28px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #f6d9c9; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: #fff; margin-bottom: 6px; }
.footer-title { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; margin-bottom: 14px; }
.site-footer p { margin: 0 0 8px; }
.footer-legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.875rem; color: rgba(255, 255, 255, 0.66); }
.eho { display: flex; align-items: center; gap: 14px; max-width: 760px; }
.eho-mark { width: 40px; height: 40px; flex-shrink: 0; color: #fff; }

/* ---- tablet ----------------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 32px 0 64px; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .cards-3 { grid-template-columns: 1fr; }
  .callout { flex-direction: column; align-items: flex-start; }
  .residents-layout, .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

/* ---- phone ------------------------------------------------------------------------------------ */

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .header-inner { min-height: 64px; }
  .menu-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(31, 37, 34, 0.08);
  }
  .nav-open .site-nav { display: flex; }
  .site-nav a:not(.button) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav a:not(.button):hover, .site-nav a[aria-current="page"]:not(.button) { border-bottom-color: var(--line); color: var(--accent); }
  .site-nav .nav-residents { margin-top: 16px; }

  .hero { min-height: min(72vh, 620px); }
  .hero-content { padding-top: 72px; padding-bottom: 48px; }
  .hero .actions .button { flex: 1 1 100%; }
  .page-head { padding: 44px 0 4px; }
  .form-card { padding: 22px; }
  .portal-panel { margin: 0 calc(-1 * var(--gutter)); border-radius: 0; border-left: 0; border-right: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .eho { align-items: flex-start; }
}
