﻿/* ============================================================
   wwwroot/css/literary-pieces.css
   نسخه نهایی — متن‌های زیبا (سایت)
   ============================================================ */

/* ═══════════════════════════════════════════════════════════
   ۱. HERO (هدر لیست)
   ═══════════════════════════════════════════════════════════ */
.literary-hero {
    background: linear-gradient(135deg, #0f1824 0%, #1e293b 100%);
    color: #fff;
    padding: 48px 24px;
}

.literary-hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.literary-hero-text h1 {
    font-family: var(--font-heading, 'BTitrBd', serif);
    font-size: 32px;
    color: #fff;
    margin: 0 0 12px;
}

.literary-hero-text p {
    font-family: var(--font-primary, Tahoma);
    color: #cbd5e1;
    font-size: 15px;
    margin: 0;
    max-width: 600px;
    line-height: 1.9;
}

.literary-hero-icon {
    color: rgba(212, 160, 23, 0.35);
    font-size: 80px;
}


/* ═══════════════════════════════════════════════════════════
   ۲. FILTER
   ═══════════════════════════════════════════════════════════ */
.literary-filter-section {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px;
}

.literary-filter-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.literary-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    font-family: var(--font-primary, Tahoma);
}

.filter-input,
.filter-select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: var(--font-primary, Tahoma);
    font-size: 13px;
    background: #fff;
    transition: border-color 0.2s;
}

    .filter-input:focus,
    .filter-select:focus {
        outline: none;
        border-color: #d4a017;
    }

.filter-btn {
    height: 40px;
    padding: 0 20px;
    background: #d4a017;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-primary, Tahoma);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}

    .filter-btn:hover {
        background: #b8890f;
    }

.active-filters {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary, Tahoma);
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 16px;
    font-size: 12px;
}

.filter-remove {
    color: #92400e;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

.clear-all-filters {
    font-size: 12px;
    color: #dc2626;
    text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════
   ۳. LIST
   ═══════════════════════════════════════════════════════════ */
.literary-list-section {
    background: #f8f9fb;
    padding: 32px 24px 60px;
    min-height: 500px;
}

.literary-list-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.literary-count-bar {
    margin-bottom: 20px;
    font-family: var(--font-primary, Tahoma);
    color: #64748b;
    font-size: 13px;
}

    .literary-count-bar i {
        color: #d4a017;
    }


/* ═══════════════════════════════════════════════════════════
   ۴. GRID
   ═══════════════════════════════════════════════════════════ */
.literary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}


/* ═══════════════════════════════════════════════════════════
   ۵. CARD
   ═══════════════════════════════════════════════════════════ */
.piece-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

    .piece-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    }

.piece-card-image-link {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9; /* ← Landscape */
    overflow: hidden;
    background: #f1f5f9;
}

    .piece-card-image-link img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.4s;
    }

.piece-card:hover .piece-card-image-link img {
    transform: scale(1.05);
}

.piece-card-badge {
    position: absolute;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-primary, Tahoma);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-featured {
    top: 10px;
    right: 10px;
    background: #fbbf24;
    color: #78350f;
}

.badge-type {
    bottom: 10px;
    right: 10px;
    background: rgba(15, 24, 36, 0.85);
    color: #fff;
}

.piece-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.piece-card-title {
    font-family: var(--font-heading, 'BTitrBd');
    font-size: 15px;
    font-weight: bold;
    margin: 0 0 8px;
    line-height: 1.5;
    color: #1a2233;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

    .piece-card-title a {
        color: inherit;
        text-decoration: none;
    }

        .piece-card-title a:hover {
            color: #d4a017;
        }

.piece-card-excerpt {
    font-family: var(--font-primary, Tahoma);
    font-size: 12px;
    color: #64748b;
    line-height: 1.7;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.piece-card-author {
    font-family: var(--font-primary, Tahoma);
    font-size: 12px;
    color: #d4a017;
    font-weight: 600;
    margin-bottom: 8px;
}

.piece-card-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

    .piece-card-meta i {
        margin-left: 3px;
    }

.piece-card-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-primary, Tahoma);
    font-size: 12px;
    color: #d4a017;
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.2s;
}

    .piece-card-more:hover {
        gap: 8px;
        color: #b8890f;
    }


