/* ══════════════════════════════════════════════════════════════════════════
   Rental Object Show Page Styles
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Utility classes for this page ── */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.input--borderless {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  width: 100%;
  outline: none;
}

.book-cta--full {
  width: 100%;
  justify-content: center;
}

.book-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sam-medium);
  margin-bottom: 12px;
  cursor: pointer;
}

.book-checkbox input[type="checkbox"] {
  accent-color: var(--sam-dark);
}

/* Map address subtitle */
.map-address-sub {
  font-size: 13px;
  color: var(--sam-brown-dark);
}

/* Similar grid loading state */

/* Booked viewing success state button */
.book-cta--success {
  background: var(--sam-confirmation);
  color: var(--sam-white);
  border-color: var(--sam-confirmation);
}

.book-cta--success:hover {
  background: color-mix(in oklab, var(--sam-confirmation) 90%, black);
  border-color: color-mix(in oklab, var(--sam-confirmation) 90%, black);
}

/* Report link muted */
.link--muted {
  color: var(--sam-medium);
}

/* Mobile bar price suffix */
.mobile-bar .price-suffix {
  font-size: 13px;
  font-weight: 400;
  color: var(--sam-medium);
}

/* Mobile bar check icon spacing */
.mobile-bar .btn svg {
  margin-right: 6px;
}

/* Admin response hidden by default */
.admin-panel__response--hidden {
  color: var(--sam-confirmation);
  font-size: 13px;
  display: none;
}

/* ── Registration popup modal ── */
.registration-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.registration-popup.is-open {
  display: flex;
}

.registration-popup__content {
  background: var(--sam-white);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-3);
  position: relative;
}

.registration-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
}

.registration-popup__title {
  margin: 0 0 16px;
  font-size: var(--text-xl);
  font-weight: 800;
}

.registration-popup__desc {
  color: var(--sam-brown-dark);
  margin-bottom: 24px;
  line-height: 1.6;
}

.registration-popup__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Gallery ── */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 260px 180px;
  gap: 4px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

.gallery .g {
  border-radius: 0;
  overflow: hidden;
  position: relative;
  background: var(--sam-brown-light);
}

.gallery .g:first-child {
  grid-row: span 2;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.gallery .g:nth-child(3) {
  border-radius: 0 var(--radius-lg) 0 0;
}

.gallery .g:nth-child(5) {
  border-radius: 0 0 var(--radius-lg) 0;
}

.ph {
  width: 100%;
  height: 100%;
  position: relative;
}

.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(49, 49, 49, .3);
}

.gallery .view-all-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
  transition: background .15s;
}

.gallery .view-all-btn:hover {
  background: #fff;
}

/* Image count badge - hidden on desktop, shown on tablet/mobile */
.gallery__count {
  display: none;
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
  transition: background .15s;
  z-index: 3;
}

.gallery__count:hover {
  background: #fff;
}

/* Gallery variants based on image count */
.gallery--1 {
  grid-template-columns: 1fr;
  grid-template-rows: 440px;
}

.gallery--1 .g:first-child {
  grid-row: 1;
  border-radius: var(--radius-lg);
}

.gallery--2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 440px;
}

