/* Rabern apartment sites — modern design system.
   Per-site brand colors arrive as CSS custom properties from base.html. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; line-height: 1.15; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin: 0 0 .5em; }
h3 { font-size: 1.2rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--c-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: min(1160px, 92%); margin: 0 auto; }
.container.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--c-muted); }
.lead { font-size: 1.12rem; color: var(--c-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--c-primary); margin: 0 0 .5em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; border: 0; border-radius: 999px;
  padding: .8em 1.6em; font-weight: 600; font-size: .98rem; line-height: 1;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 6px 18px -6px var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--c-primary-dark); border: 1.5px solid var(--c-primary); }
.btn-outline:hover { background: var(--c-primary); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.28); color: #fff; }
.btn-sm { padding: .55em 1.1em; font-size: .88rem; }
.btn-xs { padding: .42em .9em; font-size: .8rem; }
.btn-lg { padding: 1em 2.1em; font-size: 1.05rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--c-text); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 44px; width: auto; border-radius: 6px; }
.brand-name { font-family: 'Fraunces', serif; font-size: 1.15rem; }
.main-nav { display: flex; align-items: center; gap: 1.3rem; }
.main-nav a { color: var(--c-text); font-weight: 500; font-size: .96rem; }
.main-nav a:hover { color: var(--c-primary); text-decoration: none; }
.main-nav .nav-cta { background: var(--c-primary); color: #fff; padding: .55em 1.2em; border-radius: 999px; }
.main-nav .nav-cta:hover { background: var(--c-primary-dark); }
.main-nav .nav-link-muted { color: var(--c-muted); font-size: .88rem; }
.nav-burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav-burger span { width: 24px; height: 2px; background: var(--c-text); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
/* Off-canvas helpers — desktop hides them; the mobile media query turns them on. */
.nav-overlay { display: none; }
.nav-close { display: none; }

/* ---------- Special bar ---------- */
.special-bar { background: var(--c-accent); color: #1c1c1c; font-size: .95rem; }
.special-bar .container { padding: .55rem 0; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.special-bar a { color: #1c1c1c; font-weight: 700; }

/* ---------- Hero ---------- */
.hero { background-size: cover; background-position: center; color: #fff; }
.hero-inner { padding: clamp(4rem, 12vh, 9rem) 0; max-width: 760px; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .8rem; font-weight: 600; opacity: .92; margin: 0 0 1rem; }
.hero h1 { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.hero-sub { font-size: 1.2rem; opacity: .96; max-width: 38ch; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.center-cta { justify-content: center; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--c-bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.6rem; }
.page-head { background: var(--c-bg-alt); padding: clamp(2.6rem, 6vw, 4rem) 0 clamp(1.6rem,4vw,2.4rem); border-bottom: 1px solid rgba(0,0,0,.06); }

/* ---------- Amenities ---------- */
.amenity-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem 1.6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.amenity-grid li { display: flex; align-items: center; gap: .7rem; font-weight: 500; }
.amenity-grid .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-primary); flex: none; }

/* ---------- Cards / plans ---------- */
.card-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.plan-card { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 16px; overflow: hidden; color: var(--c-text); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.plan-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(0,0,0,.4); }
.plan-thumb { position: relative; aspect-ratio: 4/3; background: var(--c-bg-alt); display: flex; align-items: center; justify-content: center; }
.plan-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plan-thumb-empty { font-family: 'Fraunces', serif; font-size: 1.6rem; color: var(--c-muted); }
.badge { position: absolute; top: .7rem; left: .7rem; background: var(--c-primary); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .3em .7em; border-radius: 999px; }
.badge-accent { background: var(--c-accent); color: #1c1c1c; }
.plan-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.plan-meta { color: var(--c-muted); font-size: .92rem; margin: 0; }
.plan-rent { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600; margin: .2rem 0; }
.plan-rent span { font-size: .85rem; font-family: 'Inter', sans-serif; color: var(--c-muted); font-weight: 400; }
.plan-rent .from { font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; }
.plan-market { color: var(--c-muted); font-size: .85rem; margin: -.1rem 0 0; text-decoration: line-through; }
.plan-special { color: var(--c-primary-dark); font-size: .9rem; font-weight: 600; margin: 0; }

/* clickable plan card hint */
.plan-thumb .view-hint { position: absolute; bottom: .7rem; right: .7rem; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; font-weight: 600; padding: .3em .7em; border-radius: 999px; opacity: 0; transition: opacity .15s ease; }
.plan-card:hover .view-hint { opacity: 1; }

/* expanded floor-plan modal (:target, no JS) */
.fp-modal { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 2rem; }
.fp-modal:target { display: flex; }
.fp-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.fp-dialog { position: relative; z-index: 1; background: #fff; border-radius: 18px; overflow: hidden; max-width: 920px; width: 100%; max-height: 90vh; display: grid; grid-template-columns: 1.1fr 1fr; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.fp-media { background: var(--c-bg-alt); display: flex; align-items: center; justify-content: center; max-height: 90vh; }
.fp-media img { width: 100%; height: 100%; max-height: 90vh; object-fit: contain; }
.fp-info { padding: 1.8rem 1.9rem; overflow-y: auto; }
.fp-info h2 { margin-bottom: .2em; }
.fp-close { position: absolute; top: .8rem; right: 1rem; z-index: 2; color: var(--c-text); font-size: 2rem; line-height: 1; text-decoration: none; background: rgba(255,255,255,.85); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.fp-close:hover { text-decoration: none; background: #fff; }
.fp-rates { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.fp-rates th { text-align: left; padding: .55rem .2rem; font-weight: 500; color: var(--c-muted); border-bottom: 1px solid rgba(0,0,0,.07); }
.fp-rates td { text-align: right; padding: .55rem .2rem; font-weight: 700; border-bottom: 1px solid rgba(0,0,0,.07); }
@media (max-width: 720px) {
  .fp-modal { padding: .6rem; }                                  /* was 2rem — reclaim screen space */
  .fp-dialog { grid-template-columns: 1fr; max-height: 96vh; }   /* was 90vh */
  .fp-media { max-height: 32vh; }                                /* was 38vh — image a touch smaller */
  .fp-info { padding: 1.2rem 1.3rem; }                           /* was 1.8rem 1.9rem */
}

/* rate matrix */
.rate-matrix { margin-top: 3.5rem; }
.rate-matrix h2 { margin-bottom: .2em; }
.rate-table th { white-space: nowrap; }
.rate-table td { font-weight: 600; }
.rate-table td.market { color: var(--c-muted); font-weight: 500; }
.rate-table tbody tr:hover td { background: var(--c-bg-alt); }
.rate-note { margin-top: 1rem; color: var(--c-muted); font-size: .88rem; font-style: italic; }
.plan-actions { display: flex; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.fineprint { color: var(--c-muted); font-size: .85rem; margin-top: 2rem; }

/* ---------- Photo strip & gallery ---------- */
.photo-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .6rem; margin-bottom: 1.6rem; }
.photo-strip img { aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; }
.gallery { columns: 3 260px; column-gap: 1rem; }
.gallery-item { display: block; margin: 0 0 1rem; break-inside: avoid; }
.gallery-item img { width: 100%; border-radius: 12px; transition: filter .15s ease; }
.gallery-item:hover img { filter: brightness(1.05); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: none; align-items: center; justify-content: center; z-index: 100; padding: 2rem; }
.lightbox:target { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 1.2rem; right: 1.6rem; color: #fff; font-size: 2.6rem; line-height: 1; text-decoration: none; }

/* ---------- Availability ---------- */
.filters { display: flex; gap: 1rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.6rem; background: var(--c-bg-alt); padding: 1.1rem 1.2rem; border-radius: 14px; }
.filters label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; }
.filters select { padding: .55em .8em; border-radius: 9px; border: 1px solid rgba(0,0,0,.18); font-size: .95rem; background: #fff; min-width: 120px; }
.table-wrap { overflow-x: auto; border: 1px solid rgba(0,0,0,.08); border-radius: 14px; }
.avail-table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 720px; }
.avail-table th { background: var(--c-bg-alt); text-align: left; padding: .85rem 1rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.avail-table td { padding: .8rem 1rem; border-top: 1px solid rgba(0,0,0,.06); }
.avail-table td.num { font-weight: 700; white-space: nowrap; }
.avail-table .special-price { color: var(--c-primary-dark); }
.avail-table .strike { color: var(--c-muted); font-weight: 400; text-decoration: line-through; font-size: .88em; }
.avail-table tr:hover td { background: var(--c-bg-alt); }
.pill { font-size: .75rem; font-weight: 700; padding: .3em .7em; border-radius: 999px; white-space: nowrap; }
.pill-now { background: #e7f6ec; color: #1b7a3d; }
.pill-soon { background: #fff3e0; color: #9a5b00; }
.empty-state { text-align: center; padding: 3rem 1rem; background: var(--c-bg-alt); border-radius: 16px; }

/* ---------- Steps / apply ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 2.4rem; display: grid; gap: 1.4rem; }
.steps li { display: flex; gap: 1rem; align-items: flex-start; }
.steps li span { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: 'Fraunces', serif; }
.apply-cta { display: flex; gap: .9rem; flex-wrap: wrap; justify-content: center; margin: 1rem 0 1.4rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 2rem; grid-template-columns: 1fr 1.2fr; align-items: start; }
.contact-card h3 { margin-top: 1.3rem; }
.contact-card h3:first-child { margin-top: 0; }
.hours { border-collapse: collapse; }
.hours th { text-align: left; padding: .25rem 1.4rem .25rem 0; font-weight: 500; }
.hours td { color: var(--c-muted); }
.contact-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.contact-map iframe { width: 100%; min-height: 380px; border: 0; border-radius: 16px; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--c-bg-alt); }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-primary-dark); color: rgba(255,255,255,.85); margin-top: auto; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 3rem 0 2rem; }
.footer-brand { font-family: 'Fraunces', serif; font-size: 1.25rem; color: #fff; margin-bottom: .6rem; }
.footer-heading { font-weight: 700; color: #fff; margin-bottom: .6rem; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.footer-grid .muted { color: rgba(255,255,255,.6); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding: 1.2rem 0 2rem; border-top: 1px solid rgba(255,255,255,.16); font-size: .85rem; }
.eho { display: flex; align-items: center; gap: .4rem; }
.eho-mark { border: 1px solid currentColor; border-radius: 3px; padding: 0 .25em; font-size: .9em; }

/* ---------- Responsive nav ---------- */
@media (max-width: 860px) {
  /* The sticky header uses backdrop-filter, which makes it a containing block
     for position:fixed descendants — that trapped the drawer/overlay inside the
     ~67px header. Drop it on mobile so they anchor to the viewport instead. */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }

  /* Burger stays above the panel so it's always tappable to toggle closed. */
  .nav-burger { display: flex; position: relative; z-index: 70; }

  /* Slide-in drawer pinned to the right edge (right:0 keeps it inside the
     viewport; html{overflow-x:hidden} clips the off-canvas state so the page
     never scrolls sideways). */
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: min(280px, 80%);
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: 5rem 1.6rem 2rem; gap: 1.1rem;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -10px 0 40px -20px rgba(0,0,0,.5);
    z-index: 60; overflow-y: auto;
  }
  .nav-toggle:checked ~ .site-header .main-nav { transform: translateX(0); }

  /* Dim/tap-to-close backdrop behind the drawer. */
  .nav-overlay {
    display: block; position: fixed; inset: 0; border: 0; margin: 0; padding: 0;
    background: rgba(0,0,0,.45); cursor: pointer; z-index: 55;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
  }
  .nav-toggle:checked ~ .site-header .nav-overlay { opacity: 1; visibility: visible; }

  /* Explicit "×" inside the drawer. */
  .nav-close {
    display: grid; place-items: center;
    position: absolute; top: .7rem; right: .9rem;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 1.9rem; line-height: 1; color: var(--c-text);
    cursor: pointer; background: var(--c-bg-alt);
  }

  /* Burger morphs into an X while open. */
  .nav-toggle:checked ~ .site-header .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .site-header .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .site-header .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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