/* ═══════════════════════════════════════════════════════════
   ۶. PAGINATION
   ═══════════════════════════════════════════════════════════ */
.literary-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary, Tahoma);
    font-size: 13px;
    color: #1a2233;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

    .page-btn:hover {
        border-color: #d4a017;
        color: #d4a017;
        background: #fffbeb;
    }

    .page-btn.active {
        background: #0f1824;
        color: #fff;
        border-color: #0f1824;
        font-weight: bold;
    }

    .page-btn.disabled {
        opacity: 0.4;
        cursor: not-allowed;
        pointer-events: none;
    }

.page-dots {
    color: #94a3b8;
    padding: 0 4px;
}


/* ═══════════════════════════════════════════════════════════
   ۷. EMPTY
   ═══════════════════════════════════════════════════════════ */
.literary-empty {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
    font-family: var(--font-primary, Tahoma);
}

    .literary-empty i {
        font-size: 72px;
        color: #cbd5e1;
        margin-bottom: 20px;
        display: block;
    }

    .literary-empty h3 {
        font-family: var(--font-heading, 'BTitrBd');
        font-size: 20px;
        color: #1a2233;
        margin: 0 0 12px;
    }

    .literary-empty p {
        margin: 0 0 20px;
        line-height: 1.8;
    }

    .literary-empty .btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 24px;
        background: #d4a017;
        color: #fff;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
    }


/* ═══════════════════════════════════════════════════════════
   ۸. DETAIL — Wrapper
   ═══════════════════════════════════════════════════════════ */
.piece-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 80px;
    font-family: var(--font-primary, Tahoma);
}


/* ═══════════════════════════════════════════════════════════
   ۹. DETAIL — Breadcrumb
   ═══════════════════════════════════════════════════════════ */
.piece-breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0 0 24px;
    font-size: 13px;
    color: #64748b;
}

.piece-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .piece-breadcrumb li:not(:last-child)::after {
        content: '›';
        color: #94a3b8;
    }

.piece-breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

    .piece-breadcrumb a:hover {
        color: #d4a017;
    }

.piece-breadcrumb .active {
    color: #1a2233;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════
   ۱۰. DETAIL — Header
   ═══════════════════════════════════════════════════════════ */
.piece-header {
    background: #f8f9fb;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

.piece-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 100%;
    overflow: hidden;
    background: #1a2233;
}

    .piece-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.piece-identity-bar {
    padding: 20px 24px;
    text-align: center;
}

.piece-title {
    font-family: var(--font-heading, 'BTitrBd');
    font-size: 28px;
    color: #1a2233;
    margin: 0 0 16px;
    line-height: 1.4;
}

.piece-primary-author {
    font-family: var(--font-primary, Tahoma);
    font-size: 15px;
    color: #d4a017;
    margin-bottom: 10px;
}

    .piece-primary-author i {
        margin-left: 6px;
    }

.piece-meta-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    font-family: var(--font-primary, Tahoma);
    font-size: 13px;
    color: #64748b;
    margin-top: 12px;
}

.piece-meta-item i {
    color: #d4a017;
    margin-left: 4px;
}


/* ═══════════════════════════════════════════════════════════
   ۱۱. DETAIL — Actions
   ═══════════════════════════════════════════════════════════ */
.piece-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 24px 0;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.piece-action-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #475569;
    font-family: var(--font-primary, Tahoma);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

    .piece-action-btn:hover {
        background: #fffbeb;
        border-color: #d4a017;
        color: #d4a017;
        transform: translateY(-2px);
    }

    .piece-action-btn i {
        font-size: 18px;
    }

    .piece-action-btn.is-active {
        background: #fef3c7;
        border-color: #d4a017;
        color: #b8890f;
    }


/* ═══════════════════════════════════════════════════════════
   ۱۲. DETAIL — Opening Verse (بیت مطلع)
   ═══════════════════════════════════════════════════════════ */
