/*
  Puls Center — standalone article page styles
  Ported from article-example.html
*/

/* Fix for sticky positioning */
html,
body {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

#content,
.site-content,
.puls-article-wrapper,
.puls-wrap {
    overflow: visible !important;
}

/* Trust Bar */
/* Trust Bar - Modern */
.puls-trust-bar {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    flex-wrap: wrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puls-trust-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border-color: rgba(67, 149, 208, 0.3);
}

.puls-trust-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.puls-trust-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--pulse-blue), var(--pulse-light-blue));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(67, 149, 208, 0.3);
}

.puls-trust-text .hd {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink-900);
    margin-bottom: 2px;
}

.puls-trust-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ink-500);
}

.puls-trust-rating .stars {
    color: #FFC107;
    letter-spacing: -1px;
}

.puls-trust-rating .val {
    font-weight: 700;
    color: var(--ink-900);
}

.puls-trust-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.puls-trust-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 99px;
}

.puls-trust-sep {
    width: 1px;
    height: 24px;
    background: var(--line);
    margin: 0 4px;
}

.puls-trust-action {
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-700);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.puls-trust-action:hover {
    background: #F1F5F9;
    color: var(--pulse-blue);
}

.puls-trust-action.primary {
    background: var(--pulse-red);
    color: white;
    box-shadow: 0 2px 8px rgba(238, 75, 67, 0.3);
}

.puls-trust-action.primary:hover {
    background: #D63D36;
    box-shadow: 0 4px 12px rgba(238, 75, 67, 0.4);
}

.puls-trust-action.icon-only {
    padding: 8px;
    border-radius: 8px;
    color: var(--ink-500);
    background: #F1F5F9;
}

.puls-trust-action.icon-only:hover {
    background: var(--pulse-blue);
    color: white;
}

@media (max-width: 768px) {
    .puls-trust-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .puls-trust-right {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        /* Spread buttons */
    }

    .puls-trust-action {
        flex: 1;
        justify-content: center;
    }

    .puls-trust-action.icon-only {
        flex: 0 0 auto;
    }
}

.puls-trust-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--pulse-blue);
    color: white;
    font-weight: 900;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.puls-trust-text .hd {
    font-weight: 700;
    color: var(--ink-900);
    font-size: 14px;
    line-height: 1.2;
}

.puls-trust-text .sub {
    font-size: 11px;
    color: var(--ink-500);
    margin-top: 2px;
}

.puls-trust-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.puls-trust-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--ink-700);
    margin-right: 8px;
}

.puls-trust-check .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pulse-red);
}

.puls-trust-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink-900);
    transition: all 0.2s;
}

.puls-trust-action:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    color: var(--ink-900);
    text-decoration: none;
}

.puls-trust-action.primary {
    background: var(--pulse-red);
    border-color: var(--pulse-red);
    color: white;
}

.puls-trust-action.primary:hover {
    background: #d63d42;
    /* Slightly darker */
    color: white;
}

@media (max-width: 768px) {
    .puls-trust-bar {
        border-radius: 16px;
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .puls-trust-right {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
    }

    .puls-trust-action {
        flex: 1;
        text-align: center;
    }

    .puls-trust-check {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
}

:root {
    /* 🎨 Основная палитра «ПУЛЬС» */
    --pulse-blue: #4395D0;
    --pulse-light-blue: #5FAEDA;
    --pulse-red: #EE4B43;
    --pulse-bg-light: #CADEEE;
    --pulse-white: #FEFEFF;

    /* Нейтральные */
    --ink-900: #0B1220;
    --ink-700: #243042;
    --ink-500: #516174;
    --line: #D9E6EF;

    --radius-24: 24px;
    --radius-16: 16px;
    --radius-12: 12px;

    --shadow-1: 0 14px 40px rgba(67, 149, 208, .18);
    --shadow-2: 0 8px 22px rgba(67, 149, 208, .14);

    --max: 1100px;
    --content: 760px;
    --sidebar-width: 320px;

    /* --font is likely already defined in the main theme, but we can keep it as fallback or override if needed */
    /* --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; */
}

/* Scoping to .puls-article-page or similar used in the template */
.puls-article-wrapper {
    box-sizing: border-box;
    /* font-family: var(--font); */
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
}

.puls-article-wrapper * {
    box-sizing: border-box;
}

.puls-article-wrapper a {
    color: var(--pulse-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.puls-article-wrapper a:hover {
    text-decoration: underline;
}

.puls-wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 18px 64px;
}

/* Buttons */
.puls-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-900);
    box-shadow: 0 10px 18px rgba(67, 149, 208, .10);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, box-shadow .12s ease;
    white-space: nowrap;
    text-decoration: none;
}

.puls-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(67, 149, 208, .14);
    text-decoration: none;
    color: var(--ink-900);
}

