/* MittLantboende — design system (Countryside Haven UI) */

:root {
  --radius: 0.375rem;
  --background: oklch(0.985 0.008 90);
  --foreground: oklch(0.29 0.012 70);
  --card: oklch(0.995 0.005 90);
  --primary: oklch(0.41 0.045 145);
  --primary-foreground: oklch(0.98 0.01 90);
  --secondary: oklch(0.93 0.022 85);
  --secondary-40: oklch(0.93 0.022 85 / 0.4);
  --muted: oklch(0.955 0.012 88);
  --muted-foreground: oklch(0.52 0.014 80);
  --accent: oklch(0.91 0.028 82);
  --border: oklch(0.9 0.012 85);
  --border-70: oklch(0.9 0.012 85 / 0.7);
  --forest: oklch(0.34 0.04 148);
  --forest-10: oklch(0.34 0.04 148 / 0.1);
  --forest-foreground: oklch(0.97 0.01 90);
  --sand: oklch(0.9 0.03 80);
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; border-color: var(--border); }

html { scroll-behavior: smooth; }

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--foreground);
  line-height: 1.25;
}

.container-page { margin-inline: auto; width: 100%; max-width: 78rem; padding-inline: 1.25rem; }

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.text-muted { color: var(--muted-foreground); }
.text-forest { color: var(--forest); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  white-space: nowrap; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
  height: 2.25rem; padding: 0 1rem; border: 1px solid transparent; text-align: center;
}
.btn-xl { height: 3rem; padding: 0 1.75rem; font-size: 0.95rem; }
.btn-forest { background: var(--forest); color: var(--forest-foreground); }
.btn-forest:hover { background: oklch(0.34 0.04 148 / 0.9); }
.btn-light { background: oklch(0.985 0.008 90 / 0.95); color: var(--foreground); backdrop-filter: blur(4px); }
.btn-light:hover { background: var(--background); }
.btn-on-image { border-color: oklch(0.98 0.01 90 / 0.6); background: transparent; color: var(--primary-foreground); }
.btn-on-image:hover { background: oklch(0.98 0.01 90 / 0.15); }
.btn-quiet { border-color: oklch(0.29 0.012 70 / 0.2); background: transparent; color: var(--foreground); }
.btn-quiet:hover { background: oklch(0.29 0.012 70 / 0.05); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border-70);
  background: oklch(0.985 0.008 90 / 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.75rem; }
.header-logo img { height: 2.5rem; width: auto; }
.main-nav { display: flex; align-items: center; gap: 2rem; font-size: 0.875rem; }
.main-nav a { color: var(--muted-foreground); transition: color .15s; }
.main-nav a:hover, .main-nav a.active { color: var(--foreground); }
.nav-toggle {
  display: none; height: 2.75rem; width: 2.75rem; place-items: center;
  border-radius: var(--radius); border: 1px solid var(--border);
  color: var(--foreground); background: transparent; cursor: pointer;
}
.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--background); }
.mobile-nav.open { display: block; }
.mobile-nav nav { display: flex; flex-direction: column; padding-block: 0.5rem; }
.mobile-nav nav > a:not(.btn) { border-bottom: 1px solid oklch(0.9 0.012 85 / 0.6); padding-block: 1rem; font-size: 1rem; color: var(--foreground); }
.mobile-nav .btn { margin-block: 1.25rem; }

/* ---------- Hero ---------- */
.hero-media { position: relative; overflow: hidden; border-radius: var(--radius); }
.hero-media > img { height: 68vh; min-height: 26rem; width: 100%; object-fit: cover; }
.hero-media .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, oklch(0.29 0.012 70 / 0.7), oklch(0.29 0.012 70 / 0.25) 50%, transparent);
}
.hero-content { position: absolute; inset-inline: 0; bottom: 0; padding: 1.5rem; padding-bottom: 2.5rem; }
.hero-content .inner { max-width: 42rem; }
.hero-content h1 { font-size: 2.25rem; line-height: 1.1; color: var(--primary-foreground); }
.hero-content p { margin-top: 1.25rem; max-width: 32rem; color: oklch(0.98 0.01 90 / 0.9); }
.hero-actions { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.75rem; }

