/**
 * Jatelgram Critical CSS – Bundled (no imports)
 * @package Jatelgram
 * @version 3.4.0 – All critical styles combined for performance
 */

/* ========== 1. base.css ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: #f6f8fa;
    color: var(--farghar-text-primary);
    transition: padding-top 0.2s, margin-left 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}
body.dark {
    background: var(--farghar-black);
    color: var(--farghar-text-primary);
}
a {
    color: #0969da;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ========== 2. header.css ========== */
.jatelgram-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--farghar-header-bg);
    border-bottom: 1px solid var(--farghar-header-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 0 16px;
    height: 60px;
    box-shadow: var(--farghar-shadow-sm);
    transition: margin-left 0.2s, width 0.2s;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.jatelgram-header::-webkit-scrollbar {
    display: none;
}
.jatelgram-header-left,
.jatelgram-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.jatelgram-header-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding-left: 0;
}
.site-title-verified {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
}
.site-title-verified h1 {
    font-size: clamp(1rem, 4vw, 1.8rem);
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--farghar-text-primary);
}
.verified-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}
.verified-icon svg {
    stroke: var(--farghar-gold);
    stroke-width: 1.8;
}
.jatelgram-header-lock,
.farghar-inline-lock,
.header-lock {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    font-size: 11px;
    margin-top: 2px;
    color: #888;
    line-height: 1;
}
.jatelgram-header-lock svg,
.farghar-inline-lock svg,
.header-lock svg {
    width: 14px;
    height: 14px;
}
.jatelgram-header-btn,
.header-btn,
.menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.jatelgram-header-btn:hover,
.header-btn:hover,
.menu-toggle:hover {
    background: rgba(0,0,0,0.05);
}
body.dark .jatelgram-header-btn:hover,
body.dark .header-btn:hover,
body.dark .menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}
.jatelgram-header-btn svg,
.header-btn svg,
.menu-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}
body.dark .jatelgram-header {
    background: var(--farghar-header-bg);
    border-bottom-color: var(--farghar-header-border);
}
body.dark .header-btn svg,
body.dark .jatelgram-header-btn svg,
body.dark .menu-toggle svg {
    stroke: var(--farghar-text-primary);
}
body.dark .site-title-verified h1 {
    color: var(--farghar-text-primary);
}
body.dark .verified-icon svg {
    stroke: var(--farghar-gold-light);
}
body.dark .jatelgram-header-lock,
body.dark .farghar-inline-lock,
body.dark .header-lock {
    color: #aaa;
}
@media (min-width: 1025px) {
    .jatelgram-header-center {
        padding-left: 0;
        align-items: flex-start;
    }
    .menu-toggle {
        display: inline-flex;
    }
}
@media (max-width: 1024px) {
    .jatelgram-header-center {
        padding-left: 0;
        align-items: flex-start;
    }
    .site-title-verified h1 {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }
    .jatelgram-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
}

