/* ===== Event Detail Page — Design حرفه‌ای ===== */

/* ── Hero Banner (uses base page-hero-premium) ── */
.event-detail-hero-premium {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    padding: 180px 0 60px;
    max-width: 100%;
    width: 100%;
}

.event-detail-hero-bg {
    position: absolute;
    inset: -24px;
    background-size: cover;
    background-position: center;
    filter: blur(18px);
    transform: scale(1.08);
    z-index: 1;
}

.event-detail-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(15, 23, 42, 0.75) 40%,
        rgba(15, 23, 42, 0.5) 100%);
}

.event-detail-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
    padding: 0 16px;
}

/* ── Hero Meta Chips — inside event detail, override bases */
.event-detail-hero-content .page-hero-meta {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.event-detail-hero-content .page-hero-meta-chip {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    flex-shrink: 1;
}

.event-detail-hero-content .page-hero-meta-chip:first-child {
    white-space: nowrap;
}

.event-detail-hero-content .page-hero-meta-chip:first-child i {
    margin-left: 4px;
}

.event-detail-hero-content .page-hero-breadcrumb {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.event-detail-hero-content .page-hero-breadcrumb span,
.event-detail-hero-content .page-hero-breadcrumb a {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}
.event-detail-main {
    padding: 60px 0 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.event-detail-main::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(200px);
    opacity: 0.04;
    top: -200px;
    left: -200px;
    pointer-events: none;
}

.event-detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 50px;
    align-items: start;
    max-width: 100%;
}

.event-detail-content {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.event-featured-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(135deg, var(--surface), var(--surface-dark));
    border-radius: var(--radius-lg);
    /* بدون سایه — فقط یک خط مرزی نازک برای جدا شدن از پس‌زمینه */
    box-shadow: 0 0 0 1px rgba(36, 72, 61, 0.08);
    margin-bottom: 40px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.event-featured-image:hover {
    transform: scale(1.01);
    box-shadow: 0 0 0 1px rgba(36, 72, 61, 0.15);
}

.event-description-body {
    line-height: 2.1;
    color: var(--dark);
    font-size: 1.05rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Protect CKEditor content from overflowing */
.event-description-body h2,
.event-description-body h3 {
    margin-top: 32px;
    margin-bottom: 16px;
}

.event-description-body p {
    margin-bottom: 24px;
}

.event-description-body ul,
.event-description-body ol {
    margin-bottom: 24px;
    padding-right: 24px;
}

.event-description-body li {
    margin-bottom: 8px;
}

.event-description-body img {
    border-radius: var(--radius);
    margin: 24px 0;
    max-width: 100%;
    height: auto !important;
}

.event-description-body table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.event-description-body iframe,
.event-description-body video,
.event-description-body embed,
.event-description-body object {
    max-width: 100%;
    height: auto;
}

.event-description-body pre,
.event-description-body code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.event-description-body a {
    word-break: break-all;
}

.event-description-body figure {
    max-width: 100%;
    margin: 24px 0;
}

.event-description-body figure img {
    margin: 0;
}

/* ── Sidebar ── */
.event-detail-sidebar {
    position: sticky;
    top: 120px;
    min-width: 0;
    max-width: 100%;
}

.event-info-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow:
        0 20px 50px -15px rgba(0,0,0,0.08),
        0 0 0 1px rgba(0,0,0,0.03);
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.event-info-card:hover {
    box-shadow:
        0 30px 60px -15px rgba(36, 72, 61, 0.15),
        0 0 0 1px rgba(36, 72, 61, 0.1);
}

.event-info-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-info-card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

.event-info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--surface-dark);
    min-width: 0;
}

.event-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.event-info-item:first-child {
    padding-top: 0;
}

.event-info-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-light), rgba(185, 130, 145, 0.15));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.event-info-item:hover .event-info-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    transform: scale(1.05);
}

.event-info-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 2px;
}