/* ---------- Sections ---------- */
.section { padding-block: 6rem; }
.section-tight { padding-top: 4rem; padding-bottom: 2rem; }
.bg-secondary-40 { background: var(--secondary-40); }
.intro { margin-inline: auto; max-width: 42rem; text-align: center; }
.intro h2 { font-size: 1.875rem; }
.intro p { margin-top: 1.5rem; font-size: 1.125rem; color: var(--muted-foreground); }
.h-section { font-size: 1.875rem; }
.link-forest { color: var(--forest); text-underline-offset: 4px; }
.link-forest:hover { text-decoration: underline; }

/* ---------- Grids ---------- */
.grid-areas, .grid-cards, .grid-benefits { display: grid; gap: 2rem; }
.grid-cards { column-gap: 2rem; row-gap: 3.5rem; }
.grid-benefits { gap: 3rem; }

.area-card img { aspect-ratio: 1 / 1; width: 100%; border-radius: var(--radius); object-fit: cover; }
.area-card h3 { margin-top: 1.25rem; font-size: 1.5rem; }
.area-card p { margin-top: 0.5rem; color: var(--muted-foreground); }
.area-link { display: block; }
.area-link img { transition: transform .5s ease; }
.area-card { overflow: hidden; }
.area-card .area-link img { border-radius: var(--radius); }
.area-link:hover img { transform: scale(1.02); }
.area-more {
  margin-top: 0.75rem; display: inline-block; font-size: 0.875rem;
  color: var(--forest); text-underline-offset: 4px;
}
.area-link:hover .area-more { text-decoration: underline; }

.benefit svg { width: 1.5rem; height: 1.5rem; color: var(--forest); }
.benefit h3 { margin-top: 1.25rem; font-size: 1.25rem; }
.benefit p { margin-top: 0.5rem; color: var(--muted-foreground); }

