/**
 * ChariInfo — Footer Styles
 * @package ChariInfo
 */

.site-footer {
    background: var(--color-ink);
    color: var(--color-silver);
    margin-top: var(--space-16);
}

/* ──────────────────────────────────
   BACK TO TOP
────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: var(--space-6);
    left: var(--space-6);
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    transition: var(--transition-base);
}

.back-to-top svg {
    width: 18px;
    height: 18px;
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.back-to-top[hidden] {
    display: none;
}

/* ──────────────────────────────────
   TOAST SYSTEM
────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 360px;
}

.toast {
    background: var(--color-ink-soft);
    color: white;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    border-right: 4px solid var(--color-primary);
    animation: slideDown var(--transition-base) both;
    min-width: 280px;
}

.toast--success {
    border-right-color: #1a6e3c;
}

.toast--error {
    border-right-color: var(--color-primary);
}

.toast--info {
    border-right-color: #1565C0;
}

.toast--warning {
    border-right-color: var(--color-gold);
}

.toast__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast__text {
    flex: 1;
    line-height: var(--leading-tight);
}

.toast__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .5);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    flex-shrink: 0;
}

.toast__close:hover {
    color: white;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ──────────────────────────────────
   FOOTER WIDGETS
────────────────────────────────── */
.footer-widgets {
    padding: var(--space-8) 0;
    border-bottom: 1px solid var(--color-ink-muted);
}

.footer-widgets__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
}

/* ──────────────────────────────────
   FOOTER MAIN
────────────────────────────────── */
.footer-main {
    padding: var(--space-12) 0 var(--space-8);
    border-bottom: 1px solid var(--color-ink-muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-10);
}

.footer-col__title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-ink-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.footer-col__title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--color-gold);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Logo */
.footer-logo__link {
    text-decoration: none;
    display: inline-block;
}

.footer-logo__name {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    display: block;
}

.footer-logo__name--main {
    color: var(--color-primary);
}

.footer-logo__name--accent {
    color: var(--color-gold);
}

.footer-logo__tagline {
    font-size: var(--text-xs);
    color: var(--color-silver);
    letter-spacing: .06em;
    display: block;
    margin-top: 3px;
}

.footer-about {
    font-size: var(--text-sm);
    color: var(--color-silver);
    line-height: var(--leading-relaxed);
    margin: var(--space-5) 0;
}

.footer-badges {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.footer-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 10px;
    font-weight: 600;
    color: var(--color-silver);
    background: var(--color-ink-muted);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.footer-badge svg {
    width: 11px;
    height: 11px;
    color: var(--color-gold);
}

/* Social */
.footer-social {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.footer-social__link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--color-ink-muted);
    color: var(--color-smoke);
    transition: var(--transition-fast);
}

.footer-social__link svg {
    width: 15px;
    height: 15px;
}

.footer-social__link--x:hover {
    background: #0D0D0D;
    color: white;
}

.footer-social__link--facebook:hover {
    background: #1877F2;
    color: white;
}

.footer-social__link--telegram:hover {
    background: #0088CC;
    color: white;
}

.footer-social__link--youtube:hover {
    background: #FF0000;
    color: white;
}

.footer-social__link--instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.footer-social__link--whatsapp:hover {
    background: #25D366;
    color: white;
}

/* Liens */
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-silver);
    text-decoration: none;
    transition: var(--transition-fast);
    padding: var(--space-1) 0;
}

.footer-link:hover {
    color: var(--color-white);
    padding-right: var(--space-2);
}

