/* =========================================================
   Единая карточка записи (reboot-child / inc/cards.php)
   Разделы и рубрики, карусели главной, «Ещё из рубрики»,
   подборки «Куда сходить», «Избранное»
   ========================================================= */

.mc-card {
    --rb: #2d81e0;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 8px 8px 6px;
    background: #fff;
    border: 1px solid #eceef2;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mc-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--rb) 30%, #eceef2);
    box-shadow: 0 14px 28px -16px rgba(16, 24, 40, .3);
}

.mc-card .hr-card__link {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 7px;
    height: auto;
    color: #15171c;
    text-decoration: none;
}

/* фото */
.mc-card .hr-card__media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f4f7;
    isolation: isolate;
    box-shadow: none;
}
.mc-card .hr-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.mc-card .hr-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
    pointer-events: none;
}
.mc-card .hr-card__link:hover .hr-card__media img { transform: scale(1.06); }
.mc-card .hr-card__ph {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 38px;
    background:
        radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--rb) 30%, #fff) 0, transparent 60%),
        linear-gradient(135deg, color-mix(in srgb, var(--rb) 18%, #fff), color-mix(in srgb, var(--rb) 42%, #fff));
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.mc-card .hr-card__link:hover .hr-card__ph { transform: scale(1.06); }

/* плашка рубрики на фото */
.mc-card__rb {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 16px);
    padding: 3px 10px 3px 3px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    color: #15171c;
    background: rgba(255, 255, 255, .93);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform .25s ease;
}
.mc-card__rb i {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-style: normal;
    background: color-mix(in srgb, var(--rb) 22%, #fff);
}
.mc-card .hr-card__link:hover .mc-card__rb { transform: translateY(-1px); }

/* причина попадания в подборку — внизу фото */
.mc-card__why {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    max-width: calc(100% - 16px);
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    background: rgba(17, 19, 24, .72);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* текст */
.mc-card .hr-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 1px 2px 0;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -.005em;
    transition: color .2s ease;
}
.mc-card .hr-card__link:hover .hr-card__title { color: color-mix(in srgb, var(--rb) 85%, #000); }
.mc-card .hr-card__sub {
    margin: -3px 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #6f7680;
}
.mc-card .mc-card__st {
    display: block;
    min-height: 0;
    margin: -2px 2px 0;
    line-height: 1.3;
    font-size: 12.5px;
}
.mc-card .mc-card__st .rf-status { font-size: 12.5px; }

/* ---------- нижняя строка: просмотры · комментарии · закладки · рейтинг ---------- */
.mc-meta {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 8px -2px 0;
    padding-top: 6px;
    border-top: 1px solid #f0f1f4;
    font-size: 12.5px;
    line-height: 1;
    color: #8b9099;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.mc-meta .mc-meta__i {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    margin: 0;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: none;
    transition: color .2s ease, background .2s ease;
}
.mc-meta__i svg { flex-shrink: 0; display: block; }
.mc-meta__i b { font-weight: 600; }
.mc-meta a.mc-meta__i:hover { color: #2d81e0; background: #eef4fd; }
.mc-meta .mc-fav { cursor: pointer; }
.mc-meta .mc-fav:hover { color: #2d81e0; background: #eef4fd; }
.mc-meta .mc-fav.is-active { color: #2d81e0; }
.mc-meta .mc-fav:focus-visible { outline: 2px solid #2d81e0; outline-offset: 1px; }

.mc-rate {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 0 4px 0 2px;
    font-size: 13px;
    font-weight: 700;
}
.mc-rate i {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
}
.mc-rate i svg { display: block; }
.mc-rate.is-pos { color: #1a9e52; }
.mc-rate.is-pos i { background: #1fa45a; box-shadow: 0 2px 6px -1px rgba(31, 164, 90, .45); }
.mc-rate.is-neg { color: #e0475a; }
.mc-rate.is-neg i { background: #e5484d; box-shadow: 0 2px 6px -1px rgba(229, 72, 77, .45); }

/* ---------- в каруселях ---------- */
.hr-track { padding-top: 6px; padding-bottom: 14px; grid-auto-columns: 232px; }
.hr-track > .hr-card--more {
    padding: 8px;
    border: 1px dashed color-mix(in srgb, var(--rb) 35%, #e5e7eb);
    border-radius: 14px;
    background: #fff;
}
.hr-track > .hr-card--more .hr-card__link { height: 100%; }

/* ---------- сетка в разделах, рубриках и «Избранном» — как белая панель карусели на главной ----------
   (ID-селекторы — чтобы перебить «#main .post-cards» старой ленты из style.css) */
#main .post-cards:has(> .mc-card),
#primary .post-cards:has(> .mc-card),
.post-cards.fav-cards:has(> .mc-card) {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    flex-direction: row !important;
    gap: 16px 14px !important;
    align-items: stretch;
    margin: 0 0 20px !important;
    padding: 20px !important;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.post-cards > .mc-card {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}
.post-cards > .mc-card.is-fresh { animation: mc-fresh 1.2s ease; }
@keyframes mc-fresh {
    0%   { box-shadow: 0 0 0 3px color-mix(in srgb, var(--rb) 45%, transparent); }
    100% { box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
}

/* ---------- адаптив ---------- */
@media (max-width: 768px) {
    .hr-track { grid-auto-columns: 212px; }
    #main .post-cards:has(> .mc-card),
    #primary .post-cards:has(> .mc-card),
    .post-cards.fav-cards:has(> .mc-card) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px 10px !important;
        padding: 16px !important;
        border-radius: 0;
        box-shadow: none;
    }
}
@media (max-width: 599px) {
    .hr-track { grid-auto-columns: min(64vw, 212px); }
    .mc-card { padding: 6px 6px 4px; border-radius: 12px; }
    .mc-card .hr-card__media { border-radius: 8px; }
    .mc-card .hr-card__title { font-size: 14px; }
    .mc-card .hr-card__sub { font-size: 12.5px; }
    .mc-card__rb { top: 6px; left: 6px; font-size: 11.5px; padding-right: 8px; }
    .mc-card__rb i { width: 20px; height: 20px; font-size: 11px; }
    .mc-meta { gap: 0; margin-top: 6px; padding-top: 4px; font-size: 12px; }
    .mc-meta .mc-meta__i { gap: 3px; padding: 0 4px; height: 26px; }
    .mc-meta__i svg { width: 14px; height: 14px; }
    .mc-rate { gap: 4px; font-size: 12px; padding-right: 2px; }
    .mc-rate i { width: 18px; height: 18px; }
}
@media (max-width: 359px) {
    #main .post-cards:has(> .mc-card),
    #primary .post-cards:has(> .mc-card),
    .post-cards.fav-cards:has(> .mc-card) { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
    .mc-card,
    .mc-card .hr-card__media img,
    .mc-card .hr-card__ph,
    .mc-card__rb { transition: none; }
    .mc-card:hover { transform: none; }
}