.gallery--2 .g:first-child {
  grid-row: 1;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.gallery--2 .g:nth-child(2) {
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.gallery--3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 260px 180px;
}

.gallery--3 .g:first-child {
  grid-row: span 2;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.gallery--3 .g:nth-child(2) {
  border-radius: 0 var(--radius-lg) 0 0;
}

.gallery--3 .g:nth-child(3) {
  border-radius: 0 0 var(--radius-lg) 0;
}

.gallery--4 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 260px 180px;
}

.gallery--4 .g:first-child {
  grid-row: span 2;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.gallery--4 .g:nth-child(2) {
  border-radius: 0;
}

.gallery--4 .g:nth-child(3) {
  border-radius: 0 var(--radius-lg) 0 0;
}

/* Spans the bottom row so the last tile, and the view-all badge in it, ends at
   the grid's bottom-right corner instead of leaving that cell empty. */
.gallery--4 .g:nth-child(4) {
  grid-column: span 2;
  border-radius: 0 0 var(--radius-lg) 0;
}

/* Gallery media overlay (for video/matterport) */
.g--media {
  cursor: pointer;
  position: relative;
}

/* The 3D-tour and video tiles are <button> so they are keyboard-operable
   (WCAG 2.1.1). Strip the UA button chrome so they render identically to the
   plain <div> image tiles beside them. */
.gallery button.g {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

/* Drawn inset: .gallery .g clips to a 4px grid gap, so an outward ring would
   collide with the neighbouring tile. White reads against the dark
   .media-overlay these tiles always carry. */
.gallery button.g:focus-visible {
  outline: 3px solid var(--sam-white);
  outline-offset: -3px;
}

/* Photo tiles wrap their <img> in a <button> so opening the lightbox is
   keyboard-operable (WCAG 2.1.1). The button fills the tile; the badge row and
   "view all" control stay as absolutely-positioned siblings above it. */
.gallery .g__photo-btn {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gallery .g__photo-btn img {
  display: block;
}

.gallery .g__photo-btn:focus-visible {
  outline: 3px solid var(--sam-white);
  outline-offset: -3px;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.g--media:hover .media-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.media-overlay__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sam-dark);
  box-shadow: var(--shadow-2);
}

.media-overlay__icon--play {
  padding-left: 4px;
}

.media-overlay__icon svg {
  stroke: var(--sam-dark);
}

.media-overlay__icon--play svg {
  fill: var(--sam-dark);
  stroke: none;
}

.media-overlay__label {
  color: var(--sam-white);
  font-size: var(--text-sm);
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Media Modal — a skin over the shared .modal component so that opening it goes
   through Samtrygg.modal and inherits the focus trap, Escape handling and focus
   return (WCAG 2.4.3 / 4.1.2). Positioning, display and the fade come from
   assets/_modal.css; only the dark ground and stacking are overridden here.

   The dark layer lives on the container rather than a child backdrop element so
   that a click outside the panel lands on .media-modal itself, which is the
   target _modal.js checks for click-to-dismiss. Extra top padding keeps the
   close button (offset -48px above the panel) inside the viewport. */
.media-modal.modal {
  z-index: 2000;
  padding: 72px 24px 24px;
  background: rgba(0, 0, 0, 0.9);
  /* Override bottom-sheet behavior from _modal.css - always center */
  align-items: center !important;
  justify-content: center !important;
}

.media-modal__content {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  z-index: 1;
}

.media-modal__close {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: none;
  color: var(--sam-white);
  cursor: pointer;
  padding: 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.media-modal__close:hover {
  opacity: 1;
}

.media-modal__frame {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
}

.media-modal__frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.media-modal__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.media-modal__nav button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--sam-white);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.media-modal__nav button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.media-modal__nav span {
  color: var(--sam-white);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* Media modal - mobile responsive */
@media (max-width: 640px) {
  .media-modal.modal {
    padding: 48px 12px 12px;
  }

  .media-modal__content {
    width: 100%;
    max-width: none;
  }

  .media-modal__close {
    top: -36px;
    right: 0;
  }

  .media-modal__nav {
    margin-top: 12px;
  }
}

/* Gallery placeholder (no images) */
.gallery-placeholder {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: var(--sam-brown-light);
  border-radius: var(--radius-lg);
  color: var(--sam-medium);
  gap: 16px;
}

.gallery-placeholder svg {
  opacity: 0.5;
}

.gallery-placeholder span {
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Fullscreen gallery (PhotoSwipe) prev/next arrows, styled as the Design System
   lightbox: 48px round translucent buttons with a chevron. The default skin hides
   them on touch screens and fades them out when the mouse is idle; here they stay
   visible so the gallery can be paged without knowing to swipe. */
.pswp .pswp__button--arrow--left,
.pswp .pswp__button--arrow--right {
  top: 50%;
  margin-top: 0;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--sam-white) 12%, transparent);
  color: var(--sam-white);
  display: grid;
  place-items: center;
  visibility: visible;
  opacity: 1;
  transition: background var(--transition-fast);
}

.pswp .pswp__button--arrow--left { left: var(--s-4); }
.pswp .pswp__button--arrow--right { right: var(--s-4); }

.pswp .pswp__button--arrow--left:hover,
.pswp .pswp__button--arrow--right:hover {
  background: color-mix(in oklab, var(--sam-white) 24%, transparent);
}

.pswp .pswp__button--arrow--left:focus-visible,
.pswp .pswp__button--arrow--right:focus-visible {
  outline: 2px solid var(--sam-white);
  outline-offset: 2px;
}

/* Replace the default skin's sprite with the inline chevron. */
.pswp .pswp__button--arrow--left::before,
.pswp .pswp__button--arrow--right::before {
  display: none;
}

/* PhotoSwipe matches taps by the target's class, so the click must land on the button. */
.pswp .pswp__button--arrow--left svg,
.pswp .pswp__button--arrow--right svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Re-assert the default skin's rules that the overrides above would otherwise beat:
   no arrows for a single photo, and hidden with the rest of the UI (open animation,
   tap-to-toggle on touch). */
.pswp .pswp__ui--one-slide .pswp__button--arrow--left,
.pswp .pswp__ui--one-slide .pswp__button--arrow--right {
  display: none;
}

.pswp .pswp__ui--hidden .pswp__button--arrow--left,
.pswp .pswp__ui--hidden .pswp__button--arrow--right {
  opacity: 0.001;
}

@media (max-width: 768px) {
  .pswp .pswp__button--arrow--left { left: var(--s-2); }
  .pswp .pswp__button--arrow--right { right: var(--s-2); }
}

/* ── Media preview cards (video/matterport with thumbnail) ── */
.media-previews {
  display: flex;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 32px;
}

.media-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  padding-right: 16px;
  background: var(--sam-white);
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font: inherit;
}

.media-preview:hover {
  border-color: var(--sam-dark);
  box-shadow: var(--shadow-1);
}

.media-preview:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.media-preview__thumb {
  position: relative;
  width: 80px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sam-brown-light);
}

.media-preview__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.media-preview:hover .media-preview__overlay {
  background: rgba(0, 0, 0, 0.5);
}

.media-preview__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sam-dark);
}

