/**
 * Content area — posts, categories, pages
 * Depends on CSS variables from modern-ui.css
 */

/* ── Content archive (category/blog) ── */
.content-archive {
    padding: 0 0 3rem;
}

.content-archive__hero {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ui-shadow-sm);
}

.content-archive__hero-title {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 800;
    color: var(--theam-color);
    margin: 0 0 0.5rem;
}

.content-archive__hero-desc {
    color: var(--ui-text-muted);
    line-height: 1.85;
    margin: 0;
}

.content-archive__hero-desc p:last-child {
    margin-bottom: 0;
}

.content-archive__hero-meta {
    font-size: 13px;
    color: var(--ui-text-muted);
    margin: 0.75rem 0 0;
}

.content-archive__hero-img {
    border-radius: var(--ui-radius-md);
    max-height: 200px;
    width: 100%;
    object-fit: cover;
}

.content-archive__search {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ui-shadow-sm);
}

.content-archive__search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.content-archive__search-input-wrap {
    flex: 1 1 220px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    padding: 0.55rem 0.85rem;
    background: var(--ui-surface-muted);
    transition: border-color var(--ui-transition), box-shadow var(--ui-transition);
}

.content-archive__search-input-wrap:focus-within {
    border-color: var(--theam-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theam-color) 12%, transparent);
    background: var(--ui-surface);
}

.content-archive__search-input-wrap i {
    color: var(--theam-color);
    font-size: 1.25rem;
}

.content-archive__search-input-wrap input {
    border: 0;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 15px;
}

.content-archive__sidebar-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}

.content-archive__sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--theam-color);
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--ui-border);
    margin: 0;
}

.content-archive__sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}

.content-archive__sidebar-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    color: var(--ui-text);
    text-decoration: none;
    font-size: 14px;
    transition: background var(--ui-transition), color var(--ui-transition);
}

.content-archive__sidebar-list a:hover {
    background: color-mix(in srgb, var(--theam-color) 6%, transparent);
    color: var(--theam-color);
}

.content-archive__card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.content-archive__card-meta time {
    font-size: 12px;
    color: var(--ui-text-muted);
}

.content-archive__card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: var(--ui-radius-pill);
    background: color-mix(in srgb, var(--theam-color) 12%, #fff);
    color: var(--theam-color);
}

.content-archive__card-excerpt {
    font-size: 13px;
    line-height: 1.75;
    color: var(--ui-text-muted);
    margin: 0.35rem 0 0;
}

.content-archive__empty {
    background: var(--ui-surface);
    border: 1px dashed var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 3rem 1.5rem;
    text-align: center;
}

/* ── Single post ── */
.content-single {
    padding: 0 0 2.5rem;
}

.content-single__layout {
    align-items: flex-start;
}

.content-single__progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: color-mix(in srgb, var(--ui-border) 40%, transparent);
    z-index: 200;
    pointer-events: none;
}

.content-single__progress-bar {
    height: 100%;
    width: 0;
    background: var(--theam-color);
    transition: width 0.1s linear;
}

.content-single__hero {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
}

.content-single__figure {
    margin: -1.5rem -1.5rem 1.25rem;
    text-align: center;
}

.content-single__figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--ui-radius-lg) var(--ui-radius-lg) 0 0;
}

.content-single__title {
    font-size: clamp(1.35rem, 2.8vw, 1.9rem);
    font-weight: 800;
    color: var(--ui-text);
    line-height: 1.55;
    margin: 0.65rem 0 0.75rem;
}

.content-single__excerpt {
    font-size: 15px;
    line-height: 1.85;
    color: var(--ui-text-muted);
    margin: 0;
}

.content-single__toc {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--ui-shadow-sm);
}

.content-single__toc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--theam-color);
    margin: 0 0 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ui-border);
}

.content-single__toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content-single__toc-list li a {
    display: block;
    padding: 0.4rem 0;
    font-size: 13px;
    color: var(--ui-text-muted);
    text-decoration: none;
    line-height: 1.6;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 70%, transparent);
    transition: color var(--ui-transition);
}

.content-single__toc-list li:last-child a {
    border-bottom: 0;
}

.content-single__toc-list li a:hover {
    color: var(--theam-color);
}

.content-single__toc-empty {
    font-size: 13px;
    color: var(--ui-text-muted);
}

.content-single__preview {
    margin-bottom: 1rem;
}

.content-single__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    font-size: 13px;
    color: var(--ui-text-muted);
}

.content-single__badge {
    font-size: 11px;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--ui-radius-pill);
    background: color-mix(in srgb, var(--theam-color) 12%, #fff);
    color: var(--theam-color);
}

.content-single__body {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: var(--ui-shadow-sm);
}

.content-single__body .single_page .text {
    line-height: 1.9;
    color: var(--ui-text);
}

.content-single__body .single_page .text h2 {
    color: var(--theam-color);
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.5rem;
}

.content-single__share {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ui-border);
}

.content-single__share-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ui-text);
    margin-bottom: 0.75rem;
}

