/* GardenPortal – Insektenmodul | Version 1.0 */

#gp-insekten {
    --gp-green: #4E8F3B;
    --gp-dark-green: #315C3C;
    --gp-bg: #F7F8F3;
    /*--gp-text: #444444;*/
	--gp-text: #000000;
    --gp-muted: #666666;
    --gp-border: #DEE2E6;
    --gp-shadow: rgba(0, 0, 0, 0.5);
    max-width: 1400px;
    margin: 0 auto;
    color: var(--gp-text);
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

#gp-insekten *,
#gp-insekten *::before,
#gp-insekten *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   2. WWB-INTEGRATION
   Das WWB-HTML-Objekt erhält beim Publizieren eine feste Höhe.
   Da Die Seite erst per JavaScript aufgebaut wird, muss der Wrapper
   anschließend mit seinem Inhalt wachsen können.

   Aktuelle WWB-ID auf der Seite "Insekten_Bibliothek": Html2
   ========================================================================== */

#Html2 {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

.gp-insect-head {
    margin: 0 0 24px;
}

.gp-insect-head h1 {
    margin: 0 0 8px;
    color: var(--gp-dark-green);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
}

.gp-insect-head p {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
}

/* ==========================================================================
   Einstellungen für die Suchleiste
   ========================================================================== */
.gp-insect-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 10px;
    padding: 16px;
    border: 4px solid #737070;
    border-radius: 15px;
    background-image:
        linear-gradient(
            rgba(255,255,255,0.40),
            rgba(255,255,255,0.40)
        ),
        url("../images/metallische_Oberflaeche gruen_glossy.webp") !important;

    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
	box-shadow: 9px 9px 10px var(--gp-shadow);
}
  /* ========================================================================== */
.gp-insect-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gp-insect-filter {
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid var(--gp-dark-green);
    border-radius: 12px;
	background: linear-gradient(to top, #4E8F3B 0%, #FFFFFF 100%);	
    color: #000000;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.gp-insect-filter:hover,
.gp-insect-filter.is-active {
	background: #f7e64d;
	background: linear-gradient(174deg,rgba(247, 230, 77, 1) 0%, rgba(242, 232, 136, 1) 100%, rgba(255, 255, 186, 0.55) 100%);	
}

.gp-insect-search {
    display: grid;
    gap: 5px;
    min-width: min(100%, 310px);
    font-weight: 700;
}

.gp-insect-search input {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #AEB7AD;
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--gp-text);
    font: inherit;
}

.gp-insect-resultline {
    min-height: 28px;
    margin: 0 0 10px;
    color: var(--gp-muted);
    font-size: 14px;
}

.gp-insect-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.gp-insect-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 4px solid #737070;
    border-radius: 15px;
	background-image: url('../images/metallische_Oberflaeche hellgrau.webp');
    box-shadow: 9px 9px 10px var(--gp-shadow);
}

.gp-insect-card[hidden] {
    display: none !important;
}

.gp-insect-image-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #E8ECE5;
}

.gp-insect-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gp-insect-image-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--gp-muted);
    text-align: center;
}

.gp-image-missing .gp-insect-image-fallback {
    display: flex;
}

.gp-insect-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}

.gp-insect-badge.gp-nuetzling {
    background: #315C3C;
}

.gp-insect-badge.gp-schaedling {
    background: #8A3B2E;
}

.gp-insect-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.gp-insect-body h2 {
    margin: 0;
    color: var(--gp-dark-green);
    font-size: 21px;
    line-height: 1.2;
}

.gp-insect-latin {
    margin-top: 4px;
    color: var(--gp-muted);
    font-size: 14px;
    font-style: italic;
	font-weight: bold;
}

.gp-insect-short {
    margin: 14px 0;
    line-height: 1.5;
	font-weight: bold;	
}

.gp-insect-details {
    margin-top: auto;
    border-top: 1px solid var(--gp-border);
    padding-top: 12px;
}

/* ==========================================================================
   Beschreibung und Hinweise
   ========================================================================== */
.gp-insect-details summary {
    color: var(--gp-dark-green);
    font-weight: 700;
    cursor: pointer;	
}

.gp-insect-details summary:hover {
    transform: translateY(-5px);
	color: #F51111;	
}
	
.gp-insect-details p {
    margin: 12px 0 8px;
    line-height: 1.5;
	font-weight: bold;	
}
   ========================================================================== */
   
