/* Лента Instagram (окно 8, задача владельца: «при наведении ничего не происходит — сделать, чтобы можно было взаимодействовать»).
   Подключается только при ленте роликов (igBlock). Лента — карусель с прокруткой, snap и перетаскиванием мышью на всех ширинах;
   наведение (ПК) — подъём, наклон за курсором, свечение по краю, подпись и «Ver con sonido»; клик — просмотрщик (.igx);
   лента — рулетка «колода» (вариант D, владелец 28.10, правила в конце файла). DESIGN.md §7:
   только transform и opacity, --aw-ease-out, длительности --aw-dur-*, «меньше движения» — без наклона и инерции. */

.igx-wrap { position: relative; }

/* Карточка: свечение по краю (свой слой, только opacity), подсказка «Ver con sonido» */
.ig-card { transition: transform var(--aw-dur-base) var(--aw-ease-out), opacity var(--aw-dur-base) var(--aw-ease-out), border-color var(--aw-dur-fast) ease; transform-style: preserve-3d; }
.ig-card::before { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: 0;
    box-shadow: inset 0 0 0 1.5px var(--aw-accent), inset 0 0 28px rgba(255,59,78,0.35); transition: opacity var(--aw-dur-base) var(--aw-ease-out); }
.igx-play { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px;
    border-radius: 999px; background: var(--aw-btn-fill); color: #fff; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em;
    opacity: 0; transform: translateY(8px); transition: opacity var(--aw-dur-base) var(--aw-ease-out), transform var(--aw-dur-base) var(--aw-ease-out); }
.igx-play svg { width: 12px; height: 12px; fill: currentColor; }
.ig-card .ig-cap { transition: transform var(--aw-dur-base) var(--aw-ease-out); }

@media (hover: hover) and (pointer: fine) {
    .ig-card:hover::before, .ig-card:focus-visible::before { opacity: 1; }
    .ig-card:hover .igx-play, .ig-card:focus-visible .igx-play { opacity: 1; transform: none; }
    .ig-card:hover .ig-cap, .ig-card:focus-visible .ig-cap { transform: translateY(-40px); }
}

/* ---------- Просмотрщик (dialog, в стиле Stories / Reels) ---------- */
.igx { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff;
    overflow: hidden; opacity: 0; transition: opacity var(--aw-dur-base) var(--aw-ease-out); }
.igx::backdrop { background: rgba(5,5,7,0.92); backdrop-filter: blur(14px); }
.igx.on { opacity: 1; }
.igx-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); touch-action: pan-y; }
.igx-frame { position: relative; height: min(100%, 860px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 22px; overflow: hidden; background: #0b0b0d;
    box-shadow: 0 30px 80px rgba(0,0,0,0.55); transform: scale(0.96); transition: transform var(--aw-dur-base) var(--aw-ease-out); }
.igx.on .igx-frame { transform: none; }
.igx-media { position: absolute; inset: 0; transition: opacity var(--aw-dur-fast) ease; }
.igx-media.swap { opacity: 0; }
.igx-media :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.igx-frame::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(5,5,7,0.55), transparent 18%, transparent 58%, rgba(5,5,7,0.9)); }

.igx-bars { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; display: flex; gap: 4px; }
.igx-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.28); overflow: hidden; }
.igx-bars i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.igx-bars .done i { transform: scaleX(1); }

.igx-top { position: absolute; top: 26px; left: 14px; right: 14px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.igx-follow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.86rem; color: #fff; text-decoration: none; }
.igx-follow b { padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.4); font-weight: 600; font-size: 0.76rem; }
.igx-follow:hover b { background: #fff; color: #050505; }
.igx-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(12,12,14,0.55); color: #fff; cursor: pointer;
    transition: transform var(--aw-dur-fast) var(--aw-ease-out), background var(--aw-dur-fast) ease; }
.igx-btn:hover { background: rgba(255,255,255,0.16); }
.igx-btn:active { transform: scale(0.94); }
.igx-btn:focus-visible, .igx-follow:focus-visible, .igx-open:focus-visible { outline: 2px solid var(--aw-accent); outline-offset: 2px; }
.igx-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.igx-mute { position: absolute; top: 74px; right: 14px; z-index: 2; }

.igx-side { position: absolute; top: 50%; z-index: 3; margin-top: -24px; width: 48px; height: 48px; }
.igx-side.prev { left: max(12px, calc(50% - min(48vh, 242px) - 64px)); } .igx-side.prev svg { transform: scaleX(-1); }
.igx-side.next { right: max(12px, calc(50% - min(48vh, 242px) - 64px)); }
.igx-side[disabled] { opacity: 0.25; cursor: default; }
@media (max-width: 640px) { .igx-side { display: none; } .igx-stage { padding: 0; } .igx-frame { height: 100%; border-radius: 0; } }

