/* MandalaWelt – Motiv-Unterseiten */

.motif-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 65px 24px 100px;
}

.motif-page h1 {
  font-family: "Playfair Display", Georgia, serif;
  color: #244c3d;
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 25px 0 15px;
}

.motif-page > p {
  color: #53645a;
  line-height: 1.7;
}

.back-link {
  color: #244c3d;
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

/* Suche und Filter */

.motif-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 35px 0 25px;
  padding: 22px;
  background: #f5f7f2;
  border: 1px solid #e1e8df;
  border-radius: 18px;
}

.motif-filters label {
  font-weight: 600;
  color: #34483c;
}

.motif-filters input,
.motif-filters select {
  padding: 12px 15px;
  border: 1px solid #ccd7ca;
  border-radius: 10px;
  background: white;
  font: inherit;
}

.motif-filters input {
  flex: 1;
  min-width: 200px;
}

.motif-filters select {
  min-width: 160px;
}

/* Motivgalerie */

.motif-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.motif-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e9e7df;
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 8px 22px #2b3e3020;
}

.motif-card img {
  display: block;
  width: 100%;
  height: 270px;
  object-fit: contain;
  padding: 15px;
  background: white;
  box-sizing: border-box;
}

.motif-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

.motif-card h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.4rem;
  color: #244c3d;
  margin: 0 0 12px;
}

.motif-card p {
  color: #53645a;
  line-height: 1.6;
  margin: 0 0 12px;
}

.motif-level {
  font-size: 0.85rem;
}

.motif-card-body a {
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
  padding: 12px 19px;
  border-radius: 30px;
  background: #244c3d;
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.motif-card-body a:hover {
  background: #356b54;
}

#motif-empty {
  padding: 30px;
  text-align: center;
  color: #53645a;
}

/* Tablets */

@media (max-width: 900px) {
  .motif-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Smartphones */

@media (max-width: 600px) {
  .motif-page {
    padding: 35px 16px 65px;
  }

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

  .motif-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .motif-filters input,
  .motif-filters select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* Klickbare Vorschaubilder */

.motif-card img {
  cursor: zoom-in;
}

/* Große Motivvorschau */

.preview-overlay[hidden] {
  display: none;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 28, 21, 0.85);
  box-sizing: border-box;
}

.preview-dialog {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(900px, 100%);
  max-height: 95vh;
  padding: 20px;
  border-radius: 18px;
  background: white;
  box-sizing: border-box;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: calc(95vh - 40px);
  object-fit: contain;
}

.preview-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 1;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #244c3d;
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.preview-close:hover {
  background: #356b54;
}
