/* ==========================================================
   HomeCostly — main stylesheet
   Light, editorial-meets-financial design language.
   Palette: ink navy + spruce green (trust/value) + warm copper
   (highlight) on a cool paper background. Serif display type
   paired with a clean grotesk for UI and body copy.
   ========================================================== */

:root {
  /* Colour */
  --ink-900: #172531;
  --ink-800: #223347;
  --ink-700: #2f4459;
  --ink-500: #5b7386;
  --ink-300: #9fb0bd;
  --paper-0: #F7F8F6;
  --paper-50: #FFFFFF;
  --paper-100: #EEF1EC;
  --line: #DDE2DC;
  --line-strong: #C4CBC3;

  --spruce-900: #123B30;
  --spruce-700: #1F6F5C;
  --spruce-600: #268370;
  --spruce-100: #E1EFE9;
  --spruce-50: #EFF6F2;

  --copper-700: #A15A28;
  --copper-600: #C77B3B;
  --copper-100: #FBE9D8;
  --copper-50: #FDF3E9;

  --red-700: #9A2E23;
  --red-100: #FBE3DF;

  --text-primary: var(--ink-900);
  --text-secondary: var(--ink-700);
  --text-muted: var(--ink-500);
  --text-on-dark: #F3F5F1;

  /* Type */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --container: 1160px;
  --shadow-card: 0 1px 2px rgba(23, 37, 49, 0.06), 0 6px 20px rgba(23, 37, 49, 0.05);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: light only; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--paper-0);
}
img { max-width: 100%; display: block; }
a { color: var(--spruce-700); text-decoration: none; }
a:hover { color: var(--spruce-900); }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--ink-900); }
h1 { font-size: clamp(2rem, 1.6rem + 1.8vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; color: var(--text-secondary); }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--spruce-600); outline-offset: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--muted { background: var(--paper-100); }
.section-head { max-width: 620px; margin: 0 0 36px; }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--spruce-700);
  margin-bottom: .6em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--spruce-700); color: #fff; }
.btn-primary:hover { background: var(--spruce-900); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink-900); border-color: var(--ink-900); }
.btn-secondary:hover { background: var(--ink-900); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-800); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper-100); }
.btn-copper { background: var(--copper-600); color: #fff; }
.btn-copper:hover { background: var(--copper-700); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: .85rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,248,246,.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--ink-900); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--spruce-700); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; flex-shrink: 0; }
.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a { font-size: .93rem; font-weight: 500; color: var(--ink-800); }
.main-nav a:hover { color: var(--spruce-700); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.country-switch { display: flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; font-size: .82rem; font-weight: 600; }
.country-switch a { padding: 6px 12px; color: var(--ink-700); }
.country-switch a.active { background: var(--ink-900); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 18px; height: 2px; background: var(--ink-900); position: relative; transition: .2s; }
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.mobile-panel { display: none; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: .4em; }
.hero .lede { font-size: 1.12rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.hero-stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink-900); }
.hero-stat span { font-size: .82rem; color: var(--text-muted); }

.hero-panel {
  background: var(--paper-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
}
.hero-panel .panel-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.hero-panel .panel-title { font-family: var(--font-display); font-size: 1.15rem; margin: 6px 0 18px; }
.ledger { border-top: 1px solid var(--line); }
.ledger-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed var(--line-strong); font-size: .92rem; }
.ledger-row.total { border-bottom: none; border-top: 2px solid var(--ink-900); margin-top: 4px; padding-top: 14px; font-weight: 700; font-size: 1.05rem; }
.ledger-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-900); }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper-50);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); transform: translateY(-2px); }

/* ---------- media cards (photo/illustration + body) ----------
   Any card that carries a top image uses .card-media--wrap so the
   image can bleed to the card edges while the text keeps normal
   card padding. Used by calculator cards, guide/blog cards and
   country cards throughout the public site. */