.igx-bottom { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2; display: grid; gap: 12px; }
.igx-cap { margin: 0; font-size: 0.92rem; line-height: 1.45; color: rgba(255,255,255,0.92); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.igx-open { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--aw-radius-md); background: #fff; color: #050505;
    font-weight: 600; font-size: 0.88rem; text-decoration: none; transition: transform var(--aw-dur-fast) var(--aw-ease-out); }
.igx-open:active { transform: scale(0.97); }
/* зоны тапа по краям (телефон): левая треть — назад, правая — вперёд */
.igx-tap { position: absolute; top: 90px; bottom: 120px; z-index: 1; width: 33%; border: 0; background: transparent; cursor: pointer; }
.igx-tap.prev { left: 0; } .igx-tap.next { right: 0; }

@media (prefers-reduced-motion: reduce) {
    .ig-card { transition: opacity var(--aw-dur-fast) ease; transform: none !important; }
    .igx-play, .ig-card .ig-cap, .igx-frame { transition: opacity var(--aw-dur-fast) ease; transform: none !important; }
}

/* Рулетка (вариант D): веер-колода по кругу. Слоты двигает JS (только transform/opacity), здесь — сцена, тень боковых, кнопки */
#redes .ig-rail.igd { display: block; position: relative; overflow: visible; height: calc(var(--igd-w, 300px) * 16 / 9 + 40px); margin: 0; padding: 20px 0;
    perspective: 1400px; perspective-origin: 50% 45%; scroll-snap-type: none; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none;
    -webkit-mask-image: none; mask-image: none; }
#redes .ig-rail.igd.is-spin { cursor: grabbing; }
#redes .ig-rail.igd:focus-visible { outline: 2px solid var(--aw-accent); outline-offset: 6px; border-radius: 24px; }
.igd-on { overflow: hidden; margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut); }
.igd-slot { position: absolute; left: 50%; top: 20px; width: var(--igd-w, 300px); margin-left: calc(var(--igd-w, 300px) / -2); aspect-ratio: 9 / 16;
    transform-style: preserve-3d; will-change: transform, opacity; }
