/* Projekte Overview Block - Grid styles */

/* Projekte Overview: copy of projekt-slider styles scoped to .dx-projekte-overview
   to achieve the same visual appearance as the slider cards. */

.dx-projekte-overview { --dx-grid-gap: 2rem; }
.dx-projekte-overview .dx-projekte-grid {
  position: relative;
  display: grid;
  gap: var(--dx-grid-gap);
  grid-template-columns: repeat(1, 1fr);
  transition: opacity 160ms ease;
}

/* Controls layout: label and select side-by-side */
.dx-projekte-controls{margin-bottom:2rem;}
.dx-projekte-controls__inner { display:flex; flex-wrap:wrap; align-items:center; gap: var(--space-md); }
.dx-projekte-controls__group { display:flex; align-items:center; gap: var(--space-sm); }
.dx-projekte-controls__label { margin: 0; font-weight: 600; white-space: nowrap; }
.dx-projekte-controls__select { width: 18rem; max-width: 100%; }

.dx-projekte-empty {
  margin: var(--space-lg) 0 0;
  color: #777;
}

@media (max-width: 767.98px) {
  .dx-projekte-controls__inner { flex-direction: column; align-items: stretch; }
  .dx-projekte-controls__group { flex-direction: column; align-items: stretch; }
  .dx-projekte-controls__select { width: 100%; }
}

/* responsive columns driven by data-columns attr on wrapper */
.dx-projekte-overview[data-columns="2"] .dx-projekte-grid { grid-template-columns: repeat(2, 1fr); }
.dx-projekte-overview[data-columns="3"] .dx-projekte-grid { grid-template-columns: repeat(3, 1fr); }
.dx-projekte-overview[data-columns="4"] .dx-projekte-grid { grid-template-columns: repeat(4, 1fr); }
.dx-projekte-overview[data-columns="5"] .dx-projekte-grid { grid-template-columns: repeat(5, 1fr); }
.dx-projekte-overview[data-columns="6"] .dx-projekte-grid { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1199.98px) {
  .dx-projekte-overview[data-columns="3"] .dx-projekte-grid { grid-template-columns: repeat(2, 1fr); }
  .dx-projekte-overview[data-columns="4"] .dx-projekte-grid { grid-template-columns: repeat(2, 1fr); }
  .dx-projekte-overview[data-columns="5"] .dx-projekte-grid { grid-template-columns: repeat(2, 1fr); }
  .dx-projekte-overview[data-columns="6"] .dx-projekte-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767.98px) {
  .dx-projekte-overview .dx-projekte-grid { grid-template-columns: 1fr !important; }
}

/* === project card styles (copied from projekt-slider/style.css) === */
/* Card meta sizing variables */
.dx-projekte-overview { --projekt-meta-height: 3.2rem; --projekt-meta-gap: 1rem; }

.dx-projekte-overview .dx-projekte-grid__item { display:block; }
.dx-projekte-overview .dx-projekte-grid__item .dx-projekt-card { height: 100%; display:flex; flex-direction:column; background: var(--color-white); border-radius: 0; overflow: hidden; }
.dx-projekte-overview .dx-projekte-grid__item .dx-projekt-card__media img{ width:100%; height:100%; display:block; object-fit:cover; transition: transform 360ms cubic-bezier(.2,.9,.2,1); will-change: transform; transform: scale(1); }

/* card layout */
.dx-projekte-overview .dx-projekt-card { display: flex; flex-direction: column; justify-content: space-between; background: var(--color-white); border-radius: 0; overflow: hidden; flex: 1 1 auto; height: 100%; }
.dx-projekte-overview .dx-projekt-card__title{
  font-weight: var(--font-weight-semi-bold);
  display:-webkit-box;
  -webkit-line-clamp: 2;
  overflow:hidden;
  height: 3.7rem;
}

@media (max-width: 1199.98px) {
.dx-projekte-overview .dx-projekt-card__title{
  height: 3rem;
}}

.dx-projekte-overview .dx-projekt-card__media { height: 20rem; background: #f6f6f6; flex: 0 0 auto; overflow: hidden; }
/* Remove any vertical gap between media and body */
.dx-projekte-overview .dx-projekt-card__body { padding: var(--space-md); border-left:1px solid var(--color-secondary-alt); border-right:1px solid var(--color-secondary-alt); border-bottom:1px solid var(--color-secondary-alt); flex: 1 1 auto; display:grid;
    grid-template-rows: 4rem 1fr; gap: .5rem;  transition: border-color var(--transition-fast) ease-in-out; }

/* Grid layout for consistent card heights */
.dx-projekte-overview .dx-projekt-card__link { display: grid; grid-template-rows: auto 1fr; height: 100%; text-decoration: none; }
.dx-projekte-overview .dx-projekt-card__media { grid-row: 1; }
.dx-projekte-overview .dx-projekt-card__body { grid-row: 2; min-height: 0; }

/* Clamp description/meta to avoid exploding card heights */
.dx-projekte-overview .dx-projekt-card__meta {
  color: #777;
  font-size: .95rem;
  margin: .25rem 0 .75rem;
  /* fixed-per-row system: two rows for place and type with truncation */
  display: grid;
  grid-template-rows: var(--projekt-meta-row-height, 1.2rem) var(--projekt-meta-row-height, 1.2rem);
  gap: 0.25rem;
  align-items: start;
}
.dx-projekte-overview .dx-projekt-card__excerpt { display:none; }
.dx-projekte-overview .dx-projekt-card__meta-row { display:flex; align-items:center; justify-content:space-between; padding-top: .5rem; margin-top: auto; }

/* Clamp place/type to one line each with ellipsis */
.dx-projekte-overview .dx-projekt-card__place,
.dx-projekte-overview .dx-projekt-card__type {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--projekt-meta-row-height, 1.2rem);
  max-height: var(--projekt-meta-row-height, 1.2rem);
  display: block;
}

