/**
 * Beliebteste Events Block - Stylesheet
 * Based on Produktgrid patterns with sticker grid layout
 *
 * @package younited
 * @since 3.0.0
 */

/* ==========================================================================
   Sticker Grid Layout
   ========================================================================== */

/* CRITICAL: Overflow visible for hover effects */
.wp-block-younitedtheme-beliebteste-events,
.beliebteste-events-section {
    overflow: visible !important;
}

.sticker-grid-container {
    width: 100%;
    position: relative;
    overflow: visible !important;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
    overflow: visible !important;
}

/* Responsive Grid Columns: 2→3→4→5 (larger cards like design)
   Gaps bewusst klein gehalten - kombiniert mit scale auf .sticker-card.card-N
   entsteht eine leichte Stack-/Ueberlappungs-Optik (gewuenscht). */
@media (min-width: 640px) {
    .sticker-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 768px) {
    .sticker-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .sticker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 1280px) {
    .sticker-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 1536px) {
    .sticker-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 1920px) {
    .sticker-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.75rem;
    }
}

/* ==========================================================================
   BLOG-POST-KONTEXT (.blog-post-content)
   Sticker-Grid passt sich automatisch an die schmalere Content-Spalte eines
   Blog-Artikels an - ohne Custom-Class. Analog zum Produktgrid-Pattern.
   ========================================================================== */
/* Grid: mobil 2 Spalten, ab xl 3 Spalten (Content-Spalte ist bei lg + Sidebar
   zu schmal fuer 4-5 Spalten). */
.blog-post-content .beliebteste-events-section .sticker-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
}
@media (min-width: 1280px) {
    .blog-post-content .beliebteste-events-section .sticker-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.75rem !important;
    }
}

/* Padding: Im Blog kein zusaetzlicher Innenrand - Content hat
   bereits das Layout-Padding. */
.blog-post-content .beliebteste-events-section .sticker-grid-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ==========================================================================
   Sticker Card Base Styles
   ========================================================================== */

.sticker-card {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                z-index 0.3s ease;
    transform-origin: center center;
    will-change: transform;
}

.sticker-card:hover,
.sticker-card:focus {
    transform: rotate(0deg) translateY(-8px) scale(1.10) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 100 !important;
    border-color: white !important;
}

.sticker-card:focus {
    outline: 2px solid #f97316;
    outline-offset: 4px;
}

/* ==========================================================================
   Card Rotations (card-1 to card-12, cycling)
   ========================================================================== */

/* Card Rotations (matching HTML draft for sticker effect)
   + scale(1.04) damit die Cards bei kleinem Grid-Gap leicht in die Nachbarn
     ueberlappen (ca. 8-12px je Seite, je nach Card-Breite).
   + z-index absteigend: card-1 oben (12), card-10 unten (3), card-11/12 ganz hinten. */
.sticker-card.card-1 {
    transform: rotate(-3deg) translateY(8px) scale(1.04);
    z-index: 12;
}

.sticker-card.card-2 {
    transform: rotate(2deg) translateY(-12px) scale(1.04);
    z-index: 11;
}

.sticker-card.card-3 {
    transform: rotate(-1deg) translateY(15px) scale(1.04);
    z-index: 10;
}

.sticker-card.card-4 {
    transform: rotate(4deg) translateY(-5px) scale(1.04);
    z-index: 9;
}

.sticker-card.card-5 {
    transform: rotate(-2deg) translateY(10px) scale(1.04);
    z-index: 8;
}

.sticker-card.card-6 {
    transform: rotate(1deg) translateY(-8px) scale(1.04);
    z-index: 7;
}

.sticker-card.card-7 {
    transform: rotate(-3deg) translateY(12px) scale(1.04);
    z-index: 6;
}

.sticker-card.card-8 {
    transform: rotate(3deg) translateY(-3px) scale(1.04);
    z-index: 5;
}

.sticker-card.card-9 {
    transform: rotate(-1deg) translateY(5px) scale(1.04);
    z-index: 4;
}

.sticker-card.card-10 {
    transform: rotate(2deg) translateY(-10px) scale(1.04);
    z-index: 3;
}

.sticker-card.card-11 {
    transform: rotate(-2deg) translateY(8px) scale(1.04);
    z-index: 2;
}

.sticker-card.card-12 {
    transform: rotate(3deg) translateY(-5px) scale(1.04);
    z-index: 1;
}

/* ==========================================================================
   Card Hover Effect (shared with Produktgrid)
   ========================================================================== */

