/**
 * Footer — mostyfm
 * Original site-footer styles + footer-v2-stitch redesign.
 */

/* =============================================
   FOOTER (original)
   ============================================= */

.site-footer {
    background: var(--color-bg-surface);
    border-top: 1px solid var(--color-border-subtle);
    padding: var(--space-10) 0 var(--space-6);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-8);
    margin-bottom: var(--space-10);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-logo {
    font-family: var(--font-family-serif);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-text-primary);
    display: inline-block;
    margin-bottom: var(--space-4);
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-5);
    line-height: 1.6;
    max-width: 280px;
}

.footer-socials {
    display: flex;
    gap: var(--space-3);
}

.social-link {
    color: var(--color-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--color-accent-primary);
    color: white;
}

.footer-nav-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

.footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-nav-list a {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.footer-nav-list a:hover {
    color: var(--color-text-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border-subtle);
}

.copyright {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin: 0;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }
}

/* =============================================
   FOOTER STITCH REDESIGN (v2)
   ============================================= */

.footer-v2-stitch {
    background: transparent;
    padding: var(--space-12) 0 var(--space-12);
    position: relative;
    z-index: 10;
}

.footer-dots-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
    border-radius: inherit;
}

/* --- Карточка-контейнер футера --- */
.footer-card {
    background: var(--footer-card-bg);
    border-radius: 6px;
    padding: var(--space-12) var(--space-8);
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.07);
    margin-bottom: var(--space-6);
    transform: rotate(-1.5deg);
    transform-origin: center center;
    transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

/* Тёмная тема: карточка тёмно-серая с едва видимой рамкой */
[data-theme="dark"] .footer-card {
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* --- Скотч-ленты --- */
.footer-tape {
    display: block;
    position: absolute;
    width: 72px;
    height: 22px;
    background: var(--footer-tape-bg);
    z-index: 20;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: background var(--transition-normal);
}

.footer-tape::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.05) 3px,
            rgba(255, 255, 255, 0.05) 4px);
    border-radius: 2px;
}

.footer-tape--tl {
    top: -11px;
    left: 52px;
    transform: rotate(-9deg);
}

.footer-tape--tr {
    top: -11px;
    right: 52px;
    transform: rotate(11deg);
}

/* --- Сетка колонок --- */
.footer-card-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8) var(--space-6);
    align-items: start;
}

/* --- Лого --- */
.footer-col-brand .footer-logo-text {
    font-size: 2.25rem;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: -0.02em;
    display: inline-block;
    margin-bottom: var(--space-4);
}

.footer-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    z-index: 1;
}

.footer-logo {
    display: block;
    text-decoration: none;
}

.footer-logo img {
    max-width: 180px;
    height: auto;
    display: block;
    filter: var(--footer-logo-filter);
    transition: filter var(--transition-normal);
}

.footer-logo-name {
    display: block;
    font-family: var(--font-family);
    font-size: 1.17rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--footer-text-primary);
    transition: color var(--transition-normal);
}