/* ---------- Apartment card ---------- */
.apt-card { display: block; }
.apt-card .media { overflow: hidden; border-radius: var(--radius); background: var(--muted); }
.apt-card .media img {
  aspect-ratio: 4 / 3; width: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.apt-card:hover .media img { transform: scale(1.03); }
.apt-card .body { padding-top: 1.25rem; }
.apt-card .meta-row { display: flex; align-items: center; gap: 0.75rem; }
.status-pill { border-radius: 9999px; padding: 0.125rem 0.75rem; font-size: 0.75rem; }
.status-pill.ledig { background: var(--forest-10); color: var(--forest); }
.status-pill.uthyrd { background: var(--muted); color: var(--muted-foreground); }
.apt-card h3 { margin-top: 0.5rem; font-size: 1.25rem; }
.apt-card .specs { margin-top: 0.25rem; color: var(--muted-foreground); }
.apt-card .cta {
  margin-top: 1rem; display: inline-block; font-size: 0.875rem;
  color: var(--forest); text-underline-offset: 4px;
}
.apt-card:hover .cta { text-decoration: underline; }

/* ---------- CTA banner ---------- */
.cta-banner { position: relative; overflow: hidden; border-radius: var(--radius); }
.cta-banner > img { height: 24rem; width: 100%; object-fit: cover; }
.cta-banner .overlay { position: absolute; inset: 0; background: oklch(0.29 0.012 70 / 0.45); }
.cta-banner .content {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding-inline: 1.5rem; text-align: center;
}
.cta-banner h2 { max-width: 36rem; font-size: 1.875rem; color: var(--primary-foreground); }
.cta-banner p { margin-top: 1rem; max-width: 28rem; color: oklch(0.98 0.01 90 / 0.9); }
.cta-banner .btn { margin-top: 2rem; }

/* ---------- Page heads ---------- */
.page-head h1 { margin-top: 1rem; font-size: 2.25rem; line-height: 1.15; }
.page-head .lead { margin-top: 1.5rem; max-width: 36rem; font-size: 1.125rem; color: var(--muted-foreground); }

/* ---------- Filters ---------- */
.filters {
  margin-top: 3rem; display: grid; gap: 2rem;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding-block: 2rem;
}
.filter-options { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-pill {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  border-radius: 9999px; border: 1px solid var(--border); background: var(--card);
  padding-inline: 1rem; font-size: 0.875rem; color: var(--muted-foreground);
  transition: color .15s, background-color .15s, border-color .15s;
}
.filter-pill:hover { color: var(--foreground); }
.filter-pill.active { border-color: var(--forest); background: var(--forest); color: var(--forest-foreground); }

/* ---------- Apartment detail ---------- */
.back-link { font-size: 0.875rem; color: var(--muted-foreground); }
.back-link:hover { color: var(--foreground); }
.gallery-grid { margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.gallery-grid .main { aspect-ratio: 4 / 3; width: 100%; border-radius: var(--radius); object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.gallery-thumbs img { aspect-ratio: 1; width: 100%; border-radius: var(--radius); object-fit: cover; }

.detail-layout { margin-top: 3rem; display: grid; gap: 3.5rem; }
.detail-main h1 { margin-top: 0.75rem; font-size: 1.875rem; line-height: 1.2; }
.detail-main .rent { margin-top: 1rem; font-family: var(--font-heading); font-size: 1.5rem; color: var(--forest); }
.detail-main .meta { margin-top: 1.5rem; display: flex; flex-wrap: wrap; column-gap: 2rem; row-gap: 0.5rem; color: var(--muted-foreground); }
.detail-main h2 { margin-top: 3.5rem; font-size: 1.5rem; }
.detail-main .desc { margin-top: 1rem; color: var(--muted-foreground); }
.facts { margin-top: 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.facts > div {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-block: 1rem;
}
.facts > div + div { border-top: 1px solid var(--border); }
.facts dt { color: var(--muted-foreground); }
.plan-img { margin-top: 1rem; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); object-fit: contain; }
.map-embed {
  margin-top: 1rem; display: block; width: 100%; aspect-ratio: 16 / 10;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted);
}

.enquiry-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--secondary-40); padding: 1.5rem; }
.enquiry-card h2 { font-size: 1.5rem; }
.enquiry-card .sub { margin-top: 0.75rem; color: var(--muted-foreground); }
.enquiry-card form { margin-top: 2rem; }

/* ---------- Forms ---------- */
.form-stack { display: grid; gap: 1.25rem; }
.form-field { display: grid; gap: 0.5rem; }
.form-row { display: grid; gap: 1.25rem; }
.form-field label { font-size: 0.875rem; font-weight: 500; line-height: 1; }
.form-field input, .form-field textarea {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--border);
  background: transparent; padding: 0.5rem 0.75rem; font-family: inherit;
  font-size: 1rem; color: var(--foreground); box-shadow: 0 1px 2px oklch(0 0 0 / 0.05);
}
.form-field input { height: 3rem; }
.form-field textarea { resize: none; line-height: 1.6; }
.form-field input:focus, .form-field textarea:focus { outline: 1px solid var(--forest); border-color: var(--forest); }
.form-note { margin-top: 1rem; font-size: 0.875rem; color: var(--muted-foreground); }
.form-error { font-size: 0.8125rem; color: oklch(0.53 0.15 30); }

/* ---------- Contact ---------- */
.contact-layout { display: grid; gap: 3.5rem; }
.contact-links { margin-top: 2.5rem; display: grid; gap: 1rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); padding: 1rem 1.25rem;
  transition: background-color .15s;
}
.contact-link:hover { background: oklch(0.93 0.022 85 / 0.5); }
.contact-link svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--forest); }
.contact-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); padding: 1.5rem; }
.contact-card h2 { font-size: 1.5rem; }
.contact-card form { margin-top: 2rem; }

/* ---------- Om oss ---------- */
.wide-img { aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); object-fit: cover; }
.about-grid { display: grid; gap: 3rem; padding-top: 4rem; }
.about-grid h2 { font-size: 1.5rem; }
.about-grid .text p { margin-top: 1.25rem; color: var(--muted-foreground); }
.about-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--secondary-40); padding: 2rem; }
.about-card p { margin-top: 1rem; color: var(--muted-foreground); }
.about-card .actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 48rem; }
.faq-group { margin-top: 3rem; }
.faq-group > h2 {
  font-family: var(--font-body); font-size: 0.875rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--muted-foreground); font-weight: 400;
}
.faq-group .items { margin-top: 1rem; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.25rem; font-size: 1rem; cursor: pointer; list-style: none;
  font-weight: 500;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; width: 0.65rem; height: 0.65rem; flex-shrink: 0;
  border-right: 1.5px solid var(--muted-foreground); border-bottom: 1.5px solid var(--muted-foreground);
  transform: rotate(45deg); transition: transform .2s; margin-top: -0.25rem;
}
.faq-item[open] summary::after { transform: rotate(225deg); margin-top: 0.25rem; }
.faq-item .answer { padding-bottom: 1.5rem; color: var(--muted-foreground); }