/* Absolute footer (year + arrow) pinned to bottom of card. */
.dx-projekte-overview .dx-projekt-card { position: relative; }
.dx-projekte-overview .dx-projekt-card__meta-row { position: absolute; left: 0; right: 0; bottom: var(--projekt-meta-gap); height: var(--projekt-meta-height); padding: 0 var(--space-md); display: flex; align-items: center; justify-content: space-between; z-index: 2; box-sizing: border-box; }

/* Reserve space inside the body so content won't be hidden behind absolute meta */
.dx-projekte-overview .dx-projekt-card__body { padding-bottom: calc(var(--projekt-meta-height) + var(--projekt-meta-gap) + 0.5rem); }

/* Responsive: on small screens keep meta in flow to avoid overlap */
@media (max-width: 767.98px) {
  .dx-projekte-overview .dx-projekt-card__meta-row { position: static; height: auto; padding: 0; margin-top: 1rem; }
  .dx-projekte-overview .dx-projekt-card__body { padding-bottom: var(--space-md); }
}
.dx-projekte-overview .dx-projekt-card__year { font-weight:700; color:var(--color-text); }

/* CTA arrow on same level as year (no absolute positioning) */

.dx-projekte-overview .dx-projekt-card__cta { display:inline-block; width: 2.5rem; height: 2.5rem; background-color: currentColor; -webkit-mask-image: url('../../img/slide-next.svg'); -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain; mask-image: url('../../img/slide-next.svg'); mask-repeat: no-repeat; mask-position: center; mask-size: contain; transition: transform 0.28s var(--transition-fast), opacity 0.18s var(--transition-fast); opacity: 1; color: var(--color-primary); }
.dx-projekte-overview .dx-projekt-card__link:hover .dx-projekt-card__cta, .dx-projekte-overview .dx-projekt-card__link:focus .dx-projekt-card__cta { transform: translateX(8px); }

/* spacing helpers using layout variable */
.dx-projekte-overview { --dx-slider-gap: var(--layout-flex-gap); }

/* Hover effects: subtle image zoom and primary borders */
.dx-projekte-overview .dx-projekt-card:hover .dx-projekt-card__media img{ transform: scale(1.04); }
.dx-projekte-overview .dx-projekt-card:hover .dx-projekt-card__body{ border-left-color: var(--color-primary); border-right-color: var(--color-primary); border-bottom-color: var(--color-primary); }

@media (prefers-reduced-motion: reduce) {
  .dx-projekte-overview .dx-projekt-card__media img { transition: none !important; }
}

/* Robust equal-height rules */
.dx-projekte-overview, .dx-projekte-overview .dx-projekte-grid { align-items: stretch; }
.dx-projekte-overview .dx-projekte-grid__item { display:flex; flex-direction:column; align-items:stretch; box-sizing: border-box; min-height: 1px; }
.dx-projekte-overview .dx-projekte-grid__item > article, .dx-projekte-overview .dx-projekte-grid__item .dx-projekt-card { display: flex; flex-direction: column; height: 100%; }
.dx-projekte-overview .dx-projekte-grid__item .dx-projekt-card__link { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.dx-projekte-overview .dx-projekte-grid__item .dx-projekt-card__media { flex: 0 0 auto; }
.dx-projekte-overview .dx-projekte-grid__item .dx-projekt-card__body { flex: 1 1 auto; min-height: 0; display:grid; grid-template-rows: 4rem 1fr; gap: .5rem; }
.dx-projekte-overview .dx-projekte-grid__item .dx-projekt-card__meta-row { margin-top: auto; }

/* Loading state on sort/pagination transition */
.dx-projekte-overview.is-loading .dx-projekte-grid {
  opacity: 0.45;
  pointer-events: none;
}

.dx-projekte-overview.is-loading .dx-projekte-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(var(--color-white-rgb, 255 255 255) / 0.35);
  z-index: 3;
}

.dx-projekte-overview.is-loading .dx-projekte-grid::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  left: 50%;
  width: min(18rem, calc(100% - 2rem));
  height: 0.28rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgb(var(--color-primary-rgb) / 0.22) 0%,
    rgb(var(--color-primary-rgb) / 0.95) 45%,
    rgb(var(--color-primary-rgb) / 0.22) 100%
  );
  background-size: 200% 100%;
  animation: dx-projekte-loading-bar 900ms linear infinite;
  z-index: 4;
}

@keyframes dx-projekte-loading-bar {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* Keep identical pagination/overlay rules removed (slider only) */

/* Pagination styles for Projekte Overview */
.dx-projekte-pagination { text-align: center; margin-top: var(--space-lg); }
.dx-projekte-pagination ul { display: inline-flex; gap:0.5rem; list-style-type: none; margin: 0; padding: 0; align-items: center; }
.dx-projekte-pagination li { list-style: none; }
.dx-projekte-pagination a, .dx-projekte-pagination span { display: inline-block; border: 1px solid var(--color-secondary-alt); padding:1rem; background: transparent; color: var(--color-secondary-alt); text-decoration: none; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.dx-projekte-pagination a:hover, .dx-projekte-pagination a:focus { border-color: var(--color-text); color: var(--color-text); }
.dx-projekte-pagination .current { border-color: var(--color-text); font-weight: 700; color: var(--color-text); }
.dx-projekte-pagination a:focus-visible { outline: 2px solid rgba(0,0,0,0.08); outline-offset: 2px; }
