/* NITHE Fastigheter – stilmall */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --navy: #172a49;
  --navy-deep: #101d33;
  --ink: #1c2230;
  --muted: #5a6170;
  --sand: #b8976a;
  --sand-light: #efe7da;
  --paper: #faf8f4;
  --white: #fff;
  --line: #e5dfd4;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 6px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--navy); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--sand); }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 0.6em;
  font-variation-settings: "SOFT" 30;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.6rem); }
p { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.narrow { max-width: 42rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 1rem;
}

.lead { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--muted); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--navy); color: var(--white); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--white); }

/* Knappar */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font: 600 0.95rem/1 var(--sans);
  letter-spacing: 0.02em;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); color: var(--white); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { background: var(--sand-light); color: var(--navy); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.7); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: var(--white); }

.link-arrow {
  font-weight: 600; text-decoration: none; display: inline-flex; gap: 0.4em; align-items: center;
}
.link-arrow::after { content: "→"; transition: transform 0.2s; }
.link-arrow:hover::after { transform: translateX(4px); }

/* Sidhuvud */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand img { width: 136px; }
.brand span {
  font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.05rem;
  padding-left: 0.7rem; border-left: 1px solid var(--line); line-height: 1.2;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  display: block; padding: 0.55rem 0.85rem; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-size: 0.95rem; font-weight: 500;
}
.site-nav a:hover { color: var(--navy); background: var(--sand-light); }
.site-nav a[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -2px 0 var(--sand); border-radius: 0; }
.site-nav .nav-cta { background: var(--navy); color: var(--white); margin-left: 0.5rem; padding-inline: 1.2rem; }
.site-nav .nav-cta:hover { background: var(--navy-deep); color: var(--white); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.55rem 1rem; font: 600 0.9rem var(--sans); color: var(--navy); cursor: pointer;
  align-items: center; gap: 0.5rem;
}
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
  transition: transform 0.2s;
}
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .brand span { display: none; }
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; flex-wrap: wrap; }
  html:not(.js) .site-nav ul { flex-direction: row; justify-content: flex-end; }
  .site-nav a { padding: 0.8rem 0.5rem; border-radius: var(--radius); font-size: 1.05rem; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--sand); padding-left: 0.9rem; }
  .site-nav .nav-cta { margin: 0.5rem 0 0; text-align: center; border-radius: 999px; }
}

