/**
 * Gallery Frontend Styles.
 * Update v5.6.3: Responsive Spalten dynamisch basierend auf Anzahl und Breite
 * Update v5.6.10: Wrapper für Elementor/Page Builder Kompatibilität
 *
 * @package FourSystem_ECards
 */

/* Update v5.6.10: Wrapper für korrekten Dokumentenfluss in Page Buildern */
/* Update v5.6.12: Optimiert für JS Height-Fix */
.fsec-gallery-wrapper {
    display: block;
    width: 100%;
    clear: both;
    overflow: visible;
    position: relative;
    box-sizing: border-box;
    /* Height wird per JS gesetzt für Page Builder Kompatibilität */
}

/* Elementor-spezifische Fixes */
.elementor-widget-shortcode .fsec-gallery-wrapper,
.elementor-shortcode .fsec-gallery-wrapper,
.elementor-widget-container .fsec-gallery-wrapper {
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    float: none !important;
    position: relative !important;
}

/* Elementor Widget Container */
.elementor-widget-shortcode .elementor-widget-container,
.elementor-shortcode {
    overflow: visible !important;
    height: auto !important;
}

/* CSS Custom Properties für Grid */
.fsec-gallery {
    --fsec-columns: 3;
    --fsec-gap: 10px;
    --fsec-item-count: 999; /* Wird per Inline-Style gesetzt */
}

/* Update v5.6.3: Einzelne E-Card Container */
.fsec-single-ecard {
    max-width: 600px;
    margin: 0 auto;
}

.fsec-single-ecard .fsec-gallery {
    --fsec-columns: 1 !important;
}

/* Update v5.4.1: Kategorie-Header in Blocksy hero-section */
.hero-section .fsec-category-header {
    border: none !important;
    margin: 0;
    padding: 0;
}

.hero-section .fsec-category-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

/* Titel erbt Blocksy page-title Styles */
.fsec-category-header .page-title {
    margin: 0;
}

.fsec-category-description {
    margin-top: 15px;
    line-height: 1.7;
}

