/*
 * Tamashagar design system (approved 2026-12-06).
 * Loaded after styles.css on every public page. It does not change the layout; it unifies
 * colours, radii, shadows, line-heights and adds subtle motion. Tokens mirror
 * ../local-dev/design/tokens.css (see CLAUDE.md "Design system").
 */

/* ---------- Font (licensed IRANSans, Persian digits) ---------- */
@font-face {
    font-family: 'IRANSans';
    src: url("../font/iransans/IRANSansWeb-FaNum-Regular.woff2") format("woff2");
    font-weight: 100 400;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url("../font/iransans/IRANSansWeb-FaNum-Medium.woff2") format("woff2");
    font-weight: 500 600;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url("../font/iransans/IRANSansWeb-FaNum-Bold.woff2") format("woff2");
    font-weight: 700 900;
    font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
    --color-brand: #e51c23;
    --color-brand-strong: #c8161d;
    --color-brand-on-dark: #ff5a5f;
    --gray-50: #f5f5f6; --gray-100: #eeeef0; --gray-200: #dee2e6; --gray-300: #c4c4ca; --gray-400: #9a9aa3;
    --gray-500: #6b6b73; --gray-600: #545456; --gray-700: #2b2b31; --gray-800: #202025; --gray-900: #0c0c0e;
    --color-white: #ffffff; --color-ink: #212121;
    --surface-page: var(--gray-900); --surface-raised: var(--gray-800); --surface-hover: var(--gray-700); --surface-card: var(--color-white);
    --text-on-light: var(--color-ink);
    --text-secondary-on-light: var(--gray-600);
    --text-muted-on-light: var(--gray-500);
    --text-on-dark: var(--color-white);
    --text-muted-on-dark: var(--gray-400);
    --border-light: var(--gray-200); --border-dark: var(--gray-700);
    --color-focus: #2196f3; --focus-ring: 2px solid var(--color-focus); --focus-offset: 2px;
    --color-success: #2e7d32; --color-info: #1976d2; --color-info-strong: #1565c0; --color-warning: #b45309;
    --font-sans: 'IRANSans', Vazir, Tahoma, sans-serif;
    --font-weight-regular: 400; --font-weight-medium: 500; --font-weight-bold: 700;
    --font-size-display: 20px; --font-size-title: 18px; --font-size-card-title: 15px; --font-size-body: 14px; --font-size-small: 13px; --font-size-meta: 12px;
    --line-height-display: 1.4; --line-height-title: 1.45; --line-height-card-title: 1.6; --line-height-body: 1.85; --line-height-small: 1.7; --line-height-meta: 1.6;
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
    --page-gutter: var(--space-4);
    --radius-sm: 3px; --radius-md: 6px; --radius-lg: 10px; --radius-pill: 999px; --radius-circle: 50%;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .24); --shadow-2: 0 4px 12px rgba(0, 0, 0, .24); --shadow-3: 0 12px 32px rgba(0, 0, 0, .36);
    --ease-out: cubic-bezier(.22, .61, .36, 1);
    --duration-fast: 150ms; --duration-base: 200ms; --duration-slow: 300ms;
}
@media (min-width: 768px) { :root { --page-gutter: var(--space-5); } }
@media (min-width: 1200px) { :root { --page-gutter: var(--space-6); } }

/* ---------- Base ---------- */
body {
    background-color: var(--surface-page);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a, button, input[type=submit], input[type=button] {
    transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, label[for]:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}
::selection { background: var(--color-brand); color: var(--color-white); }

/* ---------- Typography: unitless line-heights for Persian ---------- */
.newsContent p, .newsSummery, .videoContent p, .noteDayContent, .textComment {
    line-height: var(--line-height-body);
}
.newsItemSummery p, .someNewsItemText, .topPodcast p {
    line-height: var(--line-height-small);
}
.newsItemSummery h2 a, .someNewsItemTitle, .newVideoTitle a, .imageTitle a, .topPodcast h2 {
    line-height: var(--line-height-card-title);
}
.newsTitle {
    font-size: var(--font-size-title);
    line-height: var(--line-height-title);
}
.newsItemSummery h2 a, .newsTitle { font-weight: var(--font-weight-medium); }

/* ---------- Top bar: breaking news ("خبر فوری") ---------- */
.topHeader .middle,
.topHeader .middle * {
    background-color: var(--surface-raised);
}
.topHeader .middle p {
    background-color: var(--color-brand);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-2);
    line-height: 26px;
    white-space: nowrap;
}
.topHeader .middle a { color: var(--text-on-dark); }
.topHeader .right a:hover, .topHeader .right p:hover, .topHeader .middle a:hover { color: var(--color-brand-on-dark); }