.igd-slot .ig-card { width: 100%; height: 100%; aspect-ratio: auto; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
#redes .ig-rail.igd .ig-card { display: block; }
.igd-shade { position: absolute; inset: 0; z-index: 4; border-radius: 22px; background: #050507; pointer-events: none; opacity: 0; }
.igd-slot.is-center .ig-card::before { opacity: 1; }   /* подсветка края — у центральной */
.igd-slot:not(.is-center) .igx-play, .igd-slot:not(.is-center) .ig-cap { opacity: 0; }
.is-spin .ig-card { pointer-events: none; }

/* звук — на центральной карточке, сверху слева (справа — значок Instagram) */
.igd-sound { position: absolute; z-index: 120; top: 34px; left: calc(50% - var(--igd-w, 300px) / 2 + 14px); display: grid; place-items: center; width: 44px; height: 44px;
    border-radius: 999px; border: 0; background: rgba(12,12,14,0.62); color: #fff; cursor: pointer; backdrop-filter: blur(8px);
    transition: transform var(--aw-dur-fast) var(--aw-ease-out), background var(--aw-dur-fast) ease; }
.igd-sound svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.igd-sound[aria-pressed="true"] { background: var(--aw-accent); }
.igd-sound:active { transform: scale(0.94); }
.igd-sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.igd-hint { position: absolute; z-index: 120; top: 42px; left: calc(50% - var(--igd-w, 300px) / 2 + 66px); margin: 0; padding: 6px 12px; border-radius: 999px;
    background: rgba(12,12,14,0.62); color: #fff; font-size: 0.8rem; font-weight: 600; pointer-events: none; backdrop-filter: blur(8px);
    opacity: 0; transform: translateY(-4px); transition: opacity var(--aw-dur-base) var(--aw-ease-out), transform var(--aw-dur-base) var(--aw-ease-out); }
.igd-hint.show { opacity: 1; transform: none; }

.igd-arrow { position: absolute; z-index: 120; top: calc(20px + var(--igd-w, 300px) * 8 / 9 - 24px); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18); background: rgba(12,12,14,0.72); color: #fff; cursor: pointer; backdrop-filter: blur(8px);
    transition: transform var(--aw-dur-fast) var(--aw-ease-out); }
.igd-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.igd-arrow.prev { left: max(var(--gut), calc(50% - var(--igd-w, 300px) / 2 - 300px)); } .igd-arrow.prev svg { transform: scaleX(-1); }
.igd-arrow.next { right: max(var(--gut), calc(50% - var(--igd-w, 300px) / 2 - 300px)); }
.igd-arrow:active { transform: scale(0.94); }
@media (max-width: 767px) { .igd-arrow { display: none; } }

/* «Nuevo» и кольцо-градиент как у сторис (вращается только угол градиента) */
.igd-new { position: absolute; bottom: 64px; left: 12px; z-index: 3; padding: 4px 9px; border-radius: 999px; background: #fff; color: #050505; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.igd-slot.is-new::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 25px;
    background: conic-gradient(from var(--igd-a, 0deg), #ff3b4e, #ffb340, #ff3bd4, #7a5cff, #ff3b4e); animation: igd-ring 4s linear infinite; }
@property --igd-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes igd-ring { to { --igd-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .igd-slot.is-new::before { animation: none; } }
/* Угол градиента перерисовывает всю карточку каждый кадр — кольцо крутится только у центральной, пока лента на экране
   и не крутится рулетка (на iPhone кольца боковых и вне экрана давали рывки, окно 7, 28.10) */
.igd:not(.igd-vis) .igd-slot.is-new::before, .igd.is-spin .igd-slot.is-new::before, .igd-slot.is-new:not(.is-center)::before { animation-play-state: paused; }
.igd-slot .igd-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--aw-dur-base) var(--aw-ease-out); }
.igd-slot .igd-vid.on { opacity: 1; }

/* ---------- Блок v2 (окно 4, 29.10; владелец: «расстояние огромное… непонятно, что это Instagram») ----------
   Одна композиция: на ПК слева профиль Instagram (аватар в кольце, @имя, «Seguir en Instagram», как пользоваться), справа рулетка;
   на телефоне — заголовок, строка профиля с кнопкой и сразу рулетка. Градиент Instagram — только точечно: кольцо аватара и значок Reels
   центральной карточки; остальное — токены сайта (DESIGN.md). */
.igv { display: grid; gap: 22px; }
.igv-side { display: grid; justify-items: start; gap: 14px; }
.igv-side .eyebrow { margin: 0; }
.igv-side .lead { font-size: 1rem; }
.igv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; width: 100%; }
/* профиль: аватар-логотип в кольце с градиентом Instagram, @имя и клуб */
.igv-prof { display: inline-flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; border-radius: 999px; color: var(--aw-text); text-decoration: none;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); transition: border-color var(--aw-dur-fast) ease, background var(--aw-dur-fast) ease; }
.igv-prof:hover { border-color: rgba(255, 255, 255, 0.26); background: rgba(255, 255, 255, 0.07); }
.igv-prof:focus-visible { outline: 2px solid var(--aw-accent); outline-offset: 3px; }
.igv-ava { flex: none; display: grid; width: 54px; height: 54px; padding: 3px; border-radius: 50%;
    background: linear-gradient(45deg, #feda75 5%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 95%); }
.igv-ava img { width: 100%; height: 100%; max-width: none; padding: 8px; border: 3px solid #0c0c0f; border-radius: 50%; background: #0c0c0f; }
.igv-who { display: grid; line-height: 1.25; }
.igv-who b { font-weight: 700; font-size: 0.98rem; }
.igv-who small { color: var(--aw-text-muted); font-size: 0.8rem; }
.igv-follow svg.igv-ig { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; margin-right: 2px; }
/* как пользоваться — значки, а не жесты Instagram */
.igv-how { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 2px 0 0; padding: 0; list-style: none; color: var(--aw-text-muted); font-size: 0.86rem; }
.igv-how li { display: inline-flex; align-items: center; gap: 7px; }
.igv-how svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1023px) {
    .igv-side .lead { display: none; }   /* на телефоне смысл несут профиль и сами ролики */
    .igv-prof { padding-right: 14px; }
    .igv-row .btn { padding-block: 10px; }
    .igv-how { display: none; }
}
@media (min-width: 1024px) {
    .igv { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: center; gap: 40px; }
    .igv-side { gap: 18px; }
    .igv-side .section-title { font-size: clamp(2.2rem, 3.6vw, 3.2rem); }
    .igv-row { flex-direction: column; align-items: flex-start; }
    /* рулетка — в своей колонке: без выхода за поля, края гаснут */
    .igv .igd-on { margin: 0; padding: 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
    .igv .igd-arrow.prev { left: max(4px, calc(50% - var(--igd-w, 300px) / 2 - 76px)); }
    .igv .igd-arrow.next { right: max(4px, calc(50% - var(--igd-w, 300px) / 2 - 76px)); }
}
.lite .igv .igd-on { -webkit-mask-image: none; mask-image: none; }

/* карточки ленты: значок Reels (у центральной — в кольце градиента Instagram), «Nuevo» — сверху, подпись центральной — над «Ver en Instagram» */
.igd .ig-ic { width: 32px; height: 32px; }
.igd .ig-ic svg { width: 17px; height: 17px; stroke-linecap: round; stroke-linejoin: round; }
.igd-slot.is-center .ig-ic { background: linear-gradient(45deg, #feda75 5%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 95%); }
.igd .igd-new { top: 14px; right: 50px; bottom: auto; left: auto; }
.igd .igx-play { display: none; }   /* в рулетке: звук — кнопкой на карточке, просмотрщик — по нажатию */
.igd .ig-card:hover .ig-cap { transform: none; }
.igd-slot .ig-cap { transition: bottom var(--aw-dur-base) var(--aw-ease-out), opacity var(--aw-dur-base) var(--aw-ease-out); }
.igd-slot.is-center .ig-cap { bottom: 64px; }

/* звук: одна понятная кнопка — «Activar sonido» с значком, пока звук выключен; включён — круглая красная со значком */
.igd-sound { top: 32px; left: calc(50% - var(--igd-w, 300px) / 2 + 12px); width: auto; height: 46px; min-width: 46px; padding: 0 16px 0 13px; display: inline-flex; gap: 8px;
    align-items: center; font: 600 0.9rem/1 var(--aw-font-body, inherit); background: rgba(12, 12, 14, 0.7); border: 1px solid rgba(255, 255, 255, 0.22); }
.igd-sound[aria-pressed="true"] { padding: 0; width: 46px; justify-content: center; border-color: transparent; }
.igd-sound:hover { background: rgba(30, 30, 34, 0.85); }
.igd-sound[aria-pressed="true"]:hover { background: var(--aw-accent-soft, var(--aw-accent)); }
.igd-hint { display: none; }
/* «Ver en Instagram ↗» — внизу центральной карточки, ведёт в пост */
.igd-open { position: absolute; z-index: 120; top: calc(20px + var(--igd-w, 300px) * 16 / 9 - 56px); left: calc(50% - var(--igd-w, 300px) / 2 + 12px);
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; color: #0c0c0f;
    font-weight: 700; font-size: 0.84rem; text-decoration: none; transition: opacity var(--aw-dur-fast) ease, transform var(--aw-dur-fast) var(--aw-ease-out); }
.igd-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.igd-open:active { transform: scale(0.97); }
.igd-open:focus-visible { outline: 2px solid var(--aw-accent); outline-offset: 2px; }
.igd.is-spin ~ .igd-open, .igx-wrap.is-spin .igd-open { opacity: 0; pointer-events: none; }
.lite .igd-sound { background: rgba(16, 16, 20, 0.92); }
@media (prefers-reduced-motion: reduce) { .igd-slot .ig-cap, .igd-open { transition: none; } }
@media (max-width: 380px) { .igd-sound:not([aria-pressed="true"]) { height: 42px; padding: 0 12px 0 10px; gap: 6px; font-size: 0.8rem; } }
/* кнопки рулетки (z-index 120) — внутри своего слоя: при прокрутке не выходят поверх шапки сайта */
.igd-on { isolation: isolate; }
/* под рулеткой: точки (центральная — вытянутая), «3 / 10», на телефоне до первого жеста — «← Desliza →» (ревизор 29.10) */
.igd-foot { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 4px; min-height: 28px; }
.igd-dots { display: flex; align-items: center; gap: 10px; }
.igd-dots i { display: block; width: 6px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.28);
    transition: transform var(--aw-dur-base) var(--aw-ease-out), background var(--aw-dur-base) ease; }
.igd-dots i.on { background: var(--aw-accent); transform: scaleX(2.4); }
.igd-count { font: 600 0.78rem/1 var(--aw-font-mono); color: var(--aw-text-muted); font-variant-numeric: tabular-nums; min-width: 5ch; }
.igd-swipe { display: none; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--aw-text); font-size: 0.8rem; transition: opacity var(--aw-dur-base) var(--aw-ease-out); }
.igd-swipe svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.igd-swipe b { font-weight: 600; }
@media (max-width: 767px) {
    .igd-swipe { display: inline-flex; }
    .igd-count { display: none; }   /* на телефоне — точки и подсказка, счётчик не нужен */
    .igd-used .igd-swipe { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .igd-dots i, .igd-swipe { transition: none; } }
