/**
 * PropComm Classic — fastigheter.css
 * Styles for single-fastigheter.php and archive-fastigheter.php
 *
 * @package PropComm_Classic
 */

/* ══════════════════════════════════════════════════════════════════════════════
   ARCHIVE
   ══════════════════════════════════════════════════════════════════════════════ */

.fa {
  width: 100%;
  padding-bottom: 100px;
}

/* Archive hero — bottom-anchored image (matches the news archive) */
.fa .archive-hero {
  background-position: center bottom;
}

/* Hero text: reveal on load (.is-in) + smooth swap between categories
   (.is-swapping fades the current title out; JS swaps text, then removes it). */
.fa .archive-hero__eyebrow,
.fa .archive-hero__heading {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(.16, 1, .3, 1),
              transform 0.7s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}

.fa .archive-hero.is-in .archive-hero__eyebrow { opacity: 1; transform: none; transition-delay: 0.12s; }
.fa .archive-hero.is-in .archive-hero__heading { opacity: 1; transform: none; transition-delay: 0.26s; }

/* After the entrance, drop the stagger delay + shorten so category swaps are
   snappy (no pause between fade-out and fade-in). */
.fa .archive-hero.is-ready .archive-hero__eyebrow,
.fa .archive-hero.is-ready .archive-hero__heading {
  transition-delay: 0s;
  transition-duration: 0.45s;
}

.fa .archive-hero.is-swapping .archive-hero__eyebrow,
.fa .archive-hero.is-swapping .archive-hero__heading {
  opacity: 0;
  transform: translateY(-12px);
  transition-duration: 0.28s;
}

@media (prefers-reduced-motion: reduce) {
  .fa .archive-hero__eyebrow,
  .fa .archive-hero__heading { opacity: 1; transform: none; transition: none; }
}

/* ── Intro header ── */
.fa__intro {
  text-align: center;
  padding: 80px 48px 88px;
}

.fa__eyebrow {
  display: block;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1e3a2f;
  opacity: 0.55;
  margin-bottom: 1rem;
}

.fa__heading {
  font-family: 'ConcretteXL', Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 400;
  line-height: 1.02;
  color: #1e3a2f;
  margin: 0 0 40px;
}

.fa__intro-body {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fa__intro-text {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: clamp(.95rem, 1.4vw, 1.05rem);
  line-height: 1.8;
  color: #1e3a2f;
  opacity: .7;
  margin: 0;
}

.fa__intro-contact {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: clamp(.85rem, 1.2vw, .95rem);
  line-height: 1.7;
  color: #1e3a2f;
  opacity: .55;
  margin: 0;
}

.fa__intro-link {
  color: #1e3a2f;
  opacity: 1;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(30,58,47,.4);
  padding-bottom: 1px;
  transition: border-color .15s, opacity .15s;
}

.fa__intro-link:hover {
  border-color: #1e3a2f;
  opacity: .8;
}

/* ── Grid ── */
/* ── Filter bar (centered) ── */
.fa-filter {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 0 48px 36px;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* Order inside the centered filter column: tabs → intro text → sub-filter */
.fa-filter__primary    { order: 1; }
.fa-filter__subheading { order: 2; }
.fa-filter__secondary  { order: 3; }

/* Intro subheading below the tabs — swaps per active tab (JS) */
.fa-filter__subheading {
  max-width: 720px;
  margin: 12px 0;
}

.fa-filter__subheading-state {
  display: none;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  font-weight: 400;
  line-height: 1.75;
  color: #1e3a2f;
  opacity: 0.75;
  margin: 0;
}

.fa-filter__subheading-state.is-active {
  display: block;
  animation: fa-sub-in 0.5s cubic-bezier(.16, 1, .3, 1);
}

@keyframes fa-sub-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fa-filter__subheading-state.is-active { animation: none; }
}

.fa-filter__primary {
  display: flex;
  gap: 10px;
}

.fa-filter__btn {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #064824;
  background: transparent;
  border: 1px solid #064824;
  border-radius: 4px;
  padding: 11px 26px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.fa-filter__btn:hover { background: rgba(6, 72, 36, 0.07); }

.fa-filter__btn.is-active {
  background: #064824;
  color: #fff;
  border-color: #064824;
}

/* Sub-filter row */
.fa-filter__secondary {
  display: flex;
  gap: 10px;
}

.fa-filter__secondary[hidden] { display: none; }

.fa-filter__sub {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1e3a2f;
  background: transparent;
  border: 1px solid rgba(30,58,47,0.35);
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  opacity: 0.9;
  white-space: nowrap;
}

.fa-filter__sub:hover { opacity: 1; border-color: rgba(30,58,47,0.5); }

.fa-filter__sub.is-active {
  background: rgba(30,58,47,0.08);
  border-color: rgba(30,58,47,0.35);
  opacity: 1;
}

/* Hidden card state */
.fa__card.is-hidden { display: none; }

/* ── Grid ── */
.fa__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Spacing between items (no divider lines), centred at the shared width */
  gap: var(--sp-7);
  width: min( var(--content-inner), calc(100% - var(--content-pad) * 2) );
  margin: 0 auto;
}

/* ── Card ── */
.fa__card {
  display: flex;
  flex-direction: column;
  /* slightly lighter than the page background so the items stand out */
  background: #FEFCF9;
}

/* Whole-card reveal (fades + rises; staggered in fastigheter-archive.js) */
.fa__card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
}

