*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    height:100%;
    overflow-x:hidden;
}

body{
    min-height:100vh;
    display:flex;
    flex-direction:column;

    font-family:Arial, Helvetica, sans-serif;
    background:#F7F5F2;
    color:#333;
}

.site-content{
    flex:1;
}

.container{
    width:100%;
    max-width:1200px;
    margin:40px auto;
}

/* -------- Карточки ---------- */

.articles h2{

    margin-bottom:25px;

    font-size:34px;

}

.cards{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.card{

    background:white;

    border-radius:15px;

    overflow:hidden;

    box-shadow:0 5px 15px rgba(0,0,0,.08);

    transition:.3s;
    width:100%;
    max-width:700px;
    margin:0 auto;

}

.card:hover{

    transform:translateY(-6px);

}

.card img{

    width:10%;

    height:10%;

    object-fit:cover;

}

.card-body{

    padding:25px;

}

.card-body h3{

    margin-bottom:15px;

}

.card-body p{

    color:#666;

    line-height:1.6;

    margin-bottom:20px;

}

.card-body a{

    color:#1976d2;

    text-decoration:none;

    font-weight:bold;

}

/* ---------- Артикулы ---------- */

.article-page{

    background:white;

    padding:40px;

    border-radius:15px;

    box-shadow:0 5px 20px rgba(0,0,0,.08);

}

.article-page img{

    width:100%;

    border-radius:12px;

    margin-bottom:25px;

}

.article-page h1{

    margin-bottom:20px;

}

.article-page p{

    line-height:1.8;

}

.vk-post{
    background:white;
    border-radius:16px;
    padding:20px;
    margin-bottom:25px;
    box-shadow:0 5px 20px rgba(0,0,0,.08);
}

.vk-header{
    display:flex;
    justify-content:space-between;
    font-size:14px;
    color:#777;
    margin-bottom:10px;
}

.vk-pinned-badge{
    display:inline-flex;
    align-items:center;
    gap:7px;
    width:max-content;
    margin-bottom:10px;
    padding:6px 10px;
    border:1px solid rgba(201,169,110,.55);
    border-radius:999px;
    color:#80602a;
    background:#fff8eb;
    font-size:12px;
    font-weight:700;
}

.vk-pinned-badge svg{
    width:16px;
    height:16px;
    fill:none;
    stroke:currentColor;
    stroke-linecap:round;
    stroke-linejoin:round;
    stroke-width:1.8;
}

.vk-image{
    width:100%;
    border-radius:12px;
    margin-bottom:15px;
}

.vk-text{
    color:#444;
    line-height:1.6;
    margin-bottom:15px;
    position: relative;
}

.vk-open{
    display:inline-block;
    color:#1976d2;
    font-weight:600;
    text-decoration:none;
}

.vk-footer{
    margin-top:15px;
    font-size:13px;
    color:#888;
    display:flex;
    justify-content:flex-end;
}

.vk-content {
    max-height: 7.2em;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
}

.vk-post.expanded .vk-content {
    max-height: none;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

.article-rich-text {
    color: #333;
    font-size: 16px;
    line-height: 1.65;
}

.article-rich-text > :first-child {
    margin-top: 0;
}

.article-rich-text > :last-child {
    margin-bottom: 0;
}

.article-rich-text p,
.article-rich-text h1,
.article-rich-text h2,
.article-rich-text ol,
.article-rich-text ul,
.article-rich-text blockquote,
.article-rich-text pre {
    margin: 0 0 0.8em;
}

.article-rich-text h1 {
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
}

.article-rich-text h2 {
    font-size: clamp(21px, 3vw, 28px);
    line-height: 1.3;
}

.article-rich-text ol,
.article-rich-text ul {
    padding-left: 1.6em;
}

.article-rich-text li {
    margin: 0.25em 0;
}

.article-rich-text li[data-list="bullet"] {
    list-style-type: disc;
}

.article-rich-text li[data-list="ordered"] {
    list-style-type: decimal;
}

.article-rich-text .ql-ui {
    display: none;
}

.article-rich-text blockquote {
    padding: 0.25em 0 0.25em 1em;
    border-left: 4px solid #d7b06a;
    color: #62584a;
}

.article-rich-text a {
    color: #9b6a22;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-rich-text pre,
.article-rich-text code {
    border-radius: 8px;
    background: #f3efe9;
    font-family: Consolas, monospace;
}

.article-rich-text pre {
    overflow-x: auto;
    padding: 12px 14px;
}

.article-rich-text code {
    padding: 0.1em 0.35em;
}

.article-rich-text .ql-align-center {
    text-align: center;
}

.article-rich-text .ql-align-right {
    text-align: right;
}

.article-rich-text .ql-align-justify {
    text-align: justify;
}

.article-rich-text .ql-indent-1 { margin-left: 1.5em; }
.article-rich-text .ql-indent-2 { margin-left: 3em; }
.article-rich-text .ql-indent-3 { margin-left: 4.5em; }
.article-rich-text .ql-indent-4 { margin-left: 6em; }
.article-rich-text .ql-indent-5 { margin-left: 7.5em; }
.article-rich-text .ql-indent-6 { margin-left: 9em; }
.article-rich-text .ql-indent-7 { margin-left: 10.5em; }
.article-rich-text .ql-indent-8 { margin-left: 12em; }
.vk-toggle{
    background:none;
    border:none;
    color:#1976d2;
    font-weight:600;
    cursor:pointer;
    margin-top:10px;
}

.vk-toggle:hover{
    text-decoration:underline;
}

.vk-gallery{
    position:relative;
    width:100%;
    margin:15px 0;
    overflow:hidden;
    border-radius:12px;
}

.vk-gallery-track{
    display:flex;
    transition:transform .35s ease;
}

.vk-gallery-item{
    min-width:100%;
    height:400px;
    object-fit:cover;
}

.vk-gallery-btn{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:40px;
    height:40px;
    border:none;
    border-radius:50%;
    background:rgba(255,255,255,.7);
    cursor:pointer;
    font-size:22px;
    z-index:2;
}

.vk-gallery-btn:hover{
    background:white;
}

.vk-gallery-btn.prev{ left:10px; }
.vk-gallery-btn.next{ right:10px; }

.vk-actions{
    margin-top:10px;
    display:flex;
    align-items:center;
    gap:15px;
}

.vk-like-btn{
    border:none;
    background:#f5f5f5;
    padding:8px 12px;
    border-radius:10px;
    cursor:pointer;
    font-size:14px;
    transition:.2s;
}

.vk-like-btn:hover{
    background:#eee;
}

.vk-comment-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 10px;
    background: #f5f5f5;
    color: #6f665b;
    font-size: 14px;
    font-weight: 600;
}

.vk-comment-count svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* ---------- Responsive article feed and video player ---------- */

.site-content {
    min-width: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.articles {
    width: min(100%, 900px);
    min-width: 0;
    margin-inline: auto;
}

body[data-client-authenticated="true"] .articles {
    width: min(900px, calc(100% - 400px));
    margin-right: 400px;
}

.articles .cards,
.articles .card {
    width: 100%;
    min-width: 0;
    max-width: 900px;
}

.articles .vk-post {
    padding: clamp(14px, 2.5vw, 24px);
}

.articles .vk-gallery {
    aspect-ratio: 16 / 10;
    background: #171614;
}

.articles .vk-gallery-track {
    height: 100%;
}

.articles .vk-gallery-item {
    height: 100%;
}

.vk-video {
    display: grid;
    gap: 16px;
    width: 100%;
    min-width: 0;
    margin: 16px 0;
}

.article-video-player {
    --video-accent: #d5ad68;
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 35%, rgba(213, 173, 104, 0.13), transparent 45%),
        #11100f;
    box-shadow: 0 16px 36px rgba(24, 20, 15, 0.2);
    isolation: isolate;
}

.article-video-player:focus-visible {
    outline: 3px solid rgba(213, 173, 104, 0.65);
    outline-offset: 3px;
}

.article-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    cursor: pointer;
}

.article-video-start {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    width: clamp(58px, 10vw, 76px);
    height: clamp(58px, 10vw, 76px);
    padding: 0;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    background: rgba(20, 18, 16, 0.68);
    color: #fff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.article-video-start:hover {
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(174, 127, 58, 0.88);
}

.article-video-start svg {
    width: 40%;
    fill: currentColor;
    stroke: currentColor;
}

.article-video-player.is-playing .article-video-start {
    opacity: 0;
    pointer-events: none;
}

.article-video-player.uses-native-controls .article-video-start,
.article-video-player.uses-native-controls .article-video-controls {
    display: none;
}

.article-video-controls {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 20px 16px 10px;
    color: #fff;
    background: linear-gradient(to top, rgba(8, 7, 6, 0.9), rgba(8, 7, 6, 0));
}

.article-video-button {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 7px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.article-video-button:hover,
.article-video-button:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    color: var(--video-accent);
    outline: none;
}

.article-video-button svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.article-video-button .video-icon-play {
    fill: currentColor;
    stroke-width: 1.4;
}

.video-icon-pause,
.video-icon-muted {
    display: none;
}

.article-video-player.is-playing .video-icon-play,
.article-video-player.is-muted .video-icon-volume {
    display: none;
}

.article-video-player.is-playing .video-icon-pause,
.article-video-player.is-muted .video-icon-muted {
    display: block;
}

.article-video-time {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.article-video-progress-wrap {
    display: flex;
    flex: 1 1 auto;
    min-width: 50px;
    align-items: center;
}

.article-video-volume-wrap {
    display: flex;
    flex: 0 1 72px;
    align-items: center;
}

.article-video-progress,
.article-video-volume {
    width: 100%;
    height: 4px;
    margin: 0;
    appearance: none;
    border: 0;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.article-video-progress {
    background: linear-gradient(
        to right,
        var(--video-accent) 0 var(--video-progress, 0%),
        rgba(255, 255, 255, 0.32) var(--video-progress, 0%) 100%
    );
}

.article-video-volume {
    background: linear-gradient(
        to right,
        var(--video-accent) 0 var(--video-volume, 100%),
        rgba(255, 255, 255, 0.32) var(--video-volume, 100%) 100%
    );
}

.article-video-progress::-webkit-slider-thumb,
.article-video-volume::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    appearance: none;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--video-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}

.article-video-progress::-moz-range-thumb,
.article-video-volume::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--video-accent);
}

