/* ===========================================================================
   Princeton Square HOA — styles
   Palette derived from the community logo (navy field, gold scrollwork,
   maroon monogram). Tune any value via the custom properties in :root.
   =========================================================================== */

:root {
  /* Brand — sampled from logo */
  --navy:        #0E2340;   /* logo background — brand primary */
  --navy-700:    #16345c;   /* lighter navy — links / hovers */
  --navy-900:    #081730;   /* deepest navy */
  --gold:        #DDBA54;   /* logo scrollwork — accent */
  --gold-600:    #c49a2e;   /* darker gold for text/contrast on light bg */
  --maroon:      #842C14;   /* logo monogram — secondary accent */

  /* Neutrals */
  --bg:          #faf7f0;   /* warm off-white background */
  --surface:     #ffffff;   /* cards / raised surfaces */
  --surface-alt: #f3eee3;   /* alternating section tint */
  --text:        #232830;   /* deep slate — body text */
  --muted:       #5b616b;   /* secondary text */
  --border:      #e6ded0;   /* warm hairline */

  /* Type & layout */
  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1100px;
  --measure: 64ch;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(14, 35, 64, 0.08);
  --shadow-sm: 0 2px 8px rgba(14, 35, 64, 0.06);
}

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, picture { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; color: var(--navy); margin: 0 0 0.4em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--navy-700); text-underline-offset: 2px; }
a:hover { color: var(--maroon); }

/* Accessibility helpers --------------------------------------------------- */
.visually-hidden, .hp-field {
  position: absolute !important;
  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: 8px; top: -48px;
  background: var(--navy); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius); z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; color: #fff; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, background-color 0.2s ease, color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-accent {
  background: var(--gold);
  color: var(--navy-900);
  border-color: var(--gold);
}
.btn-accent:hover { background: var(--gold-600); color: var(--navy-900); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: #fff; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.5rem 1.25rem;
}
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo { height: 46px; width: auto; border-radius: 4px; }
.nav-menu {
  display: flex; gap: 1.5rem; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.nav-menu a {
  color: #f3f0e8; text-decoration: none; font-weight: 600; font-size: 0.98rem;
  padding: 0.4rem 0.2rem; border-bottom: 2px solid transparent;
}
.nav-menu a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.nav-toggle {
  display: none;
  background: transparent; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 0; position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 2px;
  background: #f3f0e8; transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }

/* Hero -------------------------------------------------------------------- */
.hero { position: relative; background: var(--navy-900); }
.hero-bg img {
  width: 100%; height: clamp(340px, 60vh, 560px); object-fit: cover;
  display: block;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,23,48,0.35) 0%, rgba(8,23,48,0.78) 100%);
  display: flex; align-items: center;
}
.hero-content {
  max-width: var(--maxw); margin-inline: auto; width: 100%;
  padding: 1.25rem 1.25rem; color: #fff;
}
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.8rem;
  color: var(--gold); margin: 0 0 0.5rem; font-weight: 700;
}
.hero-title { color: #fff; margin-bottom: 0.5rem; max-width: 16ch; }
.hero-lede { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 46ch; color: #eef0f4; margin-bottom: 1.6rem; }

/* Sections ---------------------------------------------------------------- */
.section { max-width: var(--maxw); margin-inline: auto; padding: 4rem 1.25rem; }
.section-alt { max-width: none; background: var(--surface-alt); }
.section-alt > * { max-width: var(--maxw); margin-inline: auto; }
.section-head { margin-bottom: 2.5rem; }
.section-sub { color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  /* maroon (logo monogram) — gold failed WCAG AA on the cream background */
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem;
  font-weight: 700; color: var(--maroon); margin: 0 0 0.5rem;
}
.stack > * + * { margin-top: 0.75rem; }

/* Two-column blocks ------------------------------------------------------- */
.grid-2 {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: 1fr 1fr;
}
.figure { margin: 0; }
.figure img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
  object-fit: cover;
}

/* Amenity rows ------------------------------------------------------------ */
.amenity {
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: 1fr 1.2fr;
  padding: 1.75rem 0;
}
.amenity + .amenity { border-top: 1px solid var(--border); }
.amenity-reverse .figure { order: 2; }
.link-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 0.5rem; }
.doc-inline { font-weight: 600; }

/* Document cards ---------------------------------------------------------- */
.doc-grid {
  display: grid; gap: 1.5rem;
  /* 260px min keeps a single column from overflowing on ~320px phones */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.doc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.doc-card h3 {
  margin-bottom: 1rem; padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--gold);
}
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { margin: 0; }
.doc-list li + li { border-top: 1px solid var(--border); }
.doc-list a {
  display: block; padding: 0.6rem 0 0.6rem 1.5rem; text-decoration: none;
  color: var(--text); font-weight: 500; position: relative;
}
.doc-list a::before {
  content: ""; position: absolute; left: 0; top: 0.72rem;
  width: 0.8rem; height: 1rem; background: var(--maroon);
  -webkit-mask: no-repeat center / contain;
  /* simple document glyph */
  clip-path: polygon(0 0, 70% 0, 100% 25%, 100% 100%, 0 100%);
}
.doc-list a:hover { color: var(--maroon); }
.doc-list a:hover::before { background: var(--gold-600); }
.doc-list-lg a { font-size: 1.05rem; padding-left: 1.6rem; }

/* Contact form ------------------------------------------------------------ */
.contact-wrap { max-width: 640px; margin-inline: auto; }
.contact-form { display: block; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.req { color: var(--maroon); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text);
  padding: 0.7rem 0.85rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
}
.field input:focus, .field textarea:focus {
  outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--navy-700);
}
.field textarea { resize: vertical; }
.form-note { color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem; }
.form-status {
  margin-top: 1rem; padding: 0.85rem 1rem; border-radius: var(--radius);
  font-weight: 600;
}
.form-status.is-success { background: #e7f3ea; color: #1c5b32; border: 1px solid #b9ddc4; }
.form-status.is-error   { background: #fbeaea; color: #842020; border: 1px solid #e8c2c2; }

/* Footer ------------------------------------------------------------------ */
.site-footer { background: var(--navy); color: #d9dee7; margin-top: 2rem; }
.footer-inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: 2.5rem 1.25rem; text-align: center;
}
.footer-nav {
  display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center;
  list-style: none; margin: 0 0 1rem; padding: 0;
}
.footer-nav a, .footer-social a { color: var(--gold); text-decoration: none; font-weight: 600; }
.footer-nav a:hover, .footer-social a:hover { color: #fff; text-decoration: underline; }
.footer-privacy { color: #aeb6c4; font-size: 0.92rem; max-width: 60ch; margin-inline: auto; }
.footer-copy { color: #8e97a6; font-size: 0.88rem; margin-bottom: 0; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  nav[aria-label="Primary"] {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--navy); box-shadow: var(--shadow);
  }
  .nav-menu {
    flex-direction: column; align-items: stretch; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  }
  .nav-menu.open { max-height: 320px; }
  .nav-menu li { border-top: 1px solid rgba(255,255,255,0.12); }
  .nav-menu a { display: block; padding: 0.9rem 1.25rem; border-bottom: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

  .grid-2, .amenity { grid-template-columns: 1fr; }
  .amenity-reverse .figure { order: 0; }
  .section { padding: 3rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