/* ---------- Red text on dark surfaces ---------- */
.navBar .right a:hover, .navBar .left .menu a:hover, .navBar .left .menu a:hover i {
    color: var(--color-brand-on-dark);
}
/* Menu underline without the hover layout shift (was padding-bottom added on hover). */
.navBar .left .menu a {
    padding: 11px 0 10px; /* symmetric, so the label stays centred */
    border-bottom: 1px solid transparent;
}
.navBar .left .menu a:hover { border-bottom-color: var(--color-brand-on-dark); }

/* ---------- Surfaces: radii, shadow level 1, consistent dividers ---------- */
.LiveBox, .LiveBoxSidebar, .dayHashtak .box, .newsListContent > article, .newsItem, .newsContent,
.relatedNews, .videoList, .videoContent, .otherAlbum, .login-block, .register-block, .imageList .card,
.someNewsItem, .topPodcast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
}
.LiveBox, .LiveBoxSidebar { overflow: hidden; }
.newsItem {
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-5) var(--space-4);
}
.newsPublish { border-radius: var(--radius-pill); border-color: var(--border-light); }
.relatedNewsTitle, .otherAlbumTitle { border-radius: var(--radius-sm); }
.text { background: rgba(0, 0, 0, .6); }
hr { border: 0; border-top: 1px solid var(--border-dark); }
.newsContent hr, .videoContent hr { border-top-color: var(--border-light); }

/* Media */
.imageItem img, .newVideoImage, .newVideoImage video, .topPodcastImage > a img, .someNewsItemImage img,
.newsImage, .newsImage img {
    border-radius: var(--radius-md);
}
.imageItem .modalLink, .topPodcastImage > .modalLink, .someNewsItemImage {
    display: block;
    overflow: hidden;
    border-radius: var(--radius-md);
}
.newVideoImage { overflow: hidden; }

/* Controls */
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea,
.header .left .inputDiv {
    border-radius: var(--radius-sm);
}
button, input[type=submit], input[type=button], .loginButton, .moreNews {
    border-radius: var(--radius-sm);
}
.loginButton { background-color: var(--color-info-strong); }

/* Overlays */
.modal-content { border-radius: var(--radius-lg); box-shadow: var(--shadow-3); overflow: hidden; }
.imageItem .tooltiptext { box-shadow: var(--shadow-2); }

/* Brand red fills: one hover colour */
.LiveBox .rightBorder:hover, .moreNews:hover, .register-section .register-block .inputs input[type="button"]:hover {
    background-color: var(--color-brand-strong);
}

/* ---------- Mobile: tap targets and side gutters ---------- */
@media (max-width: 768px) {
    .navBar .left .menu a { display: inline-block; min-height: 40px; line-height: 40px; padding: 0; }
    .navBar .left label { min-width: 44px; min-height: 44px; }
}

/* Touch: grow small hit areas to >= 40px without moving anything */
@media (pointer: coarse) {
    .footerDown .link a, .footerDown .icon a, .LiveBox .leftSide a, .replyComment, [class^="viewReplis"], .tags a {
        position: relative;
    }
    .footerDown .link a::after, .footerDown .icon a::after, .LiveBox .leftSide a::after, .replyComment::after,
    [class^="viewReplis"]::after, .tags a::after {
        content: "";
        position: absolute;
        inset: -10px -6px;
    }
}

/* ---------- Skeleton loader (shimmer) ---------- */
.skeleton-list { padding-top: var(--space-4); }
.skeleton + .skeleton { margin-top: var(--space-4); }
.skeleton {
    display: block;
    height: 72px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%) 0 0 / 200% 100%;
    animation: ds-shimmer 1.4s linear infinite;
}

/* ---------- Motion ---------- */
@keyframes ds-shimmer { to { background-position: -200% 0; } }
@keyframes ds-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ds-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes ds-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* AJAX-appended items (news "more", galleries, videos, podcasts, comments) */
.newsItem, .imageItem, .newVideoItem, .topPodcast, .someNewsItem, .allComments .commentBody {
    animation: ds-rise var(--duration-slow) var(--ease-out) backwards;
}
.modal-content { animation: ds-pop var(--duration-base) var(--ease-out); }
#toggle:checked + .menu { animation: ds-drop var(--duration-base) var(--ease-out); }

