/*
 * 60 Shasti | UI refresh
 * Version: 1.0.0
 * Mobile-first overrides for the existing ASP.NET MVC / Razor frontend.
 * Load this file AFTER /Resource/css/all-bundle.min.css.
 */

:root {
    --shasti-red: #ee002d;
    --shasti-red-dark: #c90027;
    --shasti-ink: #17191d;
    --shasti-text: #343941;
    --shasti-muted: #737b86;
    --shasti-line: #e8eaee;
    --shasti-surface: #ffffff;
    --shasti-page: #f5f6f8;
    --shasti-soft-red: #fff1f4;
    --shasti-radius: 16px;
    --shasti-radius-sm: 11px;
    --shasti-shadow: 0 10px 34px rgba(20, 25, 35, .055);
    --shasti-shadow-hover: 0 16px 38px rgba(20, 25, 35, .10);
    --shasti-content-width: 1180px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    direction: rtl;
    background: var(--shasti-page);
    color: var(--shasti-text);
    font-family: IRANSans, Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.9;
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after {
    box-sizing: border-box;
}

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

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

a:hover {
    color: var(--shasti-red);
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
}

:focus-visible {
    outline: 3px solid rgba(238, 0, 45, .28);
    outline-offset: 3px;
}

/* Global frame */
body > header {
    float: none;
    display: block;
    width: 100%;
    padding: 12px 0 0;
    background: var(--shasti-page);
}

body > header .container {
    max-width: var(--shasti-content-width);
    padding-top: 0 !important;
}

body > header .container > .d-flex {
    min-height: 72px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid var(--shasti-line);
    border-radius: var(--shasti-radius);
    background: var(--shasti-surface);
    box-shadow: 0 4px 18px rgba(20, 25, 35, .035);
}

body > header ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

body > header ul li {
    max-width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
}

body > header ul li a {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    justify-content: center;
}

body > header ul li img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

body > .container {
    max-width: var(--shasti-content-width);
}

.page {
    margin-top: 16px !important;
}

.content {
    min-width: 0;
}

.Bodynews {
    margin-right: 0;
    margin-left: 0;
}

.Bodynews > [class*="col-"] {
    min-width: 0;
}

.main-section {
    min-width: 0;
    padding: 0 !important;
    overflow: visible !important;
    border: 1px solid var(--shasti-line);
    border-radius: 20px;
    background: var(--shasti-surface);
    box-shadow: var(--shasti-shadow) !important;
}

.main-section > * {
    min-width: 0;
    padding: clamp(14px, 2.4vw, 30px) !important;
}

/* Archive */
.main-section h6.border-bottom {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    padding: 0 0 14px !important;
    border-bottom: 1px solid var(--shasti-line) !important;
    color: var(--shasti-ink);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.6;
}

.main-section h6.border-bottom i {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--shasti-soft-red);
    color: var(--shasti-red);
    font-size: 15px;
}

.main-section .card {
    display: block;
    margin: 0 0 14px !important;
    overflow: hidden;
    border: 1px solid var(--shasti-line);
    border-radius: var(--shasti-radius);
    background: var(--shasti-surface);
    box-shadow: 0 3px 14px rgba(20, 25, 35, .025);
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.main-section .card:hover {
    border-color: rgba(238, 0, 45, .22);
    box-shadow: var(--shasti-shadow-hover);
    transform: translateY(-2px);
}

.main-section .card > .row {
    align-items: stretch;
    margin: 0;
}

.main-section .card > .row > [class*="col-"] {
    min-width: 0;
    padding: 0;
}

.main-section .card > .row > [class*="col-"]:first-child a {
    display: block;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background: #eceef1;
}

.main-section .card > .row > [class*="col-"]:first-child img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    transition: transform .45s ease;
}

.main-section .card:hover > .row > [class*="col-"]:first-child img {
    transform: scale(1.035);
}

.main-section .card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 18px 20px;
}

.main-section .card .card-title {
    margin: 0 0 9px;
    color: var(--shasti-ink);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.85;
}

.main-section .card .card-title a {
    color: inherit;
}

.main-section .card .card-title a:hover {
    color: var(--shasti-red);
}