.card-media--wrap { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--paper-100); }
.card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.card-media { min-height: 220px; }
@media (max-width: 760px) { .card-media { min-height: 210px; } }
.card-media--wrap:hover .card-media img { transform: scale(1.06); }
.card-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(18,28,37,0) 62%, rgba(18,28,37,.28) 100%);
}
.card-media .media-tag {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: rgba(23,37,49,.85); color: #fff; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 5px 11px; border-radius: 999px;
  backdrop-filter: blur(2px);
}
.card-media .media-tag.tag-copper { background: rgba(161,90,40,.92); }
.card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }

.calc-card { display: flex; flex-direction: column; }
.calc-card .calc-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--spruce-50); color: var(--spruce-700); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.calc-card h3 { margin-bottom: 2px; font-size: 1.08rem; }
.calc-card p { font-size: .9rem; margin-bottom: 4px; flex: 1; }
.calc-card .calc-link { font-size: .85rem; font-weight: 600; }

.article-card { display: flex; flex-direction: column; }
.article-card .article-body { padding: 0; flex: 1; display: flex; flex-direction: column; }
.article-card .cat-tag { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--copper-700); }
.article-card h3 { font-size: 1.08rem; margin: 6px 0; }
.article-card p { flex: 1; }
.article-card .meta { font-size: .8rem; color: var(--text-muted); }

.country-card { display: flex; flex-direction: column; }
.country-card .country-body { padding: 18px 20px 22px; display: flex; align-items: center; gap: 14px; }
.country-card .flag { font-size: 1.8rem; line-height: 1; }
.country-card h3 { margin: 0 0 4px; }

.step-item { display: flex; gap: 16px; }
.step-num { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--ink-900); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; }

.trust-list li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.trust-list li:last-child { border-bottom: none; }
.trust-check { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--spruce-100); color: var(--spruce-700); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }

/* ---------- badges / alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-uk { background: var(--copper-100); color: var(--copper-700); }
.badge-usa { background: var(--spruce-100); color: var(--spruce-700); }
.badge-muted { background: var(--paper-100); color: var(--ink-700); }

.alert { padding: 14px 18px; border-radius: var(--radius); font-size: .92rem; margin-bottom: 20px; border: 1px solid transparent; }
.alert-success { background: var(--spruce-50); border-color: var(--spruce-100); color: var(--spruce-900); }
.alert-error { background: var(--red-100); border-color: #f2c7c0; color: var(--red-700); }
.alert-info { background: var(--paper-100); border-color: var(--line); color: var(--ink-800); }

/* ---------- breadcrumbs ---------- */
.breadcrumbs { padding: 16px 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; color: var(--text-muted); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--line-strong); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--spruce-700); }

/* ---------- forms ---------- */
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-800); }
.field { margin-bottom: 18px; }
.help-text { font-size: .8rem; color: var(--text-muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=number], input[type=password], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: .95rem;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-50);
  color: var(--ink-900);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--spruce-600); box-shadow: 0 0 0 3px var(--spruce-100); }
textarea { resize: vertical; min-height: 130px; }
.field-error { color: var(--red-700); font-size: .8rem; margin-top: 5px; }
.field.has-error input, .field.has-error select { border-color: var(--red-700); }

.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.option-tile { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: center; font-size: .88rem; font-weight: 600; transition: border-color .15s, background .15s; }
.option-tile:hover { border-color: var(--spruce-600); }
.option-tile input { position: absolute; opacity: 0; pointer-events: none; }
.option-tile.selected { border-color: var(--spruce-700); background: var(--spruce-50); color: var(--spruce-900); }