/* ── Post sidebar ── */
.content-sidebar {
    float: none;
    width: 100%;
}

.content-sidebar__sticky {
    position: sticky;
    top: calc(var(--site-sticky-offset, 96px) + 12px);
    z-index: 50;
    max-height: calc(100vh - var(--site-sticky-offset, 96px) - 24px);
    overflow-y: auto;
}

.content-sidebar__widget {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
    padding: 0.85rem 1rem 1rem;
    margin-bottom: 1rem;
}

.content-sidebar__widget:last-child {
    margin-bottom: 0;
}

.content-sidebar__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--theam-color);
    margin: 0 0 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ui-border);
}

.content-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content-sidebar__list li a {
    display: block;
    padding: 0.45rem 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--ui-text);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 70%, transparent);
    transition: color var(--ui-transition);
}

.content-sidebar__list li:last-child a {
    border-bottom: 0;
}

.content-sidebar__list li a:hover {
    color: var(--theam-color);
}

.content-sidebar__comments {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content-sidebar__comment {
    padding: 0.55rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 70%, transparent);
}

.content-sidebar__comment:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.content-sidebar__comment-post {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text);
    text-decoration: none;
    line-height: 1.55;
    margin-bottom: 0.25rem;
}

.content-sidebar__comment-post:hover {
    color: var(--theam-color);
}

.content-sidebar__comment-text {
    font-size: 12px;
    line-height: 1.7;
    color: var(--ui-text-muted);
    margin: 0 0 0.2rem;
}

.content-sidebar__comment-meta {
    font-size: 11px;
    color: color-mix(in srgb, var(--ui-text-muted) 80%, transparent);
}

/* ── Prev / next ── */
.content-adjacent {
    background: var(--ui-surface);
    border-top: 1px solid var(--ui-border);
    border-bottom: 1px solid var(--ui-border);
    padding: 1.25rem 0;
}

.content-adjacent__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface-muted);
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: border-color var(--ui-transition), box-shadow var(--ui-transition);
}

.content-adjacent__link:hover {
    border-color: color-mix(in srgb, var(--theam-color) 35%, var(--ui-border));
    box-shadow: var(--ui-shadow-sm);
}

.content-adjacent__link:hover strong {
    color: var(--theam-color);
}

/* ── Static page (full width, no sidebar) ── */
.content-page {
    padding: 0 0 2.5rem;
}

.content-page__main {
    width: 100%;
    max-width: 100%;
}

.content-page .content-single__body .single_page .text h2 {
    color: var(--theam-color);
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.5rem;
}

/* ── Post formats (video, podcast, gallery, news) ── */
.post-format {
    margin-bottom: 1.5rem;
}

.post-format__badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: var(--ui-radius-pill);
}

