/* ----------------------------------------------------------------------------
 * Homepage below-the-fold — editorial Scandinavian
 *
 * Reuses .service-page primitives (cream paper bg, .service-page__heading,
 * .service-page__lead, etc.) and adds a few homepage-only blocks:
 *   .home-pillars     — 3-up promise pillars under a hairline rule
 *   .home-services    — service rows between hairlines (no cards): two
 *                       columns, or one beside a heading (.home-split)
 *   .home-reviews     — the dark band's sideways row of reviews
 *   .home-partners    — partner logos in colour on a white strip
 *   .home-cta-link    — prominent "Se alla tjänster" link
 * ------------------------------------------------------------------------- */

/* ============================================================
 * 1. Promise pillars
 * ============================================================ */
.home-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(40px, 5vw, 64px);
}

.home-pillar {
  padding-top: 28px;
  border-top: 1px solid var(--sp-rule);
}

.home-pillar__title {
  margin: 0 0 12px;
  font-family: "Fraunces", "Lora", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--sp-ink);
  font-variation-settings: "opsz" 48, "SOFT" 50;
}

.home-pillar__body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--sp-ink-muted);
  max-width: 38ch;
}

@media (max-width: 760px) {
  .home-pillars {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ============================================================
 * 2. Service rows
 *
 * Rows between hairlines, never boxes: a frame around every cell made
 * the grid read as six cards. Two columns by default (also used on
 * /energieffektivisering and /brf-forvaltning-goteborg); --list is the
 * homepage's single column beside its heading.
 * ============================================================ */
.home-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(32px, 4vw, 48px);
}

.home-service {
  position: relative;
  padding: 26px 0 30px;
  border-top: 1px solid var(--sp-rule);
}

/* The link covers the whole row, so the padding moves onto it. */
.home-service:has(> .home-service__link) {
  padding: 0;
}

.home-service__link {
  display: block;
  height: 100%;
  box-sizing: border-box;
  padding: 26px 0 30px;
  text-decoration: none;
  color: inherit;
}

.home-service__link:focus-visible {
  outline: 2px solid var(--sp-brass);
  outline-offset: 4px;
}

.home-service__label {
  margin: 0 0 12px;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sp-brass-deep);
}

.home-service__title {
  margin: 0 0 10px;
  font-family: "Fraunces", "Lora", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.3rem, 2vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--sp-ink);
  font-variation-settings: "opsz" 48, "SOFT" 50;
  transition: color 0.2s ease;
}

.home-service__link:hover .home-service__title {
  color: var(--sp-brass-deep);
}

.home-service__desc {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--sp-ink-muted);
  max-width: 46ch;
}

.home-service__arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sp-brass-deep);
  transition: gap 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.2s ease;
}

.home-service__link:hover .home-service__arrow {
  gap: 14px;
  color: var(--sp-ink);
}

/* — One column of rows, each with its arrow at the far end. — */
.home-services--list {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.home-services--list .home-service:last-child {
  border-bottom: 1px solid var(--sp-rule);
}

.home-services--list .home-service__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 28px;
  align-items: center;
  padding: 24px 0 26px;
}

.home-services--list .home-service__title,
.home-services--list .home-service__desc {
  grid-column: 1;
}

.home-services--list .home-service__title {
  margin-bottom: 6px;
}

.home-service__go {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: "Poppins", sans-serif;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--sp-brass);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.2s ease;
}

.home-service__link:hover .home-service__go {
  transform: translateX(6px);
  color: var(--sp-brass-deep);
}

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

/* ============================================================
 * 2b. Heading on the left, rows on the right
 *
 * The heading follows the page while the rows pass, so a visitor
 * halfway down the list still reads what it is a list of.
 * ============================================================ */
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.home-split__intro {
  position: sticky;
  top: calc(var(--sh-h, 70px) + 40px);
}

.home-split__intro .service-page__lead {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .home-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .home-split__intro {
    position: static;
  }
}