@media (hover: hover) {
    .newsItem, .imageItem, .newVideoItem, .topPodcast, .someNewsItem {
        transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
    }
    .newsItem:hover, .newVideoItem:hover, .topPodcast:hover, .someNewsItem:hover, .imageItem:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-2);
    }
    .imageItem .modalLink img, .newVideoImage video, .topPodcastImage > .modalLink img, .someNewsItemImage img {
        transition: transform var(--duration-slow) var(--ease-out);
    }
    .imageItem:hover .modalLink img, .newVideoItem:hover .newVideoImage video,
    .topPodcast:hover .topPodcastImage > .modalLink img, .someNewsItem:hover .someNewsItemImage img {
        transform: scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
    .newsItem:hover, .newVideoItem:hover, .topPodcast:hover, .someNewsItem:hover, .imageItem:hover,
    .imageItem:hover .modalLink img, .newVideoItem:hover .newVideoImage video,
    .topPodcast:hover .topPodcastImage > .modalLink img, .someNewsItem:hover .someNewsItemImage img {
        transform: none;
    }
}

/* ---------- Empty state (live-results widgets) ---------- */
.liveEmpty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    line-height: var(--line-height-small);
}
.LiveBoxSidebar .liveEmpty { min-height: 120px; }
.liveEmpty::before {
    content: "\f1e3"; /* FontAwesome futbol-o */
    font-family: FontAwesome;
    font-size: 28px;
    line-height: 1;
    color: var(--gray-300);
}

/* ---------- Accessibility helpers ---------- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 2000;
    padding: var(--space-2) var(--space-4);
    background: var(--color-white);
    color: var(--color-ink);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-body);
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; outline: var(--focus-ring); outline-offset: var(--focus-offset); }
#main-content:focus { outline: none; }

/* ---------- Mobile header (<= 768px), Claude Design "Tamashagar mobile header" ---------- */
.mh-bar, .mh-search, .mh-strip { display: none; }