.gp-insect-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 15px;
    background-image:
        linear-gradient(
            rgba(255,255,255,0.40),
            rgba(255,255,255,0.40)
        ),
        url("../images/metallische_Oberflaeche gold_gelb_glossy.webp") !important;

    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
	border: 2px solid #BDB668;
    line-height: 1.45;
}

.gp-insect-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: 40px;
    margin-top: 14px;
    padding: 8px 14px;
    border: 2px solid #000000;
    border-radius: 15px;
    background: linear-gradient(to top, #4E8F3B 0%, #FFFFFF 100%);
    color: #000000;
    font-weight: 700;
    text-decoration: none;
}

.gp-insect-link:hover {
    transform: translateY(-8px);
}

.gp-insect-empty {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--gp-border);
    border-radius: 15px;
    background: #FFFFFF;
    text-align: center;
}

/* ==========================================================================
   WWB-INTEGRATION – Schriftgrößen
   WWB kann am HTML-Objekt font-size: 0px vererben.
   Das Insektenmodul setzt deshalb seine Grundschrift explizit.
   ========================================================================== */

#gp-insekten {
    font-size: 16px;
}

#gp-insekten .gp-insect-filter {
    font-size: 16px;
}

#gp-insekten .gp-insect-search {
    font-size: 16px;
}

#gp-insekten .gp-insect-search input {
    font-size: 16px;
}

#gp-insekten .gp-insect-short {
    font-size: 16px;
}

#gp-insekten .gp-insect-details {
    font-size: 16px;
}

#gp-insekten .gp-insect-link {
    font-size: 16px;
}

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

@media (max-width: 680px) {
    .gp-insect-tools {
        align-items: stretch;
    }

    .gp-insect-search {
        width: 100%;
    }

    .gp-insect-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gp-insect-body {
        padding: 15px;
    }
}

/* ==========================================================================
   7. WWB-INTEGRATION – dynamische Modulhöhe / Footer
   Version 1.01
   Das HTML-Objekt und die unmittelbar umgebenden WWB-Container müssen die
   per JavaScript erzeugte Kartenhöhe übernehmen. Andernfalls bleibt der
   Footer auf der ursprünglich von WWB berechneten Position stehen.
   Unabhängig von der durch WWB vergebenen HTML-ID
   ========================================================== */

#wb_LG_Cont,
#LG_Cont,
#LG_Cont > .row,
#LG_Cont > .row > .col-1,
#LG_Cont > .row > .col-1 > .col-1-padding,
div:has(> #gp-insekten) {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

/* HTML-Wrapper des Insektenmoduls */
div:has(> #gp-insekten) {
    display: block !important;
    width: 100% !important;
}

/* Dynamisch erzeugter Inhalt */
#gp-insekten {
    display: flow-root;
    width: 100%;
    min-height: 1px;
}

/* Footer unterhalb des Inhalts */
#wb_LG_Footer {
    position: relative !important;
    clear: both !important;
}

/* ==========================================================================
   8. WWB-INTEGRATION – Filterbutton-Beschriftungen
   WWB kann Schriftparameter bzw. Zeilenhöhe aus dem HTML-Objekt vererben.
   Deshalb werden die Buttontexte vollständig innerhalb des Moduls definiert.
   ========================================================================== */

#gp-insekten button.gp-insect-filter,
#gp-insekten .gp-insect-filter {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 42px !important;
    padding: 8px 16px !important;
    font-family: Arial, sans-serif !important;
    font-size: 16px !important;
    font-style: normal !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: normal !important;
    text-indent: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#gp-insekten button.gp-insect-filter:not(.is-active),
#gp-insekten .gp-insect-filter:not(.is-active) {
    color: var(--gp-dark-green) !important;
}

#gp-insekten button.gp-insect-filter.is-active {
    color: #f50f0f !important;
	background: #b8b4b4 !important;
	background: linear-gradient(357deg,rgba(184, 180, 180, 1) 0%, rgba(219, 219, 219, 0.65) 54%, rgba(255, 255, 255, 0.48) 100%) !important;	
}

#gp-insekten button.gp-insect-filter:hover,
#gp-insekten .gp-insect-filter.is-active,
#gp-insekten .gp-insect-filter:hover {
    color: #000000 !important;
}

#gp-insekten button.gp-insect-filter:hover {
    transform: translateY(-8px);
}

#wb_LG_Cont {
    background-image:
        linear-gradient(

            rgba(255,255,255,0.60)
        ),
        url("../images/metallische_Oberflaeche gold_gelb_glossy.webp") !important;

    background-size: 100% !important;
    background-position: center center !important;
    background-repeat: repeat !important;
    background-color: transparent !important;	
}	