/*
 * /footer-styles.css
 * Modern interactive footer — clean, minimal, animated.
 */

/* ============================================================
   FOOTER SHELL
   ============================================================ */
.site-footer {
    /* Default = Universe (dark) */
    background-color: #09090f;
    color: #8a95a3;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

/* Earth Sky (light) override */
html.theme-earth-sky .site-footer {
    background: radial-gradient(circle at top left, #e9f6ff 0%, #f7fbff 45%, #d7ecff 100%);
    color: #102a43;
}

/* ============================================================
   ANIMATED TOP DIVIDER
   ============================================================ */
.footer-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 48px;
}

.footer-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 144, 226, 0.25), transparent);
    transform: scaleX(0);
    transform-origin: center;
    animation: dividerReveal 1s ease 0.3s forwards;
}

.footer-divider-line:last-child {
    background: linear-gradient(to left, transparent, rgba(74, 144, 226, 0.25), transparent);
}

@keyframes dividerReveal {
    to { transform: scaleX(1); }
}

.footer-divider-glyph {
    color: #4a90e2;
    font-size: 0.6rem;
    opacity: 0;
    animation: glyphFade 0.5s ease 0.9s forwards;
    flex-shrink: 0;
}

@keyframes glyphFade {
    to { opacity: 0.5; }
}

/* ============================================================
   MAIN INNER LAYOUT
   ============================================================ */
.footer-inner {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 48px 56px;
    align-items: start;
}

/* ============================================================
   BRAND SECTION
   ============================================================ */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-brand-link {
    text-decoration: none;
    display: inline-block;
}

.footer-brand-logo {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
}

