/* ==========================================================================
   JM Byggeservice — Design system
   Farver hentet fra visitkort (#2d2a80 navy / #ddd9d0 creme) og firmabil (#3b6283 stålblå)
   ========================================================================== */

:root {
  --navy: #2d2a80;
  --navy-dark: #211f5e;
  --navy-light: #4642a8;
  --steel: #3b6283;
  --steel-dark: #2c4c66;
  --cream: #f3efe6;
  --cream-dark: #e6e0d2;
  --white: #ffffff;
  --ink: #211f2b;
  --ink-soft: #55536a;
  --line: #ddd7c8;
  --gold: #d9a441;
  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 26px;
  --shadow: 0 10px 30px -12px rgba(33, 31, 60, 0.25);
  --shadow-sm: 0 4px 14px -6px rgba(33, 31, 60, 0.2);
  --container: 1180px;
  --font-head: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--navy-dark);
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.9em;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}
.section { padding: 88px 0; }
.section-head { max-width: 700px; margin: 0 0 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.bg-white { background: var(--white); }
.bg-navy { background: var(--navy); color: var(--cream); }
.bg-navy h2, .bg-navy h3 { color: var(--white); }
.bg-navy p { color: #c7c5df; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gold); color: var(--navy-dark); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #e6b357; }
.btn-outline { background: transparent; border-color: currentColor; color: inherit; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); }
.btn-block { width: 100%; justify-content: center; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243,239,230,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy-dark);
}
.brand img { width: 42px; height: 42px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--navy-dark); }
.brand-text span { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--steel); text-transform: uppercase; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.96rem;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  height: 2px; width: 0;
  background: var(--gold);
  transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  display: flex;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.78rem;
}
.lang-switch a {
  padding: 7px 12px;
  text-decoration: none;
  color: var(--navy);
}
.lang-switch a.active { background: var(--navy); color: var(--white); }
.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy-dark);
  text-decoration: none;
  font-size: 0.95rem;
}
.header-phone svg { width: 18px; height: 18px; color: var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle svg { width: 26px; height: 26px; color: var(--navy-dark); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  color: var(--white);
  background: linear-gradient(180deg, rgba(33,31,94,0.78), rgba(33,31,94,0.55) 45%, rgba(20,19,54,0.92)), url("../images/badevaerelse-hvid-marmor-sort-ramme-jm-byggeservice.jpg") center 30%/cover no-repeat;
  padding: 140px 0 90px;
}
.hero-content { max-width: 680px; }
.hero .eyebrow { color: #e7c789; }
.hero .eyebrow::before { background: var(--white); }
.hero h1 { color: var(--white); margin-bottom: 0.4em; }
.hero p.lead { color: #e4e2f2; font-size: 1.12rem; max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 42px; }
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,0.22);
}
.hero-badge { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: #e4e2f2; }
.hero-badge svg { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; }
.hero-badge strong { display: block; color: var(--white); font-family: var(--font-head); font-size: 0.98rem; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}
.about-media {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.about-media .media-stat {
  align-self: flex-end;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--shadow);
  max-width: 260px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.about-media .media-stat strong { font-family: var(--font-head); font-size: 1.9rem; color: var(--navy); white-space: nowrap; }
.about-media .media-stat span { font-size: 0.82rem; color: var(--ink-soft); }
.about-list { list-style: none; padding: 0; margin: 20px 0 30px; display: grid; gap: 12px; }
.about-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-weight: 500; }
.about-list svg { width: 20px; height: 20px; color: var(--steel); flex-shrink: 0; margin-top: 2px; }
.signature { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.signature img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
.signature strong { display: block; font-family: var(--font-head); color: var(--navy-dark); }
.signature span { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(45,42,128,0.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.service-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: var(--navy);
}
.service-icon svg { width: 28px; height: 28px; }
.service-card h3 { margin-bottom: 0.4em; }
.service-card p { margin-bottom: 0; font-size: 0.95rem; }

/* ---------- Gallery ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.filter-btn {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: all .18s ease;
}
.filter-btn:hover { border-color: var(--steel); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  grid-auto-flow: dense;
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--cream-dark);
}
.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item .caption {
  position: absolute; inset: auto 0 0 0;
  padding: 34px 16px 14px;
  background: linear-gradient(0deg, rgba(20,19,54,0.85), transparent);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(6px);
  transition: all .25s ease;
}
.gallery-item:hover .caption { opacity: 1; transform: translateY(0); }
.gallery-item.hidden { display: none; }

/* Video item */
.gallery-item.is-video { cursor: pointer; }
.play-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(20,19,54,0.65);
  border: 2px solid rgba(255,255,255,0.85);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
  pointer-events: none;
}
.play-badge svg { width: 26px; height: 26px; margin-left: 3px; }
.gallery-item.is-video:hover .play-badge {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-dark);
}
.gallery-item.is-video .caption { opacity: 1; transform: translateY(0); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15,14,36,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px 20px;
}
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: 1100px; max-height: 88vh; text-align: center; }
.lightbox img { max-height: 78vh; margin: 0 auto; border-radius: 10px; }
.lightbox video { max-height: 78vh; max-width: 100%; margin: 0 auto; border-radius: 10px; display: block; }
.lightbox figcaption { color: #e4e2f2; margin-top: 14px; font-size: 0.92rem; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--white);
  width: 46px; height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-close svg, .lightbox-prev svg, .lightbox-next svg { width: 22px; height: 22px; }

/* ---------- Reviews ---------- */
.reviews-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
}
.rating-big { display: flex; align-items: center; gap: 18px; }
.rating-big .num { font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; color: var(--navy); }
.rating-big .meta strong { display: block; font-family: var(--font-head); }
.rating-big .meta span { font-size: 0.85rem; color: var(--ink-soft); }
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.review-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.review-quote { font-size: 1.02rem; color: var(--ink); margin-bottom: 18px; }
.review-quote::before { content: "\201C"; color: var(--gold); font-size: 1.6rem; font-family: Georgia, serif; margin-right: 2px; }
.review-author { display: flex; align-items: center; justify-content: space-between; }
.review-author strong { font-family: var(--font-head); color: var(--navy-dark); font-size: 0.95rem; }
.review-author span { font-size: 0.82rem; color: var(--ink-soft); }
.review-reply {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--gold);
}
.review-reply strong { color: var(--navy-dark); }
.partners-note {
  margin-top: 34px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-align: center;
}
.partners-note a { color: var(--steel); font-weight: 600; text-decoration: underline; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 34px;
}
.contact-list { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list a { text-decoration: none; color: var(--white); font-weight: 600; }
.contact-list span.label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .06em; color: #a9a7cf; margin-bottom: 2px; }
.contact-list svg { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.social-row { display: flex; gap: 12px; margin-top: 10px; }
.social-row a {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  text-decoration: none;
}
.social-row a:hover { background: var(--gold); color: var(--navy-dark); }
.social-row svg { width: 20px; height: 20px; }
.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 4px solid var(--white); }
.map-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

.quick-form { display: grid; gap: 14px; }
.quick-form label { font-size: 0.85rem; font-weight: 600; color: var(--white); display: block; margin-bottom: 6px; }
.quick-form input, .quick-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.quick-form input::placeholder, .quick-form textarea::placeholder { color: #b7b5d3; }
.quick-form small { color: #a9a7cf; font-size: 0.78rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: #b9b7d6; padding: 60px 0 26px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand strong { color: var(--white); font-family: var(--font-head); font-size: 1.1rem; }
.footer-brand img { width: 36px; height: 36px; }
.site-footer h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a { color: #b9b7d6; text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: #8f8dbb;
}
.footer-bottom a { color: #8f8dbb; text-decoration: underline; }

/* ---------- Sticky mobile call bar ---------- */
.mobile-call-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--navy);
  padding: 12px 18px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.25);
}
.mobile-call-bar a {
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-call-bar svg { width: 18px; height: 18px; color: var(--gold); }

/* ---------- Reveal animation ----------
   Content is visible by default (progressive enhancement + SEO/no-JS safety).
   Only browsers that support IntersectionObserver AND have run our script get
   the subtle fade-in; the ".js-reveal" class is added by script.js just before
   it wires up the observer, so nothing ever depends on JS to become visible. */
.reveal { opacity: 1; transform: none; }
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js-reveal .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 190px; }
}
@media (max-width: 760px) {
  .main-nav, .header-phone { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: 20px 24px 28px;
    border-bottom: 1px solid var(--line);
    gap: 18px;
  }
  .section { padding: 60px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
  .gallery-item.wide { grid-column: span 2; }
  .gallery-item.tall { grid-row: span 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .hero { padding: 120px 0 110px; min-height: unset; }
  .mobile-call-bar { display: flex; }
  body { padding-bottom: 62px; }
  .reviews-top { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-badges { gap: 16px; }
}