.article-video-player:fullscreen {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
}

/* ---------- Full-size article gallery ---------- */

.vk-gallery-item {
    cursor: zoom-in;
    user-select: none;
}

.vk-gallery-item:focus-visible {
    outline: 4px solid rgba(213, 173, 104, 0.88);
    outline-offset: -4px;
}

body.article-lightbox-open {
    overflow: hidden;
}

.article-lightbox[hidden] {
    display: none !important;
}

.article-lightbox-arrow[hidden] {
    display: none !important;
}

.article-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    padding: 32px 88px;
    place-items: center;
    background: rgba(10, 9, 8, 0.94);
    backdrop-filter: blur(16px);
}

.article-lightbox-figure {
    display: grid;
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0;
    place-items: center;
}

.article-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 64px);
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
    user-select: none;
}

.article-lightbox-close,
.article-lightbox-arrow {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.article-lightbox-close:hover,
.article-lightbox-arrow:hover,
.article-lightbox-close:focus-visible,
.article-lightbox-arrow:focus-visible {
    background: rgba(201, 169, 110, 0.88);
    outline: none;
}

.article-lightbox-close svg,
.article-lightbox-arrow svg {
    width: 55%;
    height: 55%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.article-lightbox-close {
    position: absolute;
    top: 22px;
    right: 24px;
    z-index: 2;
    width: 48px;
    height: 48px;
}

.article-lightbox-close:hover {
    transform: rotate(4deg) scale(1.05);
}

.article-lightbox-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 54px;
    height: 54px;
    transform: translateY(-50%);
}

.article-lightbox-arrow:hover {
    transform: translateY(-50%) scale(1.06);
}

.article-lightbox-prev {
    left: 22px;
}

.article-lightbox-next {
    right: 22px;
}

.article-lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    min-width: 64px;
    padding: 7px 12px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(18, 16, 14, 0.72);
    color: #fff;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

@media (max-width: 640px) {

    .article-lightbox {
        padding: 18px 12px 92px;
    }

    .article-lightbox-image {
        max-height: calc(100dvh - 118px);
        border-radius: 7px;
    }

    .article-lightbox-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .article-lightbox-arrow {
        top: auto;
        bottom: 16px;
        width: 46px;
        height: 46px;
        transform: none;
    }

    .article-lightbox-arrow:hover {
        transform: scale(1.05);
    }

    .article-lightbox-prev {
        left: calc(50% - 66px);
    }

    .article-lightbox-next {
        right: calc(50% - 66px);
    }

    .article-lightbox-counter {
        bottom: 69px;
    }

}

