/**
 * AI ASP - Legal / Docs / About / Contact / FAQ ページ用CSS
 * 法的ページ・ドキュメント・About・Contact・FAQページ専用スタイル
 * base.css変数を活用
 */

/* ============================================================
   Legal Page
   ============================================================ */

.legal-hero-video {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;              /* サイズ: 50%=半分, 100%=画面幅, 150%=拡大 */
    height: auto;
    object-fit: cover;
    opacity: 0.15;            /* 明るさ: 0.0〜1.0 */
    filter: blur(0px) saturate(1) hue-rotate(0deg);  /* ぼかし / 彩度 / 色相 */
    z-index: 0;
    pointer-events: none;
}
.legal-page {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 64px;
}

.legal-page > .container {
    max-width: 800px;
}

.legal-page .legal-footer-note {
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 13px;
}

.legal-table .legal-td-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.legal-table .legal-td-list-mt {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: disc;
}

.legal-page h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.legal-page .legal-updated {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 32px;
}

.legal-page h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 40px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.legal-page h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 24px 0 8px;
}

.legal-page p {
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.legal-page ul,
.legal-page ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.legal-page li {
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.legal-page ul {
    list-style: disc;
}

.legal-page ol {
    list-style: decimal;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 24px;
    font-size: 14px;
}

.legal-table th,
.legal-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.legal-table th {
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.legal-table td {
    color: var(--text-secondary);
}

/* Doc TOC — Collapsible */
.doc-toc {
    margin: 32px 0;
    padding: 24px 28px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: padding 0.3s ease;
}
.doc-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    margin-bottom: 12px;
}
.doc-toc-title {
    font-weight: 700;
    font-size: 15px;
    margin: 0;
    color: var(--text-primary);
}
.doc-toc-chevron {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s;
    flex-shrink: 0;
}
.doc-toc.is-collapsed .doc-toc-chevron { transform: rotate(180deg); }
.doc-toc-body {
    overflow: hidden;
    max-height: 600px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}
.doc-toc.is-collapsed .doc-toc-body { max-height: 0; opacity: 0; margin: 0; }
.doc-toc.is-collapsed .doc-toc-toggle { margin-bottom: 0; }
.doc-toc.is-collapsed { padding: 16px 28px; }

.doc-toc-list,
.legal-page .doc-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: doctoc;
}
.doc-toc-list li {
    counter-increment: doctoc;
    margin-bottom: 6px;
}
.doc-toc-list li a::before {
    content: counter(doctoc) ". ";
    font-weight: 700;
    color: var(--accent-blue);
}
.doc-toc-list a {
    color: var(--text-secondary);
    font-size: 14px;
    display: block;
    padding: 3px 0;
    transition: color 0.2s;
}
.doc-toc-list a:hover { color: var(--accent-blue); }

/* Doc: PC Sticky TOC */
.doc-toc-sticky {
    position: fixed;
    top: calc(var(--header-h) + 32px);
    right: max(16px, calc((100vw - 800px) / 2 - 280px));
    width: 240px;
    max-height: calc(100vh - var(--header-h) - 64px);
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 50;
}
.doc-toc-sticky.is-visible { opacity: 1; pointer-events: auto; }
.doc-toc-sticky-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    margin-bottom: 12px;
}
.doc-toc-sticky-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.doc-toc-sticky-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.3s;
    flex-shrink: 0;
}
.doc-toc-sticky.is-collapsed .doc-toc-sticky-chevron { transform: rotate(180deg); }
.doc-toc-sticky .doc-toc-sticky-body {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}
.doc-toc-sticky.is-collapsed .doc-toc-sticky-body { max-height: 0; opacity: 0; }
.doc-toc-sticky.is-collapsed .doc-toc-sticky-toggle { margin-bottom: 0; }
.doc-toc-sticky ol { list-style: none; padding: 0; margin: 0; }
.doc-toc-sticky li { margin-bottom: 4px; }
.doc-toc-sticky a {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
    line-height: 1.5;
}
.doc-toc-sticky a:hover { color: var(--accent-blue); background: var(--bg-secondary); }
.doc-toc-sticky a.is-active { color: var(--accent-blue); background: var(--bg-secondary); font-weight: 700; }

