/* Homepage-only coverflow, matching the gallery preview. Card content stays intact. */
body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"] {
  --role-card-width: clamp(210px, 30vw, 320px);
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 1080px;
  height: calc(var(--role-card-width) * 1.25 + 3.5rem);
  margin: 0 auto;
  overflow: hidden;
  perspective: 1100px;
  touch-action: pan-y;
}
body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"].is-dragging { user-select: none; }
body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"].is-dragging a { cursor: grabbing; }
body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"] > .home-role-card {
  position: absolute;
  top: 1rem;
  left: 50%;
  box-sizing: border-box;
  width: var(--role-card-width);
  height: calc(var(--role-card-width) * 1.25);
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(85%) translateZ(-150px) rotateY(-30deg) rotate(5deg) scale(.82);
  transition: transform 1500ms cubic-bezier(.22,.61,.36,1), opacity 1500ms ease, box-shadow 1500ms ease;
  will-change: transform, opacity;
  box-shadow: 0 16px 38px rgba(0,0,0,.24);
}
body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"] > .home-role-card[data-role-position="left"] {
  z-index: 1;
  opacity: .58;
  transform: translateX(-108%) translateZ(-135px) rotateY(28deg) rotate(-5deg) scale(.88);
}
body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"] > .home-role-card[data-role-position="right"] {
  z-index: 1;
  opacity: .58;
  transform: translateX(8%) translateZ(-135px) rotateY(-28deg) rotate(5deg) scale(.88);
}
body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"] > .home-role-card[data-role-position="center"] {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateZ(0) rotateY(0) rotate(0) scale(1);
  box-shadow: 0 30px 68px rgba(0,0,0,.5), 0 0 34px rgba(199,167,109,.22);
}
.home-role-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin: -.5rem auto 0;
}
.home-role-carousel-controls > button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(10,10,9,.78);
  font: 1.25rem var(--sans);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, opacity .2s ease;
}
.home-role-carousel-controls > button:hover:not(:disabled) { background: rgba(199,167,109,.16); transform: scale(1.05); }
.home-role-carousel-controls > button:disabled { opacity: .38; cursor: default; }
.home-role-carousel-dots { display: flex; align-items: center; gap: .45rem; }
.home-role-carousel-dots button {
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.home-role-carousel-dots button::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 5px;
  background: #796b53;
  transition: width .3s ease, background .3s ease;
}
.home-role-carousel-dots button[aria-current="true"]::before { width: 19px; background: var(--gold); }
.home-role-carousel-status { min-height: 1.2em; margin: .45rem 0 0; color: var(--paper-dim); font-size: .72rem; letter-spacing: .08em; text-align: center; }
@media (max-width: 650px) {
  body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"] { --role-card-width: min(66vw, 270px); height: calc(var(--role-card-width) * 1.25 + 2.5rem); }
}
@media (prefers-reduced-motion: reduce) {
  body.page-home main .home-expertise .home-role-grid[data-role-carousel="true"] > .home-role-card { transition: none; }
  .home-role-carousel-controls *, .home-role-carousel-controls *::before { transition: none !important; }
}

/* Homepage-only repairs: complete panel frames and centered actions. */
body.page-home main .home-projects .project-grid > article,
body.page-home main .home-media .press-grid > .press-item {
  border: 1px solid var(--gold);
}
body.page-home main .home-role-card .home-role-action-link {
  align-self: center;
  max-width: 100%;
  line-height: 1.5;
  text-align: center;
}
body.page-home main .personal-cta {
  align-items: center;
}
body.page-home main .personal-cta > .button {
  align-self: center;
  margin-inline: auto;
}
body.page-home main .button {
  max-width: 100%;
  line-height: 1.5;
  white-space: normal;
  text-align: center;
}
body.page-home main .home-role-carousel-controls > button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
}

/* Shared visual treatment for every carousel on the site. */
[data-role-carousel="true"] {
  --role-card-width: clamp(210px, 30vw, 320px);
  position: relative !important;
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  max-width: 1080px;
  height: calc(var(--role-card-width) * 1.25 + 3.5rem);
  margin: 0 auto;
  padding: 0 !important;
  overflow: hidden;
  perspective: 1100px;
  touch-action: pan-y;
}
[data-role-carousel="true"].is-dragging { user-select: none; }
[data-role-carousel="true"].is-dragging a { cursor: grabbing; }
[data-role-carousel="true"] > :is(.home-role-card,.cb-home-gallery-slide,.gallery-card) {
  position: absolute !important;
  top: 1rem !important;
  left: 50% !important;
  display: block;
  box-sizing: border-box;
  width: var(--role-card-width) !important;
  height: calc(var(--role-card-width) * 1.25) !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(224,199,155,.55);
  background: #13110f;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateX(85%) translateZ(-150px) rotateY(-30deg) rotate(5deg) scale(.82);
  transition: transform 1500ms cubic-bezier(.22,.61,.36,1), opacity 1500ms ease, box-shadow 1500ms ease;
  will-change: transform, opacity;
  box-shadow: 0 16px 38px rgba(0,0,0,.24);
}
[data-role-carousel="true"] > [data-role-position="left"] {
  z-index: 1 !important;
  opacity: .58 !important;
  transform: translateX(-108%) translateZ(-135px) rotateY(28deg) rotate(-5deg) scale(.88) !important;
}
[data-role-carousel="true"] > [data-role-position="right"] {
  z-index: 1 !important;
  opacity: .58 !important;
  transform: translateX(8%) translateZ(-135px) rotateY(-28deg) rotate(5deg) scale(.88) !important;
}
[data-role-carousel="true"] > [data-role-position="center"] {
  z-index: 3 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateZ(0) rotateY(0) rotate(0) scale(1) !important;
  box-shadow: 0 30px 68px rgba(0,0,0,.5), 0 0 34px rgba(199,167,109,.22) !important;
}
[data-role-carousel="true"] > [data-role-position^="away"] { opacity: 0 !important; }