.main-section .card .card-text {
    margin: 0 0 12px;
    color: var(--shasti-muted);
    font-size: 13px;
    line-height: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.main-section .card .card-subtitle {
    align-self: flex-start;
    margin: 0 !important;
    color: #8b929c !important;
    font-size: 11px;
    font-weight: 500;
}

.main-section .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 24px 0 4px;
    padding: 0;
}

.main-section .pagination > li {
    margin: 0;
}

.main-section .pagination > li > a,
.main-section .pagination > li > span {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border: 1px solid var(--shasti-line);
    border-radius: 10px;
    background: #fff;
    color: var(--shasti-text);
    font-size: 12px;
}

.main-section .pagination > li.active > a,
.main-section .pagination > li.active > span,
.main-section .pagination > li > a:hover {
    border-color: var(--shasti-red);
    background: var(--shasti-red);
    color: #fff;
}

/* Article page */
.news-item-wrapper {
    padding: clamp(14px, 3vw, 34px) !important;
    color: var(--shasti-text);
    text-align: right !important;
    overflow-wrap: anywhere;
}

.news-item-wrapper .bock-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 18px;
    margin: 0 0 22px !important;
    padding: 0 0 14px !important;
    border-bottom: 1px solid var(--shasti-line) !important;
    color: var(--shasti-muted);
    font-size: 11px;
    line-height: 1.8;
}

.news-item-wrapper .bock-tools > div {
    margin: 0 !important;
}

.news-item-wrapper > .row {
    align-items: center;
    margin-right: -10px;
    margin-left: -10px;
    row-gap: 18px;
}

.news-item-wrapper > .row > [class*="col-"] {
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
}

.news-item-wrapper > .row img {
    display: block;
    width: 100% !important;
    max-height: 430px;
    object-fit: cover;
    border-radius: var(--shasti-radius);
    background: #eceef1;
}

.news-item-wrapper > .row p.text-muted {
    margin: 0 0 7px;
    color: var(--shasti-red) !important;
    font-size: 13px;
    font-weight: 700;
}

.news-item-wrapper > .row h2 {
    margin: 0 0 14px !important;
    color: var(--shasti-ink);
    font-size: clamp(22px, 2.6vw, 32px);
    font-weight: 800;
    line-height: 1.8;
    letter-spacing: -.35px;
}

.news-item-wrapper > .row p.text-black-50 {
    margin: 0;
    color: #606873 !important;
    font-size: 15px;
    font-weight: 500;
    line-height: 2.2;
}

.news-item-wrapper .news-item-content {
    margin: 24px 0 0;
    color: #343941;
    font-size: 15px;
    font-weight: 400 !important;
    line-height: 2.35;
    text-align: justify;
    overflow-wrap: anywhere;
}

.news-item-wrapper .news-item-content > * {
    max-width: 100%;
}

.news-item-wrapper .news-item-content p {
    margin: 0 0 1.35em;
    line-height: inherit;
}

.news-item-wrapper .news-item-content h1,
.news-item-wrapper .news-item-content h2,
.news-item-wrapper .news-item-content h3,
.news-item-wrapper .news-item-content h4,
.news-item-wrapper .news-item-content h5 {
    margin: 1.7em 0 .65em;
    color: var(--shasti-ink);
    font-weight: 800;
    line-height: 1.8;
}

.news-item-wrapper .news-item-content h2 { font-size: 23px; }
.news-item-wrapper .news-item-content h3 { font-size: 20px; }
.news-item-wrapper .news-item-content h4 { font-size: 17px; }

.news-item-wrapper .news-item-content img {
    display: block;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 22px auto;
    border-radius: 12px;
}

.news-item-wrapper .news-item-content iframe,
.news-item-wrapper .news-item-content video,
.news-item-wrapper video {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 20px auto;
    border: 0;
    border-radius: 14px;
    background: #111;
}

.news-item-wrapper .news-item-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.news-item-wrapper .news-item-content th,
.news-item-wrapper .news-item-content td {
    padding: 9px 12px;
    border: 1px solid var(--shasti-line);
}

.news-item-wrapper .news-item-content blockquote {
    margin: 22px 0;
    padding: 14px 18px;
    border-right: 3px solid var(--shasti-red);
    border-radius: 0 10px 10px 0;
    background: #faf1f3;
    color: #4d535c;
}

.news-item-wrapper .news-item-tag-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 18px 0 0;
    color: var(--shasti-muted);
    font-size: 12px;
    line-height: 1.8;
}

