/* admin/frontend-style.css */
/* Styles for the PDF List in the Frontend */

/* Neuer Wrapper für vertikale Ausrichtung und Höhe */
.wp-dpv-outer-wrapper {
    min-height: calc(100vh - var(--header-height, 80px) - var(--footer-height, 84.6333px)); /* Verwende CSS-Variablen für Flexibilität */
    display: flex;
    align-items: flex-start; /* <<< GEÄNDERT: Oben beginnen (vertikal), keine Zentrierung */
    justify-content: center; /* <<< ZURÜCKGEFÜGT: Horizontal zentrieren */
    padding-top: 25px;
    padding-bottom: 25px;
    width: 100%; /* Wichtig, damit Flexbox funktioniert */
    box-sizing: border-box; /* Sicherstellen, dass Padding zur Breite gehört */
}

/* Überschreibe die WordPress-Core-Layout-Regel für deinen Container */
/* Dies verhindert, dass .is-layout-constrained die max-width auf 645px setzt */
.is-layout-constrained .wp-dpv-outer-wrapper {
    max-width: 100% !important; /* Setzt die maximale Breite auf 100% des verfügbaren Raums */
    /* margin-left/right werden hier nicht mehr benötigt, da justify-content: center die Zentrierung übernimmt */
    /* Du kannst sie aber zur Sicherheit auf unset oder auto lassen, falls justify-content von woanders überschrieben wird */
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Bestehende Styles für den eigentlichen Listen-Container */
.wp-dpv-list-container {
    width: 100%; /* Oder max-width, je nachdem wie breit es sein soll */
    max-width: 1040px; /* Behält die maximale Breite bei */
    padding: 15px;
    box-sizing: border-box;
    background-color: #fcfcfc;
    border-radius: 8px;
    /* margin-bottom wurde entfernt, da es im zentrierten Layout anders wirken könnte */
}

/* Die Akzentfarbe ist jetzt hartkodiert im CSS, da sie nicht mehr konfigurierbar ist */
.wp-dpv-list-container {
    --dpv-accent-color: #712D56; /* Hartkodierte Akzentfarbe */
}

.wp-dpv-pdf-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-dpv-pdf-list-item {
    display: flex;
    flex-direction: column; /* Standardmäßig vertikal auf Mobile */
    justify-content: space-between;
    align-items: flex-start; /* Links ausgerichtet auf Mobile */
    padding: 10px 0;
    border-bottom: 1px dotted #ccc;
}

.wp-dpv-pdf-list-item:last-child {
    border-bottom: none; /* Kein Border für das letzte Element */
}

.wp-dpv-pdf-link {
    flex-grow: 1;
    text-decoration: none;
    color: var(--dpv-accent-color); /* Nutzt CSS-Variable */
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px; /* Abstand zum Download-Button auf Mobile */
}

.wp-dpv-pdf-link:hover {
    text-decoration: underline;
}

.wp-dpv-download-button {
    padding: 8px 15px;
    background-color: var(--dpv-accent-color); /* Nutzt CSS-Variable */
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    white-space: nowrap;
    display: inline-flex; /* Für Icon und Text in einer Reihe */
    align-items: center;
    gap: 5px; /* Abstand zwischen Icon und Text */
}

.wp-dpv-download-button:hover {
    filter: brightness(110%); /* Leichter Hover-Effekt */
}

.wp-dpv-download-button .dashicons {
    font-size: 1.1em; /* Passende Größe für das Icon */
    line-height: 1;
}

.wp-dpv-error-message {
    color: red;
    font-weight: bold;
    padding: 15px;
    border: 1px solid red;
    background-color: #ffecec;
    border-radius: 8px;
}

/* Media Query für Desktop-Layout der Liste */
@media (min-width: 768px) {
    .wp-dpv-pdf-list-item {
        flex-direction: row; /* Horizontal auf Desktop */
        align-items: center; /* Vertikal zentriert auf Desktop */
    }

    .wp-dpv-pdf-link {
        margin-bottom: 0; /* Kein Abstand mehr zum Button auf Desktop */
        margin-right: 15px; /* Abstand zum Download-Button auf Desktop */
    }
}

/* Download-Button auf Mobilgeräten ausblenden */
@media (max-width: 767px) {
    .wp-dpv-download-button {
        display: none !important; /* Wichtig: Überschreibt display: inline-flex */
    }
    /* Eventuell Link auf volle Breite ausdehnen */
    .wp-dpv-pdf-list-item .wp-dpv-pdf-link {
        width: 100%;
    }
}