.media-preview__icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--sam-dark);
  fill: none;
  stroke-width: 2;
}

.media-preview__icon--play svg {
  fill: var(--sam-dark);
  stroke: none;
}

.media-preview__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.media-preview__title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.media-preview__desc {
  font-size: var(--text-xs);
  color: var(--sam-medium);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.badge--brand {
  background: var(--color-action);
  color: var(--color-action-fg);
}

.badge--dark {
  background: var(--sam-dark);
  color: #fff;
}

.badge--success {
  background: #e7f5ed;
  color: #1a7a3c;
}

/* ── Media tabs (video/matterport/images) ── */
.media-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 16px 32px 0;
  max-width: 1440px;
  margin: 0 auto;
}

.media-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--sam-light);
  background: var(--sam-white);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  color: var(--sam-dark);
  transition: all .15s;
}

.media-tab:hover {
  border-color: var(--sam-dark);
}

.media-tab.active {
  border-color: var(--sam-red);
  border-width: 2px;
  background: var(--sam-brown-light);
}

.media-tab svg {
  width: 16px;
  height: 16px;
}

.media-content {
  display: none;
}

.media-content.active {
  display: block;
}

/* ── Video container ── */
.video-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--sam-dark);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.video-nav button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--sam-light);
  background: var(--sam-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-nav button:hover {
  background: var(--sam-brown-light);
}

/* ── Button loading state ── */
.btn.is-loading {
  pointer-events: none;
  opacity: .7;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── TOC ── */
.toc {
  background: var(--sam-white);
  border-bottom: 1px solid var(--sam-light);
}

.toc .inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.toc a {
  text-decoration: none;
  color: var(--sam-medium);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 0;
  margin-right: 28px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}

.toc a:hover {
  color: var(--text-primary);
}

.toc a.on {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* ── Page layout ── */
.page-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  padding-top: var(--s-4);
}

.main-grid > article {
  align-self: start;
}

/* ── Article ── */
.art {
  min-width: 0;
}

/* Title block */
.title-block {
  margin-bottom: var(--s-4);
}

.title-block h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 var(--s-2);
  color: var(--text-primary);
}

.title-block__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 var(--s-3);
}

