@font-face {
    font-family: 'Vazir';
    src: url('../assets/fonts/Vazir.woff2') format('woff2'),
         url('../assets/fonts/Vazir.woff') format('woff'),
         url('../assets/fonts/Vazir.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.62);
    --card-bg-strong: rgba(13, 13, 13, 0.92);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(0, 255, 136, 0.22);

    --primary: #00ff88;
    --primary-dark: #00c96d;
    --primary-glow: rgba(0, 255, 136, 0.18);

    --accent: #7000ff;
    --accent-glow: rgba(112, 0, 255, 0.18);

    --text-main: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #777777;

    --danger: #ff2a6d;
    --warning: #ffc107;

    --font-main: 'Vazir', sans-serif;

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;

    --container-width: 1200px;
    --shadow-dark: 0 20px 60px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 255, 136, 0.055) 0%, transparent 38%),
        radial-gradient(circle at 90% 75%, rgba(112, 0, 255, 0.09) 0%, transparent 36%),
        linear-gradient(180deg, #050505 0%, #080808 100%);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.8;
    overflow-x: hidden;
}

img,
video {
    max-width: 100%;
}

button,
input {
    font-family: inherit;
}

.news-header {
    width: 100%;
    padding: clamp(55px, 8vw, 95px) 16px clamp(35px, 5vw, 60px);
    text-align: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(5,5,5,0.95) 0%, rgba(5,5,5,0.35) 100%);
}

.news-header::before {
    content: '';
    position: absolute;
    width: min(520px, 80vw);
    height: min(520px, 80vw);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,255,136,0.12), transparent 60%);
    top: -260px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.news-header-content {
    width: min(920px, 100%);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.news-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border: 1px solid rgba(0, 255, 136, 0.45);
    color: var(--primary);
    border-radius: 999px;
    font-size: clamp(11px, 2vw, 13px);
    background: rgba(0, 255, 136, 0.06);
    letter-spacing: 1px;
    margin-bottom: 18px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.05);
}

.news-header h1 {
    font-size: clamp(26px, 5.5vw, 44px);
    line-height: 1.45;
    margin-bottom: 14px;
    text-shadow: 0 0 30px var(--primary-glow);
    letter-spacing: -0.8px;
}

.news-subtitle {
    color: var(--text-secondary);
    font-size: clamp(14px, 2.4vw, 17px);
    max-width: 760px;
    margin: 0 auto;
}

.news-container {
    width: min(var(--container-width), calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(15px, 3vw, 24px) 0;
}

.featured-news {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: clamp(18px, 3vw, 32px);
    align-items: center;
    margin: clamp(20px, 4vw, 38px) 0 clamp(35px, 5vw, 58px);
    background:
        linear-gradient(145deg, rgba(20,20,20,0.9), rgba(15,15,15,0.62));
    border: 1px solid var(--card-border);
    border-radius: clamp(18px, 3vw, 26px);
    padding: clamp(18px, 3.3vw, 32px);
    box-shadow: var(--shadow-dark);
    overflow: hidden;
    position: relative;
}

.featured-news::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent, rgba(0,255,136,0.045), transparent);
    pointer-events: none;
}

.featured-content,
.featured-media {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.featured-meta,
.news-meta,
.modal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.category,
.date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: clamp(11px, 2vw, 12px);
    white-space: nowrap;
}

.category {
    background: rgba(0, 255, 136, 0.09);
    color: var(--primary);
    border: 1px solid rgba(0, 255, 136, 0.26);
}

.date {
    background: rgba(255,255,255,0.045);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.featured-content h2 {
    font-size: clamp(22px, 4vw, 33px);
    margin-bottom: 14px;
    line-height: 1.55;
    word-break: break-word;
}

.featured-excerpt {
    color: var(--text-secondary);
    font-size: clamp(14px, 2.4vw, 16px);
    margin-bottom: 20px;
    text-align: justify;
}

.featured-media {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
}

.featured-media img,
.featured-media video {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 430px;
    object-fit: cover;
    display: block;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    /*background: #000;*/
}

.text-only-box,
.text-news-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(0,255,136,0.12), transparent 35%),
        linear-gradient(145deg, rgba(112,0,255,0.16), rgba(0,255,136,0.08));
    border: 1px solid var(--card-border);
    border-radius: 18px;
    color: var(--text-main);
    font-size: clamp(14px, 3vw, 18px);
    letter-spacing: 2px;
    text-align: center;
}

.hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.hashtags span {
    color: #d6d6d6;
    background: rgba(255,255,255,0.052);
    border: 1px solid var(--card-border);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: clamp(11px, 2vw, 12px);
    line-height: 1.7;
    max-width: 100%;
    word-break: break-word;
}

.news-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    padding: 16px 0;
}

.toolbar-title {
    min-width: 0;
}

.toolbar-title h3 {
    color: var(--text-main);
    font-size: clamp(21px, 3vw, 25px);
    margin-bottom: 4px;
}

.toolbar-title p {
    color: var(--text-secondary);
    font-size: clamp(13px, 2vw, 14px);
}

.toolbar-search {
    width: min(360px, 100%);
    flex-shrink: 0;
}

.toolbar-search input {
    width: 100%;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 13px 16px;
    border-radius: 15px;
    outline: none;
    font-size: 14px;
    transition: 0.3s ease;
}

.toolbar-search input::placeholder {
    color: var(--text-muted);
}

.toolbar-search input:focus {
    border-color: rgba(0, 255, 136, 0.38);
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.08);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2.4vw, 26px);
    margin-bottom: 65px;
}

.news-card {
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: clamp(17px, 2vw, 22px);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition:
        transform 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        background 0.35s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-7px);
    border-color: var(--card-border-hover);
    box-shadow: 0 20px 50px rgba(0,0,0,0.36);
    background: rgba(25, 25, 25, 0.72);
}

.news-media {
    width: 100%;
    overflow: hidden;
    background: #000;
}

.news-media img,
.news-media video {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    background: #000;
}

.news-body {
    padding: clamp(17px, 2.2vw, 23px);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.news-body h3 {
    font-size: clamp(17px, 2.5vw, 20px);
    margin-bottom: 10px;
    line-height: 1.65;
    word-break: break-word;
}

.news-body p {
    color: var(--text-secondary);
    font-size: clamp(13px, 2vw, 14px);
    margin-bottom: 17px;
    text-align: justify;
    line-height: 1.95;
}

.read-more-btn {
    width: 100%;
    margin-top: auto;
    border: none;
    border-radius: 14px;
    padding: 13px 15px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #03150d;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.25);
    filter: brightness(1.05);
}

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

.news-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    padding: 16px;
}

.news-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(7px);
}

.news-modal-content {
    position: relative;
    z-index: 2;
    width: min(900px, 100%);
    max-height: min(88vh, 900px);
    overflow-y: auto;
    background: var(--card-bg-strong);
    border: 1px solid var(--card-border);
    border-radius: clamp(18px, 3vw, 26px);
    padding: clamp(20px, 3vw, 32px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.48);
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,136,0.35) rgba(255,255,255,0.04);
}

.news-modal-content::-webkit-scrollbar {
    width: 7px;
}

.news-modal-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.04);
}

.news-modal-content::-webkit-scrollbar-thumb {
    background: rgba(0,255,136,0.32);
    border-radius: 20px;
}

.modal-close {
    position: sticky;
    top: 0;
    margin-right: auto;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(38px, 8vw, 44px);
    height: clamp(38px, 8vw, 44px);
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 5;
    transition: 0.25s ease;
}

.modal-close:hover {
    background: rgba(255, 42, 109, 0.15);
    border-color: rgba(255, 42, 109, 0.35);
    color: var(--danger);
}

.news-modal-content h2 {
    font-size: clamp(21px, 4vw, 29px);
    margin-bottom: 18px;
    line-height: 1.65;
    word-break: break-word;
}

.modal-media {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 18px;
    overflow: hidden;
}

.modal-media img,
.modal-media video {
    width: 100%;
    max-height: 480px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background: #000;
    display: block;
}