.card-hover {
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.empty-state {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Detail View - IMPORTANT: Slide-out (relative), NOT Fullscreen Modal!
   ========================================================================== */

.beliebteste-detail-view {
    /* CRITICAL: relative w-full (NOT fixed inset-0 z-50!) */
    position: relative;
    width: 100%;
    display: none;
    background-color: #f9fafb;
}

.beliebteste-detail-view:not(.hidden) {
    display: block;
}

/* Slide-in Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}

/* ==========================================================================
   Detail View Header
   ========================================================================== */

.beliebteste-detail-view .detail-header-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

@media (min-width: 768px) {
    .beliebteste-detail-view .detail-header-title {
        font-size: 1.25rem;
    }
}

/* Navigation Buttons */
.detail-prev-btn,
.detail-next-btn {
    transition: all 0.15s ease;
}

.detail-prev-btn:disabled,
.detail-next-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Hover: Icon bleibt weiss auf orangenem Hintergrund (Tailwind-hover-Klassen
   werden im #main-content teils ueberschrieben, daher hart hier setzen
   - 1:1 analog zum Produktgrid). */
.detail-prev-btn:not(:disabled):hover,
.detail-next-btn:not(:disabled):hover {
    background-color: #f97316 !important;
    border-color: #f97316 !important;
    color: white !important;
}

.detail-prev-btn:not(:disabled):hover svg,
.detail-next-btn:not(:disabled):hover svg {
    color: white !important;
    stroke: currentColor;
}

/* ==========================================================================
   Detail View Content
   ========================================================================== */

/* ==========================================================================
   Detail Content Grid Layout (synchron zum Produktgrid)
   Struktur: .detail-content hat 4 direkte Kinder:
     1. .detail-image-link     (Bild)
     2. .detail-info           (Name, Subtitle, Tags, Beschreibung)
     3. .detail-specs-wrapper  (Specs-Box)
     4. .detail-actions-wrapper (Booking + Favorit + Share)

   Breakpoints:
     < md (<768px):  alles gestapelt (1 Spalte)
     md-lg (768-1023px): Bild | Info nebeneinander, Specs + Actions volle Breite darunter
     lg+ (1024px+) Standard: Bild-Spalte spannt 3 Zeilen, rechts stacken Info/Specs/Actions
     lg+ (.detail-content--compact, Blog): bleibt wie md-lg (Blog-Spalte ist zu schmal)
   ========================================================================== */
.detail-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    /* Fluid Inset: 24 px Mobile (375px) → 48 px Desktop (1280px+).
       Konsistent zu Produktgrid und Section-Padding-Skala (clamp). */
    padding: clamp(1.5rem, 1rem + 2vw, 3rem);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

@media (min-width: 768px) {
    .detail-content {
        grid-template-columns: auto 1fr;
        column-gap: 2rem;
        row-gap: 2rem;
    }
    .detail-content > .detail-image-link      { grid-column: 1; grid-row: 1; }
    .detail-content > .detail-info            { grid-column: 2; grid-row: 1; }
    .detail-content > .detail-specs-wrapper   { grid-column: 1 / -1; grid-row: 2; }
    .detail-content > .detail-actions-wrapper { grid-column: 1 / -1; grid-row: 3; }
}

@media (min-width: 1024px) {
    .detail-content:not(.detail-content--compact) {
        column-gap: 3rem;
        padding: 3rem;
    }
    .detail-content:not(.detail-content--compact) > .detail-image-link {
        grid-row: 1 / span 3;
    }
    .detail-content:not(.detail-content--compact) > .detail-specs-wrapper,
    .detail-content:not(.detail-content--compact) > .detail-actions-wrapper {
        grid-column: 2;
    }
    .detail-content:not(.detail-content--compact) > .detail-specs-wrapper   { grid-row: 2; }
    .detail-content:not(.detail-content--compact) > .detail-actions-wrapper { grid-row: 3; }
}

/* Blog-Compact: Subtitle + Price bleiben immer untereinander (Info-Spalte
   ist auch bei lg+ zu schmal fuer side-by-side). Tailwind lg:flex-row
   wuerde sie sonst ab 1024px nebeneinander stellen. */
.detail-content--compact .detail-subtitle-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
}

/* Desktop (Non-Compact): mehr Luft zwischen Subtitle und Price,
   sonst kollidieren lange Subtitle-Texte mit dem Preis. */
@media (min-width: 1024px) {
    .detail-content:not(.detail-content--compact) .detail-subtitle-row {
        gap: 3rem !important;
    }
}

/* Slide-out Animations for Navigation */
.detail-content.slide-out-left {
    animation: slideOutLeft 0.15s ease-out;
}

.detail-content.slide-out-right {
    animation: slideOutRight 0.15s ease-out;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ==========================================================================
   Detail View Image & Placeholder
   ========================================================================== */

.detail-image-link {
    text-decoration: none;
    color: inherit;
    position: relative;
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Placeholder Gradient (like Produktgrid) */
.placeholder-gradient {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Detail View Info Section
   ========================================================================== */

.detail-name {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-subtitle {
    color: #f97316;
}

.detail-price {
    color: #1f2937;
}

.detail-description {
    color: #4b5563;
    line-height: 1.625;
}

/* Tags */
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.detail-tag:hover {
    background-color: #e5e7eb;
}

/* Specs Grid */
.detail-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .detail-specs {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

.detail-spec {
    text-align: center;
}

.detail-spec-icon {
    width: 2rem;
    height: 2rem;
    margin: 0 auto 0.5rem;
    color: #f97316;
}

.detail-spec-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.detail-spec-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

/* ==========================================================================
   Buttons (Booking, Favorite, Share)
   ========================================================================== */

/* Button Hover Effect (shared) */
.btn-hover {
    transition: all 0.2s ease;
}

.btn-hover:hover {
    transform: translateY(-1px);
}

.btn-hover:active {
    transform: translateY(0);
}

/* Favorite Button - SVG Heart Icon States */
.detail-favorite-btn {
    position: relative;
}

.detail-favorite-icon {
    transition: all 0.2s ease;
}

/* Filled State (favorited) */
.detail-favorite-btn[aria-pressed="true"] .detail-favorite-icon {
    fill: currentColor;
    stroke: none;
    color: #ec4899;
}

.detail-favorite-btn[aria-pressed="true"] {
    background-color: #fdf2f8;
    border-color: #f9a8d4;
}

/* Outline State (not favorited) */
.detail-favorite-btn[aria-pressed="false"] .detail-favorite-icon {
    fill: none;
    stroke: currentColor;
    color: #6b7280;
}

/* Hover States */
.detail-favorite-btn:hover .detail-favorite-icon {
    color: #ec4899;
}

/* Share Button */
.detail-share-btn svg {
    transition: all 0.15s ease;
}

.detail-share-btn:hover svg {
    fill: #3b82f6;
}

/* ==========================================================================
   Ranking Badge
   ========================================================================== */

.sticker-card .bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, #f97316, #ea580c);
}

#detail-ranking-badge {
    background-image: linear-gradient(to bottom right, #f97316, #ea580c);
}

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .sticker-card,
    .card-hover,
    .detail-prev-btn,
    .detail-next-btn,
    .detail-favorite-btn,
    .detail-share-btn,
    .btn-hover {
        transition: none !important;
        animation: none !important;
    }

    .sticker-card:hover,
    .sticker-card:focus {
        transform: none !important;
    }

    .detail-content.slide-out-left,
    .detail-content.slide-out-right {
        animation: none !important;
    }

    .animate-slideIn {
        animation: none !important;
    }
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.aspect-3-4 {
    aspect-ratio: 3 / 4;
}

.no-underline {
    text-decoration: none !important;
}

/* ==========================================================================
   Sticker Card - Bottom Gradient Overlay (darker like design)
   ========================================================================== */

.sticker-card .absolute.bottom-0 {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%) !important;
    padding: 1rem !important;
    padding-top: 2.5rem !important;
}

/* Card Title Text (larger, bolder) */
.sticker-card .text-white.font-bold.text-sm {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .sticker-card .text-white.font-bold.text-sm {
        font-size: 1rem !important;
    }
}

/* Ranking Badge Styling (circular like HTML draft) */
.sticker-card .ranking-badge {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4) !important;
    font-weight: 800 !important;
}

/* ==========================================================================
   DETAIL VIEW - TYPOGRAPHY OVERRIDES
   Überschreibt #main-content Styles
   ========================================================================== */

/* Detail Header Title */
#main-content .beliebteste-detail-view .detail-header-title,
.beliebteste-detail-view .detail-header-title {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    color: #1f2937 !important;
}

@media (min-width: 768px) {
    #main-content .beliebteste-detail-view .detail-header-title,
    .beliebteste-detail-view .detail-header-title {
        font-size: 1.25rem !important;
    }
}

/* Detail Event Name (h3) - H2-Visual-Rolle (24→36 px fluid)
   Bewusste Display-Ausnahme: Tag bleibt H3 (Modal-Header ist bereits H2),
   visuell H2-Scale als inhaltliches Herzstück des Modals.
   Siehe docs/typography-system.md §5 (Bewusste Ausnahmen). */
#main-content .beliebteste-detail-view .detail-name,
.beliebteste-detail-view .detail-name {
    font-size: clamp(1.5rem, 1.25rem + 1vw, 2.25rem) !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    color: #111827 !important;
    word-wrap: break-word;
    hyphens: auto;
}

/* Detail Subtitle */
#main-content .beliebteste-detail-view .detail-subtitle,
.beliebteste-detail-view .detail-subtitle {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    color: #f97316 !important;
}

@media (min-width: 768px) {
    #main-content .beliebteste-detail-view .detail-subtitle,
    .beliebteste-detail-view .detail-subtitle {
        font-size: 1.25rem !important;
    }
}

/* Detail Price */
#main-content .beliebteste-detail-view .detail-price,
.beliebteste-detail-view .detail-price {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    white-space: nowrap;
}

@media (min-width: 768px) {
    #main-content .beliebteste-detail-view .detail-price,
    .beliebteste-detail-view .detail-price {
        font-size: 1.5rem !important;
    }
}

/* Detail Description */
/* Detail Description - Card-Body (16 px) auf Mobile, Primary-Body (18 px) auf Desktop.
   Line-Height folgt der Size: 1.625 (leading-relaxed) bei 16 px, 1.75 bei 18 px. */
#main-content .beliebteste-detail-view .detail-description,
.beliebteste-detail-view .detail-description {
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.625 !important;
    color: #4b5563 !important;
    margin: 0 0 1rem 0 !important;
}

@media (min-width: 768px) {
    #main-content .beliebteste-detail-view .detail-description,
    .beliebteste-detail-view .detail-description {
        font-size: 1.125rem !important;
        line-height: 1.625 !important;
        margin: 0 0 1.5rem 0 !important;
    }
}

/* ==========================================================================
   DETAIL SPECS - Styling wie Produktgrid
   ========================================================================== */

/* Spec Item Container */
.beliebteste-detail-view .detail-specs > div {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

/* Spec Icon */
.beliebteste-detail-view .detail-specs .spec-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: #9ca3af;
}

/* Spec Labels */
#main-content .beliebteste-detail-view .detail-specs .spec-label,
.beliebteste-detail-view .detail-specs .spec-label {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #9ca3af !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

/* Spec Values */
#main-content .beliebteste-detail-view .detail-specs .spec-value,
.beliebteste-detail-view .detail-specs .spec-value {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin-top: 0.125rem !important;
    line-height: 1.4 !important;
}

/* ==========================================================================
   DETAIL FAVORITE BUTTON
   ========================================================================== */

.beliebteste-detail-view .detail-favorite-btn {
    transition: all 0.2s ease;
}

/* Active/Favorited State */
.beliebteste-detail-view .detail-favorite-btn.favorite-active {
    background-color: #fdf2f8 !important; /* pink-50 */
    border-color: #ec4899 !important; /* pink-500 */
}

.beliebteste-detail-view .detail-favorite-btn.favorite-active .detail-favorite-icon {
    fill: #ec4899 !important;
    stroke: #ec4899 !important;
    color: #ec4899 !important;
}

/* Hover on active button */
.beliebteste-detail-view .detail-favorite-btn.favorite-active:hover {
    background-color: #fce7f3 !important; /* pink-100 */
    border-color: #db2777 !important; /* pink-600 */
}

.beliebteste-detail-view .detail-favorite-btn.favorite-active:hover .detail-favorite-icon {
    fill: #db2777 !important;
    stroke: #db2777 !important;
    color: #db2777 !important;
}

/* ==========================================================================
   Empty State Heading Override
   ========================================================================== */

#main-content .beliebteste-events-section .empty-state h3,
.beliebteste-events-section .empty-state h3 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 0 0.5rem 0 !important;
    color: #1f2937 !important;
}

@media (min-width: 768px) {
    #main-content .beliebteste-events-section .empty-state h3,
    .beliebteste-events-section .empty-state h3 {
        font-size: 1.5rem !important;
        margin: 0 0 0.75rem 0 !important;
    }
}

/* ==========================================================================
   Responsive Utilities
   ========================================================================== */

@media (max-width: 767px) {
    .hidden-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hidden-desktop {
        display: none !important;
    }
}