.title-block__amount {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.title-block__per {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--sam-brown-dark);
}

.title-block .meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--sam-brown-dark);
  font-size: 14px;
  margin-bottom: 12px;
}

.title-block .meta-row svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}

.title-block .meta-row .meta-sep {
  color: var(--sam-light);
}

/* Icon + label pair that wraps as one unit, so the icon never
   ends up on a different line than its text on narrow screens. */
.title-block .meta-row .meta-item {
  display: inline-flex;
  align-items: center;
  gap: inherit;
  white-space: nowrap;
  line-height: 1;
}

.title-block .action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.feat-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}

.feat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--sam-white);
  border: 1px solid var(--sam-light);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--sam-brown-dark);
}

/* Chips 7–8: desktop only, so mobile caps at six. */
@media (max-width: 768px) {
  .feat-chip:nth-child(n+7) {
    display: none;
  }
}

/* Facts grid */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 var(--s-4);
}

/* Housing type spans two columns: its value ("Lägenhet · Hyresrätt") is the longest, and
   with it the seven facts fill whole rows - 4 + 4 here, 2 + 2 + 2 + 2 on phones. */
.fact--wide {
  grid-column: span 2;
}

/* Below this a quarter of the column is too narrow for a date like "12 Nov 2026". */
@media (max-width: 640px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
}

.fact {
  background: var(--sam-white);
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-md);
  padding: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fact .k {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sam-medium);
}

.fact .v {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Section */
.sec {
  padding: var(--s-5) 0;
  border-top: 1px solid var(--sam-light);
}

.sec h2 {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0 0 var(--s-3);
  color: var(--text-primary);
}

.sec p {
  color: var(--sam-brown-dark);
  line-height: 1.65;
  margin: 0 0 var(--s-2);
}

/* Description: on mobile a long text is collapsed to ~8 lines with a fade and a
   toggle under it. _rental-object-show.js adds .is-collapsible only when the text
   overflows, so without JS (or on desktop) nothing is clipped. */
.ro-desc > p:last-child {
  margin-bottom: 0;
}

/* .btn--link drops the button height; keep a full touch target on mobile. */
.ro-desc__toggle {
  min-height: 44px;
  margin-top: var(--s-1);
  gap: var(--s-1);
}

.ro-desc__chevron {
  flex-shrink: 0;
  transition: transform .2s ease;
}

.ro-desc__toggle[aria-expanded="true"] .ro-desc__chevron {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .ro-desc.is-collapsible:not(.is-expanded) {
    max-height: calc(1.65em * 8);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
            mask-image: linear-gradient(to bottom, #000 60%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ro-desc__chevron {
    transition: none;
  }
}

/* Trygghetspaket block (Partials/_SafetyPackageBlock): keep the card copy as on the
   start page; only the heading follows this page's .sec h2 scale. */
.sec .feature-card__text {
  margin: 0;
  line-height: 1.55;
}

/* Amenities */
.amenities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.amenity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--sam-white);
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-md);
}

.amenity svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--sam-red);
  stroke-width: 1.8;
  flex-shrink: 0;
}

