/*
 Theme Name:   Platzmachen Child Theme
 Theme URI:    https://platzmachen.eu
 Description:  Child Theme von Divi für die Website platzmachen.eu
 Author:       GermanZero e.V.
 Author URI:   https://germanzero.de/
 Template:     Divi
 Version:      1.0.0
 Text Domain:  plm
*/

/*
 * Inhalt
 *   1. Variablen
 *   2. Layout
 *   3. Header
 *   4. Karten (Marker, Popups, Entsiegelungs-Karte)
 *   5. Formulare
 *   6. Divi-Module
 *   7. Bearbeitungsseite für Hosts
 */

/* =========================================================================
   1. VARIABLEN
   ========================================================================= */
:root {
  --primary-color: #003a7b;
  --secondary-color: #ff4b00;
  --tertiary-color: #ffce00;
  --additional-color: #1b72c1;
}

/* =========================================================================
   2. LAYOUT
   ========================================================================= */

/* Inhaltsbreite auf Mobilgeräten */
@media only screen and (max-width: 980px) {

  #top-header>.container,
  #main-header>.container,
  #et_search_outer>.container,
  body.single #main-content>.container,
  body.home #main-content>.container,
  body.page:not(.et-tb-has-template) div.et_pb_row,
  body.page.et-tb-has-template .et-l--post div.et_pb_row,
  body.single-project div.et_pb_row,
  body.single-project div.et_pb_row.et_pb_row_fullwidth,
  .et_pb_pagebuilder_layout.single-post:not(.et-tb-has-body) #main-content .et_pb_row {
    width: 90% !important;
  }
}

/* =========================================================================
   3. HEADER
   ========================================================================= */
#top-header {
  max-height: 30px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#top-header.et-fixed-header {
  max-height: 0;
}

#main-header {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
  margin-top: 0;
  position: sticky;
  top: 0;
  z-index: 999;
  transition: background 0.3s ease, box-shadow 0.3s ease, margin-top 0.3s ease !important;
}

/* Beim Scrollen etwas stärker einfärben */
#main-header.et-fixed-header {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);
  margin-top: -30px;
}

#top-header>.container,
#main-header>.container {
  max-width: 1800px;
}

.et_pb_svg_logo #logo {
  margin-top: -5px;
}

/* =========================================================================
   4. KARTEN
   ========================================================================= */

/* ---- Marker-Cluster ---------------------------------------------------- */
.marker-cluster-small {
  background-color: #FF4B0044 !important;
}

.marker-cluster-small>div {
  background-color: var(--secondary-color) !important;
}

.marker-cluster-small>div>span {
  color: #FFF !important;
  font-weight: bold;
}

.marker-cluster-medium,
.marker-cluster-large {
  background-color: #FF4B0044 !important;
}

.marker-cluster-medium>div,
.marker-cluster-large>div {
  background-color: var(--secondary-color) !important;
}

.marker-cluster-medium>div>span,
.marker-cluster-large>div>span {
  color: #FFF !important;
  font-weight: bold;
}

/* ---- Karte aller Aktionen (inc/aktionen-map.php) ------------------------ */
.platzmachen-aktionen-map {
  height: 100%;
}

/* Mindesthöhe, damit die Karte mit height:100% nicht auf wenige Pixel zusammenfällt */
.platzmachen-aktionen-map .WPLeafletMap {
  min-height: var(--platzmachen-map-min-height, 500px);
}

/* ---- Marker-Popups ----------------------------------------------------- */
.tdoh-marker-container {
  margin-bottom: 8px !important;
}

.tdoh-marker-disclaimer {
  font-style: italic;
}

.tdoh-marker-button {
  background-color: var(--gcid-primary-color);
  display: inline-block;
  font-family: 'Inter', Helvetica, Arial, Lucida, sans-serif;
  font-weight: 700;
  color: #ffffff !important;
  font-size: var(--gvid-z8jamm3a9d) !important;
  border-top-left-radius: var(--gvid-pjqst8gwrz);
  border-top-right-radius: var(--gvid-pjqst8gwrz);
  border-bottom-right-radius: var(--gvid-pjqst8gwrz);
  border-bottom-left-radius: var(--gvid-pjqst8gwrz);
  border-width: 0px;
  border-color: #333;
  border-style: solid;
  line-height: 1.7em !important;
  padding-top: 16px !important;
  padding-right: 32px !important;
  padding-bottom: 16px !important;
  padding-left: 32px !important;
  margin: 16px 0 !important;
  transition-property: background-color;
  transition-duration: 300ms;
  transition-timing-function: ease;
  transition-delay: 0ms;
}

/* ---- Entsiegelungs-Karte (assets/js/entsiegelung-map.js) --------------- */

/* Abgerundete Ecken der Flächenkarte */
.entsiegelung-map .WPLeafletMap {
  border-radius: 12px;
  overflow: hidden;
}

/* Kontrollecke oben mittig (vom Skript angelegt) */
.leaflet-top.leaflet-center {
  left: 50%;
  transform: translateX(-50%);
}

/* Adresssuche oben mittig in der Karte: gleicher Look wie Fluent-Forms-Felder
   (Klasse ff-el-form-control; die Werte hier gelten, falls die Karte außerhalb des Formulars steht) */
.entsiegelung-search-box {
  width: min(360px, 40vw);
}

.entsiegelung-search-box--above {
  float: none;
  margin: 0 0 8px;
  width: 100%;
}

.entsiegelung-search {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  border: 1px solid #dadbdd;
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  color: #606266;
  display: block;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  padding: 11px 12px;
  transition: border-color 0.2s ease;
  width: 100%;
}