.footer-link::before {
    content: '←';
    font-size: 10px;
    color: var(--color-primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.footer-link:hover::before {
    opacity: 1;
}

.footer-link--cat:hover [data-cat="politics"] {
    color: var(--cat-politics);
}

.footer-link--cat:hover [data-cat="economy"] {
    color: var(--cat-economy);
}

.footer-link--cat:hover [data-cat="health"] {
    color: var(--cat-health);
}

.footer-link--cat:hover [data-cat="culture"] {
    color: var(--cat-culture);
}

.footer-link--cat:hover [data-cat="sport"] {
    color: var(--cat-sport);
}

.footer-link--cat:hover [data-cat="world"] {
    color: var(--cat-world);
}

.footer-link__icon {
    font-size: 14px;
    flex-shrink: 0;
}

.footer-link__count {
    font-size: 10px;
    color: var(--color-ink-muted);
    background: var(--color-ink-muted);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-right: auto;
    transition: var(--transition-fast);
}

.footer-link:hover .footer-link__count {
    background: var(--color-primary);
    color: white;
}

/* Derniers actus */
.footer-latest {
    list-style: none;
    margin-bottom: var(--space-6);
}

.footer-latest-item__link {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-ink-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-latest-item__link:hover {
    opacity: .8;
}

.footer-latest-item:last-child .footer-latest-item__link {
    border-bottom: none;
}

.footer-latest-item__thumb {
    width: 56px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.footer-latest-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s ease;
}

.footer-latest-item__link:hover .footer-latest-item__thumb img {
    transform: scale(1.15) rotate(1deg);
    filter: brightness(1.1);
}

.footer-latest-item__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-latest-item__cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.footer-latest-item__cat--politics {
    color: var(--cat-politics);
}

.footer-latest-item__cat--economy {
    color: var(--cat-economy);
}

.footer-latest-item__cat--health {
    color: var(--cat-health);
}

.footer-latest-item__cat--culture {
    color: var(--cat-culture);
}

.footer-latest-item__cat--sport {
    color: var(--cat-sport);
}

.footer-latest-item__cat--world {
    color: var(--color-silver);
}

.footer-latest-item__title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-smoke);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.footer-latest-item__date {
    font-size: 10px;
    color: var(--color-silver);
}

/* Newsletter */
.footer-newsletter__title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-smoke);
    margin-bottom: var(--space-3);
}

.footer-newsletter__input-row {
    display: flex;
    gap: var(--space-2);
}

.footer-newsletter__input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: var(--color-ink-muted);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    direction: rtl;
    outline: none;
}

.footer-newsletter__input:focus {
    border-color: var(--color-primary);
}

.footer-newsletter__input::placeholder {
    color: var(--color-silver);
}

.footer-newsletter__btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.footer-newsletter__btn svg {
    width: 16px;
    height: 16px;
}

.footer-newsletter__btn:hover {
    background: var(--color-primary-dark);
    animation: pulseBtn 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseBtn {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); transform: scale(1); }
    50% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); transform: scale(1.08); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); transform: scale(1); }
}

.footer-newsletter__status {
    font-size: var(--text-xs);
    margin-top: var(--space-2);
}

.footer-newsletter__status.is-success {
    color: #4caf50;
}

.footer-newsletter__status.is-error {
    color: var(--color-primary);
}

/* ──────────────────────────────────
   FOOTER BOTTOM
────────────────────────────────── */
.footer-bottom {
    padding: var(--space-5) 0;
    background: rgba(0, 0, 0, .2);
}

.footer-bottom__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-bottom__copy {
    font-size: var(--text-xs);
    color: var(--color-silver);
}

.footer-bottom__site-link {
    color: var(--color-gold);
    text-decoration: none;
}

.footer-bottom__site-link:hover {
    text-decoration: underline;
}

.footer-bottom__links {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.footer-bottom__link {
    font-size: var(--text-xs);
    color: var(--color-silver);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-bottom__link:hover {
    color: var(--color-gold);
}

.footer-bottom__left {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.footer-bottom__dev {
    font-size: var(--text-xs);
    color: var(--color-silver);
}

.footer-bottom__dev-link {
    color: var(--color-gold);
    text-decoration: none;
}

.footer-bottom__dev-link:hover {
    text-decoration: underline;
}

/* Langue Switcher (Footer specific overrides for Top-Tier Dropup) */
.lang-switcher--footer .lang-switcher__dropdown {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    transform-origin: bottom center !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    /* We use the transition defined in style.css, so we remove the conflicting animation */
}

/* ──────────────────────────────────
   RESPONSIVE
────────────────────────────────── */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: var(--space-4);
        left: var(--space-4);
    }

    .toast-container {
        right: var(--space-3);
        left: var(--space-3);
    }

    .toast {
        min-width: unset;
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom__inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom__links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-bottom__left {
        justify-content: center;
    }
}