#modalText {
    color: var(--text-secondary);
    font-size: clamp(14px, 2.3vw, 15px);
    text-align: justify;
    line-height: 2.05;
    word-break: break-word;
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .featured-news {
        grid-template-columns: minmax(0, 1fr);
    }

    .featured-media {
        order: -1;
    }

    .featured-media img,
    .featured-media video {
        max-height: 390px;
    }
}

@media (max-width: 820px) {
    .news-container {
        width: min(100% - 24px, var(--container-width));
    }

    .news-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 10px 0 18px;
    }

    .toolbar-search {
        width: 100%;
    }

    .toolbar-title h3,
    .toolbar-title p {
        text-align: right;
    }

    .featured-news {
        margin-top: 12px;
    }

    .featured-meta,
    .news-meta,
    .modal-meta {
        gap: 7px;
    }

    .news-modal {
        padding: 12px;
    }

    .news-modal-content {
        max-height: 90vh;
    }
}

@media (max-width: 620px) {
    body {
        background-image:
            radial-gradient(circle at 15% 12%, rgba(0, 255, 136, 0.06) 0%, transparent 34%),
            radial-gradient(circle at 90% 88%, rgba(112, 0, 255, 0.08) 0%, transparent 36%);
    }

    .news-header {
        padding-top: 48px;
        padding-bottom: 32px;
    }

    .news-container {
        width: calc(100% - 20px);
    }

    .featured-news {
        padding: 16px;
        border-radius: 18px;
        gap: 17px;
    }

    .featured-media img,
    .featured-media video,
    .text-only-box {
        aspect-ratio: 16 / 11;
        max-height: none;
        border-radius: 15px;
    }

    .featured-excerpt {
        text-align: right;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .news-card {
        border-radius: 18px;
    }

    .news-card:hover {
        transform: none;
    }

    .news-media img,
    .news-media video,
    .text-news-placeholder {
        aspect-ratio: 16 / 10.5;
    }

    .news-body {
        padding: 17px;
    }

    .news-body p {
        text-align: right;
    }

    .hashtags {
        gap: 7px;
    }

    .category,
    .date,
    .hashtags span {
        font-size: 11px;
    }

    .toolbar-search input {
        padding: 13px 14px;
        border-radius: 13px;
    }

    .read-more-btn {
        padding: 13px 14px;
        border-radius: 13px;
    }

    .news-modal {
        padding: 9px;
        align-items: flex-end;
    }

    .news-modal-content {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        padding: 18px;
    }

    .modal-media img,
    .modal-media video {
        aspect-ratio: 16 / 10;
        max-height: none;
        border-radius: 15px;
    }

    .modal-close {
        position: sticky;
        top: 0;
        margin-bottom: 10px;
    }

    #modalText {
        text-align: right;
    }
}

@media (max-width: 420px) {
    .news-header {
        padding-left: 12px;
        padding-right: 12px;
    }

    .news-badge {
        padding: 6px 13px;
    }

    .news-container {
        width: calc(100% - 16px);
    }

    .featured-news {
        padding: 13px;
        border-radius: 16px;
    }

    .featured-content h2 {
        line-height: 1.65;
    }

    .featured-meta,
    .news-meta,
    .modal-meta {
        align-items: flex-start;
    }

    .category,
    .date {
        min-height: 28px;
        padding: 4px 10px;
    }

    .news-body {
        padding: 15px;
    }

    .news-body h3 {
        margin-bottom: 8px;
    }

    .news-body p {
        line-height: 1.9;
    }

    .hashtags span {
        padding: 4px 9px;
    }

    .news-modal-content {
        padding: 16px;
    }

    .modal-close {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
}

@media (max-width: 340px) {
    .news-header h1 {
        font-size: 23px;
    }

    .news-subtitle {
        font-size: 13px;
    }

    .featured-news {
        padding: 11px;
    }

    .news-body {
        padding: 13px;
    }

    .read-more-btn {
        font-size: 13px;
    }

    .category,
    .date,
    .hashtags span {
        font-size: 10.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

.views-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: clamp(11px, 2vw, 12px);
    white-space: nowrap;
    background: rgba(255,255,255,0.045);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    gap: 6px;
}

#modalHashtags {
    margin-bottom: 18px;
}

#modalText {
    white-space: pre-line;
}
