/*
Theme Name: Capital Square Đà Nẵng
Theme URI: https://capitalsquaredanang.site/
Author: Capital Square editorial team
Description: Premium real-estate editorial theme for Capital Square Đà Nẵng, C3 Royal Place.
Version: 1.1.0-rc1
Requires at least: 6.4
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: capital-square
*/

:root {
  --navy: #0e2fa1;
  --orange: #f37011;
  --paper: #f7f6f2;
  --ink: #101828;
  --muted: #667085;
  --line: #d9dde7;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); background: #fff; line-height: 1.7; }
a { color: var(--navy); }
img { max-width: 100%; height: auto; }
.site-header { background: var(--navy); color: #fff; }
.site-header__inner, .container { width: min(1180px, 92vw); margin: 0 auto; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.brand span { display: block; font-size: .62rem; letter-spacing: .18em; opacity: .8; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.site-nav a { color: #fff; text-decoration: none; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.site-main { min-height: 60vh; }
.page-hero { padding: clamp(3rem, 8vw, 7rem) 0; background: var(--paper); }
.page-hero h1 { max-width: 18ch; font-size: clamp(2rem, 6vw, 4.5rem); line-height: 1.05; margin: 0; }
.page-hero .lead { max-width: 70ch; color: var(--muted); margin-top: 1rem; }
.section { padding: clamp(2rem, 5vw, 4rem) 0; }
.section--paper { background: var(--paper); }
.article-meta { color: var(--muted); font-size: .8rem; }
.article-body h2, .article-body h3 { line-height: 1.25; }
.article-body table { width: 100%; border-collapse: collapse; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: .65rem; text-align: left; vertical-align: top; }
.article-body th { background: var(--paper); }
.article-body blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--orange); }
.article-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.article-gallery figure { margin: 0; }
.article-gallery figcaption { font-size: .72rem; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.card { border: 1px solid var(--line); background: #fff; }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.card__body { padding: 1rem; }
.card h2 { font-size: 1.1rem; line-height: 1.35; margin: 0 0 .5rem; }
.site-footer { background: #071a4a; color: #fff; padding: 3rem 0; margin-top: 3rem; }
.site-footer a { color: #fff; }
@media (max-width: 820px) {
  .card-grid, .article-gallery { grid-template-columns: 1fr; }
  .site-header__inner { align-items: flex-start; flex-direction: column; }
}

/* Keep the language switcher readable against the header and light sections. */
.language-switcher { display: inline-flex; gap: .35rem; align-items: center; }
.language-switcher a { color: #fff !important; background: #0e2fa1; padding: .25rem .4rem; line-height: 1.2; text-decoration: none; }
.language-switcher a:hover, .language-switcher a:focus { background: #f37011; color: #fff !important; }

.cs-calc { display: grid; gap: 1rem; max-width: 720px; margin-top: 1.5rem; }
.cs-calc label { display: grid; gap: .4rem; font-weight: 600; }
.cs-calc input[type="range"] { width: 100%; }
.cs-calc output { display: block; padding: 1rem; background: #fff; border: 1px solid #d9dde7; font-size: 1.05rem; }

/* Match the Next.js shell: fixed header has no template padding; reveal content is visible without JS. */
.site-header__inner { padding: 0 !important; }
.site-main { min-height: 60vh; }
.reveal, .reveal-delay-1, .reveal-delay-2, .reveal-delay-3, .reveal-delay-4 { opacity: 1 !important; transform: none !important; transition: none !important; }
.site-header--overlay { background: linear-gradient(#040d1c8c, #0000) !important; }
.site-header--overlay.is-scrolled { background: #f4efe4f0 !important; color: var(--ink-900); }
.site-main > .page-hero:first-child, .site-main > .hero:first-child { margin-top: 0; }
@media (max-width: 980px) { .site-header__inner { padding: 0 !important; } }

/* The imported page hero uses the full Next.js grid column width. */
.page-hero h1 { max-width: none !important; }

@media (min-width: 981px) { .cta-band { min-height: 480px; } }

/* The snapshot page hero is 8px shorter than the live Next.js equivalent at desktop widths. */
.page-hero { padding-bottom: calc(clamp(2.4rem, 5vw, 4rem) + 8px) !important; }

@media (min-width: 981px) { .page-hero { padding-bottom: 59.2px !important; } }

@media (max-width: 720px) { .cta-band { min-height: 689px; } }

@media (max-width: 980px) { .page-hero { padding-bottom: 43.2px !important; } }

.site-footer { padding-bottom: 0 !important; }

.site-footer { margin-top: 0 !important; }

@media (max-width: 980px) {
  .site-header__inner { flex-direction: row !important; align-items: center !important; height: 100%; }
}

@media (max-width: 720px) {
  .brand__sub { display: none !important; }
  .mobile-contact-bar__item img { width: 18px; height: 18px; object-fit: contain; }
}

@media (max-width: 720px) { .distance-row strong { line-height: 1.5 !important; } }

@media (max-width: 720px) {
  .distance-row { padding-block: 15.7px !important; }
  .distance-row:nth-child(5), .distance-row:nth-child(6) { padding-block: 14.2px !important; }
}

@media (max-width: 720px) {
  .distance-row { grid-template-columns: minmax(0, 1fr) 178px 52px !important; padding-block: 15.2px !important; }
  .distance-row strong { line-height: 1.65 !important; }
  .distance-row:nth-child(5), .distance-row:nth-child(6) { padding-block: 15.2px !important; }
}

@media (max-width: 720px) {
  .distance-row { grid-template-columns: minmax(0, 1fr) auto 52px !important; padding-block: 15.2px !important; }
  .distance-row strong { line-height: 1.65 !important; }
}

@media (max-width: 720px) {
  .distance-row { height: 71px !important; padding-block: 15.2px !important; align-items: center; }
  .distance-row:nth-child(5), .distance-row:nth-child(6) { height: 88px !important; }
  .distance-row:nth-child(-n+4) span { white-space: nowrap; }
}

@media (min-width: 981px) {
  .distance-row { height: 71px !important; padding-block: 15.2px !important; align-items: center; }
}

.site-main { min-height: 0 !important; }

/* 320px contact fix: keep grid children and map images inside the viewport. */
@media (max-width: 720px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .contact-layout > * { min-width: 0 !important; }
  .consultant-card { grid-template-columns: 64px minmax(0, 1fr) !important; }
  .contact-channel { grid-template-columns: 72px minmax(0, 1fr) !important; }
  .map-embed, .media-slot, .media-slot img { min-width: 0 !important; max-width: 100% !important; width: 100% !important; }
}

/* Brand typography parity with Next reference (override legacy .brand span). */
.brand .brand__name { font-size: .78rem; letter-spacing: .2em; opacity: 1; }
.brand .brand__sub { font-size: .56rem; letter-spacing: .11em; opacity: 1; }
@media (max-width: 720px) {
  .brand .brand__name { font-size: .68rem; }
  .brand__sub { display: none !important; }
}

/* Brand mark parity: center CS inside the 36px box and use Next type scale. */
.brand .brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--orange);
  border: 1px solid var(--orange);
}
@media (max-width: 720px) {
  .brand .brand__mark { width: 30px; height: 30px; font-size: 13px; }
}

/* Match Next header wordmark tracking exactly. */
.brand .brand__name { letter-spacing: .16em; }

/* Accessible brand mark on dark navy: lighter orange, 4.5:1+ */
.site-header .brand__mark, .site-footer .brand__mark { color: #F37011; border-color: #F37011; }