.fa__card.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Card image ── */
.fa__card-img-link {
  display: block;
  overflow: hidden;
}

.fa__card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #DCE6D3;
}

.fa__card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(.16,1,.3,1);
}

.fa__card-img-link:hover .fa__card-img {
  transform: scale(1.04);
}

.fa__card-img--empty {
  background: #DCE6D3;
}

/* ── Badge ── */
.fa__card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1e3a2f;
  background: #FEFCF9;
  padding: 5px 10px;
  pointer-events: none;
}

/* ── Card body ── */
.fa__card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 28px 28px 36px;
  gap: 0;
}

/* Area / omrade */
.fa__card-area {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1e3a2f;
  opacity: 0.55;
  margin: 0 0 12px;
}

/* Title */
.fa__card-title {
  font-family: 'ConcretteXL', Georgia, serif;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 400;
  line-height: 1.1;
  color: #1e3a2f;
  margin: 0 0 8px;
}

.fa__card-title a {
  color: inherit;
  text-decoration: none;
}

/* Address */
.fa__card-adress {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.85rem;
  color: #1e3a2f;
  opacity: 0.5;
  margin: 0 0 24px;
}

/* Meta */
.fa__card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin: 0 0 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(30,58,47,.12);
}

.fa__card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fa__card-meta-item dt {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1e3a2f;
  opacity: 0.45;
}

.fa__card-meta-item dd {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: #1e3a2f;
  margin: 0;
}

/* CTA link */
.fa__card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  align-self: flex-start;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e3a2f;
  text-decoration: none;
  border-bottom: 1px solid rgba(30,58,47,.4);
  padding-bottom: 2px;
  transition: border-color 0.15s, opacity 0.15s;
}

.fa__card-link::after {
  content: '→';
  transition: transform 0.2s cubic-bezier(.25,.46,.45,.94);
}

.fa__card-link:hover {
  border-color: #1e3a2f;
}

.fa__card-link:hover::after {
  transform: translateX(4px);
}

/* ── Pagination ── */
.fa__pagination {
  padding: 64px 48px 0;
  display: flex;
  justify-content: center;
}

.fa__pagination .nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.fa__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #1e3a2f;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.fa__pagination .page-numbers:hover {
  border-color: rgba(30,58,47,.3);
}

.fa__pagination .page-numbers.current {
  background: #1e3a2f;
  color: #F7F2EA;
}

/* ── Empty state ── */
.fa__empty {
  text-align: center;
  padding: 80px 0;
  font-family: 'SeasonSans', system-ui, sans-serif;
  color: #1e3a2f;
  opacity: 0.5;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — archive
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Tablet ── */
@media (max-width: 1100px) {
  .fa__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fa__intro {
    padding: 64px 32px 72px;
  }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .fa__grid {
    grid-template-columns: 1fr;
  }

  .fa__intro {
    padding: 48px 20px 56px;
  }

  .fa__intro-body {
    gap: 16px;
  }

  .fa-filter {
    gap: 16px;
    padding: 0 20px 40px;
  }

  .fa-filter__primary,
  .fa-filter__secondary {
    justify-content: center;
    flex-wrap: wrap;
  }

  .fa__card {
    /* Reset gap between edge cards on mobile */
  }

  .fa__card-img-wrap {
    aspect-ratio: 16 / 9;
  }

  .fa__card-body {
    padding: 20px 20px 28px;
  }

  .fa__pagination {
    padding: 48px 20px 0;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   SINGLE
   ══════════════════════════════════════════════════════════════════════════════ */

.fastighet-single {
  width: 100%;
  padding-bottom: 100px;
}

/* ── Back link ── */
.fastighet-single__breadcrumb {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 48px 0;
  text-align: center;
}

/* Desktop: clear the floating pill nav, which reaches below the wrapper offset. */
@media (min-width: 1101px) {
  .fastighet-single__breadcrumb {
    padding-top: 80px;
  }
}

/* Green CTA button (matches the archive "Visa alla" buttons). */
.fastighet-back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  background: var(--color-primary-green);
  padding: 14px 28px;
  border-radius: 4px;
  transition: gap .2s, opacity .15s;
}

.fastighet-back-link::after {
  content: '→';
  font-size: .9em;
  transition: transform .2s cubic-bezier(.25,.46,.45,.94);
}

.fastighet-back-link:hover {
  opacity: .9;
  color: #fff;
  gap: 16px;
}

.fastighet-back-link:hover::after {
  transform: translateX(4px);
}

/* ── Hero image ── */
.fastighet-single__hero {
  position: relative;
  max-width: var(--content-max);
  margin: 32px auto 0;
  padding: 0 48px;
  aspect-ratio: 21 / 8;
  overflow: hidden;
  border-radius: 4px;
}

.fastighet-single__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fastighet-single__hero-placeholder {
  width: 100%;
  height: 100%;
  background: #DCE6D3;
}

/* Title + area overlay on hero */
.fastighet-single__hero-overlay {
  position: absolute;
  bottom: 0;
  left: 48px;
  right: 48px;
  padding: 40px 36px 36px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.797) 0%, transparent 100%);
}