.news-item-wrapper .news-item-tag-wrapper span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin: 0;
    padding: 3px 11px;
    border: 1px solid #f1cbd4;
    border-radius: 999px;
    background: var(--shasti-soft-red);
    color: #a80020;
    font-size: 11px;
    transition: background .2s ease, border-color .2s ease;
}

/* Article share controls */
.news-item-wrapper > div[style*="display: flex"] {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.news-item-wrapper .social-menu-right {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 48px;
    overflow: visible;
}

.news-item-wrapper .social-menu-right .social-trigger {
    width: 44px;
    height: 44px;
    border: 1px solid var(--shasti-line);
    border-radius: 50% !important;
    background: #fff;
    box-shadow: 0 3px 12px rgba(20, 25, 35, .06);
}

.news-item-wrapper .social-menu-right .social-trigger img {
    width: 19px;
    height: 19px;
    object-fit: contain;
}

.news-item-wrapper .social-menu-right.open .social-trigger {
    transform: none;
    background: var(--shasti-soft-red);
    border-color: #f1cbd4;
}

.news-item-wrapper .social-menu-right .social-list {
    z-index: 5;
    left: auto;
    right: 52px;
    top: 50%;
    gap: 5px;
    padding: 4px 7px;
    border: 1px solid var(--shasti-line);
    border-radius: 999px;
    box-shadow: var(--shasti-shadow);
    transform: translateY(-50%);
}

.news-item-wrapper .social-menu-right.open .social-list {
    max-width: min(280px, calc(100vw - 100px));
}

.news-item-wrapper .social-menu-right .social-item {
    width: 38px;
    height: 38px;
    background: transparent;
}

/* Footer */
body > footer {
    width: 100%;
    height: auto;
    margin-top: 28px;
    padding: 32px 0 24px !important;
    border-top: 1px solid var(--shasti-line);
    background: #fff;
    text-align: center;
}

body > footer .container {
    max-width: var(--shasti-content-width);
}

body > footer img {
    display: inline-block;
    width: 150px;
    max-width: 45%;
    height: auto;
    margin-bottom: 14px !important;
    object-fit: contain;
}

body > footer .social-box {
    margin: 8px 0 16px;
}

body > footer .social-box .d-flex {
    flex-wrap: wrap;
    gap: 10px;
}

body > footer .social-box a {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--shasti-line);
    border-radius: 50%;
    background: #fff;
    color: var(--shasti-ink);
}

body > footer .social-box a:hover {
    border-color: #f1cbd4;
    background: var(--shasti-soft-red);
    color: var(--shasti-red);
}

body > footer p {
    max-width: 760px;
    margin: 0 auto 10px;
    color: var(--shasti-muted) !important;
    font-size: 12px;
    line-height: 2.1;
}

body > footer .tarnama a {
    color: #8b929c;
    font-size: 11px;
}

body > footer .tarnama a:hover {
    color: var(--shasti-red) !important;
}

/* Back-to-top */
#back-to-top-btn {
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: var(--shasti-red);
    color: #fff;
    box-shadow: 0 8px 22px rgba(238, 0, 45, .22);
    font-size: 16px;
    transition: transform .2s ease, background-color .2s ease;
}

#back-to-top-btn:hover {
    background: var(--shasti-red-dark);
    transform: translateY(-3px);
}

/* Responsive refinements: tablet */
@media (max-width: 991.98px) {
    body > .container,
    body > header .container {
        max-width: 100%;
    }

    .page {
        margin-top: 12px !important;
    }

    .main-section {
        border-radius: 16px;
    }

    .news-item-wrapper > .row img {
        max-height: 390px;
    }
}