/* --- Glow-эффект у лого --- */
.footer-logo-glow {
    position: absolute;
    top: 10%;
    bottom: 10%;
    background: linear-gradient(90deg, var(--color-accent-1), #4a90e2, #50e3c2, #f5a623, var(--color-accent-1));
    background-size: 400% 400%;
    z-index: 1;
    filter: blur(20px);
    opacity: 0.8;
    border-radius: 50%;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

[data-theme="light"] .footer-logo-glow {
    opacity: 0.5;
}

.footer-col-brand .logo-black {
    color: var(--color-text);
}

.footer-col-brand .logo-grey {
    color: var(--color-text-secondary);
    opacity: 0.6;
}

/* --- Описание и копирайт --- */
.footer-description {
    color: var(--footer-text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 250px;
    margin-bottom: var(--space-8);
    transition: color var(--transition-normal);
}

.footer-copyright {
    color: var(--footer-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.6;
    transition: color var(--transition-normal);
}

/* --- Pill-заголовки колонок --- */
.footer-pill-title {
    display: inline-block;
    background: var(--footer-pill-bg);
    color: var(--footer-pill-color);
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-5);
    border: 1px solid var(--footer-pill-border);
    transition: background var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

/* --- Навигационные ссылки --- */
.footer-menu-stitch {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.footer-menu-stitch a {
    color: var(--footer-link-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: color 0.2s ease, letter-spacing 0.2s ease;
    display: inline-block;
    position: relative;
}

.footer-menu-stitch a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--footer-link-underline);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background var(--transition-normal);
}

.footer-menu-stitch a:hover::after {
    width: 100%;
}

.footer-menu-stitch a:hover {
    color: var(--footer-link-hover);
    letter-spacing: 0.04em;
}

/* --- Bottom bar (вне карточки) --- */
.footer-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-4);
    color: var(--color-text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    transform: rotate(-1.5deg);
}

.footer-bottom-links {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.footer-separator {
    opacity: 0.5;
    font-size: 0.75rem;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.footer-bottom-links a,
.footer-social-text-links a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-bottom-links a:hover,
.footer-social-text-links a:hover {
    color: var(--color-primary);
}

.footer-social-text-links {
    display: flex;
    gap: var(--space-4);
    text-transform: none;
}

/* =============================================
   SITE COPYRIGHT BAR (под colophon)
   ============================================= */

.site-copyright-bar {
    text-align: center;
    padding: var(--space-3) var(--space-4);
    font-size: 0.7rem;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.site-copyright-bar p {
    font-size: inherit;
    margin: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
    .footer-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .footer-card {
        transform: rotate(-0.5deg);
        padding: var(--space-8) var(--space-5);
    }

    .footer-bottom-bar {
        transform: rotate(-0.5deg);
    }

    .footer-card-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Центрирование бренд-колонки */
    .footer-col-brand {
        text-align: center;
        padding-bottom: var(--space-5);
    }

    .footer-col-brand .footer-logo-wrapper {
        align-items: center;
    }

    .footer-col-brand .footer-description {
        margin-left: auto;
        margin-right: auto;
    }

    /* ── Аккордеон-колонки ── */
    .footer-col-nav {
        border-bottom: 1px solid var(--footer-pill-border);
        padding: var(--space-1) 0;
    }

    .footer-col-nav:first-of-type {
        border-top: 1px solid var(--footer-pill-border);
    }

    /* Pill-заголовок становится кнопкой-триггером */
    .footer-pill-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        cursor: pointer;
        user-select: none;
        margin-bottom: 0;
        padding: var(--space-3) 0;
        background: transparent;
        border: none;
        /* Переопределяем inline-block pill на flex */
        border-radius: 0;
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--footer-pill-color);
        transition: color var(--transition-fast);
    }

    /* Шеврон-иконка справа */
    .footer-pill-title::after {
        content: '';
        display: block;
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 16px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0.6;
    }

    /* Шеврон вверх при открытом аккордеоне */
    .footer-pill-title.is-open::after {
        transform: rotate(180deg);
        opacity: 1;
    }

    .footer-pill-title.is-open {
        color: var(--footer-link-hover);
    }

    /* Hover-подсветка заголовка */
    .footer-pill-title:hover {
        color: var(--footer-link-hover);
    }

    /* Меню — скрываем по умолчанию */
    .footer-menu-stitch {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        margin-bottom: 0;
        transition:
            max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.28s ease,
            margin-bottom 0.3s ease;
    }

    /* Открытое меню */
    .footer-menu-stitch.is-open {
        max-height: 400px;
        opacity: 1;
        margin-top: 15px;
        margin-bottom: var(--space-4);
    }

    /* Небольшой отступ между пунктами */
    .footer-menu-stitch li+li {
        margin-top: var(--space-3);
    }
}