.piece-opening-verse {
    position: relative;
    background: linear-gradient(135deg, #fef9e7 0%, #fdf3d3 100%);
    border-right: 4px solid #d4a017;
    border-radius: 0 12px 12px 0;
    padding: 28px 32px;
    margin: 24px 0;
    font-family: var(--font-primary, Tahoma);
}

    .piece-opening-verse p {
        font-size: 16px;
        line-height: 2.2;
        color: #1a2233;
        margin: 0;
        text-align: center;
        font-weight: 500;
    }

.quote-mark {
    position: absolute;
    font-size: 48px;
    color: rgba(212, 160, 23, 0.25);
    font-family: Georgia, serif;
    line-height: 1;
}

.quote-mark-open {
    top: 8px;
    right: 16px;
}

.quote-mark-close {
    bottom: 0;
    left: 16px;
}


/* ═══════════════════════════════════════════════════════════
   ۱۳. DETAIL — Content Box
   ═══════════════════════════════════════════════════════════ */
.piece-content {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 32px;
    margin-bottom: 24px;
}


/* ═══════════════════════════════════════════════════════════
   ۱۴. DETAIL — ابیات (سه ستونی — ساده و مستقیم)
   ═══════════════════════════════════════════════════════════ */
.piece-beits {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.beyt-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr;
    gap: 16px;
    align-items: baseline;
    padding: 6px 0;
}

.beyt-index {
    color: #dc2626;
    font-family: var(--font-primary, Tahoma);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.beyt-first,
.beyt-second {
    font-family: var(--font-primary, Tahoma);
    font-size: 17px;
    line-height: 2;
    color: #1a2233;
    word-break: break-word;
    text-align: right;
}

.beyt-second {
    color: #334155;
}


/* ═══════════════════════════════════════════════════════════
   ۱۵. DETAIL — متن ساده (Prose)
   ═══════════════════════════════════════════════════════════ */
.piece-prose {
    font-family: var(--font-primary, Tahoma);
    font-size: 16px;
    line-height: 2.2;
    color: #1a2233;
}

    .piece-prose p {
        margin-bottom: 1.2em;
    }


/* ═══════════════════════════════════════════════════════════
   ۱۶. DETAIL — HTML خام (اگر ادمین وارد کرد)
   ═══════════════════════════════════════════════════════════ */
.piece-html-content {
    font-family: var(--font-primary, Tahoma);
    font-size: 16px;
    line-height: 2.2;
    color: #1a2233;
}

    .piece-html-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 12px 0;
    }

    .piece-html-content figure {
        margin: 20px 0;
    }

    .piece-html-content figcaption {
        font-size: 0.9rem;
        color: #666;
        text-align: center;
        margin-top: 8px;
    }


/* ═══════════════════════════════════════════════════════════
   ۱۷. DETAIL — Section Title
   ═══════════════════════════════════════════════════════════ */
.piece-section-title {
    font-family: var(--font-heading, 'BTitrBd');
    font-size: 18px;
    color: #1a2233;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #d4a017;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .piece-section-title i {
        color: #d4a017;
    }


/* ═══════════════════════════════════════════════════════════
   ۱۸. DETAIL — Audio
   ═══════════════════════════════════════════════════════════ */
.piece-audios {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 24px;
}

.piece-audio-item {
    padding: 14px;
    background: #f8f9fb;
    border-radius: 10px;
    margin-bottom: 12px;
}

    .piece-audio-item:last-child {
        margin-bottom: 0;
    }

.piece-audio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    font-family: var(--font-primary, Tahoma);
    font-size: 13px;
    color: #475569;
}

    .piece-audio-meta strong {
        color: #1a2233;
    }

.piece-audio-item audio {
    width: 100%;
    border-radius: 8px;
}


/* ═══════════════════════════════════════════════════════════
   ۱۹. DETAIL — Tags
   ═══════════════════════════════════════════════════════════ */
.piece-tags-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 20px 24px;
    margin-bottom: 24px;
    font-family: var(--font-primary, Tahoma);
}

    .piece-tags-section .tags-label {
        font-size: 13px;
        color: #64748b;
        font-weight: 600;
        margin-left: 8px;
    }