/* Hero */
.hero {
  position: relative; isolation: isolate;
  min-height: min(88vh, 780px);
  display: flex; align-items: flex-end;
  color: var(--white);
  overflow: hidden;
}
.hero-media, .hero-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(16, 29, 51, 0) 30%, rgba(16, 29, 51, 0.82) 100%),
    linear-gradient(90deg, rgba(16, 29, 51, 0.55) 0%, rgba(16, 29, 51, 0) 65%);
}
@media (max-width: 700px) {
  .hero::after { background: linear-gradient(180deg, rgba(16, 29, 51, 0.2) 0%, rgba(16, 29, 51, 0.55) 40%, rgba(16, 29, 51, 0.88) 100%); }
}
.hero-content { padding-block: clamp(4rem, 12vh, 7rem) clamp(3rem, 9vh, 5.5rem); }
.hero h1 { color: var(--white); max-width: 14ch; margin-bottom: 0.4em; }
.hero p { max-width: 38rem; font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: rgba(255, 255, 255, 0.9); }
.hero .eyebrow { color: var(--sand-light); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.hero--property { min-height: min(70vh, 640px); }
.hero--property h1 { max-width: none; font-size: clamp(2rem, 8.5vw, 4.25rem); }
.breadcrumb { font-size: 0.9rem; margin-bottom: 1rem; color: rgba(255, 255, 255, 0.85); }
.breadcrumb a { color: inherit; }
.breadcrumb a:hover { color: var(--white); }

/* Sektioner */
.section { padding-block: clamp(4rem, 10vw, 7.5rem); }
.section--white { background: var(--white); }
.section--navy { background: var(--navy); color: rgba(255, 255, 255, 0.85); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy .eyebrow { color: var(--sand); }
.section--sand { background: var(--sand-light); }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 3rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 { margin-bottom: 0; }
.section-head p { max-width: 30rem; margin: 0; color: var(--muted); }

/* Fastighetskort */
.cards { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  display: flex; flex-direction: column;
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(23, 42, 73, 0.35); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand-light); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 1.6rem 1.6rem 1.8rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: 0.35rem; }
.card-body h3 a { text-decoration: none; color: inherit; }
.card-body h3 a::after { content: ""; position: absolute; inset: 0; }
.card-meta { font-size: 0.9rem; color: var(--sand); font-weight: 600; margin-bottom: 1rem; }
.card-body p { color: var(--muted); font-size: 0.98rem; }
.card-body .link-arrow { margin-top: auto; color: var(--navy); }

/* Bild + text */
.split { display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: center; grid-template-columns: 1fr 1fr; }
.split + .split { margin-top: clamp(3.5rem, 8vw, 6rem); }
.split--reverse .split-media { order: 2; }
.split-media { border-radius: var(--radius); overflow: hidden; }
.split-media img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.tag {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(184, 151, 106, 0.18); color: var(--sand-light);
  margin-bottom: 1rem;
}
.section--navy a:not(.btn) { color: var(--white); }
.section--navy a:not(.btn):hover { color: var(--sand-light); }
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split-media { order: 0; }
}

/* Varför oss */
.reasons { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); counter-reset: reason; }
.reason { border-top: 1px solid var(--line); padding-top: 1.5rem; counter-increment: reason; }
.reason::before {
  content: "0" counter(reason);
  display: block; font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--sand); margin-bottom: 1rem;
}
.reason p { color: var(--muted); }

/* Omdömen */
.quotes { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.quote { margin: 0; background: var(--white); border-radius: var(--radius); padding: clamp(1.75rem, 3vw, 2.5rem); position: relative; }
.quote::before {
  content: "\201D"; font-family: var(--serif); font-size: 5rem; line-height: 1; color: var(--sand);
  position: absolute; top: 0.6rem; right: 1.5rem; opacity: 0.5;
}
.quote blockquote { margin: 0 0 1.25rem; font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.4; color: var(--navy); }
.quote figcaption { font-weight: 600; color: var(--muted); font-size: 0.95rem; }

/* Köper fastigheter */
.feature {
  position: relative; isolation: isolate; color: var(--white); overflow: hidden;
  border-radius: var(--radius);
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 6vw, 5rem);
}
.feature > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.feature::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(16, 29, 51, 0.9) 0%, rgba(16, 29, 51, 0.65) 55%, rgba(16, 29, 51, 0.3) 100%); }
.feature h2 { color: var(--white); max-width: 18ch; }
.feature p { max-width: 34rem; color: rgba(255, 255, 255, 0.88); }
.feature .eyebrow { color: var(--sand-light); }

/* Kontakt */
.contact { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: 0.9fr 1.1fr; align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact-info dl { margin: 2rem 0 0; display: grid; gap: 1.25rem; }
.contact-info dt { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); }
.contact-info dd { margin: 0.2rem 0 0; font-size: 1.15rem; }

.form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); }
.form-row { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.field label { font-size: 0.9rem; font-weight: 600; }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  border: 1px solid #cfc7b9; border-radius: var(--radius); background: var(--paper);
  padding: 0.8rem 0.9rem; width: 100%;
  transition: border-color 0.2s, background-color 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); background: var(--white); box-shadow: 0 0 0 3px rgba(23, 42, 73, 0.12); }
