@import url('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');

/* Öffentliche Damals-&-Heute-Karte. Startseite, Sidebar und Navigation bleiben unberührt. */
.damals-page { min-height: 65vh; background: #fff; }
.damals-hero { padding: 76px 0 54px; background: linear-gradient(135deg, #f2f7fa 0%, #fff 74%); }
.damals-eyebrow, .damals-section-kicker { color: #1689bd; font-size: .76rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; }
.damals-eyebrow { display: flex; align-items: center; gap: 9px; }
.damals-eyebrow i { font-size: 1rem; }
.damals-hero h1 { color: #172b3a; font-size: clamp(2.2rem, 4.2vw, 3.25rem); font-weight: 760; letter-spacing: -.035em; margin: 0 0 14px; }
.damals-intro { max-width: 780px; color: #62717c; font-size: 1.05rem; line-height: 1.75; margin: 0; }
.damals-hero-note { display: flex; align-items: center; gap: 11px; max-width: 780px; margin-top: 25px; padding: 13px 16px; border: 1px solid #e1eaf0; border-radius: 10px; background: rgba(255,255,255,.72); color: #4f6471; font-size: .92rem; }
.damals-hero-note i { flex: 0 0 auto; color: #1689bd; font-size: 1.12rem; }
.damals-map-section { padding-top: 42px; padding-bottom: 76px; }
.damals-search { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto 42px; padding: 8px 9px 8px 18px; border: 1px solid #dce5eb; border-radius: 12px; background: #fff; box-shadow: 0 8px 28px rgba(20,43,58,.06); }
.damals-search > i { color: #71818d; font-size: 1.1rem; }
.damals-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 10px 0; color: #172b3a; background: transparent; }
.damals-search button { border: 0; border-radius: 8px; padding: 11px 20px; color: #fff; background: #1689bd; font-weight: 650; }
.damals-search button:hover { background: #116f9b; }
.damals-search-clear { color: #71818d; text-decoration: none; padding: 6px; }
.damals-results-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 23px; }
.damals-results-heading h2 { color: #172b3a; font-size: 1.65rem; font-weight: 740; margin: 0 0 6px; }
.damals-results-heading p:last-child { color: #75838d; margin: 0; font-size: .92rem; }
.damals-section-kicker { margin-bottom: 7px; font-size: .69rem; }
.damals-results-icon { display: flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 14px; background: #edf5f8; color: #1689bd; font-size: 1.45rem; }

.damals-map-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .95fr); gap: 22px; align-items: stretch; }
.damals-map-frame, .damals-info-card { min-width: 0; overflow: hidden; border: 1px solid #e2e9ee; border-radius: 15px; background: #fff; box-shadow: 0 8px 28px rgba(20,43,58,.07); }
.damals-map-frame { display: flex; min-height: 550px; flex-direction: column; }
.damals-map { z-index: 0; flex: 1 1 auto; width: 100%; min-height: 510px; background: #eaf0f3; }
.damals-map .leaflet-control-attribution { font-size: 10px; }
.damals-map-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 12px 15px; color: #71818b; background: #fff; font-size: .76rem; }
.damals-map-footer span { display: inline-flex; align-items: center; gap: 6px; }
.damals-map-footer i { color: #1689bd; }
.damals-map-footer a { color: #1689bd; text-decoration: none; }
.damals-map-footer a:hover { text-decoration: underline; }
.damals-info-panel { min-width: 0; }
.damals-info-card { display: flex; min-height: 550px; flex-direction: column; }
.damals-info-empty { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; padding: 42px 30px; text-align: center; }
.damals-info-empty-icon { display: flex; width: 66px; height: 66px; align-items: center; justify-content: center; margin-bottom: 19px; border-radius: 50%; color: #1689bd; background: #edf5f8; font-size: 1.7rem; }
.damals-info-empty h3 { margin: 0 0 9px; color: #172b3a; font-size: 1.25rem; font-weight: 740; }
.damals-info-empty p { max-width: 330px; margin: 0; color: #73828c; font-size: .94rem; line-height: 1.7; }
.damals-selected-card { display: flex; min-height: 550px; flex-direction: column; }
.damals-selected-image { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 225px; max-height: 360px; padding: 0; overflow: hidden; border: 0; background: #f1f5f7; cursor: zoom-in; }
.damals-selected-image img { display: block; width: 100%; height: 100%; max-height: 360px; object-fit: contain; }
.damals-selected-image-hint { position: absolute; right: 13px; bottom: 13px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 30px; color: #fff; background: rgba(7,19,28,.76); font-size: .75rem; font-weight: 650; opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }
.damals-selected-image:hover .damals-selected-image-hint, .damals-selected-image:focus-visible .damals-selected-image-hint { opacity: 1; transform: translateY(0); }
.damals-selected-image-placeholder { display: flex; min-height: 235px; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #8c9ba4; background: #f1f5f7; }
.damals-selected-image-placeholder i { font-size: 2.3rem; }
.damals-selected-image-placeholder span { font-size: .86rem; }
.damals-selected-body { padding: 25px 25px 27px; }
.damals-selected-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; color: #7d8b94; font-size: .76rem; }
.damals-selected-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 30px; color: #126e98; background: #eaf5fa; font-weight: 720; }
.damals-selected-date { color: #7d8b94; }
.damals-selected-body h3 { margin: 0 0 12px; color: #172b3a; font-size: 1.35rem; line-height: 1.35; font-weight: 760; }
.damals-selected-description { margin: 0; color: #5e707b; font-size: .94rem; line-height: 1.75; white-space: normal; overflow-wrap: anywhere; }
.damals-selected-map-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 19px; color: #1689bd; text-decoration: none; font-size: .84rem; font-weight: 680; }
.damals-selected-map-link:hover { color: #105f86; text-decoration: underline; }
.damals-coordinate-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 2px 0; color: #7a8790; font-size: .8rem; }
.damals-coordinate-note i { flex: 0 0 auto; margin-top: 2px; color: #1689bd; }
.damals-map-load-error { display: flex; min-height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 35px; color: #667782; text-align: center; }
.damals-map-load-error > i { color: #1689bd; font-size: 2.4rem; }
.damals-map-load-error strong { color: #172b3a; }
.damals-empty { padding: 75px 20px; text-align: center; border: 1px dashed #dbe5ea; border-radius: 14px; background: #fafcfd; }
.damals-empty > i { display: inline-block; margin-bottom: 14px; color: #9aabb6; font-size: 2.8rem; }
.damals-empty h2 { color: #172b3a; font-size: 1.45rem; font-weight: 730; }
.damals-empty p { color: #6d7c86; }
.damals-empty a { color: #1689bd; font-weight: 680; }

.damals-lightbox { width: min(94vw, 1250px); max-width: 1250px; max-height: 94vh; padding: 0; border: 0; border-radius: 14px; overflow: visible; background: transparent; }
.damals-lightbox::backdrop { background: rgba(4,13,20,.86); backdrop-filter: blur(3px); }
.damals-lightbox-inner { position: relative; display: flex; min-height: 160px; flex-direction: column; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 22px 70px rgba(0,0,0,.28); }
.damals-lightbox-inner img { display: block; max-width: 100%; max-height: 82vh; width: auto; height: auto; object-fit: contain; }
.damals-lightbox-inner p { color: #405563; text-align: center; font-weight: 650; margin: 0; }
.damals-lightbox-close { position: absolute; z-index: 2; top: 22px; right: 22px; display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 0; border-radius: 50%; color: #fff; background: rgba(4,13,20,.75); }
.damals-lightbox-close:hover { background: #1689bd; }

@media (max-width: 1199px) {
  .damals-map-layout { grid-template-columns: minmax(0, 1.15fr) minmax(300px, .95fr); gap: 17px; }
  .damals-map-frame, .damals-info-card, .damals-selected-card { min-height: 500px; }
  .damals-map { min-height: 460px; }
  .damals-selected-body { padding: 21px; }
}
@media (max-width: 991px) {
  .damals-map-layout { grid-template-columns: 1fr; }
  .damals-map-frame, .damals-info-card, .damals-selected-card { min-height: 0; }
  .damals-map { min-height: 440px; height: 440px; flex: none; }
  .damals-info-empty { min-height: 260px; }
  .damals-selected-image { max-height: 420px; }
  .damals-selected-image img { max-height: 420px; }
}
@media (max-width: 767px) {
  .damals-hero { padding: 56px 0 42px; }
  .damals-map-section { padding-top: 32px; }
  .damals-results-icon { width: 44px; height: 44px; }
  .damals-map { min-height: 390px; height: 390px; }
  .damals-selected-body { padding: 19px; }
}
@media (max-width: 575px) {
  .damals-hero { padding: 46px 0 36px; }
  .damals-search { gap: 8px; padding-left: 12px; margin-bottom: 34px; }
  .damals-search button { padding: 10px 13px; }
  .damals-results-heading { align-items: center; }
  .damals-map { min-height: 340px; height: 340px; }
  .damals-map-footer { align-items: flex-start; flex-direction: column; }
  .damals-selected-image { min-height: 190px; }
  .damals-lightbox-inner { padding: 8px; }
  .damals-lightbox-close { top: 14px; right: 14px; width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .damals-selected-image-hint { transition: none; } }

/* Umschalter zwischen Karten- und Galerieansicht */
.damals-view-tabs { display: flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 6px; width: fit-content; border: 1px solid #e1e9ee; border-radius: 12px; background: #f4f7f9; }
.damals-view-tab { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 19px; border: 0; border-radius: 8px; color: #5f707b; background: transparent; font-size: .9rem; font-weight: 700; cursor: pointer; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.damals-view-tab i { font-size: 1rem; }
.damals-view-tab:hover { color: #126e98; background: #eaf2f6; }
.damals-view-tab.is-active { color: #fff; background: #1689bd; box-shadow: 0 3px 10px rgba(22,137,189,.2); }
.damals-view-tab:focus-visible { outline: 3px solid rgba(22,137,189,.28); outline-offset: 2px; }
.damals-view-panel[hidden] { display: none !important; }

/* Galerieansicht: kombinierte Vorher-/Nachher-Motive vollständig anzeigen */
.damals-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px; align-items: start; }
.damals-card { min-width: 0; overflow: hidden; border: 1px solid #e5ebef; border-radius: 14px; background: #fff; box-shadow: 0 7px 24px rgba(21,43,57,.055); transition: transform .2s ease, box-shadow .2s ease; }
.damals-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(21,43,57,.10); }
.damals-card-image { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0; border: 0; background: #f1f5f7; cursor: zoom-in; overflow: hidden; }
.damals-card-image img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.damals-image-hint { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 30px; color: #fff; background: rgba(7,19,28,.72); font-size: .75rem; font-weight: 650; opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }
.damals-card-image:hover .damals-image-hint, .damals-card-image:focus-visible .damals-image-hint { opacity: 1; transform: translateY(0); }
.damals-card-image-placeholder { display: flex; min-height: 250px; align-items: center; justify-content: center; color: #a2afb7; background: #eef2f4; font-size: 2.5rem; }
.damals-card-body { padding: 20px 21px 22px; }
.damals-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; margin-bottom: 11px; color: #7d8b94; font-size: .77rem; }
.damals-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.damals-card-meta i { color: #1689bd; }
.damals-card h3 { color: #172b3a; font-size: 1.13rem; line-height: 1.4; font-weight: 740; margin: 0 0 9px; }
.damals-card-body > p { color: #657680; font-size: .92rem; line-height: 1.68; margin: 0; }
.damals-map-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 15px; color: #1689bd; text-decoration: none; font-size: .84rem; font-weight: 680; }
.damals-map-link:hover { color: #105f86; }
.damals-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 42px; }
.damals-pagination a { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid #e0e8ed; border-radius: 8px; color: #314957; text-decoration: none; }
.damals-pagination a:hover, .damals-pagination a.is-active { color: #fff; border-color: #1689bd; background: #1689bd; }
.damals-pagination > span { color: #87949c; padding: 0 3px; }

@media (max-width: 1199px) { .damals-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px; } }
@media (max-width: 767px) { .damals-gallery-grid { grid-template-columns: 1fr; gap: 18px; max-width: 650px; margin: 0 auto; } .damals-card-body { padding: 18px 19px 20px; } .damals-view-tabs { width: 100%; } .damals-view-tab { flex: 1 1 50%; padding-inline: 12px; } }
@media (max-width: 575px) { .damals-view-tabs { margin-bottom: 17px; } .damals-card-body { padding: 17px; } .damals-pagination { gap: 6px; } .damals-pagination a { min-width: 36px; height: 36px; padding: 0 9px; } }
@media (prefers-reduced-motion: reduce) { .damals-card, .damals-image-hint, .damals-view-tab { transition: none; } .damals-card:hover { transform: none; } }


/* Suche und Karten-/Galerie-Umschalter auf einer gemeinsamen Zeile */
.damals-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.damals-controls-row .damals-view-tabs {
  flex: 0 0 auto;
  margin: 0;
}
.damals-controls-row .damals-search {
  flex: 1 1 560px;
  width: 100%;
  max-width: 760px;
  margin: 0;
  min-height: 58px;
}
@media (max-width: 767px) {
  .damals-controls-row {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .damals-controls-row .damals-view-tabs {
    align-self: flex-start;
  }
  .damals-controls-row .damals-search {
    /* Im Spaltenlayout darf die Desktop-Flex-Basis von 560px nicht zur Höhe werden. */
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-height: 52px;
    height: auto;
    align-self: stretch;
  }
  .damals-controls-row .damals-search input {
    min-height: 34px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
@media (max-width: 575px) {
  .damals-controls-row .damals-search {
    flex: 0 0 auto;
    min-height: 50px;
    margin: 0;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .damals-controls-row .damals-search button {
    padding: 9px 12px;
    white-space: nowrap;
  }
}
