/* ================================================
   Download Archiv – Filter & Kacheln
   ================================================ */

/* Hauptbereich */
.dl-archiv-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.dl-archiv-header h1 {
    margin-bottom: 2rem;
}

/* ------------------------------------------------
   Filter-Bereich
   ------------------------------------------------ */
.dl-filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dl-filter {
    flex: 1;
    min-width: 180px;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.dl-filter:focus {
    outline: 2px solid var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
}

/* ------------------------------------------------
   Kachel-Raster
   ------------------------------------------------ */
.dl-kacheln {
    display: grid;
    grid-template-columns: repeat( 3, 1fr );
    gap: 1.5rem;
}

/* Tablet */
@media ( max-width: 900px ) {
    .dl-kacheln {
        grid-template-columns: repeat( 2, 1fr );
    }

    /* Block-Theme Grid */
    .dl-archiv-raster .wp-block-post-template.is-layout-grid {
        grid-template-columns: repeat( 2, 1fr ) !important;
    }

    .dl-filter-wrapper {
        flex-direction: column;
    }

    .dl-filter {
        width: 100%;
    }
}

/* Mobil */
@media ( max-width: 600px ) {
    .dl-kacheln {
        grid-template-columns: 1fr;
    }

    /* Block-Theme Grid */
    .dl-archiv-raster .wp-block-post-template.is-layout-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ------------------------------------------------
   Einzelne Kachel
   ------------------------------------------------ */

/* Gleiche Höhe aller Kacheln in einer Reihe */
.dl-archiv-raster .wp-block-post-template > li {
    display: flex;
    flex-direction: column;
}

.dl-kachel {
    background: var(--wp--preset--color--base);
    border: 1px solid var(--wp--preset--color--border-light);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Gesamte Kachel klickbar über den Titel-Link */
.dl-kachel .wp-block-post-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.dl-kachel:hover {
    background: #E7DEDA;
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 4px 20px rgba( 0, 0, 0, 0.1 );
    transform: translateY( -2px );
}

.dl-kachel-bild img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.dl-kachel-inhalt {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

.dl-kachel-datum {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--wp--preset--color--primary);
}

.dl-kachel-titel {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.4;
}

.dl-kachel-titel a {
    text-decoration: none;
    color: inherit;
}

.dl-kachel-titel a:hover {
    color: var(--wp--preset--color--primary);
}

.dl-kachel-excerpt {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
    flex: 1;
}

/* Tags */
.dl-kachel-tags,
.dl-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.dl-tag {
    background: #f0f4f8;
    border: 1px solid #d0dce8;
    border-radius: 20px;
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
    color: #444;
}

.dl-kachel-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--wp--preset--color--primary);
    text-decoration: none;
}

.dl-kachel-link:hover {
    text-decoration: underline;
}

/* Keine Ergebnisse */
.dl-keine-ergebnisse {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* ------------------------------------------------
   Einzelseite
   ------------------------------------------------ */
.dl-single-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.dl-single-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.dl-single-header h1 {
    margin-bottom: 0.5rem;
}

.dl-single-datum {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wp--preset--color--main);
    display: block;
    margin-bottom: 1rem;
    margin-top: 0.25rem;
    text-align: center;
}

.dl-single-beschreibung {
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* Download-Liste */
.dl-single-downloads h2 {
    margin-bottom: 1rem;
}

.dl-liste {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dl-eintrag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    flex-wrap: wrap;
}

.dl-eintrag-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.dl-eintrag-titel {
    font-weight: 600;
    font-size: 1rem;
}

.dl-eintrag-vortragender {
    font-size: 0.85rem;
    color: #555;
}

.dl-eintrag-groesse {
    font-size: 0.8rem;
    color: #888;
}

.dl-eintrag-button {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    background: var(--wp--preset--color--primary);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.dl-eintrag-button:hover {
    opacity: 0.85;
}

/* Mobil Einzelseite */
@media ( max-width: 600px ) {
    .dl-eintrag {
        flex-direction: column;
        align-items: flex-start;
    }

    .dl-eintrag-button {
        width: 100%;
        text-align: center;
    }
}

/* Zurück-Link */
.dl-single-zurueck {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.dl-single-zurueck a {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    font-weight: 600;
}

.dl-single-zurueck a:hover {
    text-decoration: underline;
}

/* ------------------------------------------------
   Passwort-Formular
   ------------------------------------------------ */
.dl-passwort-form {
    width: 100%;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--wp--preset--color--border-light);
    border-radius: 10px;
    text-align: center;
}

.dl-passwort-form h2 {
    margin-bottom: 0.75rem;
}

.dl-passwort-form form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.dl-passwort-form label {
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.dl-passwort-form input[type="password"] {
    flex: 1;
    min-width: 180px;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--wp--preset--color--border-dark);
    border-radius: 6px;
    font-size: 1rem;
}

.dl-passwort-form input[type="submit"] {
    padding: 0.55rem 1.25rem;
    background: var(--wp--preset--color--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.dl-passwort-form input[type="submit"]:hover {
    opacity: 0.85;
}

.dl-passwort-hinweis {
    font-size: 0.875rem;
    color: var(--wp--preset--color--secondary);
    margin: 0;
}

.dl-passwort-hinweis a {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
}