.footer-brand-name {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.footer-brand-name em {
    font-style: normal;
    background: linear-gradient(100deg, #4a90e2, #7bb5f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand-link:hover .footer-brand-name {
    color: #c8d5e4;
}

.footer-brand-tagline {
    margin: 0;
    font-size: 0.8rem;
    color: #40495a;
    letter-spacing: 0.02em;
    line-height: 1.65;
    font-style: italic;
}

/* Secret trigger — tiny, nearly invisible glyph */
.footer-secret-trigger {
    background: none;
    border: none;
    color: #18202c;
    font-size: 0.5rem;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.5s ease, transform 0.5s ease;
    margin-top: 12px;
    align-self: flex-start;
}

.footer-secret-trigger:hover {
    color: #4a90e2;
    transform: rotate(45deg) scale(1.4);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-nav-heading {
    margin: 0 0 16px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #ffffff;
}

.footer-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sliding underline link animation */
.footer-link {
    text-decoration: none;
    color: #49566a;
    display: inline-block;
    transition: color 0.25s ease;
    font-size: 0.88rem;
}

.footer-link span {
    display: inline-block;
    position: relative;
    padding-bottom: 1px;
}

.footer-link span::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #4a90e2;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-link:hover {
    color: #c8d8ea;
}

.footer-link:hover span::after {
    width: 100%;
}

/* ============================================================
   BOTTOM BAR
   ============================================================ */
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 48px 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-copyright {
    margin: 0;
    font-size: 0.76rem;
    color: #2b333f;
    letter-spacing: 0.03em;
}

/* Legal links (Terms · Privacy · Cookies) */
.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-legal-link {
    text-decoration: none;
    color: #3a4556;
    font-size: 0.76rem;
    transition: color 0.25s ease;
    letter-spacing: 0.02em;
}

.footer-legal-link span {
    display: inline-block;
    position: relative;
    padding-bottom: 1px;
}

.footer-legal-link span::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #4a90e2;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-legal-link:hover {
    color: #a0b4cc;
}

.footer-legal-link:hover span::after {
    width: 100%;
}

.footer-legal-separator {
    color: #232c38;
    font-size: 0.65rem;
    user-select: none;
}

/* Back to top */
.footer-back-to-top {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid rgba(74, 144, 226, 0.15);
    color: #384555;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 16px;
    border-radius: 40px;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease,
                background 0.25s ease, transform 0.25s ease;
}

.footer-back-to-top svg {
    width: 12px;
    height: 12px;
    transition: transform 0.25s ease;
}

.footer-back-to-top:hover {
    color: #b8cfe8;
    border-color: rgba(74, 144, 226, 0.5);
    background: rgba(74, 144, 226, 0.06);
    transform: translateY(-1px);
}

/* Earth Sky (light) specific refinements */
html.theme-earth-sky .footer-brand-name {
    color: #0f1d33;
}

html.theme-earth-sky .footer-brand-tagline {
    color: rgba(16, 42, 67, 0.75);
}

html.theme-earth-sky .footer-secret-trigger {
    color: rgba(15, 32, 65, 0.45);
}

html.theme-earth-sky .footer-nav-heading {
    color: #0f1d33;
}

html.theme-earth-sky .footer-link {
    color: #28527a;
}

html.theme-earth-sky .footer-link:hover {
    color: #0b3868;
}

html.theme-earth-sky .footer-bottom {
    border-top: 1px solid rgba(15, 32, 65, 0.06);
}

html.theme-earth-sky .footer-copyright {
    color: rgba(15, 32, 65, 0.7);
}

html.theme-earth-sky .footer-legal-link {
    color: #28527a;
}

html.theme-earth-sky .footer-legal-link:hover {
    color: #0b3868;
}

html.theme-earth-sky .footer-legal-separator {
    color: rgba(15, 32, 65, 0.25);
}

html.theme-earth-sky .secret-modal-content {
    background: #f7fbff;
    box-shadow: 0 0 80px rgba(15, 32, 65, 0.18);
}

html.theme-earth-sky .secret-modal-content h3 {
    color: #102a43;
}

html.theme-earth-sky .secret-modal-content p {
    color: rgba(16, 42, 67, 0.8);
}

.footer-back-to-top:hover svg {
    transform: translateY(-2px);
}

/* ============================================================
   SECRET MODAL
   ============================================================ */
.secret-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 10, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.secret-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.secret-modal-content {
    background: #0b0d18;
    border: 1px solid rgba(74, 144, 226, 0.25);
    box-shadow: 0 0 80px rgba(74, 144, 226, 0.1);
    border-radius: 14px;
    padding: 48px 44px;
    width: 90%;
    max-width: 440px;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.secret-modal-overlay.is-visible .secret-modal-content {
    transform: translateY(0);
}

.secret-modal-glyph {
    font-size: 1rem;
    color: #4a90e2;
    opacity: 0.5;
    margin-bottom: 22px;
}

.secret-modal-content h3 {
    margin: 0 0 14px;
    color: #dce8f2;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.secret-modal-content p {
    color: #4e5d70;
    line-height: 1.75;
    font-size: 0.9rem;
    margin: 0;
}

.close-modal-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #2a3240;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    transition: color 0.2s ease;
}

.close-modal-btn:hover {
    color: #9ab0c8;
}

/* ============================================================
   NAV ITEM REVEAL ANIMATION
   ============================================================ */
.footer-nav-list li {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease var(--delay, 0ms),
                transform 0.4s ease var(--delay, 0ms);
}

.footer-nav-list li.footer-item-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 48px 32px 44px;
    }

    .footer-brand-tagline {
        max-width: 280px;
    }

    .footer-divider {
        padding: 0 32px;
    }

    .footer-bottom {
        padding: 16px 32px 24px;
    }
}

@media (max-width: 640px) {
    .footer-inner {
        padding: 40px 24px 36px;
    }

    .footer-nav {
        grid-template-columns: 1fr 1fr;
        gap: 28px 20px;
    }

    .footer-divider {
        padding: 0 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 14px;
        text-align: center;
        padding: 16px 24px 22px;
    }
}
