/* =========================
   ARTICLE: BASE LAYOUT
   ========================= */
.article-hero {
    display: grid;
    grid-template-columns: 420px 1fr;
    grid-template-areas: "image head";
    gap: 24px;
    align-items: start;
}

.article-hero .img-card {
    grid-area: image;
}

.article-hero .article-head {
    grid-area: head;
}

.article__title {
    line-height: 1.1;
    margin: 0 0 10px;
}

.article__meta {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    opacity: .85;
    flex-wrap: wrap;
}

.article-hero__intro p {
    margin: 0 0 12px;
}

.article__content {
    max-width: 770px;
    margin: 12px auto 32px;
}

/* =========================
   IMAGES (универсально)
   ========================= */
.img-card {
    margin: 16px auto;
    text-align: center;
    max-width: 100%;
    /* не шире контейнера */
    width: 100%;
}

.img-card__img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 6px;
}

.img-card__cap {
    font-size: .9em;
    line-height: 1.35;
    margin-top: 6px;
    opacity: .75;
}

.img-card--center {
    max-width: 820px;
}

/* float только на десктопе для картинок ВНУТРИ текста */
@media (min-width:900px) {
    .img-card--left {
        float: left;
        margin: 4px 20px 16px 0;
    }

    .img-card--right {
        float: right;
        margin: 4px 0 16px 20px;
    }
}

/* =========================
   PULLQUOTE (desktop defaults)
   ========================= */
.pullquote {
    align-items: baseline;
    color: #111;
    cursor: pointer;
    font-style: italic;
    gap: 0;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.pullquote__text {
    font-style: inherit;
}

.pullquote__icon {
    display: inline-block;
    color: #111;
    height: .9em;
    line-height: 0;
    margin-left: 2px;
}

.pullquote__icon svg {
    height: 24px;
    width: 24px;
}

.pullquote__tip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 10px);
    width: 700px;
    background: rgba(0, 0, 0, .9);
    color: #fff;
    font-size: .92em;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 9999;
}

.pullquote__tip:before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: rgba(0, 0, 0, .9);
}

.pullquote:hover .pullquote__tip {
    opacity: 1;
}

/* =========================
   SAFETY
   ========================= */
html,
body {
    overflow-x: hidden;
}

/* ===================================================================
   MEDIA QUERIES (все снизу для читаемости)
   =================================================================== */

/* ≤960px: колонка stack — title → meta → image → intro */
@media (max-width:960px) {
    .article-hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "meta"
            "image"
            "intro";
        gap: 0;
    }

    .article-hero .article-head {
        display: contents;
    }

    /* дети .article-head участвуют в гриде */
    .article-hero .article-title {
        grid-area: title;
        font-size: 20px;
    }

    .article-hero .article-meta {
        grid-area: meta;
        font-size: 12px;
    }

    .article-hero .img-card {
        grid-area: image;
        float: none;
        clear: both;
        margin: 8px 0 12px;
    }

    .article-hero .article-intro {
        grid-area: intro;
        font-size: 16px;
    }

    .article__content {
        column-count: 1;
        column-gap: 0;
        overflow: visible;
    }

    /* подсказка на планшете ужимается по ширине */
    .pullquote__tip {
        width: auto;
        max-width: 90vw;
    }
}

/* 741–960px: у hero-картинки ограничиваем высоту, лишнее — «за рамки»  */
@media (min-width:741px) and (max-width:960px) {
    .article-hero .img-card{
    position: relative;
    height: min(62vh, 560px);   
    overflow: hidden;           
    border-radius: 10px;       
    max-width: 100%;
    width: 100%;
  }
  .article-hero .img-card__img{
    position: absolute;
    inset: 0;                   
    width: 100%;
    height: 100%;
    object-fit: contain;          
    display: block;
  }
}

/* ≤740px: мобильная модалка для pullquote */
@media (max-width:740px) {

    /* отключаем hover-появление */
    .pullquote:hover .pullquote__tip {
        opacity: 0;
    }

    /* затемнение */
    .pullquote-scrim {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
        z-index: 9997;
    }

    .pullquote-scrim.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* модалка: центр, 100vw, прокрутка внутри */
    .pullquote .pullquote__tip {
        position: fixed !important;
        top: 50% !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(-50%) !important;
        /* перебиваем translateX */
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: calc(100vh - 48px) !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 18px 48px 18px 16px;
        border-radius: 10px;
        background: rgba(0, 0, 0, .82);
        box-shadow: 0 10px 28px rgba(0, 0, 0, .30);
        opacity: 0;
        pointer-events: none;
        z-index: 9998;
    }

    .pullquote.is-open .pullquote__tip {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .pullquote .pullquote__tip:before {
        display: none !important;
    }

    .pullquote__close {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
        border: 0;
        border-radius: 6px;
        background: rgba(255, 255, 255, .14);
        color: #fff;
        line-height: 28px;
        text-align: center;
        font-size: 20px;
        cursor: pointer;
    }

    .pullquote__close:before {
        content: "×";
    }

    .pullquote .pullquote__tip p {
        margin: 0 0 12px;
    }

    /* блокируем фон, когда модалка открыта */
    .pullquote-lock {
        overflow: hidden;
        height: 100vh;
    }
}

/* ≥961px: во время «разреза» прячем только интро, hover не ломаем */
@media (min-width:961px) {
    .intro-hide-desktop {
        opacity: 0;
        pointer-events: none;
    }
}

/* на мобильных отключаем флоаты картинок внутри текста */
@media (max-width:899px) {

    .img-card--left,
    .img-card--right {
        float: none;
    }
}