.piece-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-family: var(--font-primary, Tahoma);
    font-size: 12px;
    text-decoration: none;
    background: #f1f5f9;
    color: #475569;
    margin: 2px;
    transition: all 0.2s;
}


/* ═══════════════════════════════════════════════════════════
   ۲۰. DETAIL — Related
   ═══════════════════════════════════════════════════════════ */
.piece-related {
    margin-top: 40px;
}


/* ═══════════════════════════════════════════════════════════
   ۲۱. RESPONSIVE — تبلت (<= 992px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    .literary-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-submit {
        grid-column: span 2;
    }

    .literary-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .piece-title {
        font-size: 22px;
    }

    .piece-cover img {
        height: 300px;
    }
}


/* ═══════════════════════════════════════════════════════════
   ۲۲. RESPONSIVE — موبایل (<= 768px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Hero */
    .literary-hero {
        padding: 32px 16px;
    }

    .literary-hero-text h1 {
        font-size: 24px;
    }

    .literary-hero-icon {
        display: none;
    }

    /* Filter */
    .literary-filter-section {
        padding: 16px;
    }

    .literary-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-submit {
        grid-column: auto;
    }

    /* List */
    .literary-list-section {
        padding: 20px 12px 40px;
    }

    .literary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .piece-card-title {
        font-size: 13px;
        min-height: 38px;
    }

    .piece-card-excerpt {
        display: none;
    }

    /* Detail */
    .piece-detail {
        padding: 16px 12px 60px;
    }

    .piece-cover img {
        height: 250px;
    }

    .piece-title {
        font-size: 20px;
    }

    .piece-content {
        padding: 20px 16px;
    }

    /* ابیات — یکسان بودن دو مصراع */
    .beyt-row {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 4px 0;
    }

    .beyt-index {
        text-align: right;
        font-size: 11px;
        color: #94a3b8;
    }

    .beyt-first,
    .beyt-second {
        font-size: 15px;
        line-height: 1.8;
        color: #1a2233;
    }

    .beyt-second {
        margin-top: 2px;
    }

    /* Actions */
    .piece-actions {
        padding: 12px 8px;
    }

    .piece-action-btn {
        min-width: 56px;
        padding: 8px 10px;
        font-size: 10px;
    }

        .piece-action-btn i {
            font-size: 16px;
        }

    /* Opening verse */
    .piece-opening-verse {
        padding: 20px 18px;
    }

        .piece-opening-verse p {
            font-size: 14px;
            line-height: 2;
        }
}


/* ═══════════════════════════════════════════════════════════
   ۲۳. RESPONSIVE — موبایل کوچک (<= 480px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .literary-grid {
        grid-template-columns: 1fr;
    }

    .piece-action-btn {
        min-width: 48px;
        padding: 6px 8px;
    }

    .beyt-first,
    .beyt-second {
        font-size: 14px;
        line-height: 1.8;
    }
}

/* ═══════════════════════════════════════════════════════════
   DETAIL — لینک‌های شبکه‌های اجتماعی
   ═══════════════════════════════════════════════════════════ */
.piece-social-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 24px;
}

.piece-social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.piece-social-item {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.piece-social-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-family: var(--font-primary, Tahoma);
    font-size: 14px;
    color: #1a2233;
    font-weight: 600;
    flex-wrap: wrap;
}

    .piece-social-header i {
        color: #d4a017;
        font-size: 18px;
    }

.piece-social-title {
    color: #1a2233;
}

.piece-social-custom {
    font-size: 12px;
    color: #64748b;
    font-weight: normal;
}

.piece-social-embed {
    flex: 1;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

    .piece-social-embed iframe {
        width: 100%;
        max-width: 100%;
        display: block;
        border: none;
        border-radius: 8px;
    }

    .piece-social-embed img {
        max-width: 100%;
        height: auto;
        display: block;
        border-radius: 8px;
    }

.piece-social-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
}

.piece-social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-primary, Tahoma);
    font-size: 13px;
    color: #d4a017;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

    .piece-social-link:hover {
        color: #b8890f;
    }

/* Responsive */
@media (max-width: 768px) {
    .piece-social-section {
        padding: 16px;
    }

    .piece-social-grid {
        grid-template-columns: 1fr;
    }
}