.gallery-tile .ref-cover-link {
  display: block;
}
.gallery-tile .ref-cover-link:focus-visible {
  outline: 3px solid #ff8a24;
  outline-offset: -4px;
}
.gallery-tile .gallery-tile-icon {
  pointer-events: none;
}
/* Reference works: detail pages and supplemental admin forms.
   Deliberately scoped so the existing site and back-office remain unchanged. */

.gallery-cap .ref-detail-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gallery-cap .ref-detail-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.ref-page {
  --ref-ink: var(--navy, #0f172a);
  --ref-blue: var(--blue, #0369a1);
  --ref-blue-dark: var(--blue-dark, #025888);
  --ref-blue-pale: var(--blue-light, #e0f2fe);
  --ref-orange: var(--accent, #f97316);
  --ref-orange-dark: var(--accent-dark, #ea580c);
  --ref-copy: var(--text-mid, #334155);
  --ref-muted: var(--text-muted, #64748b);
  --ref-line: var(--border, #e2e8f0);
  --ref-paper: var(--off-white, #f8fafc);
  width: min(100% - 48px, 1080px);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 58px) 0 88px;
  color: var(--ref-ink);
}

.ref-page *,
.ref-admin * { min-width: 0; }

.ref-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  color: var(--ref-muted);
  font-size: .84rem;
  line-height: 1.5;
}

.ref-breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ref-blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color .18s ease, text-decoration-color .18s ease;
}

.ref-breadcrumb a:hover {
  color: var(--ref-blue-dark);
  text-decoration-color: currentColor;
}

.ref-breadcrumb > :not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #94a3b8;
}

.ref-page > header {
  max-width: 820px;
  margin: 0 0 34px;
}

.ref-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--ref-blue);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ref-eyebrow::before {
  content: "";
  width: 24px;
  height: 3px;
  flex: 0 0 24px;
  border-radius: 2px;
  background: var(--ref-orange);
}

.ref-page h1,
.ref-page h2 {
  color: var(--ref-ink);
  font-family: var(--font-head, 'Poppins', sans-serif);
  letter-spacing: -.03em;
}

.ref-page h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.ref-page > header > p:last-child {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--ref-muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.75;
}

.ref-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 34px 0 54px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ref-line);
  border-left: 4px solid var(--ref-blue);
  border-radius: 14px;
  background: var(--ref-paper);
}

.ref-facts > div {
  padding: 18px 20px;
}

.ref-facts > div + div {
  border-left: 1px solid var(--ref-line);
}

.ref-facts dt {
  margin: 0 0 5px;
  color: var(--ref-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ref-facts dd {
  margin: 0;
  color: var(--ref-ink);
  font-family: var(--font-head, 'Poppins', sans-serif);
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ref-page > section {
  max-width: 820px;
  margin: 0 0 46px;
}

.ref-page h2 {
  position: relative;
  margin: 0 0 17px;
  padding: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.22;
}

.ref-page h2::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 42px;
  height: 3px;
  border-radius: 2px;
  background: var(--ref-orange);
  content: "";
}

.ref-page section > p,
.ref-page .ref-prose {
  margin: 0;
  color: var(--ref-copy);
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.ref-page .ref-prose + .ref-prose { margin-top: 16px; }

.ref-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 48px 0 58px;
}

.ref-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08));
}

.ref-gallery figure > a {
  display: block;
  min-height: 120px;
  overflow: hidden;
  background: var(--ref-blue-pale);
}

.ref-gallery figure > a:focus-visible,
.ref-page a:focus-visible,
.ref-admin a:focus-visible,
.ref-admin button:focus-visible,
.ref-admin input:focus-visible,
.ref-admin select:focus-visible,
.ref-admin textarea:focus-visible {
  outline: 3px solid var(--ref-orange);
  outline-offset: 3px;
}

.ref-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .35s ease;
}

/* Keep the complete marketing composition and its contact information visible. */
.ref-gallery img[src$="-marketing.webp"] {
  aspect-ratio: 1;
  object-fit: contain;
}

.ref-gallery img[src*="bosch-condens-3000-kecskemet-2026-10-17-"],
.ref-gallery img[src*="bosch-condens-3000-ea-varosfold-"] {
  aspect-ratio: auto;
  object-fit: contain;
}

.ref-gallery figure > a:hover img { transform: scale(1.025); }

.ref-gallery figcaption {
  padding: 14px 17px;
  color: var(--ref-copy);
  font-size: .9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ref-gallery .ref-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: 7px 0 0;
  color: var(--ref-blue);
  font-family: var(--font-head, 'Poppins', sans-serif);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color .18s ease, text-decoration-color .18s ease;
}

.ref-gallery .ref-detail-link::after {
  content: "→";
  color: var(--ref-orange);
  font-size: 1.1em;
}

.ref-gallery .ref-detail-link:hover {
  color: var(--ref-blue-dark);
  text-decoration-color: currentColor;
}

.ref-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 60px;
  padding: clamp(22px, 4vw, 38px);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(3,105,161,.28), transparent 52%),
    var(--navy, #0f172a);
  color: #fff;
}