/* ---------- Policy pages ---------- */
.policy { max-width: 42rem; }
.policy h1 { font-size: 2.25rem; }
.policy p { margin-top: 1.25rem; color: var(--muted-foreground); }
.policy p:first-of-type { margin-top: 2rem; }

/* ---------- Honungsfälla (osynlig för människor) ---------- */
.hp-field {
  position: absolute !important; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- Samtycke ---------- */
.form-consent {
  display: flex; gap: 0.6rem; align-items: flex-start;
  font-size: 0.9rem; color: var(--muted-foreground); cursor: pointer;
}
.form-consent input {
  margin-top: 0.3rem; width: 1.05rem; height: 1.05rem; flex-shrink: 0;
  accent-color: var(--forest); cursor: pointer;
}
.form-consent a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Kakmeddelande ---------- */
.cookie-notice {
  position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 60;
  margin-inline: auto; max-width: 34rem;
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px oklch(0 0 0 / 0.12);
  padding: 0.9rem 1.1rem;
}
/* display: flex ovan vinner annars över hidden-attributet – då går rutan inte att stänga. */
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); }
.cookie-notice a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.cookie-notice .btn { flex-shrink: 0; }

/* ---------- Alerts ---------- */
.alert-success {
  border-radius: var(--radius); border: 1px solid var(--forest);
  background: var(--forest-10); color: var(--forest);
  padding: 0.875rem 1.125rem; margin-bottom: 1.25rem; font-size: 0.9375rem;
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 6rem; border-top: 1px solid var(--border); background: var(--secondary-40); }
.footer-main { display: grid; gap: 3rem; padding-block: 4rem; }
.footer-main .brand img { height: 3rem; width: auto; }
.footer-main .brand p { margin-top: 1rem; max-width: 24rem; color: var(--muted-foreground); }
.footer-main nav, .footer-main .contact-col { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-main a { color: var(--muted-foreground); }
.footer-main a:hover { color: var(--foreground); }
.footer-bottom { border-top: 1px solid var(--border-70); padding-block: 1.5rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- Responsive (md: 768px) ---------- */
@media (min-width: 768px) {
  .hero-media > img { height: 74vh; }
  .hero-content { padding: 3.5rem; }
  .hero-content h1 { font-size: 3.75rem; }
  .hero-actions { flex-direction: row; }
  .section { padding-block: 8rem; }
  .section-tight { padding-top: 6rem; }
  .intro h2, .h-section { font-size: 2.25rem; }
  .cta-banner > img { height: 28rem; }
  .cta-banner h2 { font-size: 2.25rem; }
  .page-head h1 { font-size: 3rem; }
  .grid-areas, .grid-benefits { grid-template-columns: repeat(3, 1fr); }
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .gallery-grid .main { aspect-ratio: 3 / 2; }
  .gallery-thumbs { grid-template-columns: repeat(2, 1fr); align-content: start; }
  .detail-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 5rem; }
  .detail-main h1 { font-size: 2.25rem; }
  .detail-aside { position: sticky; top: 7rem; align-self: start; }
  .enquiry-card { padding: 2rem; }
  .contact-layout { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 5rem; }
  .contact-card { padding: 2.5rem; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .footer-main { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: grid; }
  .grid-cards { grid-template-columns: 1fr; }
}

@media (min-width: 640px) and (max-width: 767px) {
  .grid-cards { grid-template-columns: 1fr 1fr; }
}

/* Stora skärmar: hela layouten är byggd i rem, så en större grundstorlek
   skalar upp allt proportionerligt (spalt, text, bilder, luft) i stället
   för att lämna sidan som en smal remsa mitt på en bred skärm. */
@media (min-width: 1700px) {
  html { font-size: 18px; }
  .container-page { max-width: 90%; }
}
@media (min-width: 2100px) {
  html { font-size: 20px; }
  .container-page { max-width: 90%; }
}
@media (min-width: 2600px) {
  html { font-size: 22px; }
  .container-page { max-width: 90%; }
}