.post-format__badge--news { background: color-mix(in srgb, #0d6efd 15%, #fff); color: #0d6efd; }
.post-format__badge--gallery { background: color-mix(in srgb, #0dcaf0 15%, #fff); color: #087990; }
.post-format__badge--video { background: color-mix(in srgb, var(--theam-color) 15%, #fff); color: var(--theam-color); }
.post-format__badge--podcast { background: color-mix(in srgb, #6f42c1 15%, #fff); color: #6f42c1; }

.post-format__meta {
    font-size: 13px;
    color: var(--ui-text-muted);
    margin-right: 0.5rem;
}

.post-format__empty-text {
    font-size: 13px;
    color: var(--ui-text-muted);
    margin: 0.5rem 0 0;
}

.post-format-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ui-radius-lg);
    overflow: hidden;
    background: #0f172a;
    box-shadow: var(--ui-shadow-md);
}

.post-format-video__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-format-podcast--audio {
    background: var(--ui-surface-muted);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 1rem 1.25rem;
}

.post-format-podcast__label {
    font-size: 13px;
    font-weight: 700;
    color: #6f42c1;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.post-format-podcast__audio {
    width: 100%;
}

.post-format-podcast--embed {
    border-radius: var(--ui-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ui-border);
    min-height: 152px;
}

.post-format-podcast__iframe {
    width: 100%;
    min-height: 152px;
    border: 0;
    display: block;
}

/* ── Gallery (inline in content + format gallery) ── */
.post-format--gallery {
    margin: 1.25rem 0 1.5rem;
    clear: both;
}

.single_page .text .post-format--gallery,
.single_page .text .post-gallery-grid {
    float: none;
    width: 100%;
}

.single_page .text .post-gallery-grid figure,
.single_page .text .post-gallery-grid__item {
    margin: 0;
    float: none;
    width: auto;
    max-width: none;
}

.single_page .text .post-gallery-grid img,
.single_page .text .post-gallery-grid__img {
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.post-gallery-grid {
    display: grid;
    gap: 0.75rem;
    width: 100%;
    clear: both;
}

.post-gallery-grid--cols-2,
.post-gallery-grid[data-cols="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-gallery-grid--cols-3,
.post-gallery-grid[data-cols="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-gallery-grid--cols-4,
.post-gallery-grid[data-cols="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* گالری‌های قدیمی بدون تنظیمات */
.post-gallery-grid:not([class*="post-gallery-grid--cols-"]):not([data-cols]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-gallery-grid:not([class*="post-gallery-grid--size-"]):not([data-size]) .post-gallery-grid__link {
    aspect-ratio: 4 / 3;
}

.post-gallery-grid--size-sm .post-gallery-grid__link,
.post-gallery-grid[data-size="sm"] .post-gallery-grid__link {
    aspect-ratio: 1 / 1;
}

.post-gallery-grid--size-md .post-gallery-grid__link,
.post-gallery-grid[data-size="md"] .post-gallery-grid__link {
    aspect-ratio: 4 / 3;
}

.post-gallery-grid--size-lg .post-gallery-grid__link,
.post-gallery-grid[data-size="lg"] .post-gallery-grid__link {
    aspect-ratio: 3 / 2;
}

.post-gallery-grid--size-xl .post-gallery-grid__link,
.post-gallery-grid[data-size="xl"] .post-gallery-grid__link {
    aspect-ratio: 16 / 9;
}

.post-gallery-grid__item {
    margin: 0;
    min-width: 0;
}

.post-gallery-grid__link {
    display: block;
    border-radius: var(--ui-radius-md);
    overflow: hidden;
    background: var(--ui-surface-muted);
    border: 1px solid var(--ui-border);
    line-height: 0;
    transition: box-shadow var(--ui-transition), border-color var(--ui-transition);
}

.post-gallery-grid__link:hover {
    border-color: color-mix(in srgb, var(--theam-color) 35%, var(--ui-border));
    box-shadow: var(--ui-shadow-sm);
}

.post-gallery-grid__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.post-gallery-grid__link:hover .post-gallery-grid__img {
    transform: scale(1.03);
}

@media (max-width: 767.98px) {
    .post-gallery-grid--cols-4,
    .post-gallery-grid[data-cols="4"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-gallery-grid--cols-3,
    .post-gallery-grid[data-cols="3"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 479.98px) {
    .post-gallery-grid--cols-4,
    .post-gallery-grid--cols-3,
    .post-gallery-grid--cols-2,
    .post-gallery-grid[data-cols="4"],
    .post-gallery-grid[data-cols="3"],
    .post-gallery-grid[data-cols="2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
}

.content-format--video .content-single__hero,
.content-format--podcast .content-single__hero,
.content-format--gallery .content-single__hero {
    margin-bottom: 1rem;
}

@media (max-width: 991.98px) {
    .content-sidebar__sticky {
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible;
    }
}

/* ── Legacy CMS pages (about-us, contact-us, comment shell) ── */
.single_page_color .title {
    text-align: center;
    background: var(--theam-color);
    padding: 1.25rem 0;
    border-radius: 0 0 var(--ui-radius-lg) var(--ui-radius-lg);
    margin-bottom: 1.5rem;
}

.single_page_color .title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.6;
}

.single_page {
    width: 100%;
    position: relative;
    padding-right: 1.5rem;
}

.single_page::before {
    content: "";
    background-color: var(--theam-color);
    position: absolute;
    width: 2px;
    top: 0;
    bottom: 0;
    right: 4px;
}

.single_page .text {
    direction: rtl;
    text-align: justify;
    line-height: 1.9;
    color: var(--ui-text);
}

.single_page .text img {
    max-width: 100%;
    height: auto;
    margin: 0.75rem 0;
    border-radius: var(--ui-radius-md);
}

.single_page .img_box img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

/* ── Contact page ── */
.contact-us label {
    width: 100%;
    margin: 1rem 0;
}

.contact-us .list-unstyled li {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--ui-border);
    margin-bottom: 1.25rem;
    border-radius: var(--ui-radius-lg);
}

.contact-us textarea {
    width: 100%;
    margin-bottom: 1rem;
}

.contact-us .btn-primary {
    float: left;
}

.contact-us .list-unstyled a {
    color: var(--theam-secend-color);
}

.contact-page-info li i {
    color: var(--theam-color, #0d6efd);
}

.soial-list ul li a i {
    font-size: 1.5rem;
    color: #fff;
}

/* ── Blog sidebar categories ── */
.sidebar {
    background: var(--theam-color);
    border-radius: var(--ui-radius-lg);
    margin-top: 1.25rem;
    width: 100%;
    padding: 0 1rem;
}

.categoryslider {
    width: 100%;
    padding-top: 1.5rem;
}

.categoryslider .title {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 600;
}

ul.categorylist {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0 1rem;
}

ul.categorylist li {
    line-height: 1.6;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, #fff 12%, var(--theam-color));
    border-radius: var(--ui-radius-md);
}

ul.categorylist li a {
    color: #fff;
    font-size: 0.95rem;
}

ul.categorylist li a h2 {
    margin: 0;
    font-size: inherit;
    font-weight: 500;
}