/* Update v5.4.3: Stark reduzierter Abstand zwischen Header und Galerie */
/* Update v5.4.4: Noch weniger Abstand */
/* Update v5.4.5: Blocksy entry-header Margin/Padding überschreiben - Ziel: 30px Abstand */
.fsec-taxonomy-archive .hero-section,
.fsec-taxonomy-archive .hero-section.is-width-constrained,
article.fsec-taxonomy-archive .hero-section {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Das ist der Übeltäter: entry-header hat margin-bottom: 30px und padding-bottom: 20px */
.fsec-category-header,
.fsec-category-header.entry-header,
header.entry-header.fsec-category-header,
.hero-section .fsec-category-header,
.hero-section header.entry-header.fsec-category-header {
    margin: 0 0 30px 0 !important;
    padding: 0 !important;
}

.fsec-taxonomy-archive .entry-content,
article.fsec-taxonomy-archive .entry-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.fsec-taxonomy-archive .entry-content .fsec-gallery,
article.fsec-taxonomy-archive .entry-content .fsec-gallery {
    margin-top: 0 !important;
}

/* Update v5.3.8: Share-Buttons im Kategorie-Header */
.fsec-category-share {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fsec-category-share .fsec-share-buttons {
    display: flex;
    gap: 6px;
}

.fsec-category-share .fsec-share-btn {
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Update v5.3.9: Farbige Hintergründe für Share-Buttons */
.fsec-category-share .fsec-share-facebook {
    background: #1877f2;
    color: #fff;
}
.fsec-category-share .fsec-share-facebook:hover {
    background: #166fe5;
}

.fsec-category-share .fsec-share-twitter {
    background: #000;
    color: #fff;
}
.fsec-category-share .fsec-share-twitter:hover {
    background: #333;
}

.fsec-category-share .fsec-share-pinterest {
    background: #e60023;
    color: #fff;
}
.fsec-category-share .fsec-share-pinterest:hover {
    background: #ad081b;
}

.fsec-category-share .fsec-share-linkedin {
    background: #0a66c2;
    color: #fff;
}
.fsec-category-share .fsec-share-linkedin:hover {
    background: #004182;
}

.fsec-category-share .fsec-share-whatsapp {
    background: #25d366;
    color: #fff;
}
.fsec-category-share .fsec-share-whatsapp:hover {
    background: #128c7e;
}

.fsec-category-share .fsec-share-download {
    background: #6c757d;
    color: #fff;
}
.fsec-category-share .fsec-share-download:hover {
    background: #5a6268;
}

.fsec-category-share .fsec-share-native {
    background: #3498db;
    color: #fff;
}
.fsec-category-share .fsec-share-native:hover {
    background: #2980b9;
}

.fsec-category-share .fsec-share-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

.fsec-category-description {
    line-height: 1.7;
    color: #444;
}

.fsec-show-more,
.fsec-show-less {
    color: #2271b1;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.fsec-show-more:hover,
.fsec-show-less:hover {
    text-decoration: underline;
}

.fsec-desc-full {
    animation: fsec-slide-down 0.3s ease;
}

@keyframes fsec-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery Grid */
.fsec-gallery {
    display: grid;
    grid-template-columns: repeat(var(--fsec-columns), 1fr);
    gap: var(--fsec-gap);
}

/* Update v5.6.3: Dynamische Spalten basierend auf Item-Count */
/* Bei weniger Items als Spalten: Items gleichmäßig verteilen */
.fsec-gallery[data-count="1"] {
    grid-template-columns: 1fr !important;
}

.fsec-gallery[data-count="2"] {
    grid-template-columns: repeat(min(2, var(--fsec-columns)), 1fr) !important;
}

.fsec-gallery[data-count="3"] {
    grid-template-columns: repeat(min(3, var(--fsec-columns)), 1fr) !important;
}

.fsec-gallery[data-count="4"] {
    grid-template-columns: repeat(min(4, var(--fsec-columns)), 1fr) !important;
}

/* E-Card Item */
.fsec-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fsec-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Media Container */
.fsec-card-media {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
}

.fsec-card-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fsec-card:hover .fsec-card-media img {
    transform: scale(1.05);
}

/* Play Icon für Videos - Update v5.0.8 */
.fsec-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

/* Weißes Dreieck als SVG */
.fsec-play-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px; /* Optische Zentrierung */
}

.fsec-card:hover .fsec-play-icon {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video Placeholder */
.fsec-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1d2327;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.fsec-video-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.7;
}

/* No Image Placeholder */
.fsec-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fsec-no-image .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #c3c4c7;
}

/* Card Footer */
.fsec-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px 5px;
    font-size: 13px;
}

/* Favoriten-Stern */
.fsec-card-favorite {
    cursor: pointer;
}

.fsec-icon-star {
    color: #c3c4c7;
    font-size: 18px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.fsec-icon-star:hover {
    color: #f0c14b;
    transform: scale(1.2);
}

.fsec-icon-star.fsec-favorited {
    color: #f0c14b;
}

/* Statistiken - Update v5.5.18: SVG Icons */
.fsec-card-stats {
    display: flex;
    gap: 12px;
    color: #888;
}

.fsec-stat-views,
.fsec-stat-sends {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.fsec-card-stats .fsec-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Tooltip */
/* Update v5.4.2: position: fixed für korrektes Scrolling */
.fsec-tooltip {
    position: fixed;
    z-index: 99999;
    background: #1d2327;
    color: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    max-width: 280px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fsec-tooltip.fsec-visible {
    opacity: 1;
    transform: translateY(0);
}

.fsec-tooltip-title {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.fsec-tooltip-desc {
    margin: 0;
    opacity: 0.9;
}

.fsec-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1d2327;
}

/* No Results */
.fsec-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Pagination */
.fsec-pagination {
    margin-top: 30px;
    text-align: center;
}

.fsec-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    background: #f0f0f1;
    color: #1d2327;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.fsec-pagination .page-numbers:hover {
    background: #dcdcde;
}

.fsec-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
}

/* Load More Button */
.fsec-load-more-wrap {
    margin-top: 30px;
    text-align: center;
}

.fsec-load-more {
    padding: 12px 30px;
    font-size: 15px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fsec-load-more:hover {
    background: #135e96;
}

.fsec-load-more:disabled {
    background: #c3c4c7;
    cursor: not-allowed;
}

/* Infinite Scroll Trigger */
.fsec-infinite-trigger {
    height: 1px;
    margin-top: 20px;
}

/* === Update v5.6.3: Responsive Breakpoints === */

/* Desktop: Maximale Spalten aus Einstellungen */
@media (min-width: 1201px) {
    .fsec-gallery {
        /* Nutzt die konfigurierten Spalten */
    }
}

/* Laptop / kleiner Desktop */
@media (max-width: 1200px) {
    .fsec-gallery {
        --fsec-columns: min(var(--fsec-columns), 4) !important;
    }
    
    /* Bei weniger Items: Keine Änderung */
    .fsec-gallery[data-count="1"],
    .fsec-gallery[data-count="2"],
    .fsec-gallery[data-count="3"],
    .fsec-gallery[data-count="4"] {
        /* Behält data-count Regeln bei */
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    .fsec-gallery {
        --fsec-columns: min(var(--fsec-columns), 3) !important;
    }
    
    .fsec-gallery[data-count="1"] {
        grid-template-columns: 1fr !important;
    }
    .fsec-gallery[data-count="2"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .fsec-gallery[data-count="3"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .fsec-gallery {
        --fsec-columns: 2 !important;
    }
    
    .fsec-gallery[data-count="1"] {
        grid-template-columns: 1fr !important;
    }
    .fsec-gallery[data-count="2"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .fsec-gallery[data-count="3"],
    .fsec-gallery[data-count="4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile - Update v5.6.11: Mindestens 2 Spalten für Elementor-Kompatibilität */
@media (max-width: 600px) {
    /* Wrapper explizit blocken für korrekten Dokumentenfluss */
    .fsec-gallery-wrapper {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 10px !important;
    }
    
    .fsec-gallery {
        --fsec-columns: 2 !important;
        display: grid !important;
        height: auto !important;
        min-height: 10px !important;
    }
    
    /* Bei nur 1 Item: Eine Spalte */
    .fsec-gallery[data-count="1"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Ab 2 Items: Zwei Spalten */
    .fsec-gallery[data-count="2"],
    .fsec-gallery[data-count="3"],
    .fsec-gallery[data-count="4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Alle anderen auch 2 Spalten */
    .fsec-gallery:not([data-count="1"]) {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .fsec-category-title {
        font-size: 1.5em;
    }
    
    /* Einzelne E-Card auf Mobile: Volle Breite */
    .fsec-single-ecard {
        max-width: 100%;
    }
    
    /* Cards etwas kompakter auf Mobile */
    .fsec-card-footer {
        padding: 6px 4px 4px;
        font-size: 11px;
    }
    
    .fsec-card-stats {
        gap: 8px;
    }
}

/* Update v5.5.18: Favoriten-Button Styles mit SVG */
.fsec-favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fsec-favorite-btn svg {
    width: 22px;
    height: 22px;
}

.fsec-favorite-btn:hover {
    color: #ffb800;
    transform: scale(1.15);
}

.fsec-favorite-btn.fsec-favorited {
    color: #ffb800;
}

.fsec-favorite-btn.fsec-favorited:hover {
    color: #cc9400;
}

/* === Update v5.0.1: Verbesserte Galerie-Layouts === */

/* Masonry Layout - CSS Column-basiert */
.fsec-gallery-masonry {
    display: block !important;
    column-count: var(--fsec-columns, 3);
    column-gap: var(--fsec-gap, 15px);
}

.fsec-gallery-masonry .fsec-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: var(--fsec-gap, 15px);
    display: block;
    width: 100%;
}

/* Masonry: Variable Höhen erlauben */
.fsec-gallery-masonry .fsec-card-media {
    padding-top: 0;
    height: auto;
}

.fsec-gallery-masonry .fsec-card-media img {
    position: relative;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Justified Layout - Flexbox-basiert, Bilder nicht beschnitten */
.fsec-gallery-justified {
    display: flex !important;
    flex-wrap: wrap;
    gap: var(--fsec-gap, 15px);
    align-items: flex-end; /* Bilder unten ausrichten */
}

.fsec-gallery-justified .fsec-card {
    flex: 1 1 auto;
    min-width: 150px;
    max-width: 400px;
}

/* Justified: Bilder behalten ihre natürlichen Proportionen */
.fsec-gallery-justified .fsec-card-media {
    padding-top: 0 !important;
    height: auto !important;
    overflow: visible;
}

.fsec-gallery-justified .fsec-card-media img {
    position: relative !important;
    width: 100%;
    height: auto !important;
    object-fit: contain !important; /* Bild vollständig sichtbar, nicht beschnitten */
}

/* Standard Grid: Explizit setzen */
.fsec-gallery-standard {
    display: grid !important;
    grid-template-columns: repeat(var(--fsec-columns, 3), 1fr);
    gap: var(--fsec-gap, 15px);
}

.fsec-gallery-standard .fsec-card-media {
    padding-top: 75%; /* 4:3 Aspect Ratio */
}

.fsec-gallery-standard .fsec-card-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive: Masonry */
@media (max-width: 1024px) {
    .fsec-gallery-masonry {
        column-count: 2 !important;
    }
}

/* Update v5.6.11: Masonry und Justified auch 2 Spalten auf Mobile */
@media (max-width: 600px) {
    .fsec-gallery-masonry {
        column-count: 2 !important;
    }
    
    .fsec-gallery-justified .fsec-card {
        flex: 1 1 calc(50% - var(--fsec-gap, 10px));
        min-width: calc(50% - var(--fsec-gap, 10px));
        max-width: calc(50% - var(--fsec-gap, 10px));
    }
}

/* === Update v5.0.3: Taxonomy-Archive-Styles === */
/* Respektiert Theme-Container-Breite aus Customizer */
.fsec-taxonomy-archive {
    padding: 20px 0;
}

/* Überschrift-Formatierung für Kategorie-Archiv */
.fsec-taxonomy-archive .fsec-category-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.fsec-taxonomy-archive .fsec-category-title {
    font-size: 2.2em;
    margin: 0 0 15px;
    color: #1d2327;
}

.fsec-taxonomy-archive .fsec-category-description {
    font-size: 1.1em;
    line-height: 1.8;
    color: #50575e;
}

/* === Update v5.3.0: E-Card Schlagworte (Tags) === */

/* Tag-Header */
.fsec-tag-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.fsec-tag-title {
    font-size: 1.8em;
    margin: 0 0 10px;
    color: #1d2327;
}

.fsec-tag-count {
    font-size: 1em;
    color: #50575e;
    margin: 0;
}

/* Tags unter E-Cards */
.fsec-ecard-tags {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eaeaea;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.fsec-tag-link {
    display: inline-block;
    padding: 3px 8px;
    background: #f0f0f1;
    border-radius: 3px;
    font-size: 11px;
    color: #50575e;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.fsec-tag-link:hover {
    background: #2271b1;
    color: #fff;
}

/* Tag-Cloud Widget */
.fsec-tag-cloud {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.fsec-tag-cloud a {
    display: inline-block;
    margin: 4px 6px;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 16px;
    text-decoration: none;
    color: #2271b1;
    transition: all 0.2s ease;
}

.fsec-tag-cloud a:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    transform: translateY(-1px);
}

.fsec-no-tags {
    text-align: center;
    color: #787c82;
    font-style: italic;
}

/* === Update v5.6.32: Kategorien-Galerie Styles - Masonry Layout === */

.fsec-categories-wrapper {
    margin: 20px 0;
}

/* Masonry-Layout mit CSS Columns */
.fsec-categories-gallery {
    column-count: var(--fsec-columns, 3);
    column-gap: var(--fsec-gap, 15px);
}

/* Kategorie-Karte */
.fsec-category-card {
    position: relative;
    overflow: hidden;
    break-inside: avoid; /* Verhindert Umbruch innerhalb der Karte */
    margin-bottom: var(--fsec-gap, 15px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fsec-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Link über gesamte Karte */
.fsec-category-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fsec-category-card-link:hover {
    text-decoration: none;
}

/* Bild-Container für Kategorien - Update v5.6.31: Vollständige Bilddarstellung */
/* Hohe Spezifität um .fsec-gallery-standard Regeln zu überschreiben */
.fsec-categories-gallery .fsec-category-card .fsec-card-media {
    position: relative;
    width: 100%;
    padding-top: 0 !important; /* Überschreibt das 4:3 Ratio */
    overflow: hidden;
    line-height: 0; /* Verhindert Lücke unter dem Bild */
}

.fsec-categories-gallery .fsec-category-card .fsec-card-media img {
    position: relative !important;
    width: 100%;
    height: auto !important;
    display: block;
    transition: transform 0.3s ease;
}

.fsec-categories-gallery .fsec-category-card:hover .fsec-card-media img {
    transform: scale(1.05);
}

/* Footer für Kategorien */
.fsec-category-footer {
    padding: 10px 8px;
    text-align: center;
    background: transparent;
}

.fsec-category-info {
    display: flex;
    flex-direction: row; /* Nebeneinander statt untereinander */
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap; /* Bei langen Namen umbrechen */
}

/* Kategorie-Name - kursiv */
.fsec-category-name {
    font-style: italic;
    font-size: 1em;
    color: #333;
    line-height: 1.3;
}

/* Kategorie-Anzahl - direkt hinter dem Namen */
.fsec-category-count {
    font-style: italic;
    font-size: 1em;
    color: #333;
}

/* Hover-Effekt für Name */
.fsec-category-card:hover .fsec-category-name {
    color: #2271b1;
}

/* No-Image Placeholder für Kategorien - Update v5.6.31 */
.fsec-categories-gallery .fsec-category-card .fsec-no-image {
    position: relative !important;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; /* Festes Seitenverhältnis nur für Placeholder */
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.fsec-category-card .fsec-no-image .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

/* Responsive: Kategorien-Galerie - Masonry */
@media (max-width: 768px) {
    .fsec-categories-gallery {
        column-count: 2 !important;
    }
    
    .fsec-category-name,
    .fsec-category-count {
        font-size: 0.9em;
    }
    
    .fsec-category-footer {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .fsec-categories-gallery {
        column-count: 2 !important;
    }
    
    .fsec-category-footer {
        padding: 6px 4px;
    }
    
    .fsec-category-name,
    .fsec-category-count {
        font-size: 0.85em;
    }
}

/* ==========================================================================
   Update v5.6.35: Expandierbare Kategorie-Beschreibung
   ========================================================================== */

.fsec-category-description {
    margin: 15px 0;
    line-height: 1.7;
    color: inherit;
}

.fsec-category-description p {
    margin: 0 0 1em 0;
}

.fsec-category-description p:last-child {
    margin-bottom: 0;
}

/* Position der Beschreibung */
.fsec-description-above {
    margin-bottom: 25px;
}

.fsec-description-below {
    margin-top: 25px;
}

/* Expandierbare Beschreibung */
.fsec-description-expandable {
    position: relative;
}

.fsec-description-short,
.fsec-description-full {
    transition: opacity 0.3s ease;
}

.fsec-description-toggle {
    display: inline-block;
    margin-top: 8px;
    color: #2271b1;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s ease;
}

.fsec-description-toggle:hover {
    color: #135e96;
    text-decoration: underline;
}

.fsec-description-toggle::after {
    content: ' →';
    transition: transform 0.2s ease;
}

.fsec-show-less::after {
    content: ' ↑';
}

/* Animation beim Erweitern */
.fsec-description-full.fsec-expanding {
    animation: fsec-fade-in 0.3s ease forwards;
}

.fsec-description-short.fsec-collapsing {
    animation: fsec-fade-in 0.3s ease forwards;
}

@keyframes fsec-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
