/* ==========================================================================
   RH Bygg — Riadh Hassad Bygg AB
   ========================================================================== */

:root {
  --bg:          #f8f8f6;
  --bg-muted:    #f1f0ec;
  --surface:     #ffffff;
  --ink:         #14140f;
  --ink-muted:   #55584f;
  --ink-faint:   #a3a69c;
  --border:      #e4e2da;
  --dark:        #1b1b1d;
  --accent:      #1e4d34;
  --accent-deep: #163a27;
  --gold:        #a67c42;

  --radius:    12px;
  --radius-sm: 8px;
  --header-h:  96px;

  --shadow-lift: 0 16px 40px -12px rgba(20, 20, 15, 0.3);
}

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

/* Flera element här sätter display: … med samma CSS-specificitet som
   webbläsarens inbyggda [hidden]{display:none} och vinner annars på
   källordning eftersom det här stylesheetet laddas senare. Den här regeln
   garanterar att .hidden = true i JS faktiskt döljer elementet. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; transition: opacity 0.15s ease; }
a:hover { opacity: 0.72; }

::selection { background: rgba(30, 77, 52, 0.18); }

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

.band-dark :focus-visible,
.cta-band :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible { outline-color: #ffffff; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { opacity: 1; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); }

.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--bg-muted); }

.btn-ghost { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.1); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 248, 246, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #d3d3cf;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.logo img { height: 60px; width: auto; }

.nav-links { display: flex; gap: 34px; font-size: 15px; font-weight: 600; }
.nav-links a { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 24px; }

.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.header-phone svg { color: var(--accent); flex-shrink: 0; }

.btn-accent.btn { padding: 12px 22px; font-size: 14px; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Visas bara under 860px, och bara när [hidden] är borttaget av JS. */
.mobile-menu {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 8px 22px 20px;
}
.mobile-menu a {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(20, 20, 15, 0.92),
    rgba(20, 20, 15, 0.66),
    rgba(20, 20, 15, 0.18)
  );
}

.hero-inner { position: relative; padding-top: 110px; padding-bottom: 90px; }
.hero-copy { max-width: 620px; }

.hero h1 { font-size: 64px; line-height: 1.06; color: #fff; }

.hero-lead {
  font-size: 17.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 24px;
  max-width: 500px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }

.hero-trust {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 44px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
}
.hero-trust li { display: flex; align-items: center; gap: 6px; }

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
  0%, 100% { transform: translate(-50%, 0);   opacity: 0.6; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* -------------------------------------------------------- shared sections */

.section { padding: 100px 0; }
.band-dark  { background: var(--dark); }
.band-muted { background: var(--bg-muted); }

section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow .rule { width: 24px; height: 1px; background: currentColor; }
.eyebrow-light { color: rgba(255, 255, 255, 0.5); }

.section-title { font-size: 42px; max-width: 620px; }
.section-title-light { color: #fff; }

.section-lead {
  font-size: 17px;
  color: var(--ink-muted);
  margin-top: 16px;
  max-width: 560px;
}

/* ----------------------------------------------------------------- stats */

.stats { padding: 56px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 38px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.stat-label { font-size: 13.5px; color: rgba(255, 255, 255, 0.5); margin-top: 6px; }

/* -------------------------------------------------------------- services */

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 52px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.card-number {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.card-icon { color: var(--accent); margin-top: 14px; }
.service-card h3 { font-size: 22px; margin-top: 16px; }
.service-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-top: 10px;
  font-weight: 400;
}

/* -------------------------------------------------------------- timeline */

.timeline { position: relative; margin-top: 52px; }

.timeline-line {
  position: absolute;
  top: 44px;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.22) 15%,
    rgba(255, 255, 255, 0.22) 85%,
    rgba(255, 255, 255, 0.05)
  );
}

.timeline-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.timeline-step { text-align: center; }

.timeline-node {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.timeline-step h3 { font-size: 18px; font-weight: 700; color: #fff; margin-top: 22px; }
.timeline-step p {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 10px;
}

/* --------------------------------------------------------------- gallery */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 44px;
}

.gallery-item { margin: 0; }
.gallery-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
}
.gallery-item-wide { grid-column: span 2; }
.gallery-item-wide img { aspect-ratio: 2 / 1; }

.gallery-item figcaption {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin-top: 10px;
}

/* ---------------------------------------------------------------- why us */

.why-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.why-list { display: flex; flex-direction: column; gap: 28px; margin-top: 40px; }
.why-list li { display: flex; gap: 18px; }
.why-list svg { color: var(--accent); flex-shrink: 0; }
.why-list h3 { font-size: 18px; font-weight: 700; }
.why-list p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-top: 6px;
  font-weight: 400;
}

.why-media { position: relative; }
.why-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 16px;
}

.why-badge {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 24px;
  box-shadow: var(--shadow-lift);
}
.why-badge-value { display: block; font-size: 28px; font-weight: 800; color: var(--accent); }
.why-badge-label { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 2px; }

/* ---------------------------------------------------------- testimonials */