.amenity i.fa-solid {
  font-size: 18px;
  color: var(--sam-red);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.amenity span {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Unavailable / not included in the rent. Named to match .amenity--off in the
   design system (_listing-detail.css) rather than the prototype's .amenity.off. */
.amenity--off {
  opacity: .38;
}

.amenity--off svg {
  stroke: var(--sam-medium);
}

.amenity--off i.fa-solid {
  color: var(--sam-medium);
}

/* Plain checklist: a mark and a label, no tile border or background, so the
   items read as information rather than as buttons. */
.amenities--list {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--s-2) var(--s-4);
}

.amenities--list .amenity {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  align-items: baseline;
  gap: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.amenities--list .amenity::before {
  content: "✓";
  content: "✓" / "";
  flex-shrink: 0;
  width: 1em;
  font-weight: 700;
  color: var(--sam-confirmation);
}

.amenities--list .amenity--off {
  opacity: 1;
  color: var(--sam-medium);
}

.amenities--list .amenity--off::before {
  content: "–";
  content: "–" / "";
  color: var(--sam-medium);
}

/* Map placeholder */
.map-placeholder {
  position: relative;
  overflow: hidden;
  background: var(--sam-light);
  border-radius: var(--radius-lg);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-placeholder__bg,
.map-placeholder__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-placeholder__bg img {
  object-fit: cover;
  object-position: center;
}

.map-placeholder > :not(.map-placeholder__bg) {
  position: relative;
}

/* ── Booking panel ── */
.book-panel {
  position: sticky;
  top: 120px;
  background: var(--sam-white);
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

/* Mobile booking card - hidden on desktop */
.book-panel--mobile {
  display: none;
}

.book-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--sam-light);
}

.book-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.book-price .amount {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.book-price .per {
  font-size: var(--text-base);
  color: var(--sam-medium);
}

.book-price .crossed {
  font-size: var(--text-base);
  color: var(--sam-medium);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.book-meta {
  font-size: 12.5px;
  color: var(--sam-medium);
  display: flex;
  justify-content: space-between;
}

.book-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--sam-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}

.book-row{
    display: grid;
}

.book-date {
  padding: 12px 14px;
  cursor: pointer;
  transition: background .12s;
}

.book-date:first-child {
  border-right: 1px solid var(--sam-light);
}

.book-date:hover {
  background: var(--sam-brown-light);
}

.book-date .k {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sam-medium);
  margin-bottom: 3px;
}

.book-date .v {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Read-only period: plain text, without the field frame and hover of the
   date inputs it shares .book-dates with. */
.book-dates--static {
  margin: 0 0 var(--s-1);
  border: 0;
  border-radius: 0;
  gap: var(--s-4);
}

.book-dates--static .book-date {
  padding: 0;
  cursor: default;
}

.book-dates--static .book-date:first-child {
  border-right: 0;
}

.book-dates--static .book-date:hover {
  background: none;
}

.book-dates--static dd {
  margin: 0;
}

.book-body {
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-cta {
  width: 100%;
  justify-content: center;
  font-size: 16px;
}

.book-trust {
  padding: 14px 22px;
  border-top: 1px solid var(--sam-light);
  background: var(--sam-dark);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.book-trust svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--sam-red);
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 2px;
}

.book-trust p {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .7);
  line-height: 1.5;
}

.book-trust b {
  color: #fff;
}

/* ── Care-banner (ContractInProgress / MaxLimitCrossed states) ── */
.care-banner {
  display: none;
  background: var(--sam-brown-light);
  border: 1px solid var(--sam-light);
  border-left: 3px solid var(--sam-red);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.care-banner.on {
  display: block;
}

/* h3, not h4: the page outline went h2 → h4 here (WCAG 1.3.1). Visual size
   is set below, so promoting the level changes nothing on screen. */
.care-banner h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.care-banner p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--sam-brown-dark);
  line-height: 1.5;
}

.care-banner .care-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.care-banner .btn {
  justify-content: center;
  width: 100%;
}

/* ── Agent-assists card ── */
.agent-card {
  display: none;
  gap: 16px;
  align-items: flex-start;
  background: var(--sam-white);
  border: 1px solid var(--sam-light);
  border-left: 3px solid var(--sam-red);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.agent-card.is-visible {
  display: flex;
}

.agent-card__body {
  flex: 1;
}

.agent-card .agent-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--sam-light);
}

.agent-card .agent-photo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--sam-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-card .agent-photo-placeholder svg {
  width: 32px;
  height: 32px;
  color: var(--sam-medium);
}

.agent-card .agent-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sam-red-ink);
  margin-bottom: 6px;
}

.agent-card .agent-tag svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--sam-red);
  stroke-width: 2.5;
}

.agent-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.agent-card .agent-comment {
  font-size: 14px;
  color: var(--sam-brown-dark);
  line-height: 1.6;
  font-style: italic;
}

/* Agent comment box (standalone) */
.agent-comment-box {
  display: flex;
  gap: 16px;
  margin-top: var(--s-4);
  padding: 20px;
  background: var(--sam-brown-light);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--sam-red);
}

.agent-comment-box__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sam-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-comment-box__icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--sam-red);
}

.agent-comment-box__content {
  flex: 1;
}

