/* Site footer (views/partials/main-footer.ejs). Self-contained: own tokens so it renders the same on
   editorial pages (ai.css) and the legacy-themed pages (main-footer-styles). */
.site-footer {
    --sf-bg: #0A0E1A;
    --sf-fg: #F5F7FB;
    --sf-fg-2: #9AA6BD;
    --sf-fg-3: #5F6B82;
    --sf-line: rgba(255,255,255,0.09);
    --sf-accent: #EBA24E;
    --sf-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sf-pad: clamp(1.25rem, 4vw, 2.5rem);

    position: relative; z-index: 1; overflow: hidden;
    background:
        radial-gradient(60% 55% at 50% 100%, rgba(235,162,78,0.16), transparent 70%),
        var(--sf-bg);
    color: var(--sf-fg-2);
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    border-top: 1px solid var(--sf-line);
}
.site-footer * { box-sizing: border-box; }
.site-footer p, .site-footer ul, .site-footer dl, .site-footer dd { margin: 0; padding: 0; }
.site-footer ul { list-style: none; }
.site-footer a { color: inherit; text-decoration: none; }

.sf-inner { max-width: 1200px; margin: 0 auto; padding: clamp(4rem, 9vw, 7rem) var(--sf-pad) 0; }

/* ---- Statement + contact ---- */
.sf-top {
    display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
    gap: 2rem 3rem; padding-bottom: clamp(3rem, 6vw, 4.5rem);
}
.sf-kicker {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--sf-accent); margin-bottom: 1.1rem !important;
    display: flex; align-items: center; gap: 0.75rem;
}
.sf-kicker::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.sf-statement {
    font-family: 'Noto Serif TC', 'Noto Sans TC', serif; font-weight: 900;
    font-size: clamp(2.2rem, 5.6vw, 4.4rem); line-height: 1.12; letter-spacing: -0.02em;
    color: var(--sf-fg);
}
.sf-statement em {
    font-style: normal;
    background: linear-gradient(100deg, #F6C783 0%, var(--sf-accent) 45%, #D9734A 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.sf-dot { color: var(--sf-accent); }

.sf-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.sf-pill {
    display: inline-flex; align-items: center; gap: 0.75rem;
    padding: 0.95rem 1.5rem 0.95rem 1.75rem; border-radius: 999px;
    background: var(--sf-accent); color: #1A1206 !important;
    font-size: 1rem; font-weight: 700; letter-spacing: 0.02em;
    transition: background-color 0.3s var(--sf-ease), gap 0.3s var(--sf-ease);
}
.sf-pill svg { transition: transform 0.3s var(--sf-ease); }
.sf-mail {
    position: relative;
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.35rem 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 0.95rem; color: var(--sf-fg);
    border-bottom: 1px solid var(--sf-line);
    transition: border-color 0.25s ease, color 0.25s ease;
}
.sf-mail svg { color: var(--sf-fg-3); transition: color 0.25s ease; }
.sf-toast {
    position: absolute; left: 100%; top: 50%; margin-left: 0.75rem;
    transform: translate(-6px, -50%); opacity: 0; pointer-events: none; white-space: nowrap;
    font-size: 0.75rem; font-weight: 600; color: var(--sf-accent);
    transition: opacity 0.25s ease, transform 0.25s var(--sf-ease);
}
.sf-mail.is-copied .sf-toast { opacity: 1; transform: translate(0, -50%); }
.sf-mail.is-copied svg { color: var(--sf-accent); }

/* ---- Link grid ---- */
.sf-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 2.5rem 2rem;
    padding: clamp(2.5rem, 5vw, 3.5rem) 0;
    border-top: 1px solid var(--sf-line); border-bottom: 1px solid var(--sf-line);
}
.sf-label {
    display: flex; align-items: baseline; gap: 0.6rem;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--sf-fg-3); margin-bottom: 1.25rem !important;
}
.sf-label span { font-variant-numeric: tabular-nums; color: var(--sf-accent); letter-spacing: 0.08em; }
.sf-col ul { display: flex; flex-direction: column; gap: 0.7rem; }
.sf-col ul a {
    position: relative; display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.95rem; color: var(--sf-fg-2);
    transition: color 0.25s ease, transform 0.35s var(--sf-ease);
}
/* Underline that draws in from the left */
.sf-col ul a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
    background: currentColor; transform: scaleX(0); transform-origin: right;
    transition: transform 0.4s var(--sf-ease);
}
.sf-social a { color: var(--sf-fg-2); }
.sf-ico { flex: none; color: var(--c, currentColor); }
.sf-arrow { opacity: 0.4; transition: opacity 0.25s ease, transform 0.35s var(--sf-ease); }

