/* Modal Fenster*/
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-box {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-strong);

  width: 96%;
  max-width: 1200px;
  max-height: 96vh;

  overflow-y: auto;
  border-radius: 0;
  padding: 0;
  position: relative;
}

#modal-close {
    position: absolute;
    right: 0.1rem;
    top: 0.1rem;
    font-size: 1.7rem;
    background: var(--hhm-red);
    border: none;
    cursor: pointer;
    color: #fff;
}
/* --- Modal-Foto Layout ----------------------------------- */

.modal-photo {
  padding: 0;
  opacity: 1;
  transition: opacity 0.18s ease;
}



.modal-photo__body {
  padding: 1.25rem 1.5rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text);
}
@media (max-width: 768px) {
  .modal-box {
    width: 100%;
    max-height: 100vh;
  }

  .modal-photo__media-wrap {
    min-height: auto;
    padding: 0;
  }

  .modal-photo__image {
    max-height: 65vh;
  }

  .modal-photo__body {
    padding: 1rem;
  }

  #modal-close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
  }
}
.modal-photo__remark {
  max-width: 900px;
  margin: -0.35rem 0 1.25rem;

  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
}

.modal-photo__title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.modal-photo__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    margin-bottom: 0.75rem;
}

.modal-photo__meta-item {
    flex: 1 1 200px;     /* min 200px, Rest verteilt sich */
    max-width: 50%;      /* auf großen Screens 2 Spalten */
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.1rem;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--hhm-blue);
}

.modal-photo__edit-btn {
    display: inline-block;
    background: var(--hhm-red);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 0px;
    font-size: 0.9rem;
    text-decoration: none;
}

.modal-photo__edit-btn:hover {
    background: #b91c1c;
}

.modal-photo__map-title {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.modal-photo__map {
    width: 100%;
    height: 300px;
    border-radius: 0px;
    overflow: hidden;
}
.photo-series-block{

  margin-top:40px;

}

.photo-series-block h2{

  font-size:18px;
  margin-bottom:15px;

}

.series-count{

  color:var(--muted);
  font-weight:normal;
  margin-left:6px;

}

.photo-series-grid{

  display:grid;

  grid-template-columns:
    repeat(auto-fill,minmax(160px,1fr));

  gap:10px;

}

.series-thumb{

  display:block;

  border-radius:6px;

  overflow:hidden;

  border:2px solid transparent;

  transition:.2s;

}

.series-thumb img{

  width:100%;

  height:120px;

  object-fit:cover;

}

.series-thumb:hover{

  transform:translateY(-2px);

  border-color:var(--hhm-light-blue);

}

.series-thumb.is-current{

  border-color:var(--hhm-red);

  opacity:.85;

}


.modal-series-nav{
  position:absolute;
  top:96%;
  transform:translateY(-50%);
  z-index:20;

  width:48px;
  height:48px;
  border:none;
  border-radius:999px;

  display:flex;
  align-items:center;
  justify-content:center;

  background:var(--hhm-red);
  color:#fff;
  cursor:pointer;

  box-shadow:0 4px 14px rgba(0,0,0,.22);
  transition:transform .15s ease, background .15s ease, opacity .15s ease;
}

.modal-series-nav:hover{
  background:rgba(0,48,99,.9);
  transform:translateY(-50%) scale(1.05);
}

.modal-series-nav span{
  font-size:34px;
  line-height:1;
  margin-top:-2px;
}

.modal-series-nav--prev{
  left:30%;
}

.modal-series-nav--next{
  right:30%;
}

@media (max-width: 768px){
  .modal-series-nav{
    width:42px;
    height:42px;
  }

  .modal-series-nav span{
    font-size:28px;
  }

  .modal-series-nav--prev{
    left:8px;
  }

  .modal-series-nav--next{
    right:8px;
  }
}
.modal-series-position{
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  z-index:20;

  padding:6px 12px;
  border-radius:999px;
  background:rgba(20,22,26,.72);
  color:#fff;
  font-size:13px;
  line-height:1;
}
.modal-photo{
  opacity:1;
  transition:opacity .18s ease;
}

.modal-photo.is-switching{
  opacity:.35;
}


.modal-photo.is-switching .modal-photo__media-wrap::after{
  background:rgba(0,0,0,.18);
}

.photo-badge--series{
  position:absolute;
  left:10px;
  top:10px;
  padding:6px 10px;
  border-radius:px;
  background:var(--hhm-red);
  color:#fff;
  font-size:12px;
  z-index:5;
}

.photo-badge--series-member{
  position:absolute;
  left:10px;
  top:10px;

  padding:4px 8px;

  border-radius:999px;

  background:var(--surface-2);

  font-size:12px;

  z-index:5;
}

.media-viewer-nav{

    position:absolute;

    top:10%;

    transform:translateY(-50%);

    width:54px;
    height:54px;

    border:none;

    border-radius:50%;

    background:rgba(0,0,0,.45);

    color:#fff;

    font-size:30px;

    cursor:pointer;

    z-index:40;

    transition:.2s;

    backdrop-filter:blur(4px);

}

.media-viewer-nav:hover{

    background:rgba(0,0,0,.75);

    transform:translateY(-50%) scale(1.05);

}

.media-viewer-prev{

    left:20px;

}

.media-viewer-next{

    left:135px;

}

.media-viewer-nav.hidden{

    display:none;

}
.media-viewer-position{
  display:none;
  position:static;
  margin:0 0 1.5rem;
  padding:0;
  background:transparent;
  color:var(--hhm-blue);
  font-family:var(--heading-font-family);
  line-height:1.2;
}

.media-viewer-position__title{
  font-size:1.6rem;
  font-weight:600;
}

.media-viewer-position__sub{
  margin-top:.25rem;
  font-size:1rem;
  color:var(--muted);
}
.media-viewer-add-btn{
  border:0;
  background:var(--hhm-blue);
  color:#fff;
  padding:.65rem 1rem;
  cursor:pointer;
  font-family:var(--heading-font-family);
  font-size:1rem;
}

.media-viewer-add-btn.is-added{
  background:var(--hhm-red);
}
.media-viewer-nav.hidden{
  display:none !important;
}
.media-tag-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0.3rem 0.3rem 0;
  padding: 0.28rem 0.58rem;
  border: 1px solid #d8dde3;
  border-radius: 999px;
  background: #f3f5f7;
  color: #26313d;
  font-size: 0.84rem;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.media-tag-badge:hover,
.media-tag-badge:focus {
  border-color: #74869a;
  background: #e4e9ee;
  color: #111820;
  text-decoration: none;
}

.media-tag-badge:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
#modal-close {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10050;

  width: 44px;
  height: 44px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;
  background: var(--hhm-red);
  color: #fff;

  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

#modal-close:hover,
#modal-close:focus {
  background: var(--hhm-blue);
}
.modal-photo__media-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: min(72vh, 850px);
  padding: 4px;

  background: var(--modal-media-bg, #17191c);
  overflow: hidden;
}