/* Gallery photos become the same full-bleed cards used by Tätigkeitsbereiche. */
body.page-home main .cb-home-gallery-slide { inset: auto; }
body.page-home main .cb-home-gallery-card { position: absolute !important; inset: 0; height: 100%; }
body.page-home main .cb-home-gallery-image-link {
  position: absolute !important; inset: 0 !important; top: 0 !important; left: 0 !important;
  display: block; width: 100% !important; height: 100%; margin: 0 !important;
  transform: none !important; opacity: 1 !important;
}
body.page-home main .cb-home-gallery-image { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border: 0; }
body.page-home main .cb-home-gallery-card::after,
body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,rgba(0,0,0,.04) 8%,rgba(0,0,0,.16) 38%,rgba(0,0,0,.9) 100%);
}
body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card .gallery-image { position: absolute !important; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card .gallery-image img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
body.page-home main .cb-home-gallery-caption,
body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card figcaption {
  z-index: 1; display: flex !important; position: absolute !important;
  top: auto !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  width: 100% !important; min-width: 0; box-sizing: border-box;
  flex-direction: column; align-items: center; justify-content: flex-end;
  gap: .55rem; margin: 0 !important; padding: 1.1rem !important;
  border: 0 !important; background: transparent !important; color: #fff !important;
  text-align: center !important; transform: none !important; opacity: 1 !important;
  visibility: visible !important; transition: none;
}
body.page-home main .cb-home-gallery-caption h3,
body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card figcaption h3 {
  max-width: 100%; margin: 0 !important; color: #fff !important;
  font: 400 clamp(1.35rem,3.2vw,2.15rem)/1.08 var(--serif) !important;
  text-align: center !important; text-shadow: 0 2px 12px #000;
}
body.page-home main .cb-home-gallery-caption p,
body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card figcaption :is(p,.photo-credit,.photo-rights,.image-description) {
  max-width: 34ch; margin: 0 auto !important; color: #fff !important;
  font: 400 clamp(.78rem,1.3vw,1rem)/1.45 var(--sans) !important;
  text-align: center !important; text-shadow: 0 1px 8px #000;
}
body.page-home main .cb-home-gallery-caption .cb-home-gallery-credit,
body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card figcaption :is(.photo-credit,.photo-rights) {
  color: #e4d8c5 !important; font-size: .68rem !important;
}
body.page-home main .cb-home-gallery-open { min-height: 28px; color: #f0dec0; font-size: .78rem; }
body main .portfolio-album > .portfolio-heading,
body main .portfolio-album > .series-intro,
body main section:has(> [data-fashion-carousel]) > :is(h1,h2,h3),
body.page-home main .cb-gallery-unified .showcase-copy { text-align: center !important; }
body main .portfolio-album > .portfolio-heading { margin-inline: auto; }
body main .portfolio-album > .series-intro { margin-inline: auto; }
body main .portfolio-album-toolbar { display: none !important; }
.home-role-carousel-controls { position: relative; z-index: 5; }
@media (max-width: 650px) {
  [data-role-carousel="true"] { --role-card-width: min(66vw,270px); height: calc(var(--role-card-width) * 1.25 + 2.5rem); }
  body.page-home main .cb-home-gallery-caption,
  body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card figcaption { gap: .4rem; padding: .8rem !important; }
  body.page-home main .cb-home-gallery-caption h3,
  body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card figcaption h3 { font-size: clamp(1.15rem,6vw,1.65rem) !important; }
  body.page-home main .cb-home-gallery-caption p,
  body main :is(.portfolio-album-track,[data-fashion-carousel]) .gallery-card figcaption :is(p,.photo-credit,.photo-rights,.image-description) { font-size: .74rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  [data-role-carousel="true"] > :is(.home-role-card,.cb-home-gallery-slide,.gallery-card),
  .home-role-carousel-controls *, .home-role-carousel-controls *::before { transition: none !important; }
}
