﻿.section.details-section {
    margin-top: -70px !important;
    margin-bottom: -70px !important;
}

.details-container {
    padding-left: 4px !important;
    padding-right: 4px !important;
    max-width: 100% !important;
}

.details-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 20px 0;
}

.details-image-box {
    margin-left: 20px;
}

.details-main-image {
    max-width: 300px;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    box-shadow: 0 2px 8px #ccc;
    cursor: pointer;
}

.details-header-content {
    flex: 1;
    margin-right: 20px;
}

.details-title {
    margin-bottom: 16px;
}

.details-meta {
    color: #888;
    font-size: 0.94em;
    margin-bottom: 14px;
}

.details-summary {
    color: #444;
    margin-bottom: 18px;
}

.responsive-font.details-body-text {
    margin-top: 10px;
    line-height: 1.9;
}
.responsive-item {
    margin-bottom: -500px;
}
.details-body-image {
    float: left;
    aspect-ratio: 4 / 3;
    max-width: 45%;
    margin: 0 16px 12px 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px #ccc;
    padding: 8px;
}

.details-video-iframe {
    width: 100%;
    max-width: 640px;
    height: 360px;
    border-radius: 12px;
    box-shadow: 0 2px 8px #ccc;
}

.details-notification {
    margin: 8px 0;
}

.details-ref-tags {
    margin-bottom: 12px;
}

.details-ref-tag {
    margin-left: 4px;
}

.details-label-tags {
    margin-bottom: 12px;
}

.details-label-btn,
.details-label-clear {
    margin: 4px;
    cursor: pointer;
}

    .details-label-btn.is-selected {
        background: #1976d2 !important;
        color: #fff !important;
    }

.details-back {
    margin-top: 30px;
}

.details-suggested-wrapper {
    margin-top: 40px;
}

.details-suggested-title {
    margin-bottom: 15px;
}

.details-suggested-link-title {
    font-weight: bold;
    color: #1976d2;
}

.details-suggested-link-summary {
    font-size: 0.95em;
    color: #444;
    margin-bottom: 4px;
}

.details-suggested-link-labels {
    font-size: 0.85em;
    color: #666;
}

.details-suggested-label {
    margin: 3px;
}

.details-suggested-link-date {
    font-size: 0.83em;
    color: #aaa;
    margin-top: 2px;
}

/* Highlighted keyword */
.highlighted {
    background: #fff200;
    color: #222;
}

/* Modal styles */
.details-image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
}

.details-image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

.details-image-modal-img {
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s ease;
}

/* Responsive (mobile/tablet) */
@media (max-width: 600px) {
    .section {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .details-title {
        font-size: 1.2rem !important;
        text-align: center !important;
        font-weight: bold !important;
    }

    .details-summary {
        font-size: 1.1rem !important;
        text-align: center !important;
    }

    .details-section {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .details-container {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .details-body-image {
        float: none;
        display: block;
        max-width: 100%;
        margin: 0 auto 16px auto;
    }
}

@media (max-width: 768px) {
    .details-body-image {
        float: none;
        display: block;
        max-width: 100%;
        margin: 0 auto 16px auto;
    }

    .details-header {
        flex-direction: column !important;
        align-items: center !important;
    }

    .details-image-box {
        margin-left: 0 !important;
        margin-bottom: 14px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .details-main-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block;
        margin: 0 auto;
    }

    .details-header-content {
        margin-right: 0 !important;
        width: 100%;
    }
}

/* Similar items grid (up to 12 cards) */
.details-suggested {
    margin-top: 2rem;
}

.similar-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr); /* desktop: 4 columns (4x3 = 12) */
}

/* Card */
.similar-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e6e6e6;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    height: 100%;
}

    .similar-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    }

.similar-card-media img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.similar-card-body {
    padding: 0.75rem;
}

.similar-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.3;
    text-align: right;
}

.similar-card-meta {
    font-size: 0.82rem;
    color: #666;
    text-align: right;
}

/* Responsive grid breakpoints */
@media (max-width: 1200px) {
    .similar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    /* 3 columns */
}

@media (max-width: 900px) {
    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* 2 columns (tablet) */
}

@media (max-width: 600px) {
    .similar-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    /* 1 column (mobile) */
}

/* Small polish */
.details-meta, .subtitle {
    color: #555;
}
/* =========================
   Responsive wide video 1920×1080 (16:9)
   ========================= */

/* کانتینر: نسبت 16:9 را حفظ می‌کند، بیشینه عرض 1920px */
.video-wrapper.details-video {
    position: relative;
    width: 100%; /* پیش‌فرض: 100% در موبایل/تبلت */
    max-width: 1920px; /* حداکثر اندازه «واید» */
    margin: 20px auto; /* وسط‌چین کردن */
    height: 0; /* fallback با padding-top */
    padding-top: 56.25%; /* 1080/1920 = 56.25% — fallback برای مرورگرهای قدیمی */
}

/* اگر مرورگر از aspect-ratio پشتیبانی کند از آن استفاده کن (modern browsers) */
@supports (aspect-ratio: 16 / 9) {
    .video-wrapper.details-video {
        padding-top: 0; /* برداشتن fallback */
        height: auto;
        aspect-ratio: 16 / 9; /* نسبت دقیق 16:9 */
    }
}

/* iframe تمام فضای کانتینر را می‌پوشاند */
.details-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: block;
}

/* در دسکتاپ (مثلاً از 992px به بالا) عرض کانتینر نصف صفحه شود و همچنان وسط باشد */
@media (min-width: 992px) {
    .video-wrapper.details-video {
        width: 50%;
    }
}

/* اطمینان از اینکه در تبلت/موبایل همیشه 100% باشد */
@media (max-width: 991.98px) {
    .video-wrapper.details-video {
        width: 100%;
    }
}
/* هر رکورد پشت سر هم بیاد با فاصله معقول */
.responsive-item {
    margin-bottom: 20px; /* فاصله بین رکوردها */
    padding-bottom: 10px; /* کمی فاصله داخلی */
    border-bottom: 1px solid #eee; /* خط ظریف بین رکوردها (اختیاری برای زیبایی) */
}

    /* آخرین رکورد خط جداکننده نداشته باشد */
    .responsive-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

/* متن داخل رکورد */
.details-body-text {
    margin-top: 10px;
    margin-bottom: 10px;
    line-height: 1.8;
}

/* تصویر داخل رکورد */
.details-body-image {
    display: block;
    max-width: 100%;
    margin: 10px 15px auto auto;
}

/* ویدیو در رکورد */
.video-wrapper.details-video {
    margin: 15px auto; /* فاصله معقول با متن و تصویر */
}