@media (max-width: 768px) {
    :root { --mh-height: 56px; --mh-gutter: var(--space-3); }
    .header {
        position: sticky;
        top: 0;
        z-index: 1100;
        display: block;
        width: 100%;
        padding: 0;
        margin: 0;
        background: var(--surface-raised);
    }
    .header > .right, .header > .middle, .header > .left { display: none; }

    .mh-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2);
        height: var(--mh-height);
        box-sizing: border-box;
        padding: 0 var(--mh-gutter);
        border-bottom: 1px solid var(--border-dark);
    }
    .mh-logo { display: flex; align-items: center; height: 44px; }
    .mh-logo img { display: block; height: 38px; width: auto; }
    .mh-actions { display: flex; align-items: center; gap: var(--space-1); }
    .mh-live {
        display: flex;
        align-items: center;
        gap: 6px;
        height: 32px;
        padding: 0 var(--space-3);
        margin-left: var(--space-1);
        background: var(--surface-hover);
        border-radius: var(--radius-pill);
        color: var(--text-on-dark);
        font-size: var(--font-size-small);
        font-weight: var(--font-weight-medium);
    }
    .mh-dot {
        width: 8px; height: 8px;
        border-radius: var(--radius-circle);
        background: #43a047;
        box-shadow: 0 0 0 3px rgba(67, 160, 71, .25);
    }
    .mh-btn, .mh-submit {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px; height: 44px;
        padding: 0;
        border: 0;
        border-radius: var(--radius-md);
        background: transparent;
        color: var(--text-on-dark);
        cursor: pointer;
    }
    .mh-btn[aria-expanded="true"] { background: var(--surface-hover); }
    #mhMenuBtn[aria-expanded="true"] { background: transparent; }
    .mh-ico-close, #mhMenuBtn[aria-expanded="true"] .mh-ico-open { display: none; }
    #mhMenuBtn[aria-expanded="true"] .mh-ico-close { display: block; }

    .mh-search:not([hidden]) {
        display: flex;
        gap: var(--space-2);
        padding: var(--space-2) var(--mh-gutter);
        border-bottom: 1px solid var(--border-dark);
        animation: ds-drop var(--duration-base) var(--ease-out);
    }
    .mh-search select, .mh-search input {
        height: 44px;
        box-sizing: border-box;
        background: var(--surface-hover);
        color: var(--text-on-dark);
        border: 1px solid var(--gray-600);
        border-radius: var(--radius-md);
        font-family: var(--font-sans);
    }
    .mh-search select { width: 104px; flex: 0 0 104px; padding: 0 var(--space-2); font-size: var(--font-size-body); }
    .mh-search input { flex: 1 1 auto; min-width: 0; padding: 0 var(--space-3); font-size: 16px; }
    .mh-search input::placeholder { color: var(--text-muted-on-dark); }
    .mh-search input:focus-visible, .mh-search input:focus { outline: 0; border: 2px solid var(--color-focus); }
    .mh-submit { background: var(--color-brand); flex: 0 0 44px; }

    .mh-strip {
        display: block;
        background: var(--surface-page);
        border-bottom: 1px solid var(--surface-raised);
    }
    .mh-chips {
        display: flex;
        gap: var(--space-2);
        margin: 0;
        padding: var(--space-2) var(--mh-gutter);
        list-style: none;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 var(--mh-gutter);
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .mh-chips::-webkit-scrollbar { display: none; }
    .mh-chip { flex: 0 0 auto; scroll-snap-align: start; }
    .mh-chip a {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 168px;
        box-sizing: border-box;
        padding: 6px 10px;
        background: var(--surface-raised);
        border-radius: var(--radius-md);
        color: var(--text-on-dark);
    }
    .mh-meta { font-size: var(--font-size-meta); color: var(--text-muted-on-dark); white-space: nowrap; line-height: var(--line-height-meta); }
    .mh-meta b { color: var(--color-brand-on-dark); font-weight: var(--font-weight-medium); }
    .mh-line { display: flex; gap: 6px; font-size: var(--font-size-small); white-space: nowrap; line-height: var(--line-height-small); }
    .mh-line small { font-size: var(--font-size-meta); color: var(--text-muted-on-dark); }

    /* Menu panel: the shared nav (fragments/menu.html), opened by #mhMenuBtn. */
    .navBar .left label, #toggle { display: none !important; }
    .navBar {
        position: fixed;
        top: var(--mh-height);
        left: 0; right: 0;
        z-index: 1090;
        display: none;
        height: auto;
        max-height: calc(100vh - var(--mh-height));
        max-height: calc(100dvh - var(--mh-height));
        overflow-y: auto;
        padding: 0;
        background: var(--surface-raised);
        box-shadow: var(--shadow-3);
    }
    .navBar.is-open { display: block; animation: ds-drop var(--duration-base) var(--ease-out); }
    .navBar .left .menu {
        display: flex;
        flex-flow: row wrap;
        width: 100%;
        margin: 0;
        padding: 0;
        text-align: start;
        animation: none;
    }
    .navBar .left .menu > li { flex: 0 0 100%; order: 1; }
    .navBar .left .menu .menuItem {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        height: 48px;
        min-height: 0;
        line-height: normal;
        padding: 0 var(--space-4);
        border-bottom: 1px solid var(--border-dark);
        font-size: 15px;
    }
    .navBar .left .menu .menuItem.active { color: var(--color-brand-on-dark); }
    .navBar .left .menu img.live { display: none; }
    .navBar .left .menu a[href$="/live"]::after {
        content: "";
        width: 8px; height: 8px;
        border-radius: var(--radius-circle);
        background: #43a047;
    }
    .navBar .menu .mobileOnly { display: block; }
    .navBar .left .menu > li.mh-acct { flex: 1 1 0; order: 2; padding: var(--space-3) var(--space-4) 0 var(--space-1); }
    .navBar .left .menu > li.mh-acct + li.mh-acct { padding: var(--space-3) var(--space-1) 0 var(--space-4); }
    .navBar .left .menu li.mh-acct .menuItem {
        justify-content: center;
        height: 44px;
        padding: 0;
        border: 1px solid var(--gray-600);
        border-radius: var(--radius-md);
        font-size: var(--font-size-body);
    }
    .navBar .left .menu li.mh-acct.mh-primary .menuItem { background: var(--color-brand); border-color: var(--color-brand); }
    .navBar .right {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: var(--space-1);
        padding: var(--space-2) var(--space-4) var(--space-3);
        color: var(--text-muted-on-dark);
        font-size: var(--font-size-small);
    }
    .navBar .right::before { content: "ما را دنبال کنید:"; }
    .navBar .right a[href="#"] { display: none; }
    .navBar .right a { padding: var(--space-3); color: var(--text-on-dark); }
    .mh-backdrop {
        position: fixed;
        inset: var(--mh-height) 0 0 0;
        z-index: 1080;
        background: rgba(0, 0, 0, .55);
        animation: ds-fade var(--duration-base) var(--ease-out);
    }
    html.mh-lock, html.mh-lock body { overflow: hidden; }
}
@media (min-width: 600px) and (max-width: 768px) {
    :root { --mh-gutter: var(--space-5); }
}
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }
@media (hover: hover) and (max-width: 768px) {
    .mh-btn:hover, .mh-live:hover { background: var(--surface-hover); color: var(--text-on-dark); }
    .mh-chip a:hover { background: var(--surface-hover); }
    .mh-submit:hover { background: var(--color-brand-strong); }
}
.termsContainer h1.termsTitle { text-align: center; font-size: 16px; font-weight: bold; margin: .83em 0; }