/* ---------- calculator ---------- */
.calc-shell { max-width: 760px; margin: 0 auto; }
.calc-progress { display: flex; gap: 6px; margin-bottom: 34px; }
.calc-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.calc-progress span.done { background: var(--spruce-700); }
.calc-step { display: none; }
.calc-step.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }
.calc-step-head { margin-bottom: 22px; }
.calc-step-head .step-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; }
.calc-nav { display: flex; justify-content: space-between; margin-top: 28px; }
.calc-loading { display: none; text-align: center; padding: 60px 0; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--spruce-700); margin: 0 auto 16px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- results ---------- */
.result-hero { text-align: center; padding: 8px 0 24px; }
.result-hero .range { font-family: var(--font-display); font-size: clamp(2rem, 1.6rem + 1.6vw, 2.9rem); color: var(--ink-900); margin: 6px 0; }
.result-hero .typical-tag { display: inline-block; margin-top: 10px; background: var(--copper-50); color: var(--copper-700); border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: .9rem; }
.result-breakdown { max-width: 480px; margin: 28px auto; }
.factors-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0 8px; }
.factor-chip { display: flex; align-items: center; gap: 8px; font-size: .87rem; color: var(--ink-700); padding: 10px 12px; background: var(--paper-100); border-radius: var(--radius-sm); }
.result-actions { display: flex; gap: 14px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* ---------- guide / article ---------- */
.article-header { max-width: 780px; margin: 0 auto 32px; text-align: left; }
.article-header .badge { margin-bottom: 14px; }
.article-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: .85rem; margin-top: 12px; }
.article-body { max-width: 720px; margin: 0 auto; }
.article-body h2 { margin-top: 1.8em; }
.article-body h3 { margin-top: 1.4em; }
.article-body ul, .article-body ol { padding-left: 1.3em; margin-bottom: 1em; }
.article-body li { list-style: disc; color: var(--text-secondary); margin-bottom: .4em; }
.article-body ol li { list-style: decimal; }
.quick-answer { background: var(--spruce-50); border: 1px solid var(--spruce-100); border-radius: var(--radius); padding: 20px 22px; margin: 24px 0; }
.quick-answer .label { font-size: .78rem; text-transform: uppercase; font-weight: 700; color: var(--spruce-700); letter-spacing: .04em; }
.cost-box { background: var(--paper-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 24px 0; }
.cost-box .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.cost-box .row:last-child { border-bottom: none; }
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item h4 { margin-bottom: 6px; }
table.data-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .9rem; }
table.data-table th, table.data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data-table th { background: var(--paper-100); font-weight: 700; }