.ref-cta h2 {
  margin: 0 0 8px;
  padding: 0;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.ref-cta h2::after { display: none; }

.ref-cta p {
  max-width: 570px;
  margin: 0;
  color: rgba(255,255,255,.76);
  line-height: 1.7;
}

.ref-cta a {
  display: inline-flex;
  min-height: 52px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--ref-orange);
  color: #fff;
  font-family: var(--font-head, 'Poppins', sans-serif);
  font-size: .94rem;
  font-weight: 700;
  text-align: center;
  transition: background .18s ease, transform .18s ease;
}

.ref-cta a:hover {
  transform: translateY(-2px);
  background: var(--ref-orange-dark);
}

/* Admin additions use the existing back-office palette and card language. */
.ref-admin {
  --ref-admin-blue: var(--blue, #1a56e8);
  --ref-admin-line: var(--border, #e2e8f0);
  --ref-admin-muted: var(--muted, #64748b);
  color: var(--text, #1e293b);
}

.ref-admin .ref-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 20px;
}

.ref-admin .ref-form-grid > label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: var(--navy, #0f172a);
  font-size: .86rem;
  font-weight: 700;
}

.ref-admin .ref-form-grid > label:has(textarea),
.ref-admin .ref-form-grid > label:has(input[type="url"]),
.ref-admin .ref-form-grid > label:has(input[type="text"][name*="title"]),
.ref-admin .ref-form-grid > label.ref-form-wide {
  grid-column: 1 / -1;
}

.ref-admin .ref-form-grid input:not([type="checkbox"]):not([type="radio"]),
.ref-admin .ref-form-grid select,
.ref-admin .ref-form-grid textarea,
.ref-admin .ref-image-row input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--ref-admin-line);
  border-radius: 9px;
  background: #fff;
  color: var(--text, #1e293b);
  font: inherit;
  font-size: .95rem;
  line-height: 1.45;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.ref-admin .ref-form-grid textarea {
  min-height: 118px;
  resize: vertical;
}

.ref-admin .ref-form-grid input:focus,
.ref-admin .ref-form-grid select:focus,
.ref-admin .ref-form-grid textarea:focus,
.ref-admin .ref-image-row input:not([type="checkbox"]):focus {
  border-color: var(--ref-admin-blue);
  box-shadow: 0 0 0 3px rgba(26,86,232,.13);
  outline: none;
}

.ref-admin .ref-image-row {
  display: grid;
  grid-template-columns: auto minmax(82px, 120px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--ref-admin-line);
  border-radius: 11px;
  background: #fff;
}

.ref-admin .ref-image-row + .ref-image-row { margin-top: 12px; }

.ref-admin .ref-image-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--ref-admin-blue);
}

.ref-admin .ref-image-row img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--ref-admin-line);
  border-radius: 7px;
  background: var(--gray, #f1f5f9);
  object-fit: cover;
}

.ref-admin .ref-list {
  display: grid;
  gap: 12px;
}

.ref-admin .ref-list > * {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--ref-admin-line);
  border-left: 4px solid var(--ref-admin-blue);
  border-radius: 10px;
  background: #fff;
  overflow-wrap: anywhere;
}

.ref-admin .ref-list a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ref-admin-blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ref-admin .ref-list a:hover { color: var(--blue-dark, #1442b8); }

@media (max-width: 700px) {
  .ref-page {
    width: min(100% - 36px, 600px);
    padding-top: 28px;
    padding-bottom: 64px;
  }

  .ref-breadcrumb { margin-bottom: 22px; }
  .ref-page > header { margin-bottom: 28px; }
  .ref-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 28px 0 42px;
  }
  .ref-facts > div { padding: 15px 16px; }
  .ref-facts > div:nth-child(odd) { border-left: 0; }
  .ref-facts > div:nth-child(n+3) { border-top: 1px solid var(--ref-line); }
  .ref-gallery { gap: 16px; margin: 38px 0 46px; }
  .ref-cta { align-items: stretch; flex-direction: column; gap: 18px; margin-top: 44px; }
  .ref-cta a { width: 100%; }
}

@media (max-width: 480px) {
  .ref-page { width: calc(100% - 32px); }
  .ref-page h1 { font-size: clamp(1.85rem, 9vw, 2.4rem); }
  .ref-facts > div { padding: 13px 12px; }
  .ref-facts dd { font-size: .91rem; }
  .ref-gallery { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ref-gallery img { aspect-ratio: 4 / 3; }
  .ref-admin .ref-form-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .ref-admin .ref-form-grid > label:has(textarea),
  .ref-admin .ref-form-grid > label:has(input[type="url"]),
  .ref-admin .ref-form-grid > label:has(input[type="text"][name*="title"]),
  .ref-admin .ref-form-grid > label.ref-form-wide { grid-column: auto; }
  .ref-admin .ref-image-row {
    grid-template-columns: auto minmax(72px, 88px) minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ref-page *,
  .ref-admin * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