.field textarea { min-height: 9rem; resize: vertical; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.85rem; color: var(--muted); margin: 1rem 0 0; }
.form-status { margin: 1rem 0 0; padding: 0.9rem 1.1rem; border-radius: var(--radius); font-weight: 500; }
.form-status:empty { display: none; }
.form-status.is-ok { background: #e6f1e8; color: #1f5130; }
.form-status.is-error { background: #f8e5e3; color: #7a2419; }
.form button[disabled] { opacity: 0.6; cursor: wait; }

/* Fastighetssidor */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  margin: calc(-1 * clamp(2rem, 5vw, 3rem)) 0 0; position: relative; z-index: 2;
}
.facts div { padding: 1.25rem 1.5rem; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); }
.facts dd { margin: 0.25rem 0 0; font-family: var(--serif); font-size: 1.25rem; color: var(--navy); line-height: 1.3; }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { padding: 1rem 1.1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .facts div:nth-child(odd) { border-right: 1px solid var(--line); }
  .facts div:last-child { border-bottom: 0; }
  .facts div:last-child:nth-child(odd) { grid-column: span 2; border-right: 0; }
  .facts dd { font-size: 1.1rem; }
}

.prose-grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 900px) { .prose-grid { grid-template-columns: 1fr; } }
.prose p { font-size: 1.1rem; }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.prose h2:first-child { margin-top: 0; }
.prose .intro { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.45; color: var(--navy); }

.aside-card {
  position: sticky; top: calc(var(--header-h) + 1.5rem);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem;
}
.aside-card h2 { font-size: 1.4rem; }
.aside-card p { color: var(--muted); font-size: 0.98rem; }
.aside-card .btn { width: 100%; justify-content: center; }

.award { display: grid; grid-template-columns: 120px 1fr; gap: 1.25rem; align-items: center; margin: 2rem 0; padding: 1.25rem; background: var(--sand-light); border-radius: var(--radius); }
.award img { border-radius: 4px; }
.award strong { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; color: var(--navy); display: block; }
.award span { color: var(--muted); font-size: 0.95rem; }

/* Galleri */
.gallery { display: grid; gap: 0.75rem; grid-template-columns: repeat(6, 1fr); }
.gallery a { display: block; overflow: hidden; border-radius: var(--radius); grid-column: span 2; background: var(--sand-light); }
.gallery a:nth-child(1), .gallery a:nth-child(2) { grid-column: span 3; }
.gallery--even a { grid-column: span 3; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.5s; }
.gallery a:hover img { transform: scale(1.04); }
@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery a, .gallery a:nth-child(1), .gallery a:nth-child(2) { grid-column: span 1; }
  .gallery a:first-child { grid-column: span 2; }
}

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
}
.lightbox::backdrop { background: rgba(10, 16, 28, 0.92); }
.lightbox-inner { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 4rem 4.5rem; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, 0.12); color: var(--white); border: 0; cursor: pointer;
  width: 3rem; height: 3rem; border-radius: 999px; font-size: 1.4rem; line-height: 1; display: grid; place-items: center;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox .lb-close { top: 1rem; right: 1rem; }
.lightbox .lb-prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lightbox .lb-next { right: 1rem; top: 50%; translate: 0 -50%; }
.lightbox .lb-count { position: absolute; bottom: 1.25rem; left: 50%; translate: -50% 0; color: rgba(255, 255, 255, 0.75); font-size: 0.9rem; }
@media (max-width: 600px) { .lightbox-inner { padding: 4rem 0.5rem; } .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 0.75rem; translate: none; } }

.cta-band { text-align: center; }
.cta-band h2 { margin-inline: auto; max-width: 22ch; }
.cta-band p { margin-inline: auto; max-width: 36rem; }

/* Sidfot */
.site-footer { background: var(--navy-deep); color: rgba(255, 255, 255, 0.7); padding-block: 4rem 2rem; font-size: 0.95rem; }
.site-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid img { width: 150px; margin-bottom: 1.25rem; }
.footer-grid h2 { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.85rem; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }
