/*
Theme Name: Javier Sells NYC
Theme URI: https://javiersellsnyc.com
Author: Javier Perez-Karam
Description: Custom theme for javiersellsnyc.com. Seller first, valuation led, editorial.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: javiersells
*/

:root {
  --ink: #0b0b0b;
  --ink-2: #2a2a2a;
  --muted: #6a6a6a;
  --stone: #c9c9c9;
  --line: #e2e2df;
  --mist: #f3f3f1;
  --paper: #ffffff;
  --radius: 4px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --display: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6.4vw, 84px); letter-spacing: -0.035em; }
h2 { font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.03em; }
h3 { font-size: clamp(20px, 2vw, 24px); }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 620px; }
.muted { color: var(--muted); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: var(--ink); color: #fff; padding: 10px 14px; clip: auto; width: auto; height: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  padding: 15px 26px; border-radius: var(--radius);
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, transform .2s;
  white-space: nowrap;
}
.btn:hover { background: #333; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.light:hover { background: var(--stone); border-color: var(--stone); }
.btn[disabled] { opacity: .5; cursor: wait; }
.arrow::after { content: "→"; font-family: var(--body); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } .admin-bar .nav { top: 118px; height: calc(100dvh - 118px); } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } .admin-bar .nav { top: 72px; height: calc(100dvh - 72px); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-sub { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover, .nav .current-menu-item > a { text-decoration: underline; }
.nav .btn { padding: 11px 18px; font-size: 14px; color: #fff; }
.nav .btn:hover { text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink); margin: 5px 0; transition: transform .2s, opacity .2s; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .nav {
    position: fixed; top: 72px; left: 0; right: 0; height: calc(100vh - 72px); height: calc(100dvh - 72px); z-index: 60; background: #fff;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 32px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    overflow-y: auto;
  }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li a { display: block; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 22px; font-family: var(--display); font-weight: 600; }
  .nav .btn { margin-top: 24px; padding: 16px; font-size: 16px; }
  body.nav-open .nav { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease, visibility 0s; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* Sections */
.section { padding: clamp(72px, 10vw, 140px) 0; }
.section.tight { padding: clamp(48px, 6vw, 80px) 0; }
.section.mist { background: var(--mist); }
.section.dark { background: var(--ink); color: #fff; }
.section.dark .eyebrow, .section.dark .muted { color: #a3a3a3; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(36px, 5vw, 64px); flex-wrap: wrap; }
.section-head h2 { margin: 0; max-width: 760px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Hero */
.hero { padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 8vw, 112px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 { margin-bottom: 24px; }
.hero-photo { position: relative; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border-radius: var(--radius);  }
.hero-photo figcaption { position: absolute; left: 16px; bottom: 16px; background: #fff; padding: 10px 14px; font-size: 13px; line-height: 1.35; border-radius: var(--radius); }
.hero-photo figcaption b { display: block; font-family: var(--display); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: min(420px, 100%); }
  .hero-photo img { aspect-ratio: 1 / 1; }
}

/* Valuation box */
.val-box { margin-top: 36px; max-width: 620px; }
.val-row { display: grid; grid-template-columns: 1fr 120px auto; border: 1px solid var(--ink); border-radius: var(--radius); background: #fff; overflow: hidden; }
.val-row input { border: 0; padding: 18px 18px; font: inherit; font-size: 16px; min-width: 0; background: transparent; color: var(--ink); }
.val-row input + input { border-left: 1px solid var(--line); }
.val-row input:focus { outline: none; background: var(--mist); }
.val-row .btn { border-radius: 0; }
.val-note { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
@media (max-width: 620px) {
  .val-row { grid-template-columns: 1fr 96px; }
  .val-row .btn { grid-column: 1 / -1; padding: 17px; }
  .val-row input:nth-of-type(1) { border-bottom: 1px solid var(--line); }
  .val-row input + input { border-bottom: 1px solid var(--line); }
}

.section.dark .val-row { border-color: #fff; }
.section.dark .val-row .btn { background: var(--stone); border-color: var(--stone); color: var(--ink); }
.section.dark .val-row .btn:hover { background: #fff; }
.section.dark .val-note { color: #9a9a9a; }

/* Proof strip */
.proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.proof-item { padding: 28px 24px; border-left: 1px solid var(--line); }
.proof-item:first-child { border-left: 0; padding-left: 0; }
.proof-num { font-family: var(--display); font-size: clamp(28px, 3vw, 40px); font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.proof-label { font-size: 14px; color: var(--muted); margin-top: 8px; }
@media (max-width: 760px) {
  .proof-grid { grid-template-columns: 1fr 1fr; }
  .proof-item { padding: 22px 0 22px 16px; }
  .proof-item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .proof-item:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Split / statement */
.statement { font-family: var(--display); font-size: clamp(28px, 3.6vw, 48px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 550; max-width: 980px; }
.statement em { font-style: normal; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.step { padding: 32px 32px 8px 0; }
.step + .step { padding-left: 32px; border-left: 1px solid var(--line); }
.step-num { font-family: var(--display); font-size: 13px; letter-spacing: 0.16em; color: var(--muted); margin-bottom: 20px; }
.step p { color: var(--ink-2); }
.section.dark .steps { border-top-color: #fff; }
.section.dark .step + .step { border-left-color: #333; }
.section.dark .step p { color: #cfcfcf; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step { padding: 28px 0 8px; border-left: 0; }
  .step + .step { border-top: 1px solid var(--line); }
  .section.dark .step + .step { border-top-color: #333; }
}

/* Deals strip: one row of equal boxes */
.deal-strip { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); border: 1px solid var(--ink); border-radius: var(--radius); background: #fff; overflow: hidden; }
.deal-cell { display: flex; flex-direction: column; padding: 24px 20px; min-height: 200px; }
.deal-cell + .deal-cell { border-left: 1px solid var(--line); }
.deal-tag { font-family: var(--display); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.deal-addr { font-size: 18px; margin: 0 0 6px; letter-spacing: -0.015em; }
.deal-meta { color: var(--muted); font-size: 14px; line-height: 1.45; }
.deal-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line); margin-top: auto; }
.deal-cell .deal-foot { margin-top: auto; }
.deal-price { font-family: var(--display); font-weight: 650; font-size: 22px; letter-spacing: -0.02em; }
.deal-side { font-size: 13px; color: var(--muted); margin-top: 2px; }
.deal-meta + .deal-foot { margin-top: auto; }
@media (max-width: 980px) {
  .deal-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .deal-cell { flex: 0 0 62%; scroll-snap-align: start; }
}
@media (max-width: 560px) { .deal-cell { flex-basis: 78%; } }

/* Neighborhood cards */
.hoods { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.hood { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: #fff; transition: border-color .2s, transform .2s; }
.hood:hover { border-color: var(--ink); transform: translateY(-2px); text-decoration: none; }
.hood-boro { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-family: var(--display); font-weight: 600; }
.hood h3 { margin: 10px 0 18px; font-size: 26px; }
.hood-stat { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.hood-stat-label { font-size: 13.5px; color: var(--muted); }
.hood-pair { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.hood .arrow { display: inline-block; margin-top: 18px; font-size: 14px; font-weight: 600; }

/* Stats table */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 8px 0 12px; }
.stat { background: #fff; padding: 24px; }
.stat-num { font-family: var(--display); font-size: 30px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.stat-label { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.source { font-size: 13px; color: var(--muted); }

/* About band */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.about-grid img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-grid img { max-width: min(420px, 100%); aspect-ratio: 1 / 1; } }

/* CTA band */
.cta-band { text-align: left; }
.cta-band h2 { max-width: 820px; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; font-family: var(--display); letter-spacing: 0.01em; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 14px 14px; border: 1px solid #cfcfcc; border-radius: var(--radius);
  background: #fff; color: var(--ink); appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.hp { position: absolute; left: -9999px; }
.form-msg { margin-top: 14px; font-size: 15px; }
.form-msg.error { color: #a32020; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* Valuation tool page */
.tool { border: 1px solid var(--ink); border-radius: var(--radius); background: #fff; }
.tool-head { padding: 26px 28px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.tool-head h3 { margin: 0; font-size: 26px; }
.tool-body { padding: 28px; }
.tool-steps { display: flex; gap: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-family: var(--display); font-weight: 600; color: var(--muted); }
.tool-steps .on { color: var(--ink); }
.snapshot { display: none; }
.snapshot.ready { display: block; }
.sales-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sales-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; align-items: baseline; }
.sales-list .price { font-family: var(--display); font-weight: 600; }
.sales-list .date { color: var(--muted); font-size: 13.5px; min-width: 76px; text-align: right; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 10px 0; }
.loading::before { content: ""; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done-card { text-align: left; padding: 8px 0; }
.done-card h3 { font-size: 30px; }

/* Content */
.page-hero { padding: clamp(48px, 7vw, 104px) 0 clamp(32px, 4vw, 56px); }
.page-hero h1 { font-size: clamp(38px, 5.6vw, 72px); max-width: 980px; }
.prose { font-size: 18px; line-height: 1.7; }
.prose h2 { font-size: clamp(26px, 3vw, 36px); margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose a { text-decoration: underline; }
.prose blockquote { margin: 1.6em 0; padding-left: 22px; border-left: 2px solid var(--ink); font-family: var(--display); font-size: 24px; line-height: 1.3; letter-spacing: -0.015em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose figure, .prose .wp-block-embed { margin: 2em 0; }
.prose iframe { max-width: 100%; }
.wp-block-embed__wrapper { position: relative; }
.wp-embed-aspect-16-9 .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.wp-embed-aspect-16-9 .wp-block-embed__wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Posts */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(28px, 3vw, 44px); }
.post-card { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.post-card:hover { text-decoration: none; }
.post-card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post-thumb { aspect-ratio: 16 / 10; background: var(--mist); border-radius: var(--radius); overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.post-card h3 { font-size: 22px; margin: 0; }
.post-card p { color: var(--ink-2); font-size: 15.5px; margin: 0; }
.pagination { display: flex; gap: 10px; margin-top: 56px; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); text-decoration: none; border-radius: var(--radius); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Footer */
.site-footer { background: var(--ink); color: #d6d6d6; padding: clamp(56px, 7vw, 96px) 0 36px; font-size: 15px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid h4 { color: #fff; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 16px; font-weight: 600; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 9px; }
.footer-grid li a { text-decoration: none; }
.footer-grid li a:hover { text-decoration: underline; }
.footer-brand { font-family: var(--display); font-size: 26px; color: #fff; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 10px; }
.legal { border-top: 1px solid #2a2a2a; margin-top: 56px; padding-top: 26px; font-size: 12.5px; color: #9a9a9a; line-height: 1.6; }
.legal a { color: #cfcfcf; }
.eho { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* Grid children never force overflow on small screens */
.hero-grid > *, .about-grid > *, .two-col > *, .form-grid > *, .footer-grid > * { min-width: 0; }
html { overflow-x: clip; }

/* Utility */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 40px; }
.center { text-align: center; }
.fade { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.fade.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .fade { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
