/* =====================================================================
   VOLAGO — лента находок (главная, «Горячее», «Подписки»)
   static/css/vlg_feed.css
   Цвета из переменных Bootstrap → светлая и тёмная тема работают сами.
   ===================================================================== */
.fc, .fw, .fw-mhead, .tm-card, .fc-toast, .sub-head {
    --fc-accent: #FF6B00;
    --fc-accent-ink: #E85F00;
    --fc-hot: #FF3D00;
    --fc-cold: #03A9F4;
    --fc-ink: var(--bs-body-color);
    --fc-muted: var(--bs-secondary-color);
    --fc-line: var(--bs-border-color);
    --fc-surface: var(--bs-body-bg);
    --fc-sunken: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .fc, [data-bs-theme="dark"] .fw, [data-bs-theme="dark"] .fw-mhead,
[data-bs-theme="dark"] .tm-card, [data-bs-theme="dark"] .fc-toast {
    --fc-surface: #242526;
    --fc-sunken: #1c1d1f;
    --fc-line: #3a3b3c;
}

/* ============================ КАРТОЧКА ============================ */
.fc {
    position: relative;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    grid-template-areas: "media body" "media foot";
    background: var(--fc-surface);
    border: 1px solid var(--fc-line);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.fc:hover { box-shadow: 0 16px 36px -22px rgba(20, 20, 30, .45); border-color: color-mix(in srgb, var(--fc-line) 60%, var(--fc-muted)); }
[data-bs-theme="dark"] .fc:hover { box-shadow: 0 16px 36px -18px rgba(0, 0, 0, .8); }
.fc a { text-decoration: none; }

/* Вся карточка кликабельна (ссылка заголовка растянута), кнопки — поверх */
.fc-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fc-vote, .fc-follow, .fc-stat, .fc-author, .fc-cta, .fc-admin { position: relative; z-index: 2; }

/* --- Фото --- */
.fc-media { grid-area: media; position: relative; display: block; background: var(--fc-sunken); min-height: 190px; overflow: hidden; }
.fc-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.fc:hover .fc-media img { transform: scale(1.03); }
.fc--archived .fc-media img { filter: grayscale(.9); opacity: .8; }
.fc-flags { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 5px; z-index: 2; pointer-events: none; }
.fc-flag {
    font-size: .7rem; font-weight: 800; line-height: 1;
    padding: 6px 9px; border-radius: 999px;
    background: rgba(33, 37, 41, .82); color: #fff;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.fc-flag--hot { background: var(--fc-hot); }
.fc-flag--sale { background: var(--fc-accent); }

/* --- Текст --- */
.fc-body { grid-area: body; min-width: 0; padding: 16px 18px 10px; display: flex; flex-direction: column; gap: 6px; }
.fc-top { display: flex; align-items: center; gap: 10px; font-size: .74rem; color: var(--fc-muted); }
.fc-cat { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--fc-ink); }
.fc-cat i { color: var(--fc-accent); font-size: .72rem; }
.fc-time { white-space: nowrap; }
.fc-admin {
    margin-left: auto; width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--fc-line); background: var(--fc-surface); color: #0dcaf0;
    display: inline-flex; align-items: center; justify-content: center; font-size: .75rem;
}

.fc-title { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.3; letter-spacing: -.005em; }
.fc-title a { color: var(--fc-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fc:hover .fc-title a { color: var(--fc-accent-ink); }

.fc-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 9px; margin-top: 2px; }
.fc-price { font-size: 1.35rem; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; color: var(--fc-hot); font-variant-numeric: tabular-nums; }
.fc-old { font-size: .85rem; color: var(--fc-muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.fc-save { font-size: .72rem; font-weight: 800; color: var(--fc-accent-ink); background: color-mix(in srgb, var(--fc-accent) 13%, transparent); padding: 3px 8px; border-radius: 999px; }

.fc-route { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: var(--fc-muted); margin-top: 2px; }
.fc-route > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.fc-route i { color: var(--fc-accent); font-size: .74rem; }
.fc-route b { color: var(--fc-ink); font-weight: 700; }
.fc-dir { max-width: 100%; }
.fc-dir span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Колокольчик «Следить за направлением» */
.fc-follow {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px dashed color-mix(in srgb, var(--fc-accent) 55%, transparent);
    background: transparent; color: var(--fc-accent-ink);
    font-size: .72rem; font-weight: 700; line-height: 1;
    padding: 5px 9px; border-radius: 999px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.fc-follow i { color: inherit !important; font-size: .7rem !important; }
.fc-follow:hover { background: color-mix(in srgb, var(--fc-accent) 10%, transparent); }
.fc-follow.is-on { border-style: solid; border-color: transparent; background: color-mix(in srgb, var(--fc-accent) 13%, transparent); }
.fc-follow--icon { display: none; width: 34px; height: 34px; padding: 0; justify-content: center; font-size: .85rem; }
.fc-follow--icon i { font-size: .85rem !important; }

/* --- Нижняя строка --- */
.fc-foot {
    grid-area: foot; min-width: 0;
    display: flex; align-items: center; gap: 14px;
    padding: 10px 18px 14px;
}
.fc-vote {
    display: inline-flex; align-items: center; gap: 1px;
    padding: 3px; border-radius: 999px;
    border: 1px solid var(--fc-line); background: var(--fc-surface);
}
.fc-vote button {
    width: 30px; height: 30px; border-radius: 50%; border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; font-weight: 700; line-height: 1;
    background: var(--fc-sunken); color: var(--fc-ink);
    transition: background .15s ease, color .15s ease, transform .1s ease;
}
.fc-vote button:active { transform: scale(.88); }
.fc-vote button[data-dir="up"]:hover, .fc-vote.is-up button[data-dir="up"] { background: var(--fc-hot); color: #fff; }
.fc-vote button[data-dir="down"]:hover, .fc-vote.is-down button[data-dir="down"] { background: var(--fc-cold); color: #fff; }
.fc-score { min-width: 50px; text-align: center; font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; color: var(--fc-ink); }
.fc-score.is-warm { color: var(--fc-accent-ink); }
.fc-score.is-hot { color: var(--fc-hot); }
.fc-score.is-cold { color: var(--fc-cold); }

.fc-stat { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 700; color: var(--fc-muted); }
.fc-stat:hover { color: var(--fc-ink); }
.fc-author { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: .8rem; font-weight: 600; color: var(--fc-muted); }
.fc-author:hover { color: var(--fc-ink); }
.fc-author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; background: var(--fc-sunken); }
.fc-author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.fc-cta {
    margin-left: auto; flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 999px;
    background: var(--fc-accent); color: #fff !important;
    font-size: .86rem; font-weight: 800;
    box-shadow: 0 8px 18px -10px rgba(255, 107, 0, .7);
    transition: background .15s ease;
}
.fc-cta:hover { background: var(--fc-accent-ink); }
.fc--archived .fc-cta { background: transparent; color: var(--fc-muted) !important; border: 1px solid var(--fc-line); box-shadow: none; }

.fc a:focus-visible, .fc button:focus-visible { outline: 2px solid var(--fc-accent); outline-offset: 2px; }

/* ============================ ТЕЛЕФОН ============================ */
@media (max-width: 767.98px) {
    .fc {
        grid-template-columns: 112px minmax(0, 1fr);
        grid-template-rows: auto auto;
        grid-template-areas: "media body" "foot foot";
        border-radius: 16px; margin-bottom: 12px;
    }
    .fc:hover { transform: none; }
    .fc-media { min-height: 0; margin: 12px 0 0 12px; border-radius: 12px; }
    .fc-flags { top: 6px; left: 6px; }
    .fc-flag { font-size: .62rem; padding: 4px 7px; }
    .fc-flag--sale { display: none; }                 /* скидка и так видна у цены */
    .fc-body { padding: 12px 12px 4px 12px; gap: 4px; }
    .fc-top { font-size: .7rem; gap: 8px; }
    .fc-title { font-size: .94rem; font-weight: 700; line-height: 1.3; }
    .fc-title a { -webkit-line-clamp: 3; }
    .fc-price { font-size: 1.12rem; }
    .fc-old { font-size: .78rem; }
    .fc-route { font-size: .78rem; gap: 3px 10px; }
    .fc-route .fc-dates { display: none; }            /* даты — отдельной строкой ниже */
    .fc-route .fc-follow { display: none; }           /* «Следить» — колокольчиком внизу */
    .fc-follow--icon { display: inline-flex; }
    .fc-dates-m { display: flex !important; }
    .fc-foot { padding: 8px 12px 12px; gap: 12px; border-top: 1px solid var(--fc-line); margin-top: 8px; }
    .fc-vote button { width: 32px; height: 32px; }
    .fc-author { margin-left: auto; }
    .fc-author span { max-width: 96px; }
    .fc-cta { display: none; }
}
.fc-dates-m { display: none; align-items: center; gap: 6px; font-size: .76rem; color: var(--fc-muted); }
.fc-dates-m i { color: var(--fc-accent); font-size: .72rem; }

@media (max-width: 359.98px) {
    .fc { grid-template-columns: 92px minmax(0, 1fr); }
    .fc-author span { display: none; }
}

/* ============================ ВИДЖЕТЫ САЙДБАРА ============================ */
.fw {
    background: var(--fc-surface);
    border: 1px solid var(--fc-line);
    border-radius: 18px;
    padding: 16px 16px 10px;
    margin-bottom: 16px;
}
.fw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fw-title { font-size: .95rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--fc-ink); }
.fw-title i { color: var(--fc-accent); }
.fw-nav {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--fc-line);
    background: transparent; color: var(--fc-muted); font-size: .72rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.fw-nav:hover { color: var(--fc-ink); background: var(--fc-sunken); }
.fw .list-group { --bs-list-group-bg: transparent; }
.fw-empty { padding: 10px 4px; font-size: .84rem; color: var(--fc-muted); text-align: center; }

/* строка топа (partials/top_desktop.html, также в попапе при уходе) */
.td-item {
    display: flex !important; align-items: center; gap: 10px;
    padding: 9px 6px !important; border: 0 !important; border-radius: 12px;
    background: transparent !important; color: var(--bs-body-color) !important;
    text-decoration: none;
}
.td-item:hover { background: var(--bs-tertiary-bg) !important; }
.td-rank {
    flex: none; width: 22px; height: 22px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 800; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg);
}
.td-item:first-child .td-rank { background: color-mix(in srgb, #FF6B00 16%, transparent); color: #E85F00; }
.td-title { flex: 1; min-width: 0; font-size: .82rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.td-temp { flex: none; font-size: .74rem; font-weight: 800; color: #E85F00; font-variant-numeric: tabular-nums; }
.td-temp.is-hot { color: #FF3D00; }

.fw-disc {
    display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 12px;
    color: var(--fc-ink); text-decoration: none;
}
.fw-disc:hover { background: var(--fc-sunken); color: var(--fc-ink); }
.fw-disc-title { flex: 1; min-width: 0; font-size: .82rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fw-disc-meta { flex: none; font-size: .74rem; color: var(--fc-muted); display: inline-flex; align-items: center; gap: 4px; }

.fw-social { text-align: center; padding: 18px 16px; }
.fw-social p { font-size: .82rem; color: var(--fc-muted); margin: 4px 0 14px; }
.fw-social-row { display: flex; justify-content: center; gap: 10px; }
.fw-social-row a {
    width: 42px; height: 42px; border-radius: 12px; font-size: 1.15rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--fc-sunken); transition: transform .15s ease;
}
.fw-social-row a:hover { transform: translateY(-2px); }
.fw-social-row .s-tg { color: #229ED9; } .fw-social-row .s-vk { color: #0077FF; }
.fw-social-row .s-ig { color: #E1306C; } .fw-social-row .s-yt { color: #FF0000; }
.fw-more { font-size: .78rem; font-weight: 700; color: var(--fc-muted); text-decoration: none; }
.fw-more:hover { color: var(--fc-ink); }

/* ============================ ТОП НА ТЕЛЕФОНЕ ============================ */
.fw-mhead { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; margin-bottom: 6px; }
.fw-mhead h6 { margin: 0; font-size: .9rem; font-weight: 800; color: var(--bs-body-color); display: flex; align-items: center; gap: 7px; }
.fw-mhead h6 i { color: #FF6B00; }
.mobile-top-swiper .tm-card.top-card-mobile { width: 150px; }
.tm-card {
    display: flex !important; flex-direction: column; height: 100%;
    background: var(--fc-surface); border: 1px solid var(--fc-line); border-radius: 14px;
    overflow: hidden; text-decoration: none; color: var(--fc-ink);
}
.tm-card:hover { color: var(--fc-ink); }
.tm-img { position: relative; display: block; height: 92px; background: var(--fc-sunken); }
.tm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-temp {
    position: absolute; left: 7px; bottom: 7px;
    font-size: .7rem; font-weight: 800; line-height: 1; padding: 4px 7px; border-radius: 999px;
    background: var(--fc-hot); color: #fff;
}
.tm-body { padding: 8px 9px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tm-title { font-size: .74rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tm-price { margin-top: auto; font-size: .82rem; font-weight: 800; color: var(--fc-hot); }

/* ============================ ШАПКА «ПОДПИСКИ» ============================ */
.sub-head { padding: 20px; }
.sub-head-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sub-head-ic {
    width: 48px; height: 48px; flex: none; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
    background: color-mix(in srgb, var(--fc-accent) 13%, transparent); color: var(--fc-accent-ink);
}
.sub-head-text { flex: 1; min-width: 220px; }
.sub-head-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 2px; color: var(--fc-ink); }
.sub-head-text p { margin: 0; font-size: .86rem; color: var(--fc-muted); }
.sub-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sub-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
    font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap;
    border: 1px solid var(--fc-line); color: var(--fc-ink); background: var(--fc-surface);
}
.sub-btn:hover { background: var(--fc-sunken); color: var(--fc-ink); }
.sub-btn--tg { background: #229ED9; border-color: #229ED9; color: #fff; }
.sub-btn--tg:hover { background: #1c8cc2; color: #fff; }
.sub-btn--ok { background: color-mix(in srgb, #16a34a 12%, transparent); border-color: transparent; color: #16a34a; cursor: default; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--fc-line); }
.sub-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 6px 11px; border-radius: 999px; background: var(--fc-sunken); color: var(--fc-ink); }
.sub-chip i { color: var(--fc-accent); font-size: .7rem; }
.sub-chip-add { background: transparent; border: 1px dashed var(--fc-line); color: var(--fc-muted); text-decoration: none; }
.sub-chip-add:hover { color: var(--fc-ink); }
.sub-empty { text-align: center; padding: 40px 20px; }
.sub-empty-ic { font-size: 2rem; display: block; margin-bottom: 10px; }
.sub-empty h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 6px; color: var(--fc-ink); }
.sub-empty p { font-size: .88rem; color: var(--fc-muted); margin: 0 auto 16px; max-width: 420px; }
@media (max-width: 575.98px) {
    .sub-head { padding: 16px; }
    .sub-head-actions { width: 100%; }
    .sub-head-actions .sub-btn { flex: 1; justify-content: center; }
}

/* ============================ ТОСТ ============================ */
.fc-toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 1080;
    transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
    max-width: calc(100% - 32px); text-align: center;
    background: var(--fc-ink); color: var(--fc-surface);
    font-size: .86rem; font-weight: 600; padding: 10px 18px; border-radius: 999px;
    transition: opacity .2s ease, transform .2s ease;
}
.fc-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fc-toast a { color: inherit; text-decoration: underline; }
@media (max-width: 991.98px) { .fc-toast { bottom: calc(76px + env(safe-area-inset-bottom)); } }

@media (prefers-reduced-motion: reduce) {
    .fc, .fc-media img, .fc-toast { transition: none !important; }
}