/* Headings demoted from h1 for a sane outline (one h1 per page); same look as the old h1 rules in styles.css. */
.hotNewsItem h2, .hotNewsItem h3 {
    font-size: 14px; min-height: 48px; max-height: 48px; overflow: hidden;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; display: -webkit-box;
}
.hotNewsItem h2 a, .hotNewsItem h3 a { color: #221e1f; }
.hotNewsItem h2 a:hover, .hotNewsItem h3 a:hover { color: var(--color-brand); }
.commentsSidebar h2 { width: 100%; border-bottom: 2px solid #545456; line-height: 0.1em; margin: 23px 0 20px; }
.commentsSidebar h2 span { background: #0c0c0e; padding: 0 0 0 15px; }
.text h2 { font-size: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 896px; }
.newVideoMeta li.metaSep { margin: 0; }

/* ---------- Desktop sticky header (> 768px), Claude Design "Tamashagar desktop sticky header" ---------- */
.sh-bar { display: none; }
@media (min-width: 769px) {
    html { scroll-padding-top: 64px; }
    .sh-bar {
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 1020; /* below Bootstrap/modal.js overlays (1040+) */
        display: block;
        height: 56px;
        box-sizing: border-box;
        background: var(--surface-raised);
        border-bottom: 1px solid var(--border-dark);
        box-shadow: var(--shadow-2);
        color: var(--text-on-dark);
        font-family: var(--font-sans);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-base);
    }
    .sh-bar[hidden] { display: none; }
    .sh-bar.is-visible { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
    .sh-inner {
        display: flex;
        align-items: center;
        gap: var(--space-4);
        max-width: 1152px;
        height: 100%;
        margin: 0 auto;
        padding: 0 var(--space-4);
        box-sizing: border-box;
    }
    .sh-logo { display: flex; align-items: center; height: 44px; flex: 0 0 auto; }
    .sh-logo img { display: block; height: 36px; width: auto; }
    .sh-nav { flex: 1 1 auto; min-width: 0; }
    .sh-nav ul { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
    .sh-nav a, .sh-acct a {
        display: flex;
        align-items: center;
        height: 36px;
        border-radius: var(--radius-md);
        color: var(--text-on-dark);
        font-weight: var(--font-weight-medium);
        text-decoration: none;
    }
    .sh-nav a { gap: 6px; padding: 0 var(--space-3); font-size: var(--font-size-body); }
    .sh-nav a[aria-current="page"] { color: var(--color-brand-on-dark); }
    .sh-dot { width: 8px; height: 8px; border-radius: var(--radius-circle); background: #43a047; box-shadow: 0 0 0 3px rgba(67, 160, 71, .25); }
    .sh-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 40px;
        width: 40px; height: 40px;
        padding: 0;
        border: 0;
        border-radius: var(--radius-md);
        background: transparent;
        color: var(--text-on-dark);
        cursor: pointer;
    }
    .sh-acct { display: flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; }
    .sh-acct a { padding: 0 14px; font-size: var(--font-size-small); border: 1px solid var(--gray-600); }
    .sh-acct a.sh-primary { background: var(--color-brand); border-color: var(--color-brand); }
    .sh-bar.is-searching .sh-nav, .sh-bar.is-searching #shSearchBtn { display: none; }
    .sh-search:not([hidden]) { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 auto; min-width: 0; animation: ds-fade var(--duration-base) var(--ease-out); }
    .sh-search select, .sh-search input {
        height: 40px;
        box-sizing: border-box;
        background: var(--surface-hover);
        color: var(--text-on-dark);
        border: 1px solid var(--gray-600);
        border-radius: var(--radius-md);
        font-family: var(--font-sans);
        font-size: var(--font-size-body);
    }
    .sh-search select { flex: 0 0 112px; width: 112px; padding: 0 var(--space-2); }
    .sh-search input { flex: 1 1 auto; min-width: 0; padding: 0 var(--space-3); }
    .sh-search input::placeholder { color: var(--text-muted-on-dark); }
    .sh-search input:focus { outline: 0; border: 2px solid var(--color-focus); }
    .sh-submit { background: var(--color-brand); }
    .sh-close { background: var(--surface-hover); }
    .sh-bar a:focus-visible, .sh-bar button:focus-visible, .sh-bar select:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
}
@media (min-width: 769px) and (max-width: 1100px) {
    .sh-inner { gap: var(--space-3); }
    .sh-nav a { padding: 0 var(--space-2); }
}
@media (hover: hover) and (min-width: 769px) {
    .sh-nav a:hover, .sh-btn:hover, .sh-acct a.sh-ghost:hover { background: var(--surface-hover); color: var(--text-on-dark); }
    .sh-nav a[aria-current="page"]:hover { color: var(--color-brand-on-dark); }
    .sh-submit:hover, .sh-acct a.sh-primary:hover { background: var(--color-brand-strong); }
}
@media (prefers-reduced-motion: reduce) {
    .sh-bar, .sh-bar.is-visible { transition: none; }
    .sh-search:not([hidden]) { animation: none; }
}

/* ---------- Full desktop header tidy (> 768px), Claude Design "Tamashagar desktop sticky header" ---------- */
#temperatureImage.img-fallback, #temperatureImage[src=""] { display: none; } /* no weather icon: hide, not a logo placeholder */
@media (min-width: 769px) {
    .header { align-items: center; gap: var(--space-5); padding: var(--space-5) 0; }
    .header > .right, .header > .left { flex: 1 1 0; min-width: 0; height: auto; justify-content: center; }
    .header > .middle { flex: 0 0 auto; align-items: center; margin: 0; }
    .header > .middle .logo { display: flex; }
    .header > .middle .logo img { display: block; }
    .header .right .LiveBox { height: auto; max-height: 125px; }
    .header .right .LiveBox .leftBorder { flex: 1 1 auto; width: auto; }
    .header .right .LiveBox .rightBorder { flex: 0 0 28px; width: auto; display: flex; align-items: center; justify-content: center; }
    .header .right .LiveBox .rightBorder p { padding: var(--space-2) 0; margin: 0; }
    .header .right .LiveBox .leftBorder .rightSide { flex: 1 1 auto; width: auto; overflow-y: auto; }
    .header .right .LiveBox .leftBorder .rightSide .liveEmpty { flex-direction: row; min-height: 64px; box-sizing: border-box; padding: var(--space-3); }
    .header .right .LiveBox .leftBorder .rightSide .liveEmpty::before { font-size: 20px; }
    .header .left { gap: var(--space-3); position: static; }
    .header .left .liveTv:not(:has(.tvSection)) { display: none; }
    .header .left .inputDiv { position: static; margin: 0; flex: 0 0 auto; }
}
/* Header TV-schedule rows: one line, icon | teams | tournament | time + clock (inline styles overridden). */
@media (min-width: 769px) {
    .header .liveTv .box { gap: var(--space-2); }
    .header .liveTv .box section.tvSection {
        display: flex; align-items: center; gap: var(--space-3);
        height: 32px !important; margin: 0 !important; padding: 0 var(--space-3);
        box-sizing: border-box; background: var(--color-white); color: var(--text-on-light); overflow: hidden;
    }
    .header .liveTv .box section.tvSection > div {
        display: flex; align-items: center; gap: 6px; height: auto !important; min-width: 0; width: auto; background: transparent;
    }
    .header .liveTv .box section.tvSection .rightTv { flex: 1 1 0; }
    .header .liveTv .box section.tvSection .middleTv { flex: 1 1 0; }
    .header .liveTv .box section.tvSection .leftTv { flex: 0 0 auto; flex-direction: row-reverse; }
    .header .liveTv .box section.tvSection p {
        margin: 0; font-size: var(--font-size-meta); line-height: 1; background: transparent;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
    }
    .header .liveTv .box section.tvSection .leftTv p { overflow: visible; }
    .header .liveTv .box section.tvSection i { padding: 0 !important; margin: 0 !important; line-height: 1; background: transparent; flex: 0 0 auto; }
    .header .liveTv .box section.tvSection .television img { display: block; width: 16px !important; margin: 0 !important; }
    .header .liveTv .box > a { margin: 0 !important; }
}

/* ---------- "More" link (one component for every "بیشتر") ---------- */
/* Dark surfaces by default; white cards (widgets, lists on white pages) switch to the on-light colours. */
.more-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 24px;
    color: var(--gray-300);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
.more-link i { font-size: var(--font-size-small); line-height: 1; transition: transform var(--duration-fast) var(--ease-out); }
.more-link:hover, .more-link:focus-visible { color: var(--color-brand-on-dark); }
.LiveBoxSidebar .more-link, .latestNews .more-link, .relatedNews .more-link { color: var(--gray-600); }
.LiveBoxSidebar .more-link:hover, .LiveBoxSidebar .more-link:focus-visible,
.latestNews .more-link:hover, .latestNews .more-link:focus-visible,
.relatedNews .more-link:hover, .relatedNews .more-link:focus-visible { color: var(--color-brand); }
@media (hover: hover) { .more-link:hover i { transform: translateX(-2px); } }
/* End-aligned (left in RTL) in every container. */
.LiveBoxSidebarMore { display: flex; justify-content: flex-end; padding: var(--space-1) var(--space-4); }
.latestNews > .more-link { display: flex; width: max-content; margin-inline-start: auto; margin-top: var(--space-2); }
.relatedNewItems li .more-link { margin-top: var(--space-1); }
.header .liveTv .more-link { align-self: flex-end; }
@media (max-width: 768px) {
    .more-link { min-height: 40px; }
}

/* ---------- Sidebar section titles (editorial blocks) ---------- */
/* One title style on the dark sidebars: bold, white, red leading edge like the "اخبار مرتبط" bar. */
.editorSuggestionHeader > p, .noteDayHeader > p, .dayPhotoHeader > p,
aside .titlePart > p, aside .selectLeague .titlePart > span {
    margin: 0;
    padding-inline-start: var(--space-2);
    border-inline-start: 4px solid var(--color-brand);
    color: var(--text-on-dark);
    font-size: var(--font-size-card-title);
    font-weight: var(--font-weight-bold);
    line-height: 24px;
    white-space: nowrap;
}
.editorSuggestionHeader, .noteDayHeader, .dayPhotoHeader { align-items: center; padding: 0 0 var(--space-3); }
aside .titlePart { align-items: center; }
.editorSuggestion, .noteDay, .dayPhoto { margin: var(--space-5) 0 0; padding: 0 0 var(--space-4); border-bottom: 1px solid var(--border-dark); }
aside > .editorSuggestion:first-child, aside > .noteDay:first-child { margin-top: var(--space-4); }
.dayPhoto { border-bottom: 0; }
.LiveBoxContainer { margin-top: var(--space-5); }

/* ---------- Live-table widget: show exactly 5 rows, the rest scrolls ---------- */
.LiveBoxSidebar .LiveBoxSidebarText { height: auto; max-height: calc(var(--space-3) + 5 * 28px + 1px); padding: var(--space-3) 0 0; box-sizing: border-box; }
.LiveBoxSidebar .LiveBoxSidebarText table { border-collapse: collapse; }
.LiveBoxSidebar .LiveBoxSidebarText tr { height: 28px; }
.LiveBoxSidebar .LiveBoxSidebarText td { line-height: 20px; vertical-align: middle; }
.LiveBoxSidebar .LiveBoxSidebarText .liveEmpty { min-height: 120px; margin: 0; }

/* ---------- Media grids (/reports, /socialNetwork, galleries): one gap and radius ---------- */
.imageItems, .editorSuggestionImageItems {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5) var(--space-3);
    margin: var(--space-5) 0 0;
}
.editorSuggestionImageItems { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.imageItems > .imageItem, .editorSuggestionImageItems > .editorSuggestionImageItem { width: auto; flex-basis: auto; margin: 0; }
.editorSuggestionPicture { border-radius: var(--radius-md); overflow: hidden; }
.editorSuggestionPicture > a { display: block; }
.editorSuggestionImageItem img { display: block; width: 100%; border-radius: var(--radius-md); }
.imageTitle, .editorSuggestionImageTitle { width: auto; margin: var(--space-2) 0 0; white-space: normal; }
.imageTitle a, .editorSuggestionImageTitle a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    font-size: var(--font-size-meta);
    line-height: var(--line-height-meta);
    min-height: calc(2em * var(--line-height-meta));
}
@media (max-width: 1100px) {
    .imageItems, .editorSuggestionImageItems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .imageItems { grid-template-columns: minmax(0, 1fr); }
    .editorSuggestionImageItem img { height: 120px; }
}

/* ---------- Latest-news meta: date and views on one row ---------- */
.latestNewsItemMeta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0 0; }
.latestNewsItemMeta li { margin: 0; line-height: var(--line-height-meta); }

/* ---------- Comment lists (home "نظر شما", search sidebar) ---------- */
.commentListItem { list-style: none; }
.commentListItem a { padding: 0; }
.commentMeta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: var(--space-1) 0 0; font-size: var(--font-size-meta); }
.commentMeta .commentDate { margin: 0; }

/* ---------- Search results: empty / error state ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-7) var(--space-4);
    color: var(--text-muted-on-dark);
    text-align: center;
    line-height: var(--line-height-small);
}
.empty-state::before {
    content: "\f002"; /* FontAwesome search */
    font-family: FontAwesome;
    font-size: 28px;
    line-height: 1;
    color: var(--gray-500);
}
.empty-state p { margin: 0; }
.empty-state-action {
    min-height: 44px;
    padding: 0 var(--space-5);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-brand);
    color: var(--color-white);
    font: inherit;
    cursor: pointer;
}
.empty-state-action:hover { background: var(--color-brand-strong); }