.puls-btn.primary {
    background: var(--pulse-red);
    border-color: var(--pulse-red);
    color: #fff;
}

.puls-btn.primary:hover {
    color: #fff;
}


.puls-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border: 1px solid var(--line);
    background: rgba(254, 254, 255, .75);
    border-radius: 999px;
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 500;
}

.puls-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--pulse-red);
}

/* Hero */
.puls-hero {
    /* Full width adaptation */
    margin-top: 0;
    border-top: 1px solid rgba(254, 254, 255, .35);
    border-bottom: 1px solid rgba(254, 254, 255, .35);
    border-radius: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--pulse-blue), var(--pulse-light-blue));
    box-shadow: var(--shadow-1);
    color: #fff;
    position: relative;
    z-index: 1;
}

.puls-hero-inner {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
    padding: 0;
    /* Padding is now handled by the wrapper */
}

.puls-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(254, 254, 255, .38);
    background: rgba(254, 254, 255, .18);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .35px;
    text-transform: uppercase;
    width: fit-content;
}

.puls-hero h1 {
    margin: 12px 0 10px;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -.4px;
    color: #fff;
}

.puls-hero p {
    margin: 0 0 16px;
    color: #F2F7FB;
    font-size: 15px;
}

.puls-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.puls-meta .puls-chip {
    background: rgba(254, 254, 255, .85);
    border: none;
}

.puls-hero-card {
    background: rgba(254, 254, 255, .90);
    border: 1px solid rgba(254, 254, 255, .55);
    border-radius: var(--radius-16);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: stretch;
    color: var(--ink-700);
}

.puls-hero-card h3 {
    margin: 0;
    font-size: 14px;
    color: var(--ink-900);
}

.puls-hero-card .pulse-list {
    margin: 0;
    padding: 0;
    color: var(--ink-700);
    /* font-size: 13px; */
}

.puls-hero-card .pulse-list li {
    margin-bottom: 8px;
    font-size: 13px;
    padding-left: 24px;
}

.puls-hero-card .pulse-list li:before {
    font-size: 12px;
    top: 3px;
}

.puls-callout-mini {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-radius: var(--radius-16);
    border: 1px solid rgba(67, 149, 208, .15);
    background: rgba(235, 245, 255, 0.7);
    /* Lighter, cleaner */
    padding: 14px 16px;
    color: var(--ink-700);
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(67, 149, 208, .08);
}

.puls-badge {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--pulse-blue), var(--pulse-light-blue));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 14px;
    flex: 0 0 auto;
}

/* Layout */
.puls-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 40px;
    align-items: start;
    margin-top: 4px;
}

.puls-article {
    background: var(--pulse-white);
    border: 1px solid var(--line);
    border-radius: var(--radius-24);
    box-shadow: var(--shadow-2);
    overflow: hidden;
    min-width: 0;
}

.puls-article-inner {
    padding: 26px 26px 10px;
    max-width: var(--content);
    margin: 0 auto;
}

.puls-article h2 {
    margin: 28px 0 10px;
    font-size: 22px;
    letter-spacing: -.2px;
    color: var(--ink-900);
}

.puls-article h3 {
    margin: 20px 0 8px;
    font-size: 18px;
    color: var(--ink-900);
}

.puls-article p {
    margin: 10px 0;
    color: var(--ink-700);
}

.puls-article ul,
.puls-article ol {
    margin: 10px 0 10px 18px;
    color: var(--ink-700);
}

.puls-article li {
    margin-bottom: 5px;
}

.puls-article blockquote {
    margin: 18px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--pulse-light-blue);
    background: rgba(202, 222, 238, .55);
    border-radius: 12px;
    color: var(--ink-700);
    font-style: italic;
}