.entsiegelung-search::placeholder {
  color: #868e96;
}

.entsiegelung-search:focus {
  border-color: #409eff;
  outline: 0;
}

/* Flächenanzeige oben rechts in der Karte */
.entsiegelung-area {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  color: var(--primary-color);
  font-size: 16px;
  line-height: 1.2;
  padding: 8px 12px;
  pointer-events: none;
}

.entsiegelung-area__label {
  font-size: 12px;
  opacity: 0.7;
  text-transform: uppercase;
}

.entsiegelung-area__count {
  display: block;
  font-size: 12px;
  margin-top: 2px;
  opacity: 0.7;
}

/* =========================================================================
   5. FORMULARE (Fluent Forms)
   ========================================================================= */
.frm-fluent-form .choices__list--multiple .choices__item {
  background-color: var(--primary-color) !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: #fff !important;
}

.frm-fluent-form .choices__list--multiple .choices__item.is-highlighted {
  background-color: #FFF !important;
  border: 1px solid var(--primary-color) !important;
  color: var(--primary-color) !important;
}

.ff-message-success {
  border-radius: 1.5rem;
  padding: 24px;
}

/* =========================================================================
   6. DIVI-MODULE
   ========================================================================= */

/* Akkordeon */
.et_pb_accordion_item hr {
  margin: 8px 0;
  width: 100%;
}

/* =========================================================================
   7. BEARBEITUNGSSEITE FÜR HOSTS (inc/aktion-edit/, assets/js/aktion-edit.js)
   ========================================================================= */
.platzmachen-edit__intro {
  margin-bottom: 24px;
}

.platzmachen-edit__notice {
  border-radius: 8px;
  padding: 16px 20px;
}

.platzmachen-edit__notice--error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
}

.platzmachen-edit__notice--success {
  background: #e8f5e9;
  border: 1px solid #b7dfba;
}

.platzmachen-edit-images__label {
  margin-bottom: 8px;
}

.platzmachen-edit-images ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.platzmachen-edit-images__item {
  background: #fff;
  border: 2px solid #dadbdd;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  overflow: hidden;
  padding: 0;
  text-align: center;
  width: 140px;
}

.platzmachen-edit-images__item img {
  display: block;
  height: 105px;
  object-fit: cover;
  width: 100%;
}

.platzmachen-edit-images__remove {
  color: var(--primary-color);
  display: block;
  font-size: 13px;
  padding: 6px 4px;
}

.platzmachen-edit-images__item.is-removed {
  border-color: #c62828;
}

.platzmachen-edit-images__item.is-removed img {
  filter: grayscale(1);
  opacity: 0.35;
}

.platzmachen-edit-images__item.is-removed .platzmachen-edit-images__remove {
  color: #c62828;
  font-weight: 700;
}

/* Aktion absagen: aufklappbarer Bereich mit Rückfrage */
.platzmachen-edit__cancel {
  border-top: 1px solid #dadbdd;
  margin-top: 40px;
  padding-top: 24px;
}

.platzmachen-edit__cancel summary {
  color: #c62828;
  cursor: pointer;
  font-weight: 700;
}

.platzmachen-edit__cancel form {
  background: #fdecea;
  border-radius: 8px;
  margin-top: 16px;
  padding: 16px 20px;
}

.platzmachen-edit__cancel button {
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 20px;
}

.platzmachen-edit__cancel-confirm {
  background: #c62828;
  border: 1px solid #c62828;
  color: #fff;
}

.platzmachen-edit__cancel-abort {
  background: #fff;
  border: 1px solid #dadbdd;
  color: #333;
}

/* ---- Detailseite einer Aktion (inc/aktion-detail.php) -------------------- */
.platzmachen-detail { font-size: 1rem; line-height: 1.6; }
.platzmachen-detail h2 { font-size: 1.5rem; margin: 0 0 .75rem; padding: 0; color: var(--primary-color); }
.platzmachen-detail__section { margin: 0 0 2.5rem; }
.platzmachen-detail__chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; padding: 0; }
.platzmachen-detail__chip { margin: 0; padding: .25rem .75rem; border: 2px solid var(--primary-color); border-radius: 999px; color: var(--primary-color); font-weight: 600; }
.platzmachen-detail__chip--status { background: var(--primary-color); color: #fff; }
.platzmachen-detail__chip--status.is-cancelled { background: #fff; color: #8a1f11; border-color: #8a1f11; }
.platzmachen-detail__notice { margin: 0 0 1.5rem; padding: .75rem 1rem; border-left: 4px solid #8a1f11; background: #fdf0ee; }
.platzmachen-detail__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 0; }
.platzmachen-detail__row { padding: 1rem 1.25rem; background: #f3f4f6; border-radius: .5rem; }
.platzmachen-detail__row dt { font-size: .875rem; font-weight: 700; text-transform: none; color: #3d4451; margin: 0 0 .25rem; }
.platzmachen-detail__row dd { margin: 0; font-size: 1.0625rem; }
.platzmachen-detail__hint { font-size: .875rem; color: #3d4451; }
.platzmachen-detail__big { font-size: 1.25rem; }
.platzmachen-detail__gallery { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem; margin: 0; padding: 0; }
.platzmachen-detail__gallery li { margin: 0; padding: 0; }
.platzmachen-detail__gallery a { display: block; border-radius: .5rem; overflow: hidden; }
.platzmachen-detail__gallery a:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }
.platzmachen-detail__gallery img { display: block; width: 100%; height: 12rem; object-fit: cover; }
.platzmachen-detail__map .WPLeafletMap { border-radius: .5rem; }