/* ---------- /live page ---------- */
.liveList .latestNews, .liveList .latestNews h3, .liveList .card-header p { text-align: start; }
#calendarInput { min-height: 40px; box-sizing: border-box; }
@media (max-width: 768px) {
    .liveStream iframe { height: auto; aspect-ratio: 16 / 9; }
}

/* ---------- Focus visible on inputs and media ---------- */
video:focus-visible, audio:focus-visible, #calendarInput:focus-visible,
.commentsContainer .commentsList .messageContainer .textMessage:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* ---------- Login / register forms ---------- */
.login-section .login-block .inputs input[type="text"], .login-section .login-block .inputs input[type="password"],
.login-section .login-block .inputs input[type="button"],
.register-section .register-block .inputs input[type="text"], .register-section .register-block .inputs input[type="password"],
.register-section .register-block .inputs input[type="button"] {
    min-height: 44px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
}
.login-section .login-block .inputs .input-container i,
.register-section .register-block .inputs .input-container i { top: 15px; }
.login-section .login-block .inputs input[type="button"] {
    background-color: var(--color-brand);
    border-color: var(--color-brand);
    font-weight: var(--font-weight-medium);
}
.login-section .login-block .inputs input[type="button"]:hover { background-color: var(--color-brand-strong); border-color: var(--color-brand-strong); }
.login-section .login-block .inputs input[type="button"]:focus-visible,
.register-section .register-block .inputs input[type="button"]:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 var(--space-3);
    margin: 0 0 var(--space-3);
}
.form-check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 40px;
    cursor: pointer;
    text-align: start;
}
.login-section .login-block .inputs .form-check input[type="checkbox"],
.register-section .register-block .inputs .form-check input[type="checkbox"] {
    float: none;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-brand);
}
.login-section .login-block .inputs .form-check span,
.register-section .register-block .inputs .form-check span { float: none; margin: 0; font-size: var(--font-size-meta); color: var(--text-secondary-on-light); }
.register-section .register-block .inputs .form-check span a { font-size: var(--font-size-meta); }
.login-section .login-block .inputs .form-link {
    float: none;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-size: var(--font-size-meta);
}

/* ---------- Footer on mobile: finger-sized links ---------- */
@media (max-width: 768px) {
    .footer .footerUp .footerLinks a { display: block; margin: 0; padding: 10px 0; line-height: 20px; }
    .footer .footerDown .link { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3) var(--space-4); }
    .footer .footerDown .link a { display: inline-flex; align-items: center; min-height: 40px; white-space: nowrap; font-size: var(--font-size-meta); }
}

/* ---------- Comment composer on mobile: 44px targets ---------- */
@media (max-width: 768px) {
    .commentsContainer .commentsList .messageContainer { min-height: 44px; height: auto; }
    .commentsContainer .commentsList .messageContainer .textMessage { min-height: 44px; line-height: 44px; }
    .commentsContainer .commentsList .messageContainer .custom-file-input { width: 44px; height: 44px; top: -9px; left: -11px; opacity: 0; }
    .commentsContainer .commentsList .messageContainer #recordVideo,
    .commentsContainer .commentsList .messageContainer #recordAudio { position: relative; }
    .commentsContainer .commentsList .messageContainer #recordVideo::after,
    .commentsContainer .commentsList .messageContainer #recordAudio::after { content: ""; position: absolute; inset: -12px -6px; }
    .videoSocial .videoShare { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}