/* ---------- FAQ accordion ---------- */
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-trigger { width: 100%; text-align: left; background: none; border: none; padding: 18px 0; font-weight: 600; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; color: var(--ink-900); }
.accordion-panel { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.accordion-panel p { padding-bottom: 16px; margin: 0; }
.accordion-item.open .accordion-panel { max-height: 400px; }
.accordion-item.open .accordion-icon { transform: rotate(45deg); }
.accordion-icon { transition: transform .2s ease; font-size: 1.2rem; color: var(--spruce-700); }

/* ---------- newsletter ---------- */
.newsletter { background: var(--ink-900); color: var(--text-on-dark); border-radius: var(--radius-lg); padding: 44px; display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.newsletter h2 { color: #fff; margin-bottom: .3em; }
.newsletter p { color: #C4CFC6; margin: 0; }
.newsletter-form { display: flex; gap: 10px; flex: 0 0 380px; max-width: 100%; }
.newsletter-form input { flex: 1; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink-900); color: #C4CFC6; padding: 60px 0 24px; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 30px; padding-bottom: 40px; border-bottom: 1px solid #2C3F4F; }
.footer-brand .brand { color: #fff; }
.footer-brand p { color: #93A3AC; font-size: .88rem; max-width: 30ch; margin-top: 12px; }
.footer-col h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.footer-col a { display: block; color: #A9B7BE; font-size: .88rem; padding: 5px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; font-size: .82rem; color: #7C8B93; flex-wrap: wrap; gap: 10px; }
.social-icons { display: flex; gap: 12px; }
.social-icons a { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #3A4E5D; display: flex; align-items: center; justify-content: center; color: #C4CFC6; }

/* ---------- ad slot ---------- */
.ad-slot { background: var(--paper-100); border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; padding: 18px; font-size: .78rem; color: var(--text-muted); margin: 30px 0; }

/* ---------- misc pages ---------- */
.error-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; }
.error-code { font-family: var(--font-display); font-size: 5rem; color: var(--spruce-700); margin: 0; }
.legal-content { max-width: 760px; margin: 0 auto; }
.legal-content h2 { margin-top: 1.6em; }
.about-photo { margin: 32px 0 38px; }
.about-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.about-photo figcaption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.55;
}
.about-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 34px;
  align-items: center;
  margin-bottom: 34px;
}
.about-intro-grid .about-photo--intro { margin: 0; }
.about-photo--intro img { aspect-ratio: 4 / 3; }

.about-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 30px 0 38px;
}
.about-photo-grid .about-photo { margin: 0; }
@media (max-width: 760px) {
  .about-intro-grid { grid-template-columns: 1fr; gap: 20px; }
  .about-photo-grid { grid-template-columns: 1fr; }
}

/* ---------- about page: hero + founder ---------- */
.about-hero {
  margin: 0 0 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.about-hero img {
  width: 100%;
  height: clamp(220px, 34vw, 460px);
  object-fit: cover;
  display: block;
}
.about-intro { margin-bottom: 52px; }
.about-intro h1 { margin-bottom: .55em; }
.about-intro p:last-child { margin-bottom: 0; }

.founder-section { margin: 8px 0 44px; }
.founder-section h2 { margin: 0 0 20px; }
.founder-card {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  background: var(--paper-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px;
  margin-top: 6px;
  box-shadow: var(--shadow-card);
}
.founder-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--paper-50);
}
.founder-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1122 / 1402; /* exact ratio of the original photo — no cropping */
  object-fit: contain;
  display: block;
}
.founder-bio h3.founder-name { margin-bottom: .15em; font-family: var(--font-display); font-size: 1.5rem; }
.founder-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
  color: var(--spruce-700);
  margin-bottom: 1.1em;
}
.founder-bio p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .founder-card {
    grid-template-columns: 1fr;
    padding: 26px 22px;
    text-align: left;
  }
  .founder-photo { max-width: 260px; margin: 0 auto; }
  .founder-bio { text-align: left; }
}


/* ---------- utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-muted); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .main-nav { display: none; }
  .country-switch { display: none; }
  .nav-toggle { display: flex; }
  .mobile-panel.open { display: block; padding: 10px 24px 20px; border-top: 1px solid var(--line); }
  .mobile-panel a { display: block; padding: 11px 0; font-weight: 500; color: var(--ink-800); border-bottom: 1px solid var(--line); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .newsletter { flex-direction: column; align-items: flex-start; }
  .newsletter-form { flex: 1 1 100%; }
  .factors-grid { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { line-height: 1.15; }
}
@media (max-width: 420px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .option-grid { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================
   MOBILE RESPONSIVE PATCH — HomeCostly
   Keeps desktop styling intact and improves small screens.
   ========================================================== */
html, body { overflow-x: hidden; }
button, input, select, textarea { max-width: 100%; }

@media (max-width: 760px) {
  .header-inner { padding: 11px 16px; gap: 10px; }
  .brand { font-size: 1.15rem; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-actions { gap: 8px; }
  .header-actions > .btn { display: none; }
  .nav-toggle { flex-shrink: 0; }
  .mobile-panel.open { padding: 8px 16px 18px; }
  .mobile-panel a { padding: 10px 0; }

  .hero { padding: 42px 0 38px; }
  .hero-grid { gap: 28px; }
  .hero .lede { font-size: 1rem; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { gap: 18px 24px; margin-top: 28px; }
  .hero-stat { min-width: 100px; }

  .section { padding: 46px 0; }
  .section--tight { padding: 30px 0; }
  .section-head { margin-bottom: 26px; }
  .card { padding: 18px; }
  .country-card { padding: 18px; }
  .step-item { gap: 12px; }
  .newsletter { padding: 28px 20px; }
  .newsletter-form { width: 100%; flex-direction: column; }
  .newsletter-form .btn { width: 100%; }

  .calc-shell { width: 100%; }
  .calc-nav { gap: 10px; }
  .calc-nav .btn { flex: 1; }
  .option-grid { gap: 8px; }
  .option-tile { padding: 12px 8px; min-width: 0; }

  .article-header { padding: 0 16px; }
  .article-meta { flex-wrap: wrap; gap: 8px 14px; }
  .article-body { width: 100%; }
  table.data-table { display: block; overflow-x: auto; white-space: nowrap; }


  .footer-top { gap: 20px 16px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .container { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: clamp(1.85rem, 9vw, 2.35rem); }
  h2 { font-size: 1.55rem; }
  .hero-panel { padding: 20px 16px; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-stat:last-child { grid-column: 1 / -1; }
  .calc-nav { flex-direction: column-reverse; }
  .calc-nav .btn { width: 100%; }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .factors-grid { grid-template-columns: 1fr; }
  .newsletter { border-radius: 10px; }
  .footer-top { grid-template-columns: 1fr; }
}

/* ==========================================================
   Cookie consent — compact bottom-right notice
   ========================================================== */
.cookie-consent-root {
  --cookie-bg: #172531;
  --cookie-ink: #ffffff;
  --cookie-muted: #c5d0d5;
  --cookie-line: rgba(255,255,255,.14);
  --cookie-accent: #2f766b;
  --cookie-accent-dark: #245b53;
}
.cookie-banner {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  width: min(390px, calc(100vw - 32px));
  background: var(--cookie-bg);
  color: var(--cookie-ink);
  border: 1px solid var(--cookie-line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(23,37,49,.30), 0 4px 14px rgba(23,37,49,.16);
  padding: 18px;
  display: none;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner.visible { display: block; animation: cookie-in .2s ease; }
.cookie-copy { min-width: 0; }
.cookie-banner h2 {
  margin: 0 0 7px;
  color: var(--cookie-ink);
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.25;
}
.cookie-banner p {
  margin: 0;
  color: var(--cookie-muted);
  font-size: .79rem;
  line-height: 1.5;
}
.cookie-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.cookie-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 36px;
  padding: 8px 15px;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.cookie-btn:hover { transform: translateY(-1px); }
.cookie-btn:focus-visible { outline: 3px solid rgba(255,255,255,.25); outline-offset: 2px; }
.cookie-btn-primary { background: var(--cookie-accent); border-color: var(--cookie-accent); color: #fff; }
.cookie-btn-primary:hover { background: var(--cookie-accent-dark); border-color: var(--cookie-accent-dark); }
.cookie-btn-ghost { background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.cookie-btn-ghost:hover { background: rgba(255,255,255,.08); }
@keyframes cookie-in { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@media (max-width:560px) {
  .cookie-banner {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    padding: 15px;
    border-radius: 12px;
  }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .cookie-btn { flex: 1; }
}

/* ---------- image card responsive refinements ---------- */

@media (max-width: 760px) {
  .card-media--wrap { border-radius: var(--radius); }
  .card-body { padding: 16px 16px 18px; }
  .country-card .country-body { padding: 16px; }
  .media-tag { font-size: .66rem; padding: 4px 9px; top: 10px; left: 10px; }
}
@media (max-width: 420px) {
  .card-media { aspect-ratio: 4/3; }
}

/* ==========================================================
   HOMECOSTLY MODERN HOME DESIGN
   Visual refresh only: existing logo, copy, links and
   calculator functionality remain unchanged.
   ========================================================== */
.site-header {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #e8ece8;
}
.header-inner { min-height: 76px; }
.brand-mark { border-radius: 9px; }
.main-nav { gap: 24px; }
.main-nav a { font-size: .92rem; }

.hero {
  position: relative;
  padding: 0;
  background: #f8f8f5;
  overflow: hidden;
}
.hero-grid {
  max-width: none;
  width: 100%;
  padding: 0 0 0 max(24px, calc((100vw - var(--container)) / 2 + 24px));
  grid-template-columns: minmax(420px, .86fr) minmax(520px, 1.14fr);
  gap: 0;
  min-height: 470px;
}
.hero-grid > div:first-child {
  padding: 70px 42px 62px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.hero .eyebrow {
  color: var(--spruce-700);
  font-weight: 700;
  margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--font-body);
  font-weight: 750;
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  letter-spacing: -.045em;
  line-height: 1.05;
  max-width: 680px;
  margin-bottom: 22px;
}
.hero .lede {
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 570px;
}
.hero-actions { margin-top: 24px; }
.hero-actions .btn { border-radius: 7px; padding: 13px 24px; }
.hero-actions .btn-secondary { background: #fff; }
.hero-stats { margin-top: 28px; }
.hero-photo {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  border-radius: 180px 0 0 180px;
}
.hero-photo > img {
  width: 100%;
  height: 100%;
  min-height: 470px;
  object-fit: cover;
  object-position: center;
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(248,248,245,.05), rgba(18,59,48,.04));
  pointer-events: none;
}
.hero-estimate-card {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: min(350px, calc(100% - 48px));
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(221,226,220,.9);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(23,37,49,.18);
  padding: 18px 20px;
  z-index: 2;
  backdrop-filter: blur(8px);
}
.hero-estimate-card .panel-label { font-size: .72rem; }
.hero-estimate-card .panel-title { font-size: 1.05rem; margin: 4px 0 10px; }

.section { padding: 68px 0; }
.section--muted { background: #f6f7f4; }
.section-head { margin-bottom: 28px; }
.section-head h2 {
  font-family: var(--font-body);
  font-weight: 750;
  letter-spacing: -.025em;
}
.home-card-grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
.home-card-grid .card-media { min-height: 190px; aspect-ratio: 16/10; }
.card {
  border-radius: 12px;
  border-color: #e2e6e1;
  box-shadow: 0 2px 8px rgba(23,37,49,.035);
}
.card-media--wrap { border-radius: 12px; }
.card-media img { object-position: center; }
.card-media .media-tag {
  background: rgba(193,105,54,.94);
  border-radius: 999px;
  padding: 5px 10px;
}
.card-media .media-tag.tag-copper { background: rgba(193,105,54,.94); }
.article-card .article-body {
  padding: 17px 18px 20px;
}
.article-card h3, .calc-card h3 {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -.015em;
}
.article-card p, .calc-card p { font-size: .9rem; line-height: 1.5; }
.calc-card .calc-link, .article-card .meta { margin-top: auto; }

.country-card .card-media { min-height: 270px; }
.country-card .country-body { padding: 18px 20px 22px; }

.about-photo {
  border-radius: 14px;
  overflow: hidden;
}
.about-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.about-photo figcaption {
  padding: 10px 4px 0;
  color: var(--text-muted);
  font-size: .88rem;
}

/* Blog/guides pages: keep their content but use the same photo-first card language. */
.article-card .card-media { min-height: 220px; }
.article-card .card-media img { object-fit: cover; }

@media (max-width: 1100px) {
  .hero-grid {
    padding-left: 24px;
    grid-template-columns: minmax(380px, .9fr) minmax(430px, 1.1fr);
  }
  .hero-grid > div:first-child { padding-right: 30px; }
  .home-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero-grid {
    display: block;
    padding: 0;
    min-height: 0;
  }
  .hero-grid > div:first-child {
    padding: 48px 18px 34px;
  }
  .hero h1 { font-size: clamp(2.35rem, 10vw, 3.25rem); }
  .hero-photo {
    min-height: 360px;
    border-radius: 0;
  }
  .hero-photo > img { min-height: 360px; }
  .hero-estimate-card {
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }
  .home-card-grid { grid-template-columns: 1fr; }
  .home-card-grid .card-media { min-height: 220px; }
}
@media (max-width: 480px) {
  .hero-grid > div:first-child { padding: 40px 14px 30px; }
  .hero .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-photo, .hero-photo > img { min-height: 320px; }
  .hero-estimate-card { padding: 14px; }
  .hero-estimate-card .ledger-row { padding: 8px 0; font-size: .84rem; }
}


/* Newsletter submission feedback */
.newsletter-msg {
  margin: 10px 0 0;
  font-size: 0.92rem;
}
.newsletter-msg--success {
  color: #b9e6c4;
}
.newsletter-msg--error {
  color: #f0997b;
}