/* ========== 3. footer.css ========== */
.jatelgram-nav-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    z-index: 550;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: margin-left 0.2s, width 0.2s;
    padding-bottom: env(safe-area-inset-bottom, 0);
    overflow-x: hidden;
}
@media (min-width: 1025px) {
    .jatelgram-nav-footer {
        display: none;
    }
}
@media (max-width: 1024px) {
    .jatelgram-nav-footer {
        display: flex;
    }
}
.nav-footer-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    justify-content: center;
}
.nav-footer-controls::-webkit-scrollbar {
    display: none;
}
.nav-footer-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--footer-text);
    font-size: 10px;
    gap: 4px;
    min-width: 50px;
    transition: none;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 0;
    border-radius: 0;
    position: relative;
}
.nav-footer-btn[aria-current="page"] {
    color: var(--footer-active-text);
}
.nav-footer-btn[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--footer-active-border);
    border-radius: 2px;
    animation: slideIn 0.2s ease-out;
}
@keyframes slideIn {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
.nav-footer-btn:active {
    transform: scale(0.95);
    transition: transform 0.05s linear;
}
.nav-footer-btn:focus-visible {
    outline: 2px solid var(--footer-active-border);
    outline-offset: 4px;
    border-radius: 8px;
}
.nav-footer-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}
.nav-footer-label {
    font-size: 10px;
    font-weight: 500;
}
.nav-footer-profile-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.footer-scroll-indicator {
    height: 2px;
    background: var(--footer-border);
    width: 40px;
    border-radius: 2px;
    margin: 4px auto 0;
    opacity: 0;
    transition: opacity 0.2s;
}
.jatelgram-nav-footer[data-overflow="true"] .footer-scroll-indicator {
    opacity: 0.6;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.jatelgram-nav-footer {
    animation: fadeUp 0.25s ease-out;
}

/* ========== 4. sidebar-desktop-links.css ========== */
.sidebar-desktop-footer-links {
    padding: 12px 16px;
    margin-top: auto;
    border-top: 1px solid var(--farghar-footer-border, #e6e6e6);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--farghar-text-primary, #1a1e23);
    transition: background 0.2s;
}
.sidebar-footer-link:hover {
    background: rgba(0,0,0,0.04);
}
.sidebar-footer-link.active {
    background: rgba(174,130,38,0.1);
    color: var(--farghar-gold, #ae8226);
}
.sidebar-footer-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}
.sidebar-footer-link-label {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}
@media (max-width: 1024px) {
    .sidebar-desktop-footer-links {
        display: none;
    }
}
@media (min-width: 1025px) {
    .sidebar-advanced.collapsed .sidebar-desktop-footer-links .sidebar-footer-link-label {
        display: none;
    }
    .sidebar-advanced.collapsed .sidebar-desktop-footer-links {
        padding: 12px 0;
        align-items: center;
    }
    .sidebar-advanced.collapsed .sidebar-footer-link {
        justify-content: center;
        padding: 10px 0;
    }
    .sidebar-advanced.collapsed .sidebar-footer-link-icon {
        width: 24px;
        height: 24px;
    }
}
body.dark .sidebar-desktop-footer-links {
    border-top-color: var(--farghar-header-border, #30363d);
}
body.dark .sidebar-footer-link:hover {
    background: rgba(255,255,255,0.08);
}
body.dark .sidebar-footer-link.active {
    background: rgba(204,164,62,0.15);
    color: var(--farghar-gold-light, #cca43e);
}

/* ========== 5. audio-player.css ========== */
.jatelgram-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--farghar-header-bg, #f6f8fa);
    border-top: 1px solid var(--farghar-header-border, #d0d7de);
    box-shadow: var(--farghar-shadow-md, 0 -2px 10px rgba(0,0,0,0.1));
    z-index: 900;
    padding: var(--farghar-space-sm, 8px) var(--farghar-space-md, 16px);
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    transition: opacity var(--farghar-transition-base), visibility var(--farghar-transition-base), transform var(--farghar-transition-base);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.jatelgram-audio-player[data-player-state="minimized"] {
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    pointer-events: none;
}
.jatelgram-audio-player::-webkit-scrollbar {
    display: none;
}

/* ========== 6. notification-panel.css ========== */
.notification-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--farghar-white);
    z-index: 1200;
    transition: right 0.3s cubic-bezier(0.2,0.9,0.4,1.1);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
body.dark .notification-panel {
    background: var(--farghar-black);
}
.notification-panel.open {
    right: 0;
}
.notification-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #d0d7de;
    background: #f6f8fa;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}
body.dark .notification-panel__header {
    background: #0d1117;
    border-bottom-color: #30363d;
}
.notification-panel__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1e23;
}
body.dark .notification-panel__title {
    color: #e6edf3;
}
.notification-panel__actions {
    display: flex;
    gap: 8px;
}
.notification-panel__close {
    background: transparent;
    border: none;
    color: #57606a;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: background 0.2s;
}
.notification-panel__close:hover {
    background: rgba(0,0,0,0.05);
}
body.dark .notification-panel__close {
    color: #8b949e;
}
body.dark .notification-panel__close:hover {
    background: rgba(255,255,255,0.1);
}
.notification-panel__content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
.notification-timeline {
    position: relative;
    padding-left: 30px;
}
.notification-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #d0d7de;
}
body.dark .notification-timeline::before {
    background: #30363d;
}
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    position: relative;
}
.timeline-dot {
    position: absolute;
    left: -26px;
    top: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ae8226;
    border: 2px solid #fff;
    z-index: 2;
}
body.dark .timeline-dot {
    border-color: #0d1117;
}
.timeline-content {
    flex: 1;
}
.timeline-link {
    text-decoration: none;
    display: block;
}
.timeline-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1e23;
    line-height: 1.4;
}
body.dark .timeline-title {
    color: #e6edf3;
}
.timeline-date {
    font-size: 12px;
    color: #57606a;
}
body.dark .timeline-date {
    color: #8b949e;
}
.notification-panel__empty {
    text-align: center;
    padding: 40px 20px;
    color: #57606a;
    font-size: 16px;
}
body.dark .notification-panel__empty {
    color: #8b949e;
}
@media (max-width: 768px) {
    .notification-panel {
        max-width: 100%;
    }
    .notification-panel__header {
        padding: 12px 16px;
    }
    .notification-panel__content {
        padding: 16px;
    }
}