.fastighet-single__title {
  font-family: 'ConcretteXL', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 400;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.08;
}

.fastighet-single__omrade {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin: 0;
}

/* ── Body: sidebar + content ── */
.fastighet-single__body {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 56px 48px 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}

/* ── Details sidebar ── */
.fastighet-single__details {
  background: #DCE6D3;
  border-radius: 4px;
  padding: 28px 28px 32px;
  position: sticky;
  top: 48px;
}

.fastighet-single__details-heading {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: .95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #000000;
  opacity: .95;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(30,58,47,.15);
}

.fastighet-detail-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.fastighet-detail-list__row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(30,58,47,.08);
}

.fastighet-detail-list__row:last-child {
  border-bottom: none;
}

.fastighet-detail-list__label {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #1e3a2f;
  opacity: .85;
}

.fastighet-detail-list__value {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 1rem;
  color: #1e3a2f;
}

/* ── Main content ── */
.fastighet-single__content {
  min-width: 0;
}

.fastighet-single__om {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #1e3a2f;
  opacity: .85;
  margin: 0 0 2.5rem;
}

.fastighet-single__content .entry-content {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #1e3a2f;
  opacity: .85;
  margin-bottom: 2.5rem;
}

.fastighet-single__content .entry-content > * + * {
  margin-top: 1.25em;
}

/* ── Map ── */
.fastighet-single__map-wrap {
  margin-top: 0;
}

.fastighet-single__map-heading {
  font-family: 'ConcretteXL', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #1e3a2f;
  margin: 0 0 20px;
}

.fastighet-single__map {
  width: 100%;
  height: 380px;
  display: block;
  border: none;
}

.fastighet-single__map-link {
  margin-top: 10px;
}

.fastighet-single__map-link a {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: .78rem;
  color: #1e3a2f;
  opacity: .45;
  text-decoration: none;
  transition: opacity .15s;
}

.fastighet-single__map-link a:hover {
  opacity: .8;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .fastighet-single__breadcrumb {
    padding: 40px 32px 0;
  }

  .fastighet-single__hero {
    padding: 0 32px;
    margin-top: 24px;
  }

  .fastighet-single__hero-overlay {
    left: 32px;
    right: 32px;
  }

  .fastighet-single__body {
    padding: 40px 32px 0;
    grid-template-columns: 240px 1fr;
    gap: 32px;
  }
}

@media (max-width: 760px) {
  .fastighet-single__body {
    grid-template-columns: 1fr;
  }

  .fastighet-single__details {
    position: static;
  }

  .fastighet-single__hero {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .fastighet-single__breadcrumb {
    padding: 4px 20px 0;
  }

  .fastighet-single__hero {
    padding: 0 20px;
    margin-top: 20px;
  }

  .fastighet-single__hero-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.508);
    width: calc(100% - 40px);
    left: 20px;
  }

  .fastighet-single__body {
    padding: 32px 20px 0;
    gap: 24px;
  }

  .fastighet-single__map {
    height: 260px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   SINGLE — scroll-in reveal (hidden state only when JS is active: html.single-anim)
   ══════════════════════════════════════════════════════════════════════════════ */
.fastighet-single__hero,
.fastighet-single__details,
.fastighet-single__content {
  transition: opacity .8s ease, transform .8s cubic-bezier(.16, 1, .3, 1);
}

.single-anim .fastighet-single__hero,
.single-anim .fastighet-single__details,
.single-anim .fastighet-single__content {
  opacity: 0;
  transform: translateY(28px);
}

.single-anim .fastighet-single__hero.is-revealed,
.single-anim .fastighet-single__details.is-revealed,
.single-anim .fastighet-single__content.is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .single-anim .fastighet-single__hero,
  .single-anim .fastighet-single__details,
  .single-anim .fastighet-single__content {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
