:root {
  --page-gutter: clamp(1.5rem, 5vw, 4rem);
  --content-width: 1200px;
  --section-space: clamp(2.5rem, 5vw, 4rem);
}
.page-header, .nyheter-header, .gard-page-hero {
  padding: clamp(8rem, 13vw, 11rem) var(--page-gutter) var(--section-space);
}
.page-header-inner, .nyheter-header-inner, .gard-page-hero-inner, .home-inner {
  max-width: var(--content-width);
  margin-inline: auto;
}
.horses-section, .listings-section, .nyheter-section, .personal-section,
.trainer-section, .contact-section, .gard-content,
[data-page="startkommentarer"] .main, [data-page="horse-profile"] main {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding: var(--section-space) var(--page-gutter);
}
.home-section { padding: var(--section-space) var(--page-gutter); }
.owner-strip { padding-inline: var(--page-gutter); }
.sale-detail { max-width: calc(var(--content-width) + 2 * var(--page-gutter)); padding-inline: var(--page-gutter); }
.trainer-section, .contact-section, .gard-content-grid, [data-page="horse-profile"] .info {
  gap: var(--section-space);
}
.personal-cards, .horses-grid { gap: clamp(1.25rem, 3vw, 2rem); }
.horse-intro { margin-block: var(--section-space); }
.site-gallery { min-width: 0; }
.gallery-stage, .gallery-hero-button, .gallery-thumbnail {
  box-sizing: border-box;
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  color: #f4f2ee;
  background: #0d141d;
  cursor: zoom-in;
  font: inherit;
}
.gallery-stage { width: 100%; aspect-ratio: 4 / 3; }
.gallery-stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-hero-button { width: 100%; height: 100%; }
.photo:after { pointer-events: none; }
.gallery-enlarge {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  background: #0a0a0cc9;
  color: #f4f2ee;
  pointer-events: none;
}
.gallery-enlarge svg { display: block; width: 22px; height: 22px; }
.gallery-count { margin: .65rem 0; color: #b7bec8; font-size: .85rem; }
.gallery-thumbnails { display: flex; gap: .75rem; overflow-x: auto; padding: 4px; }
.gallery-thumbnail { flex: 0 0 90px; height: 72px; border: 2px solid #ffffff30; cursor: pointer; }
.gallery-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbnail[aria-pressed="true"] { border-color: #c8d8e8; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.gallery-grid .gallery-thumbnail { width: 100%; height: 180px; }
.gallery-stage:focus-visible, .gallery-hero-button:focus-visible, .gallery-thumbnail:focus-visible,
.image-viewer button:focus-visible { outline: 3px solid #c8d8e8; outline-offset: 3px; }
.image-viewer-open { overflow: hidden; }
dialog.image-viewer {
  box-sizing: border-box;
  margin: auto;
  width: min(1160px, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 3vw, 1.5rem);
  color: #f4f2ee;
  background: #0a0a0c;
  border: 1px solid #ffffff30;
  overflow: auto;
}
.image-viewer::backdrop { background: #000e; }
.image-viewer-header, .image-viewer-controls { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.image-viewer-header { margin-bottom: 1rem; }
.image-viewer-header h2 { margin: 0; font: 300 clamp(1.5rem, 4vw, 2rem) 'Cormorant Garamond', serif; }
.image-viewer button { min-height: 44px; padding: .6rem .8rem; color: inherit; background: transparent; border: 1px solid #ffffff50; font: inherit; cursor: pointer; }
.image-viewer [hidden] { display: none; }
.image-viewer-frame { display: grid; justify-items: center; align-content: center; min-height: 180px; }
.image-viewer-frame img { max-width: 100%; max-height: 65dvh; width: auto; height: auto; object-fit: contain; touch-action: pan-y pinch-zoom; }
.image-viewer-controls { margin-top: 1rem; font-size: .9rem; }
.gallery-error { color: #ffb6ae; }
@media (max-width: 600px) {
  .image-viewer-controls { gap: .5rem; }
  .image-viewer-controls button { padding-inline: .5rem; }
  .image-viewer-controls span { text-align: center; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid .gallery-thumbnail { height: 140px; }
}

/* Readable body copy on the trainer and facility pages. */
.trainer-body { font-size: 1.125rem; color: rgba(244, 242, 238, .85); }
.gard-content p { font-size: 1.25rem; color: rgba(244, 242, 238, .85); }
.gard-stat-num, .gard-gallery-label { color: rgba(244, 242, 238, .85); }