.event-info-value {
    font-weight: 700;
    color: var(--dark);
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── Countdown Timer ── */
.event-countdown-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px 24px 32px;
    box-shadow:
        0 20px 50px -15px rgba(0,0,0,0.08),
        0 0 0 1px rgba(0,0,0,0.03);
    margin-bottom: 24px;
    text-align: center;
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.event-countdown-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.event-countdown-card.ended::before {
    background: linear-gradient(90deg, #8A8F8C, #5A5F5D);
}

.countdown-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.countdown-title i {
    color: var(--primary);
}

.event-countdown-card.ended .countdown-title i {
    color: #8A8F8C;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    max-width: 100%;
}

.countdown-unit {
    text-align: center;
    min-width: 0;
}

.countdown-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 8px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* کارت پس‌زمینه سفید دارد؛ پس حباب آیکون باید تُن روشن اما
       قابل تشخیص داشته باشد (نسخه قبلی سفید نیمه‌شفاف و نامرئی بود) */
    background: linear-gradient(135deg, var(--surface), #FBFAF6);
    border: 1px solid var(--surface-dark);
    color: var(--primary-dark);
    font-size: 1.05rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.countdown-icon i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.countdown-unit:hover .countdown-icon {
    transform: translateY(-3px) scale(1.05);
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(36, 72, 61, 0.3);
}

.event-countdown-card.ended .countdown-icon {
    color: #8A8F8C;
    background: #FBFAF6;
}

.countdown-num {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--surface), #FBFAF6);
    padding: 12px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-dark);
    transition: all 0.3s ease;
    min-width: 0;
    overflow-wrap: break-word;
}

.event-countdown-card.ended .countdown-num {
    color: #8A8F8C;
    background: #FBFAF6;
}

.countdown-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 6px;
    font-weight: 600;
}

.countdown-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
}

.countdown-status.upcoming {
    background: #F5EBD6;
    color: #8F743C;
}

.countdown-status.ended {
    background: #F1EEE8;
    color: #5A5F5D;
}

.countdown-status i {
    font-size: 0.65rem;
}

.countdown-status.upcoming i {
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Responsive Countdown ── */
@media (max-width: 1024px) {
    .event-countdown-card {
        display: block;
    }

    .countdown-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .countdown-num {
        font-size: 1.6rem;
        padding: 10px 4px;
    }
}

/* ── Share Card ── */
.event-share-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px 32px;
    box-shadow:
        0 20px 50px -15px rgba(0,0,0,0.08),
        0 0 0 1px rgba(0,0,0,0.03);
    text-align: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.event-share-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.event-share-links {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.event-share-link {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #333433;
    border: 1px solid transparent;
    color: white;
}

.share-logo,
.event-share-link > i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-share-link > i svg {
    width: 22px;
    height: 22px;
    display: block;
}

.event-share-link .social-eitaa-icon svg,
.event-share-link .social-bale-icon svg {
    width: 24px;
    height: 24px;
}

.event-share-link:hover {
    transform: translateY(-3px);
}

.event-share-link.telegram:hover {
    background: #0088cc;
    border-color: #0088cc;
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.3);
}

.event-share-link.bale:hover {
    background: #27AE60;
    border-color: #27AE60;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.event-share-link.eitaa:hover {
    background: #FF8C00;
    border-color: #FF8C00;
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.3);
}

.event-share-link.bale:hover .share-logo {
    filter: brightness(0) invert(1);
}

.event-share-link.copy-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(36, 72, 61, 0.3);
}

/* ── Back Button ── */
.event-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    margin-bottom: 40px;
    max-width: 100%;
    overflow-wrap: break-word;
}

.event-detail-back:hover {
    color: var(--primary-dark);
    gap: 12px;
}

.event-detail-back i {
    font-size: 0.85rem;
}

/* ── No Image Fallback ── */
.event-no-image {
    width: 100%;
    max-width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-light), rgba(185, 130, 145, 0.1));
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    color: var(--primary-dark);
    position: relative;
    overflow: hidden;
}

.event-no-image::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(185, 130, 145, 0.15);
    border-radius: 50%;
    animation: float-icon 6s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.event-no-image i {
    font-size: 4rem;
    opacity: 0.6;
    position: relative;
    z-index: 1;
}