.puls-divider {
    height: 1px;
    background: var(--line);
    margin: 22px 0;
}

.puls-note {
    border: 1px solid rgba(67, 149, 208, .22);
    background: rgba(202, 222, 238, .55);
    border-radius: var(--radius-16);
    padding: 14px 16px;
    color: var(--ink-700);
    margin: 16px 0;
}

.puls-note strong {
    color: var(--ink-900);
}

/* Media (images inside article) */
figure.puls-media {
    margin: 18px 0;
}

.puls-media .frame {
    border: 1px solid var(--line);
    border-radius: var(--radius-24);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(67, 149, 208, .10), rgba(95, 174, 218, .10));
    box-shadow: 0 10px 22px rgba(67, 149, 208, .10);
}

.puls-media img {
    display: block;
    width: 100%;
    height: auto;
}

.puls-media figcaption {
    margin-top: 8px;
    color: var(--ink-500);
    font-size: 12px;
    text-align: center;
}

/* Info cards */
.puls-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 16px 0;
}

.puls-card {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius-16);
    padding: 14px;
    box-shadow: 0 10px 18px rgba(67, 149, 208, .08);
}

.puls-card h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--ink-900);
}

.puls-card p {
    margin: 0;
    font-size: 13px;
    color: var(--ink-700);
}

/* FAQ */
.puls-faq {
    margin: 18px 0 10px;
}

.puls-faq details {
    border: 1px solid var(--line);
    border-radius: var(--radius-16);
    background: #fff;
    padding: 12px 14px;
    margin: 10px 0;
    box-shadow: 0 10px 18px rgba(67, 149, 208, .08);
}

.puls-faq summary {
    cursor: pointer;
    font-weight: 900;
    color: var(--ink-900);
    list-style: none;
}

.puls-faq summary::-webkit-details-marker {
    display: none;
}

.puls-faq details p {
    margin: 10px 0 0;
    color: var(--ink-700);
}

/* Sidebar */
.puls-sidebar {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: start;
}

.puls-side {
    border: 1px solid var(--line);
    border-radius: var(--radius-24);
    background: rgba(254, 254, 255, .88);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}

.puls-side .hd {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(67, 149, 208, .14), rgba(95, 174, 218, .14));
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.puls-side .hd strong {
    font-size: 13px;
    color: var(--ink-900);
}

.puls-side .bd {
    padding: 14px 16px;
}

.puls-toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--ink-700);
    font-size: 13px;
    transition: background 0.2s;
}

.puls-toc a:hover,
.puls-toc a.active {
    background: rgba(202, 222, 238, .65);
    text-decoration: none;
    color: var(--ink-900);
}

.puls-author {
    display: flex;
    gap: 12px;
    align-items: center;
}

.puls-avatar {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--pulse-blue), var(--pulse-light-blue));
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
    letter-spacing: .6px;
    box-shadow: 0 12px 22px rgba(67, 149, 208, .18);
    overflow: hidden;
    flex-shrink: 0;
}

.puls-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.puls-author div {
    line-height: 1.25;
}

.puls-author small {
    display: block;
    color: var(--ink-500);
    font-size: 12px;
}

.puls-author strong {
    display: block;
    font-size: 13px;
    color: var(--ink-900);
}

.puls-cta {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-24);
    border: 1px solid rgba(67, 149, 208, .24);
    background: rgba(202, 222, 238, .55);
    margin-top: 18px;
}

.puls-cta p {
    margin: 0;
    color: var(--ink-700);
    font-size: 13px;
}

/* Footer of the article card */
.puls-foot {
    padding: 18px 26px 26px;
    color: var(--ink-500);
    font-size: 12px;
    border-top: 1px solid var(--line);
    background: rgba(254, 254, 255, .75);
}