.sf-co-name { color: var(--sf-fg); font-size: 0.95rem; font-weight: 600; }
.sf-co-en { font-size: 0.8rem; color: var(--sf-fg-3); margin-top: 0.2rem !important; }
.sf-co-meta { margin-top: 1.1rem !important; display: grid; gap: 0.55rem; font-size: 0.85rem; }
.sf-co-meta div { display: grid; grid-template-columns: 4.5em 1fr; gap: 0.75rem; }
.sf-co-meta dt { color: var(--sf-fg-3); }
.sf-co-meta dd { color: var(--sf-fg-2); font-variant-numeric: tabular-nums; }

/* ---- Bottom bar ---- */
.sf-bar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 2rem;
    padding: 1.5rem 0 clamp(2rem, 5vw, 3rem); font-size: 0.8rem; color: var(--sf-fg-3);
}
.sf-clock { display: inline-flex; align-items: center; gap: 0.5rem; font-variant-numeric: tabular-nums; }
.sf-time { color: var(--sf-fg-2); }
.sf-live {
    width: 6px; height: 6px; border-radius: 50%; background: #4F9D77;
    box-shadow: 0 0 0 0 rgba(79,157,119,0.55); animation: sf-pulse 2.4s ease-out infinite;
}
@keyframes sf-pulse { to { box-shadow: 0 0 0 8px rgba(79,157,119,0); } }
.sf-top-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--sf-fg-2); transition: color 0.25s ease; }
.sf-top-link svg { transition: transform 0.35s var(--sf-ease); }

/* ---- Bar letters: popcorn pop on hover, plus a wave that runs on its own ----
   The wave animates `translate` and hover animates `transform`, so the two never fight. --i numbers the letters
   along the whole bar, so the wave travels left to right through copyright, clock and back-to-top. */
.sf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sf-pop {
    display: inline-block; white-space: pre;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
}
@media (prefers-reduced-motion: no-preference) {
    .sf-pop { animation: sf-wave 6s cubic-bezier(0.33, 1, 0.68, 1) infinite; animation-delay: calc(1.5s + var(--i) * 45ms); }
}
@keyframes sf-wave {
    0%, 9%, 100% { translate: 0 0; }
    3% { translate: 0 -0.55em; color: var(--sf-accent); }
    6% { translate: 0 0.08em; }
}
/* ---- Hover (pointer devices only, so a tap never leaves motion stuck on) ---- */
@media (hover: hover) and (pointer: fine) {
    .sf-pill:hover { background: #F6C783; gap: 1.1rem; }
    .sf-pill:hover svg { transform: translateX(2px); }
    .sf-mail:hover { border-color: var(--sf-accent); }
    .sf-mail:hover svg { color: var(--sf-fg); }
    .sf-col ul a:hover { color: var(--sf-fg); transform: translateX(4px); }
    .sf-col ul a:hover::after { transform: scaleX(1); transform-origin: left; }
    .sf-col ul a:hover .sf-arrow { opacity: 1; transform: translate(2px, -2px); }
    .sf-top-link:hover { color: var(--sf-fg); }
    .sf-top-link:hover svg { transform: translateY(-3px); }
    /* Letters pop like popcorn */
    .sf-pop:hover { transform: translateY(-0.5em) rotate(calc((var(--i) % 5 - 2) * 6deg)); color: var(--sf-accent); transition-duration: 0.3s; }
}

.site-footer :focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
    .sf-live { animation: none; }
    .site-footer *, .site-footer *::after { transition: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .sf-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .sf-top { flex-direction: column; align-items: flex-start; }
    .sf-grid { grid-template-columns: 1fr 1fr; gap: 2.25rem 1.25rem; }
    .sf-company { grid-column: 1 / -1; }
    .sf-bar { flex-direction: column; align-items: flex-start; }
    .sf-mail { font-size: 0.9rem; }
}