/* Mobile-first finishing */
@media (max-width: 767.98px) {
    body {
        font-size: 13px;
        line-height: 1.85;
    }

    body > header {
        padding: 8px 0 0;
    }

    body > header .container {
        padding-right: 12px;
        padding-left: 12px;
    }

    body > header .container > .d-flex {
        min-height: 54px;
        padding: 7px;
        border-radius: 12px;
    }

    body > header ul {
        gap: 6px;
    }

    body > header ul li img {
        max-height: 76px;
        width: auto;
    }

    body > .container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .page {
        margin-top: 10px !important;
    }

    .Bodynews {
        margin-right: 0;
        margin-left: 0;
    }

    .Bodynews > [class*="col-"] {
        padding-right: 0;
        padding-left: 0;
    }

    .main-section {
        border-radius: 14px;
        box-shadow: 0 5px 20px rgba(20, 25, 35, .045) !important;
    }

    .main-section > * {
        padding: 14px !important;
    }

    .main-section h6.border-bottom {
        margin-bottom: 13px;
        padding-bottom: 11px !important;
        font-size: 16px;
    }

    .main-section .card {
        margin-bottom: 12px !important;
        border-radius: 13px;
    }

    .main-section .card > .row {
        display: flex;
        flex-direction: column;
    }

    .main-section .card > .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .main-section .card > .row > [class*="col-"]:first-child a {
        height: auto;
    }

    .main-section .card > .row > [class*="col-"]:first-child img {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    .main-section .card .card-body {
        padding: 13px 14px 14px;
    }

    .main-section .card .card-title {
        margin-bottom: 6px;
        font-size: 15px;
        line-height: 1.85;
    }

    .main-section .card .card-text {
        margin-bottom: 8px;
        font-size: 12px;
        line-height: 1.9;
        -webkit-line-clamp: 2;
    }

    .main-section .pagination {
        gap: 5px;
        margin-top: 18px;
    }

    .main-section .pagination > li > a,
    .main-section .pagination > li > span {
        min-width: 35px;
        min-height: 35px;
        padding: 5px 9px;
        border-radius: 9px;
    }

    .news-item-wrapper {
        padding: 14px !important;
    }

    .news-item-wrapper .bock-tools {
        gap: 5px 12px;
        margin-bottom: 16px !important;
        padding-bottom: 11px !important;
        font-size: 10px;
    }

    .news-item-wrapper > .row {
        margin-right: 0;
        margin-left: 0;
        row-gap: 13px;
    }

    .news-item-wrapper > .row > [class*="col-"] {
        padding-right: 0;
        padding-left: 0;
    }

    .news-item-wrapper > .row img {
        width: 100% !important;
        max-height: none;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 12px;
    }

    .news-item-wrapper > .row h2 {
        margin-bottom: 8px !important;
        font-size: 22px;
        line-height: 1.75;
    }

    .news-item-wrapper > .row p.text-muted {
        font-size: 12px;
    }

    .news-item-wrapper > .row p.text-black-50 {
        font-size: 13px;
        line-height: 2.05;
    }

    .news-item-wrapper .news-item-content {
        margin-top: 18px;
        font-size: 14px;
        line-height: 2.2;
        text-align: right;
    }

    .news-item-wrapper .news-item-content h2 { font-size: 20px; }
    .news-item-wrapper .news-item-content h3 { font-size: 18px; }
    .news-item-wrapper .news-item-content h4 { font-size: 16px; }

    .news-item-wrapper .news-item-content img {
        margin: 16px auto;
        border-radius: 10px;
    }

    .news-item-wrapper .news-item-content iframe,
    .news-item-wrapper .news-item-content video,
    .news-item-wrapper video {
        margin: 16px auto;
        border-radius: 10px;
    }

    .news-item-wrapper > div[style*="display: flex"] {
        align-items: flex-start;
        justify-content: space-between !important;
        gap: 8px;
    }

    .news-item-wrapper .news-item-tag-wrapper {
        flex: 1 1 100%;
        gap: 6px;
        margin-top: 12px;
    }

    .news-item-wrapper .social-menu-right {
        min-height: 44px;
    }

    .news-item-wrapper .social-menu-right .social-list {
        right: 48px;
    }

    body > footer {
        margin-top: 18px;
        padding: 24px 12px 18px !important;
    }

    body > footer img {
        width: 128px;
    }

    body > footer p {
        font-size: 11px;
    }

    #back-to-top-btn {
        right: 12px;
        bottom: 12px;
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}

/* Narrow phones */
@media (max-width: 359.98px) {
    body > .container {
        padding-right: 9px;
        padding-left: 9px;
    }

    .main-section > * {
        padding: 11px !important;
    }

    .news-item-wrapper {
        padding: 11px !important;
    }

    .news-item-wrapper > .row h2 {
        font-size: 20px;
    }

    .main-section .card .card-title {
        font-size: 14px;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