.modal-photo__image {
  display: block;

  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 78vh;

  margin: 0;
  border-radius: 0;
  object-fit: contain;
}
.modal-photo__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-photo__heading-text {
  min-width: 0;
  flex: 1;
}

.modal-photo__edit-toggle {
  flex: 0 0 auto;

  border: 0;
  padding: 0.55rem 0.9rem;

  background: var(--hhm-red);
  color: #fff;
  cursor: pointer;
}

.modal-photo__edit-toggle:hover {
  background: var(--hhm-blue);
}

@media (max-width: 768px) {
  .modal-photo__heading {
    display: block;
  }

  .modal-photo__edit-toggle {
    margin-bottom: 1rem;
  }
}
body.media-modal-open {
  overflow: hidden;
}
.modal-loading,
.modal-error {
  padding: 3rem 2rem;
  text-align: center;
}

.modal-error {
  color: var(--hhm-red);
}
[data-modal-edit] {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.modal-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.modal-edit-field {
  margin-bottom: 1rem;
}

.modal-edit-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.modal-edit-field input,
.modal-edit-field textarea,
.modal-edit-field select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.modal-edit-field select[multiple] {
  min-height: 150px;
}

.modal-edit-fieldset {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
}

.modal-edit-fieldset legend {
  padding: 0 0.5rem;
  font-weight: 600;
}

.modal-edit-help {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
}

.modal-edit-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.modal-edit-save,
.modal-edit-cancel {
  border: 0;
  padding: 0.6rem 1rem;
  cursor: pointer;
}

.modal-edit-save {
  background: var(--hhm-red);
  color: #fff;
}

.modal-edit-cancel {
  background: var(--hhm-blue);
  color: #fff;
}

.modal-edit-status.is-success {
  color: #267339;
}

.modal-edit-status.is-error {
  color: var(--hhm-red);
}

@media (max-width: 768px) {
  .modal-edit-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
/* -----------------------------------
   Tagtree im Modal
----------------------------------- */

.modal-edit-field--tagtree {
  position: relative;
}

.modal-edit-field--tagtree > label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

/* geschlossene Auswahlzeile */
.modal-edit-field--tagtree .ttree-control {
  min-height: 44px;
  padding: 0.45rem 2.25rem 0.45rem 0.55rem;

  display: flex;
  align-items: center;

  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  position: relative;
}

.modal-edit-field--tagtree .ttree-control:hover {
  border-color: var(--hhm-blue);
}

.modal-edit-field--tagtree .ttree-caret {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

/* ausgewählte Stichworte */
.modal-edit-field--tagtree .ttree-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.modal-edit-field--tagtree .ttree-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;

  padding: 0.28rem 0.5rem;

  background: var(--hhm-blue);
  color: #fff;

  font-size: 0.82rem;
  line-height: 1.2;
}

.modal-edit-field--tagtree .ttree-pill-x {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.8;
}

.modal-edit-field--tagtree .ttree-pill-x:hover {
  opacity: 1;
}

/* Dropdown */
.modal-edit-field--tagtree .ttree-dropdown {
  display: none;

  position: relative;
  z-index: 30;

  max-height: 430px;
  overflow: auto;

  margin-top: 0.35rem;
  padding: 0.5rem;

  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.modal-edit-field--tagtree .ttree.is-open .ttree-dropdown {
  display: block;
}

/* Suche */
.modal-edit-field--tagtree .ttree-search {
  position: sticky;
  top: 0;
  z-index: 5;

  display: flex;
  gap: 0.35rem;

  padding: 0 0 0.5rem;
  background: var(--bg);
}

.modal-edit-field--tagtree .ttree-search-input {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 2.25rem 0.5rem 0.65rem;

  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.modal-edit-field--tagtree .ttree-search-clear {
  position: absolute;
  right: 0.65rem;
  top: 0.3rem;

  width: 30px;
  height: 30px;

  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}

/* Baum */
.modal-edit-field--tagtree .ttree-level {
  list-style: none;
  margin: 0;
  padding: 0;
}

.modal-edit-field--tagtree .ttree-level .ttree-level {
  margin-left: 1.15rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--border);
}

.modal-edit-field--tagtree .ttree-item {
  margin: 0;
}

.modal-edit-field--tagtree .ttree-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;

  min-height: 38px;
  padding: 0.2rem 0.35rem;

  border-bottom: 1px dotted var(--border);
}

.modal-edit-field--tagtree .ttree-row:hover {
  background: var(--surface-2);
}

/* Auf-/Zuklappen */
.modal-edit-field--tagtree .ttree-toggle,
.modal-edit-field--tagtree .ttree-spacer {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}

.modal-edit-field--tagtree .ttree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;

  transition: transform 0.15s ease;
}

.modal-edit-field--tagtree
.ttree-item.is-open
> .ttree-row
.ttree-toggle {
  transform: rotate(90deg);
}

/* Unterebenen standardmäßig geschlossen */
.modal-edit-field--tagtree
.ttree-item
> .ttree-level {
  display: none;
}

.modal-edit-field--tagtree
.ttree-item.is-open
> .ttree-level {
  display: block;
}

/* Checkbox + Text als große Klickfläche */
.modal-edit-field--tagtree .ttree-label {
  flex: 1;
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 0.55rem;

  min-height: 34px;
  cursor: pointer;
}

.modal-edit-field--tagtree .ttree-check {
  flex: 0 0 auto;

  width: 18px;
  height: 18px;
  margin: 0;

  accent-color: var(--hhm-red);
  cursor: pointer;
}

.modal-edit-field--tagtree .ttree-title {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

/* ausgewählte Zeile deutlicher hervorheben */
.modal-edit-field--tagtree
.ttree-row:has(.ttree-check:checked) {
  background: rgba(180, 0, 0, 0.08);
}

.modal-edit-field--tagtree
.ttree-row:has(.ttree-check:checked)
.ttree-title {
  font-weight: 700;
  color: var(--hhm-red);
}

/* Suchtreffer */
.modal-edit-field--tagtree mark {
  padding: 0 0.08em;
  background: #ffe08a;
  color: inherit;
}

/* durch JS ausgeblendete Einträge */
.modal-edit-field--tagtree .ttree-item.ttree-hidden {
  display: none;
}

/* Mobil */
@media (max-width: 768px) {
  .modal-edit-field--tagtree .ttree-dropdown {
    max-height: 60vh;
  }

  .modal-edit-field--tagtree .ttree-level .ttree-level {
    margin-left: 0.65rem;
    padding-left: 0.45rem;
  }

  .modal-edit-field--tagtree .ttree-pill {
    font-size: 0.78rem;
  }
}
.modal-free-tags {
  position: relative;
}

.modal-free-tags__suggestions {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 60;

  max-height: 260px;
  overflow-y: auto;

  margin-top: 0.25rem;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.modal-free-tags__suggestion {
  display: block;
  width: 100%;

  padding: 0.6rem 0.75rem;

  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);

  text-align: left;
  cursor: pointer;
}

.modal-free-tags__suggestion:last-child {
  border-bottom: 0;
}

.modal-free-tags__suggestion:hover,
.modal-free-tags__suggestion.is-active {
  background: var(--surface-2);
  color: var(--hhm-red);
}

.modal-free-tags__suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-free-tags__suggestion-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-free-tags__suggestion-badge {
  flex: 0 0 auto;
  padding: 0.2rem 0.45rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.modal-free-tags__suggestion--new {
  border-top: 2px solid var(--border);
}

.modal-free-tags__suggestion--new
.modal-free-tags__suggestion-badge {
  background: var(--hhm-red);
  color: #fff;
}

.modal-free-tags__suggestion:hover
.modal-free-tags__suggestion-badge,
.modal-free-tags__suggestion.is-active
.modal-free-tags__suggestion-badge {
  background: var(--hhm-blue);
  color: #fff;
}
.modal-geo-editor__map {
  width: 100%;
  height: 360px;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.modal-geo-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.modal-geo-clear input {
  width: 18px;
  height: 18px;
  margin: 0;
}

@media (max-width: 768px) {
  .modal-geo-editor__map {
    height: 300px;
  }
}