/* ==========================================================================
   momintools.tech 共通フッター — スタイル
   --------------------------------------------------------------------------
   partials/footer.html とセットで使う。style.css を読んでいないページ
   （音声カッターなど）でも単体で成立するよう、変数はすべてフォールバック付き、
   リセットも #site-footer の中に閉じて持たせている。
   ========================================================================== */

#site-footer {
    background: linear-gradient(180deg, var(--text-primary, #1a1a2e) 0%, #12122a 100%);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-sans, 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    font-size: 16px;
    line-height: 1.6;
    padding: 64px 0 0;
    position: relative;
    text-align: left;
}

/* ページ側のリセットに依存しないための最小限の下地 */
#site-footer *,
#site-footer *::before,
#site-footer *::after {
    box-sizing: border-box;
}

#site-footer p,
#site-footer h4 {
    margin: 0;
}

#site-footer a {
    text-decoration: none;
}

#site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right,
        var(--color-primary, #13498a),
        var(--color-accent, #f69946),
        var(--color-primary, #13498a));
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px; /* ページ側の変数に依存させない（どのページでも同じ見た目にする） */
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.footer-logo .logo-accent {
    color: var(--color-accent, #f69946);
}

.footer-tagline {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.35);
}

/* --- Share ------------------------------------------------------------- */
.footer-share {
    margin-top: 8px;
}

.footer-share-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 14px;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    position: relative;
    transition: transform var(--transition-spring, 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)),
                background var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1)),
                color var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1)),
                border-color var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1)),
                box-shadow var(--transition-smooth, 0.4s cubic-bezier(0.4, 0, 0.2, 1));
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-btn:hover {
    transform: translateY(-3px);
    color: #fff;
    border-color: transparent;
}

.share-btn:active {
    transform: translateY(-1px);
}

.share-btn:focus-visible {
    outline: 2px solid var(--color-accent, #f69946);
    outline-offset: 2px;
}

/* Per-network hover colors */
.share-btn--x:hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
}

.share-btn--facebook:hover {
    background: #1877f2;
    box-shadow: 0 6px 18px rgba(24, 119, 242, 0.4);
}

.share-btn--line:hover {
    background: #06c755;
    box-shadow: 0 6px 18px rgba(6, 199, 85, 0.4);
}

.share-btn--hatena:hover {
    background: #00a4de;
    box-shadow: 0 6px 18px rgba(0, 164, 222, 0.4);
}

.share-btn--copy:hover {
    background: var(--color-accent, #f69946);
    box-shadow: 0 6px 18px rgba(246, 153, 70, 0.4);
}

/* Copy button success state */
.share-btn--copy .icon-check {
    display: none;
}

.share-btn--copy.copied {
    background: #06c755;
    color: #fff;
    border-color: transparent;
    transform: none;
}

.share-btn--copy.copied .icon-link {
    display: none;
}

.share-btn--copy.copied .icon-check {
    display: block;
}

/* Copy feedback tooltip */
.share-btn--copy::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary, #1a1a2e);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0, 0, 0, 0.06));
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1)),
                transform var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1));
}

.share-btn--copy.copied::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- リンク列 ----------------------------------------------------------- */
.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    position: relative; /* 優先ソースボタンの位置決めの基準 */
}

.footer-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
    transition: color var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1)),
                transform var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1));
    display: inline-block;
}

.footer-link:hover {
    color: var(--color-accent, #f69946);
    transform: translateX(3px);
}

.footer-bottom {
    padding: 24px 0;
    text-align: center;
}

.copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
}

/* --- Google「優先ソースに追加」ボタン ------------------------------------ */
/* リンク列エリアの右下（Internal 列の左端から右いっぱい、Services 列の
   最後のリンクと同じ高さ）に絶対配置する。フッターの高さは変えない。 */
.ps-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    line-height: 1.5;
    color: inherit;
}

.ps-cta[hidden] {
    display: none;
}

.ps-cta__label {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

.ps-cta__slot {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

/* ライブラリが読めなかったときに出る、公式ディープリンクへのリンク */
.ps-cta__fallback {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.78rem;
    text-decoration: none;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ps-cta__fallback:hover {
    opacity: 1;
}

.ps-cta--links {
    position: absolute;
    /* 2列目（Internal）の左端に合わせる: 3等分の列 + 32px の gap */
    left: calc((100% - 64px) / 3 + 32px);
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    margin: 0;
}

.ps-cta--links .ps-cta__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.5;
}

/* 列が伸びて重なりそうなときは、絶対配置をやめて次の行に送る（footer.js が判定） */
.ps-cta--links.ps-cta--stacked {
    position: static;
    grid-column: 2 / -1;
    margin-top: 8px;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    #site-footer {
        padding-top: 48px;
    }

    .footer-inner {
        padding: 0 20px;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .ps-cta--links {
        position: static;
        grid-column: 1 / -1;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .ps-cta {
        gap: 6px 10px;
    }

    .ps-cta__label {
        font-size: 0.72rem;
    }
}