/* "Se alla våra tjänster" */
.home-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 14px 0;
  font-family: "Fraunces", "Lora", serif;
  font-weight: 400;
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  letter-spacing: -0.005em;
  color: var(--sp-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--sp-brass);
  transition: gap 0.3s ease, border-color 0.2s ease, color 0.2s ease;
  font-variation-settings: "opsz" 48, "SOFT" 50;
}

.home-cta-link:hover {
  gap: 22px;
  border-bottom-color: var(--sp-ink);
  color: var(--sp-ink);
}

.home-cta-link::after {
  content: "→";
  font-family: "Poppins", sans-serif;
  color: var(--sp-brass);
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.home-cta-link:hover::after {
  color: var(--sp-ink);
}

/* ============================================================
 * 3. Kundröster: the dark band (shared/_reviews_band)
 *
 * The one dark break in the page, echoing the hero and the footer.
 * Reviews sit in a single row that scrolls sideways and runs off the
 * right edge of the page; hairlines part them, not tiles. Twelve
 * reviews as a grid of tiles was four screens of scrolling.
 * ============================================================ */
.home-reviews-band {
  --rb-bg: #1E1B16;
  --rb-cream: #F2EBDD;
  --rb-cream-soft: #BDB8AC;
  --rb-rule: rgba(242, 235, 221, 0.14);
  --rb-brass: #D4A361;

  position: relative;
  isolation: isolate;
  padding: clamp(56px, 7vw, 92px) 0 clamp(52px, 6.5vw, 84px);
}

/* Full-bleed backdrop, out of .service-page__container. */
.home-reviews-band::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  background: var(--rb-bg);
  z-index: -2;
}

/* Faint architectural grid, the hero's and footer's vocabulary. */
.home-reviews-band::after {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(242, 235, 221, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 235, 221, 0.03) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 80%, transparent 100%);
}

/* — Heading on the left, rating and arrows on the right. — */
.home-reviews-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
}

.home-reviews-band .service-page__section-eyebrow {
  color: var(--rb-brass);
}

.home-reviews-band .service-page__heading {
  margin-bottom: 0;
  color: var(--rb-cream);
}

.home-reviews-head__aside {
  display: flex;
  align-items: center;
  gap: 28px;
  /* Sits on the heading's baseline rather than its bottom edge. */
  padding-bottom: 6px;
}

/* The aggregate rating, visible so it matches the AggregateRating
   JSON-LD on the global LocalBusiness. */
.home-reviews-rating {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  color: var(--rb-cream-soft);
  white-space: nowrap;
}

.home-reviews-rating__stars {
  display: inline-flex;
  gap: 3px;
  color: var(--rb-brass);
  font-size: 13px;
}

.home-reviews-rating__value {
  font-family: "Fraunces", "Lora", Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--rb-cream);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 48, "SOFT" 50;
}

.home-reviews-nav {
  display: flex;
  gap: 8px;
}

.home-reviews-nav[hidden] {
  display: none;
}

.home-reviews-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(242, 235, 221, 0.24);
  border-radius: 50%;
  background: transparent;
  color: var(--rb-cream);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.home-reviews-nav__btn:hover {
  border-color: var(--rb-brass);
  color: var(--rb-brass);
}

.home-reviews-nav__btn:focus-visible {
  outline: 2px solid var(--rb-brass);
  outline-offset: 3px;
}

.home-reviews-nav__btn:disabled {
  opacity: 0.3;
  cursor: default;
  border-color: rgba(242, 235, 221, 0.24);
  color: var(--rb-cream);
}

/* — The row. It keeps its left edge on the page's column and runs to
     the right edge of the window; the mask lets the last review in view
     fade out instead of being cut. — */
.home-reviews {
  display: flex;
  margin: clamp(28px, 3.5vw, 44px) calc(50% - 50vw) 0 0;
  border-top: 1px solid var(--rb-rule);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 calc(100% - 96px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 96px), transparent);
}

.home-reviews::-webkit-scrollbar {
  display: none;
}

.home-reviews:focus-visible {
  outline: 2px solid var(--rb-brass);
  outline-offset: 6px;
}