.event-no-image span {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-gray);
    position: relative;
    z-index: 1;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .event-detail-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .event-detail-sidebar {
        position: static;
    }

    .page-hero-title {
        font-size: 2.2rem;
    }

    .page-hero-meta {
        flex-wrap: wrap;
        justify-content: center;
    }

    .event-info-card {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding: 24px;
    }

    .event-info-card-title {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .event-info-item {
        flex-direction: column;
        text-align: center;
        padding: 12px 0;
        border-bottom: none;
        border-left: 1px solid var(--surface-dark);
    }

    .event-info-item:last-child {
        border-left: none;
    }

    .event-share-card {
        display: none;
    }

    .event-featured-image {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    .event-detail-hero-premium {
        padding: 130px 16px 50px;
        min-height: 42vh;
        width: 100%;
    }

    .page-hero-title {
        font-size: 1.6rem;
    }

    .page-hero-meta {
        gap: 8px;
    }

    .page-hero-meta-chip {
        font-size: 0.82rem;
        padding: 6px 14px;
        max-width: 100%;
        min-width: 0;
    }

    .page-hero-breadcrumb {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .event-detail-grid {
        gap: 32px;
    }

    .event-detail-main {
        padding: 40px 0 0;
    }

    .event-info-card {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .event-info-item {
        border-left: none;
        border-bottom: 1px solid var(--surface-dark);
        flex-direction: row;
        text-align: right;
        padding: 14px 0;
    }

    .event-info-item:last-child {
        border-bottom: none;
    }

    .event-info-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .event-featured-image {
        max-height: 55vh;
        border-radius: var(--radius);
        margin-bottom: 30px;
    }

    .event-no-image {
        height: 220px;
    }

    .event-no-image i {
        font-size: 3rem;
    }

    .event-description-body {
        font-size: 0.95rem;
        line-height: 1.9;
    }

    .event-detail-back {
        margin-bottom: 30px;
    }

    .countdown-num {
        font-size: 1.5rem;
        padding: 8px 2px;
    }

    .countdown-label {
        font-size: 0.7rem;
    }

    .event-countdown-card {
        padding: 22px 18px 26px;
    }
}

@media (max-width: 480px) {
    .event-detail-hero-premium {
        padding: 110px 12px 40px;
        min-height: 38vh;
        width: 100%;
    }

    .page-hero-title {
        font-size: 1.3rem;
        line-height: 1.5;
    }

    .page-hero-meta {
        gap: 6px;
    }

    .page-hero-meta-chip {
        font-size: 0.75rem;
        padding: 5px 10px;
        max-width: 100%;
        min-width: 0;
    }

    .page-hero-breadcrumb {
        font-size: 0.78rem;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 14px;
    }

    .page-hero-orb {
        display: none;
    }

    .event-detail-grid {
        gap: 24px;
    }

    .event-detail-main {
        padding: 30px 0 0;
    }

    .event-featured-image {
        max-height: 45vh;
        border-radius: var(--radius);
        margin-bottom: 24px;
    }

    .event-no-image {
        height: 180px;
        border-radius: var(--radius);
    }

    .event-no-image i {
        font-size: 2.5rem;
    }

    .event-no-image span {
        font-size: 0.9rem;
    }

    .event-description-body {
        font-size: 0.9rem;
        line-height: 1.85;
    }

    .event-description-body h2 {
        font-size: 1.2rem;
    }

    .event-description-body h3 {
        font-size: 1.1rem;
    }

    .event-detail-back {
        margin-bottom: 24px;
        font-size: 0.85rem;
    }

    .event-info-card {
        padding: 18px;
        border-radius: var(--radius);
    }

    .event-info-card-title {
        font-size: 1.05rem;
    }

    .event-info-item {
        padding: 12px 0;
    }

    .event-info-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .event-info-label {
        font-size: 0.75rem;
    }

    .event-info-value {
        font-size: 0.88rem;
    }

    .countdown-grid {
        gap: 6px;
    }

    .countdown-icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 0.9rem;
    }

    .countdown-num {
        font-size: 1.3rem;
        padding: 8px 2px;
        border-radius: var(--radius-sm);
    }

    .countdown-label {
        font-size: 0.68rem;
    }

    .countdown-title {
        font-size: 0.85rem;
    }

    .countdown-status {
        font-size: 0.78rem;
    }

    .event-countdown-card {
        padding: 18px 14px 22px;
        margin-bottom: 16px;
    }

    .event-share-card {
        display: none;
    }
}