.agent-comment-box__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sam-red-ink);
  margin-bottom: 6px;
}

.agent-comment-box__text {
  margin: 0;
  font-size: 15px;
  font-style: italic;
  color: var(--sam-brown-dark);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .agent-card {
    flex-wrap: wrap;
  }

  .agent-card > div:last-child {
    width: 100%;
  }
}

/* ── Landlord ── */
/* Plain text row without a card frame: it is information, not something to open. */
.landlord-card {
  display: flex;
  gap: 16px;
  align-items: center;
}

.landlord-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sam-brown-light), #c9a382);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

/* Stand-in when there is no initial to draw, so the circle is never just an
   empty beige disc. */
.landlord-avatar__icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landlord-info {
  flex: 1;
}

.landlord-info h3 {
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0 0 4px;
}

.landlord-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--sam-brown-dark);
}

.landlord-meta .hl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.landlord-meta svg {
  width: 13px;
  height: 13px;
  stroke: var(--sam-confirmation);
  fill: none;
  stroke-width: 2.5;
}

@media (max-width: 768px) {
  .landlord-card {
    flex-wrap: wrap;
  }

  .landlord-card > div:last-child {
    width: 100%;
  }

  .landlord-card .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Mobile sticky bar ── */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: var(--sam-white);
  border-top: 1px solid var(--sam-light);
  padding: 12px 16px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(49, 49, 49, .08);
}

/* The bar stands in for the inline booking card once that card has scrolled away.
   While the card is on screen the bar is a second copy of the same price sitting on
   top of whatever is at the bottom edge, so _rental-object-show.js hides it for
   exactly as long as the card is visible. Moved rather than `display: none`d — the
   breakpoint rule below wins with !important, and sliding reads better anyway. */
.mobile-bar.is-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Added after the observer's first call, so the page does not open on a slide-in. */
.mobile-bar--animated {
  transition: transform .2s ease, opacity .2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bar--animated { transition: none; }
}

.mobile-bar .price {
  font-size: var(--text-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mobile-bar .sub {
  font-size: 12px;
  color: var(--sam-medium);
}

/* ── Footer ── */
.site-footer {
  background: var(--sam-dark);
  color: #cfcfcf;
  margin-top: 0;
}

.site-footer .inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 32px 20px;
}

.site-footer .cols {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid #3a3a3a;
}

.site-footer h4 {
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  margin: 0 0 12px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.site-footer a {
  color: #cfcfcf;
  font-size: 13.5px;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .brand-col .logo {
  color: #fff;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.02em;
}

.site-footer .brand-col p {
  font-size: var(--text-sm);
  color: #9a9a9a;
  margin: 10px 0 18px;
  max-width: 260px;
  line-height: 1.55;
}

.site-footer .social {
  display: flex;
  gap: 8px;
}

.site-footer .social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer .social svg {
  width: 15px;
  height: 15px;
  fill: #fff;
}

.site-footer .bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  font-size: 12px;
  color: #9e9e9e;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Admin Panel ── */
.admin-panel {
  max-width: 1440px;
  margin: 40px auto;
  padding: 0 32px;
}

.admin-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--color-action);
  color: var(--color-action-fg);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.admin-panel__header svg {
  stroke: var(--sam-white);
}

.admin-panel__body {
  padding: 24px;
  background: var(--sam-white);
  border: 1px solid var(--sam-light);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.admin-panel__form {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--sam-light);
}

.admin-panel__checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--text-sm);
}

.admin-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--sam-red);
}

.admin-panel__actions {
  display: flex;
  gap: 12px;
}

.admin-panel__info {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--sam-light);
}

.admin-panel__info p {
  margin: 0 0 8px;
  font-size: var(--text-sm);
  color: var(--sam-brown-dark);
}

.admin-panel__info p:last-child {
  margin-bottom: 0;
}

.admin-panel__info strong {
  color: var(--text-primary);
}

.admin-panel__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.admin-panel__links a {
  font-size: var(--text-sm);
  color: var(--sam-red);
  text-decoration: underline;
}

.admin-panel__links a:hover {
  color: var(--text-primary);
}

.admin-link--warning {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sam-error) !important;
}

.admin-link--warning svg {
  stroke: var(--sam-error);
}