/* Room after the last review, so it clears the fade when scrolled to. */
.home-reviews::after {
  content: "";
  flex: 0 0 clamp(96px, 12vw, 160px);
}

.home-review {
  flex: 0 0 clamp(248px, 24vw, 300px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 30px 32px 4px;
  border-left: 1px solid var(--rb-rule);
  scroll-snap-align: start;
}

.home-review:first-child {
  padding-left: 0;
  border-left: 0;
}

.home-review--long {
  flex-basis: clamp(248px, 44vw, 520px);
}

.home-review__stars {
  display: flex;
  gap: 3px;
  color: var(--rb-brass);
  font-size: 11px;
}

/* Fraunces upright: the italic was hard to read on the dark band at
   this size. */
.home-review__quote {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: "Fraunces", "Lora", Georgia, serif;
  font-style: normal;
  /* Light, and at a large optical size: Fraunces' text cut is sturdy
     enough to read as bold in cream on the dark band. */
  font-weight: 340;
  font-size: 1.125rem;
  line-height: 1.5;
  letter-spacing: -0.003em;
  color: var(--rb-cream);
  font-variation-settings: "opsz" 72, "SOFT" 50, "WONK" 0;
  text-wrap: pretty;
}

.home-review--short .home-review__quote {
  font-size: 1.4rem;
  line-height: 1.32;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 96, "SOFT" 50, "WONK" 0;
}

.home-review--long .home-review__quote {
  font-size: 1.0625rem;
  line-height: 1.55;
}

.home-review__quote::before {
  content: "\201D";
  color: var(--rb-brass);
}

.home-review__quote::after {
  content: "\201D";
  color: var(--rb-brass);
}

/* Names line up along the foot of the row whatever the quote's length. */
.home-review__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: auto 0 0;
  padding-top: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--rb-cream-soft);
}

.home-review__author {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--rb-cream);
}

@media (max-width: 640px) {
  .home-reviews-head__aside {
    width: 100%;
    justify-content: space-between;
    padding-bottom: 0;
  }

  .home-review,
  .home-review--long {
    flex-basis: min(80vw, 320px);
    padding: 24px 24px 4px;
  }

  .home-review:first-child {
    padding-left: 0;
  }

  .home-review--short .home-review__quote {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .home-reviews {
    scroll-behavior: smooth;
  }
}

/* ============================================================
 * 4. Partners: the logos in their own colours, on white
 *
 * A strip across the whole page (it is a child of .service-page, not
 * of the column). Each image carries its height in --h, set per logo
 * in the view so a long wordmark and a compact mark read as one size.
 * ============================================================ */
.home-partners-band {
  background: #FFFEFC;
  border-top: 1px solid var(--sp-rule);
}

.home-partners-band__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 44px) clamp(24px, 5vw, 64px) clamp(36px, 4.5vw, 52px);
}

.home-partners-band .service-page__section-eyebrow {
  margin-bottom: clamp(22px, 2.6vw, 30px);
  color: var(--sp-ink-muted);
}

.home-partners {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px clamp(24px, 3.4vw, 44px);
}

.home-partner {
  display: flex;
  align-items: center;
  min-height: 46px;
  transition: opacity 0.2s ease;
}

.home-partner:hover {
  opacity: 0.7;
}

.home-partner:focus-visible {
  outline: 2px solid var(--sp-brass);
  outline-offset: 6px;
}

.home-partner img {
  display: block;
  width: auto;
  height: var(--h, 32px);
  max-width: none;
}

/* Once the row wraps, spread-out logos would leave the last line with
   one at each end, so they gather from the left instead. */
@media (max-width: 1040px) {
  .home-partners {
    justify-content: flex-start;
    gap: 24px 44px;
  }
}

@media (max-width: 760px) {
  .home-partners {
    gap: 22px 32px;
  }

  .home-partner {
    min-height: 40px;
  }

  .home-partner img {
    height: calc(var(--h, 32px) * 0.86);
  }
}