/* ========== 7. content-wrapper.css ========== */
.jatelgram-content-wrap {
    max-width: var(--jatelgram-container-max-width, 1200px);
    margin-left: auto;
    margin-right: auto;
    padding: var(--jatelgram-spacing-lg, 20px) var(--jatelgram-spacing-md, 16px);
    width: 100%;
    transition: margin-left 0.2s, width 0.2s;
}
@media (min-width: 1025px) {
    body:not(.sidebar-closed) .jatelgram-header,
    body:not(.sidebar-closed) .jatelgram-audio-player,
    body:not(.sidebar-closed) .jatelgram-content-wrap {
        margin-left: var(--sidebar-width-expanded, 320px);
        width: calc(100% - var(--sidebar-width-expanded, 320px));
    }
    body.sidebar-closed .jatelgram-header,
    body.sidebar-closed .jatelgram-audio-player,
    body.sidebar-closed .jatelgram-content-wrap {
        margin-left: var(--sidebar-width-collapsed, 72px);
        width: calc(100% - var(--sidebar-width-collapsed, 72px));
    }
    body:not(.sidebar-closed) .audio-floating-btn {
        left: calc(var(--sidebar-width-expanded, 320px) + var(--jatelgram-spacing-md, 16px));
        right: auto;
    }
    body.sidebar-closed .audio-floating-btn {
        left: auto;
        right: var(--jatelgram-spacing-lg, 24px);
    }
}
@media (max-width: 1024px) {
    body.jatelgram-sidebar-open,
    body.sidebar-open {
        overflow: hidden;
    }
    .jatelgram-header,
    .jatelgram-nav-footer,
    .jatelgram-audio-player,
    .jatelgram-content-wrap {
        margin-left: 0;
        width: 100%;
    }
    .jatelgram-content-wrap {
        max-width: 100%;
    }
    .archive-feed,
    .feed-container,
    .feed-post,
    .post-media img,
    .post-media video {
        max-width: 100%;
        overflow-x: hidden;
    }
    body {
        overflow-x: hidden;
    }
}

/* ========== 8. rtl.css ========== */
body.rtl {
    direction: rtl;
    text-align: right;
}
body.rtl .header-left,
body.rtl .header-right {
    flex-direction: row-reverse;
}
body.rtl .menu-toggle .menu-icon,
body.rtl .menu-toggle .close-icon {
    transform: scaleX(-1);
}
@media (min-width: 1025px) {
    body.rtl .jatelgram-header-center {
        padding-right: 0;
        padding-left: 0;
        align-items: flex-end;
    }
}
@media (max-width: 1024px) {
    body.rtl .jatelgram-header-center {
        padding-right: 0;
        padding-left: 0;
        align-items: flex-end;
    }
}
body.rtl .notification-panel {
    right: auto;
    left: -100%;
    transition: left 0.3s cubic-bezier(0.2,0.9,0.4,1.1);
}
body.rtl .notification-panel.open {
    right: auto;
    left: 0;
}
body.rtl .notification-panel__header {
    flex-direction: row-reverse;
}
body.rtl .notification-timeline {
    padding-left: 0;
    padding-right: 40px;
}
body.rtl .notification-timeline::before {
    left: auto;
    right: 18px;
}
body.rtl .timeline-dot {
    left: auto;
    right: -26px;
}
body.rtl .timeline-year-dot {
    left: auto;
    right: -31px;
}
body.rtl .jatelgram-nav-footer {
    direction: ltr;
}
body.rtl .nav-footer-controls {
    flex-direction: row-reverse;
}
body.rtl .sidebar-footer-link {
    flex-direction: row-reverse;
    text-align: right;
}
body.rtl .sidebar-footer-link-icon {
    margin-left: 12px;
    margin-right: 0;
}

/* ========== 9. homepage-fix.css ========== */
.jatelgram-content-wrap {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px;
    box-sizing: border-box;
}
.jatelgram-content-wrap.archive-feed {
    max-width: 100%;
}
.container-mainpage {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
.container-mainpage * {
    max-width: 100%;
    box-sizing: border-box;
}
.container-inner-mainpage-1,
.farghar-gravatar-mainpage,
.farghar-pocht-container-mainpage,
.container-second-mainpage,
.farghar-biography-mainpage,
.farghar-title-link-mainpage,
.farghar-links-section {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}
.farghar-grid-container,
.instagram-slideshow,
.fullwidth-posts-grid {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
@media (max-width: 768px) {
    .fullwidth-posts-grid,
    .instagram-panel .farghar-grid-container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
@media (min-width: 1025px) {
    body:not(.sidebar-closed) .jatelgram-content-wrap {
        margin-left: var(--sidebar-width-expanded, 320px);
        width: calc(100% - var(--sidebar-width-expanded, 320px));
    }
    body.sidebar-closed .jatelgram-content-wrap {
        margin-left: var(--sidebar-width-collapsed, 72px);
        width: calc(100% - var(--sidebar-width-collapsed, 72px));
    }
}