.admin-link--success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sam-confirmation) !important;
}

.admin-link--success svg {
  stroke: var(--sam-confirmation);
}

.admin-panel__section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--sam-light);
}

.admin-panel__section-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-primary);
}

.admin-panel__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--sam-medium);
  margin-bottom: 6px;
}

.admin-panel__textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--text-sm);
  resize: vertical;
  margin-bottom: 12px;
}

.admin-panel__textarea:focus {
  outline: none;
  border-color: var(--sam-red);
}

.admin-panel__select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sam-light);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--text-sm);
  background: var(--sam-white);
  margin-bottom: 12px;
}

.admin-panel__select:focus {
  outline: none;
  border-color: var(--sam-red);
}

.admin-panel__response {
  font-size: var(--text-sm);
  margin-left: 12px;
}

.admin-panel__meta {
  font-size: var(--text-sm);
  color: var(--sam-medium);
  margin-left: 12px;
}

/* ══════════════════════════════════════════════════════════════════════════
   Responsive Styles
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  /* Single cover image only */
  .gallery {
    display: block;
      padding: 0;
    overflow: hidden;
  }

  .gallery .g:first-child {
    height: 360px;
    border-radius: 0;
  }

  .gallery .g:nth-child(2),
  .gallery .g:nth-child(3),
  .gallery .g:nth-child(4),
  .gallery .g:nth-child(5) {
    display: none;
  }

  /* Show image count badge */
  .gallery__count {
    display: flex;
  }

  /* Hide desktop view-all button */
  .gallery .view-all-btn {
    display: none;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  /* Hide sidebar booking panel, show inline mobile version */
  aside .book-panel {
    display: none;
  }

  .book-panel--mobile {
    display: block;
    position: static;
    margin-bottom: var(--s-4);
    scroll-margin-top: var(--s-8);
  }

  .mobile-bar {
    display: none !important;
  }
}

@media (max-width: 768px) {

  .topband {
    display: none;
  }

  .nav .inner {
    padding: 0 16px;
    height: 56px;
  }

  .nav ul {
    display: none;
  }

  .nav .right .langsw,
  .nav .right .btn--secondary,
  .nav .right .btn--primary {
    display: none;
  }

  .gallery {
    border-radius: 0;
  }

  .gallery .g:first-child {
    height: 280px;
  }

  .media-previews {
    padding: 0 16px;
    gap: 8px;
    margin: 12px 0;
  }

  .media-preview {
    padding: 6px 10px;
    gap: 8px;
    flex: 1;
  }

  .media-preview__thumb {
    width: 44px;
    height: 34px;
  }

  .media-preview__icon {
    width: 24px;
    height: 24px;
  }

  .media-preview__icon svg {
    width: 12px;
    height: 12px;
  }

  .media-preview__title {
    font-size: 12px;
  }

  .media-preview__desc {
    display: none;
  }

  .toc .inner {
    padding: 0 16px;
  }

  .toc a {
    font-size: var(--text-sm);
    margin-right: 16px;
  }

  .page-wrap {
    padding: 0 16px 100px;
  }

  .main-grid {
    padding-top: 20px;
    gap: 0;
  }

  .mobile-bar {
    display: flex !important;
  }

  body {
    padding-bottom: 76px;
  }

  .title-block h1 {
    font-size: 26px;
  }

  .amenities {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer .cols {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .site-footer .inner {
    padding: 28px 16px 12px;
  }

  .site-footer .bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  /* Spread the five tabs across the row instead of a fixed right margin, so
     the bar fits a phone without scrolling (overflow-x stays as a fallback). */
  .toc .inner {
    justify-content: space-between;
    gap: var(--s-2);
  }

  .toc a {
    margin-right: 0;
  }

  .gallery {
    grid-template-rows: 200px 0;
  }

  .gallery .g:nth-child(2) {
    display: none;
  }

  .amenities {
    grid-template-columns: 1fr;
  }

  .site-footer .cols {
    grid-template-columns: 1fr;
  }
}

/* Narrow phones: one step smaller so all five TOC tabs still fit down to 360px. */
@media (max-width: 380px) {
  .toc a {
    font-size: 12px;
  }
}