/* Doc: SP FAB + Panel */
.doc-toc-fab {
    position: fixed;
    bottom: 92px;
    right: 16px;
    z-index: 899;
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 10px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}
.doc-toc-fab .lucide-icon { width: 16px; height: 16px; color: var(--accent-blue); }
.doc-toc-fab.is-visible { transform: translateY(0); opacity: 1; }
.doc-toc-fab-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: var(--bg-primary);
    border-top-left-radius: var(--radius-xl, 16px);
    border-top-right-radius: var(--radius-xl, 16px);
    padding: 20px 24px 32px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s;
}
.doc-toc-fab-panel.is-open { transform: translateY(0); }
.doc-toc-fab-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 700;
}
.doc-toc-fab-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}
.doc-toc-fab-close .lucide-icon { width: 20px; height: 20px; }
.doc-toc-fab-panel ol { list-style: none; padding: 0; margin: 0; }
.doc-toc-fab-panel li { margin-bottom: 2px; }
.doc-toc-fab-panel a {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.doc-toc-fab-panel a:hover { background: var(--bg-secondary); }
.doc-toc-fab-panel a.is-active { color: var(--accent-blue); background: var(--bg-secondary); font-weight: 700; }
.doc-toc-fab-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.doc-toc-fab-overlay.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 768px) {
    .doc-toc-sticky { display: none !important; }
    .doc-toc-fab { display: flex; bottom: 92px; }
    .legal-page table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .legal-page pre { overflow-x: auto; }
}
@media (min-width: 769px) {
    .doc-toc-fab { display: none !important; }
    .doc-toc-fab-panel { display: none !important; }
    .doc-toc-fab-overlay { display: none !important; }
}

/* Doc Tool */
.doc-tool {
    margin: 24px 0 32px;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.doc-tool h3 {
    margin-top: 0;
}

.doc-tool h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 8px;
}

.doc-badge-write {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-orange-light);
    color: var(--accent-orange);
    vertical-align: middle;
    margin-left: 8px;
}

/* ============================================================
   FAQ Page
   ============================================================ */

.faq-page {
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 64px;
}

.faq-page h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.faq-page .faq-page-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 40px;
}

.faq-category-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-category-title .lucide-icon {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

.faq-category {
    margin-bottom: 40px;
}
.faq-list {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: disc;
}

/* ============================================================
   Contact Page
   ============================================================ */

.contact-page { padding: calc(var(--header-h) + 40px) 0 80px; }
.contact-page .container { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.contact-page h1 { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 32px; }
.reset-desc { text-align: center; color: var(--text-secondary); margin-bottom: 32px; }
.contact-page .form-group { margin-bottom: 10px; }
.contact-page .btn-lg { padding: 20px 28px; }

/* ============================================================
   About Page
   ============================================================ */

.about-hero {
    position: relative;
    overflow: hidden;
    padding: calc(var(--header-h) + 64px) 0 24px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
    text-align: center;
}
.about-hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    filter: hue-rotate(120deg) saturate(1.2);
    z-index: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
    mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
}
[data-theme="dark"] .about-hero-video {
    display: none;
}
.about-hero > .container {
    position: relative;
    z-index: 2;
}
.about-hero h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px;
}
.about-hero p {
    font-size: 17px;
    color: var(--text-secondary);
    margin: 0;
}
.legal-page--no-hero-pad {
    padding-top: 24px;
}

.about-mission-img {
    display: block;
    max-width: 75%;
    width: 75%;
    margin: 40px auto 0px;
    transform: translateX(-0.5%);
    opacity: 0.85;
    object-fit: cover;
    object-position: top;
    aspect-ratio: 4 / 2.1;
}

.about-list {
    margin: 4px 0 0;
    padding-left: 20px;
    list-style: disc;
}
.about-list li {
    padding: 2px 0;
    line-height: 1.7;
}
.about-cta {
    margin-top: 48px;
    padding: 32px;
    background: var(--bg-surface);
    border-radius: 12px;
    text-align: center;
}
.about-cta p {
    margin: 0 0 16px;
    color: var(--text-secondary);
}

/* ============================================================
   SP Responsive（Legal / FAQ / About ページ対応）
   ============================================================ */

@media (max-width: 768px) {
    .legal-page h1,
    .faq-page h1 {
        font-size: 22px;
    }
    .about-hero {
        padding: calc(var(--header-h) + 40px) 0 0px;
    }
    .about-hero h1 {
        font-size: 26px;
    }
    .about-hero p {
        font-size: 15px;
    }
}

/* ============================================================
   Dark Mode（FAQ関連）
   ============================================================ */

/* ============================================================
   Dark Mode（Legal）
   ============================================================ */

[data-theme="dark"] .legal-page {
    background-color: #111111;
}

[data-theme="dark"] .legal-table td {
    background: #1a1a1a;
}