/* Responsive */
@media (max-width: 980px) {
    .puls-hero-inner {
        grid-template-columns: 1fr;
    }

    .puls-grid {
        grid-template-columns: 1fr;
    }

    .puls-sidebar {
        position: static;
        top: auto;
    }

    .puls-article-inner {
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .puls-hero h1 {
        font-size: 28px;
    }

    .puls-article-inner {
        padding: 20px 16px 10px;
    }

    .puls-cards {
        grid-template-columns: 1fr;
    }
}

/* Mobile TOC */
.puls-toc-mobile-btn {
    position: fixed;
    top: 50%;
    right: 24px;
    bottom: auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--pulse-blue);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(67, 149, 208, .4);
    display: none;
    /* Default hidden, shown via media query */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* High Z-Index to stay above floating bar */
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 0.2s, background 0.2s;
}

.puls-toc-mobile-btn svg {
    display: block;
}

.puls-toc-mobile-btn:active {
    transform: translateY(-50%) scale(0.95);
    background: var(--ink-700);
}

.puls-mobile-toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(11, 18, 32, .4);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: none;
    /* Default hidden */
}

.puls-mobile-toc-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.puls-mobile-toc-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: white;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.puls-mobile-toc-overlay.open .puls-mobile-toc-drawer {
    transform: translateX(0);
}

.puls-mobile-toc-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    color: var(--ink-900);
}

.puls-toc-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--ink-500);
    padding: 0 8px;
    cursor: pointer;
}

.puls-mobile-toc-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.puls-mobile-toc-content a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink-700);
    text-decoration: none;
    font-size: 14px;
}

.puls-mobile-toc-content a:last-child {
    border-bottom: none;
}

.puls-mobile-toc-content a.active {
    color: var(--pulse-blue);
    font-weight: 600;
}

@media (max-width: 991px) {

    .puls-toc-mobile-btn,
    .puls-mobile-toc-overlay {
        display: flex !important;
        /* flex for centering icon */
    }

    .puls-sidebar {
        display: none;
    }
}

/* Print Styles */
@media print {

    /* Hide UI elements */
    header,
    #masthead,
    footer,
    #main_footer,
    .puls-sidebar,
    .puls-toc-mobile-btn,
    .puls-mobile-toc-overlay,
    .puls-trust-right,
    .puls-trust-action,
    .accessibility-switcher,
    .social-icons,
    .puls-hero-card,
    .puls-breadcrumbs,
    .breadcrumbs,
    #hamburger-menu,
    .puls-callout-mini,
    .floating-bar,
    .tech-mode-banner {
        display: none !important;
    }

    /* Reset Layout */
    body,
    html,
    #content,
    .site-content,
    .puls-wrap,
    .puls-article-wrapper {
        background: white !important;
        color: black !important;
        overflow: visible !important;
        height: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .puls-wrap {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .puls-grid {
        display: block !important;
        margin-top: 0 !important;
        gap: 0 !important;
    }

    /* Hero transformations for print */
    .puls-hero {
        background: none !important;
        color: black !important;
        padding: 0 !important;
        margin-bottom: 10px !important;
        border: none !important;
    }

    .puls-hero-inner {
        display: block !important;
    }

    .puls-hero * {
        color: black !important;
        text-shadow: none !important;
    }

    .puls-kicker {
        color: #666 !important;
        border: 1px solid #ccc !important;
    }

    .puls-chip {
        border-color: #ccc !important;
        background: none !important;
    }

    /* Trust Bar for Print */
    .puls-trust-bar {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 10px 0 !important;
        margin-bottom: 20px !important;
        border-bottom: 2px solid #000 !important;
        border-radius: 0 !important;
        display: block !important;
    }

    .puls-trust-left {
        display: flex !important;
        align-items: center;
    }

    .puls-trust-icon {
        border: 1px solid #000 !important;
        color: black !important;
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Add output branding */
    .puls-trust-bar:after {
        content: "Источник: puls-center.kz";
        display: block;
        margin-top: 5px;
        font-size: 11px;
        color: #444;
    }

    /* Typography adjustments */
    h1 {
        font-size: 24pt !important;
        margin-bottom: 0.5cm !important;
    }

    h2 {
        font-size: 18pt !important;
        margin-top: 1cm !important;
    }

    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
        color: black !important;
    }

    p,
    ul,
    ol,
    table {
        page-break-inside: avoid;
        font-size: 11pt !important;
        line-height: 1.5;
    }

    a {
        text-decoration: none !important;
        color: black !important;
    }

    /* Ensure content is visible */
    .puls-article-content {
        width: 100% !important;
    }
}