.testimonial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.testimonial { margin: 0; }
.quote-mark { display: block; font-size: 44px; font-weight: 800; color: var(--gold); line-height: 1; }
.testimonial blockquote {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.testimonial figcaption {
  margin-top: 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

/* --------------------------------------------------------------- booking */

.booking-card {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
}

.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.booking-steps { display: flex; flex-direction: column; gap: 22px; }
.booking-steps li {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-muted);
}
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 700;
}
.booking-steps li.is-active { color: var(--ink); }
.booking-steps li.is-active .step-num { background: var(--accent); color: #fff; }
.booking-steps li.is-done .step-num { background: var(--accent-deep); color: #fff; }

/* Alla tre steg staplas i samma grid-cell så panelen alltid är lika hög
   som det högsta steget, oavsett vilket som är aktivt just nu. */
.booking-panel {
  display: grid;
  border-left: 1px solid var(--border);
  padding-left: 40px;
}

.booking-step {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.booking-step.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.calendar-head h3 { font-size: 17px; font-weight: 700; }
.calendar-nav { display: flex; gap: 8px; }

.cal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cal-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cal-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
}
.calendar-weekdays span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
  padding: 6px 0;
}

.cal-day {
  padding: 8px 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.cal-day:hover:not(:disabled) { background: var(--bg-muted); }
.cal-day:disabled { color: #d8d5c9; cursor: not-allowed; }
.cal-day.is-selected { background: var(--accent); color: #fff; font-weight: 700; }
.cal-empty { padding: 8px 0; }

.booking-hint {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 18px;
  text-align: center;
}

.booking-step-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.booking-chosen { font-weight: 600; color: var(--ink-muted); }

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.time-slot {
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.time-slot:hover { border-color: var(--accent); }
.time-slot.is-selected { background: var(--accent); border-color: var(--accent); color: #fff; }

.link-back {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}
.link-back:hover { color: var(--accent); }

.booking-summary {
  font-size: 14.5px;
  color: var(--ink-muted);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
}

.booking-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.optional { font-weight: 400; color: var(--ink-faint); }

.field input,
.field select,
.field textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid="true"] { border-color: #b4442f; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}
.form-actions .link-back { margin-top: 0; }

/* Spamfälla — dold för människor, syns för robotar */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-status { font-size: 14px; color: var(--ink-muted); }
.form-status:not(:empty) { margin-top: 16px; }
.form-status.is-error { color: #b4442f; }
.form-status.is-ok { color: var(--accent); font-weight: 600; }

/* -------------------------------------------------------------- CTA band */

.cta-band { padding: 88px 0; background: var(--accent); text-align: center; }
.cta-band h2 { font-size: 42px; color: #fff; }
.cta-band p { font-size: 17px; color: rgba(255, 255, 255, 0.82); margin-top: 14px; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 32px; }
.cta-note { font-size: 13.5px; color: rgba(255, 255, 255, 0.6); margin-top: 24px; }

/* ---------------------------------------------------------------- footer */

.site-footer { background: var(--dark); color: #c9cac6; padding: 72px 0 28px; }

.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }

.footer-brand img { height: 88px; width: auto; }
.footer-brand p {
  font-size: 14.5px;
  line-height: 1.65;
  color: #96988f;
  margin-top: 20px;
  max-width: 320px;
}

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a7c74;
  margin-bottom: 18px;
}

.footer-contact,
.footer-links { display: flex; flex-direction: column; gap: 14px; font-size: 14.5px; }
.footer-contact li { display: flex; align-items: center; gap: 10px; }
.footer-contact a,
.footer-links a { color: #c9cac6; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid #313330;
  font-size: 13px;
  color: #7a7c74;
}

/* ----------------------------------------------------------- breakpoints */

@media (max-width: 1000px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero h1 { font-size: 46px; }
  .timeline-line { display: none; }
  .why-grid { grid-template-columns: 1fr; }
  .why-media { order: -1; }
}

@media (max-width: 860px) {
  .nav-links,
  .header-phone { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu:not([hidden]) { display: flex; }
  .header-actions { gap: 12px; }

  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-item-wide { grid-column: span 2; }
  .timeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-grid { grid-template-columns: 1fr; gap: 32px; }
  .booking-steps { flex-direction: row; flex-wrap: wrap; gap: 16px 28px; }
  .booking-panel { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; padding-top: 32px; }
}

@media (max-width: 640px) {
  .container { padding: 0 22px; }
  :root { --header-h: 80px; }

  .logo img { height: 46px; }
  .header-actions .btn-accent { display: none; }

  .hero { min-height: 0; }
  .hero-inner { padding-top: 72px; padding-bottom: 72px; }
  .hero h1 { font-size: 36px; }
  .hero-actions .btn { width: 100%; }
  .hero-trust { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-scroll { display: none; }

  .section { padding: 72px 0; }
  .section-title, .cta-band h2 { font-size: 28px; }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services-grid,
  .timeline-grid,
  .gallery-grid,
  .testimonial-grid,
  .footer-grid { grid-template-columns: 1fr; }
  .gallery-item-wide { grid-column: span 1; }
  .testimonial-grid { gap: 40px; }

  .booking-card { padding: 24px 18px; }
  .booking-panel { padding-top: 24px; }
  .booking-form { grid-template-columns: 1fr; }
  .time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions .btn { width: 100%; }

  /* Större träffytor i kalendern på små skärmar */
  .calendar-weekdays,
  .calendar-grid { gap: 4px; }
  .cal-day,
  .cal-empty { min-height: 44px; }
  .cal-day { display: flex; align-items: center; justify-content: center; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
