/* QWERTYMAIL — global design tokens, reset, shared shell and modal */
:root {
    --qw-font: Inter, Arial, sans-serif;
    --qw-bg: #f7f7f4;
    --qw-bg-white: #ffffff;
    --qw-bg-soft: #f3f3ee;
    --qw-bg-blue: #f5f6ff;
    --qw-text: #302b2b;
    --qw-muted: #828175;
    --qw-muted-2: #5f5d55;
    --qw-heading: #302b2b;
    --qw-accent: #2f2dd4;
    --qw-accent-hover: #2422b8;
    --qw-accent-soft: rgba(47, 45, 212, 0.08);
    --qw-accent-border: rgba(47, 45, 212, 0.16);
    --qw-border: rgba(48, 43, 43, 0.10);
    --qw-border-soft: rgba(48, 43, 43, 0.07);
    --qw-radius-sm: 10px;
    --qw-radius: 14px;
    --qw-radius-md: 18px;
    --qw-radius-lg: 24px;
    --qw-radius-xl: 32px;
    --qw-radius-pill: 999px;
    --qw-shadow-sm: 0 8px 22px rgba(48, 43, 43, 0.04);
    --qw-shadow: 0 16px 42px rgba(48, 43, 43, 0.06);
    --qw-shadow-lg: 0 24px 70px rgba(48, 43, 43, 0.08);
    --qw-container: 1200px;
    --qw-container-wide: 1240px;
}

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

html,
body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--qw-font);
    color: var(--qw-text);
    background: var(--qw-bg-white);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
}

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

#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.site-content {
    flex: 1 0 auto;
}

body.video-modal-open {
    overflow: hidden;
}

.qwerty-video-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.qwerty-video-modal.active {
    display: flex;
}

.qwerty-video-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 28, 28, 0.62);
    backdrop-filter: blur(6px);
}

.qwerty-video-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(960px, 100%);
    border-radius: var(--qw-radius-md);
    background: #fff;
    box-shadow: var(--qw-shadow-lg);
    overflow: hidden;
}

.qwerty-video-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: var(--qw-radius-pill);
    background: rgba(255,255,255,0.9);
    color: var(--qw-text);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--qw-shadow-sm);
}

.qwerty-video-modal__video {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}

body.qwertymail-home-page .site-content,
body.qwertymail-home-page .site-content-inner,
body.qwertymail-home-page .content-area,
body.qwertymail-home-page .site-main,
body.qwertymail-home-page .entry-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.qwertymail-home-page,
body.qwertymail-product-page {
    background: var(--qw-bg, #f7f7f4) !important;
}

body.qwertymail-product-page .site-content,
body.qwertymail-product-page .site-content-inner,
body.qwertymail-product-page .content-area,
body.qwertymail-product-page .site-main,
body.qwertymail-product-page .entry-content,
body.qwertymail-product-page .site-content > .container,
body.qwertymail-product-page .content-area > .container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.qwerty-builder-page .qb-hero,
.qwerty-builder-page .qb-proof,
.qwerty-builder-page .qb-section,
.qwerty-prices-page .qp-hero,
.qwerty-prices-page .qp-section,
.qt-page .qt-hero,
.qt-page .qt-proof,
.qt-page .qt-section,
.qwerty-templates-page .qtpl-hero,
.qwerty-templates-page .qtpl-proof,
.qwerty-templates-page .qtpl-section,
.qapi-page .qapi-hero,
.qapi-page .qapi-proof,
.qapi-page .qapi-section {
    background: transparent;
    background-image: none;
}

.qb-hero__actions,
.qp-hero__actions,
.qt-hero__actions,
.qtpl-hero__actions,
.qapi-hero__actions {
    gap: 0;
}


/* Blog category navigation */
.qwertymail-blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 30px;
}

.qwertymail-blog-categories__item {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid #e1e1e8;
    border-radius: 999px;
    background: #fff;
    color: #45454f !important;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none !important;
}

.qwertymail-blog-categories__item.is-active {
    border-color: #2f2dd4;
    background: #2f2dd4;
    color: #fff !important;
}

@media (max-width: 640px) {
    .qwertymail-blog-categories { gap: 8px; }
    .qwertymail-blog-categories__item { min-height: 36px; padding: 7px 12px; font-size: 13px; }
}


/* Related articles / internal SEO hub */
.qw-related-materials {
    width: 100%;
    padding: 34px 20px 74px;
    box-sizing: border-box;
}

.qw-related-materials__inner {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 42px;
    border: 1px solid #e7e7ef;
    border-radius: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f6f6ff 100%);
    box-shadow: 0 18px 46px rgba(27, 27, 50, .045);
    box-sizing: border-box;
}

.qw-related-materials__head {
    max-width: 760px;
    margin-bottom: 26px;
}

.qw-related-materials__head > span {
    display: inline-flex;
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #2f2dd4;
}

.qw-related-materials__head h2 {
    margin: 0;
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.12;
    letter-spacing: -.035em;
    color: #191925;
}

.qw-related-materials__head p {
    margin: 12px 0 0;
    max-width: 700px;
    font-size: 16px;
    line-height: 1.65;
    color: #686875;
}

.qw-related-materials__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.qw-related-materials__grid--1 {
    grid-template-columns: minmax(0, 760px);
}

.qw-related-materials__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qw-related-material {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    padding: 24px;
    border: 1px solid #e8e8f0;
    border-radius: 20px;
    background: rgba(255, 255, 255, .88);
    color: #191925;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.qw-related-material:hover,
.qw-related-material:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(47, 45, 212, .28);
    box-shadow: 0 16px 30px rgba(27, 27, 50, .07);
}

.qw-related-material:focus-visible {
    outline: 3px solid rgba(47, 45, 212, .22);
    outline-offset: 3px;
}

.qw-related-material__type {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #2f2dd4;
}

.qw-related-material h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.28;
    letter-spacing: -.02em;
    color: #191925;
}

.qw-related-material p {
    margin: 11px 0 20px;
    font-size: 15px;
    line-height: 1.58;
    color: #70707c;
}

.qw-related-material strong {
    margin-top: auto;
    font-size: 14px;
    color: #2f2dd4;
}

@media (max-width: 760px) {
    .qw-related-materials {
        padding: 24px 14px 56px;
    }

    .qw-related-materials__inner {
        padding: 28px 20px;
        border-radius: 24px;
    }

    .qw-related-materials__grid,
    .qw-related-materials__grid--2 {
        grid-template-columns: 1fr;
    }

    .qw-related-material {
        min-height: 0;
    }
}


/* Компактная версия блока материалов внутри статьи. */
.qw-related-materials--article {
    padding: 34px 0 18px;
}

.qw-related-materials--article .qw-related-materials__inner {
    padding: 30px;
    border-radius: 24px;
}

.qw-related-materials--article .qw-related-materials__head h2 {
    font-size: clamp(25px, 3vw, 34px);
}

.qw-related-materials--article .qw-related-material {
    min-height: 190px;
}

@media (max-width: 760px) {
    .qw-related-materials--article {
        padding: 26px 0 10px;
    }

    .qw-related-materials--article .qw-related-materials__inner {
        padding: 24px 18px;
        border-radius: 20px;
    }
}
