/* =======================================================
   Home / Shared UI Styles (consolidated)
   - Header (brand, header-inner, nav)
   - Hero (shared + home-specific)
   - Section-cards
   - Cards
   - News (including background overlays)
   - About page
   - Modal (mode selector)
   - Responsive tweaks
   ======================================================= */

/* =====================
   Header (brand, header-inner, nav)
   ===================== */
.brand {
    /* font-family: "Noto Serif JP", serif; */
    /* font-weight: 700; */
    letter-spacing: .05em;
    font-size: 20px;
    /* text-shadow: 0 1px 4px rgba(0, 0, 0, .15); */
    white-space: nowrap;
}

/* ヘッダー内の配置（左ロゴ・右ナビ） */
.header-inner {
    display: flex;
    justify-content: space-between;
    /* ← 左右に分ける */
    align-items: center;
    width: 100%;
    max-width: 1200px;
    /* 任意、中央寄せを防ぐ */
    margin: 0 auto;
    padding: 0 40px;
    /* 端の余白 */
    gap: 10px;
}

/* brandを左側に固定 */
.header-inner .brand {
    margin-right: auto;
    /* これで左寄せを明確に */
}

/* navを右側に寄せる */
.header-inner .nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-wrap: nowrap;
    /* 1行に固定 */
    white-space: nowrap;
    /* 文字の折返し防止 */
    justify-content: flex-end;
}

/* SNS icon container */
.header-inner .nav nav[aria-label="SNS"] {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.header-inner .nav nav[aria-label="SNS"] a {
    display: inline-flex;
    align-items: center;
}

.header-inner .nav nav[aria-label="SNS"] svg {
    width: 20px;
    height: 20px;
}

.header-inner .nav a {
    white-space: nowrap;
}

.header-inner .nav a {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .02em;
    text-decoration: none;
    color: inherit;
}

/* ヘッダーのリンクにホバー時の青色を付与 */
.header-inner .nav a:hover {
    color: #2563eb;
    transition: color 0.2s ease;
}

/* ヘッダー */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid transparent;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* スクロール後だけ薄いガラス感を付与 */
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ナビゲーションのアクティブ表示（微細な下線） */
.nav a.active {
    position: relative;
}

.nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: currentColor;
    opacity: .85;
}


/* =====================
   Footer (shared)
   ===================== */
.site-footer {
    position: relative;
    z-index: 2;
}

.page-home:not(.page-news) .site-footer {
    background: rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* =====================
   Hero (shared + home-specific)
   ===================== */
/* ===== Hero ===== */
/* タイトル：柔らかいセリフ体で余白感を出す */
.hero-title {
    font-family: "Noto Serif JP", serif;
    font-weight: 600;
    font-size: clamp(24px, 3.6vw, 34px);
    line-height: 1.35;
    letter-spacing: .02em;
    font-feature-settings: "palt" 1, "kern" 1;
    font-style: oblique 8deg;
    font-synthesis: style;
}

/* リード：読みやすさ重視のサンセリフ */
.hero-lead {
    font-family: "Noto Serif JP", serif;
    font-weight: 400;
    font-size: clamp(15px, 2.1vw, 18px);
    line-height: 1.9;
    letter-spacing: .01em;
    color: var(--muted);
    font-feature-settings: "palt" 1, "kern" 1;
    font-style: oblique 8deg;
    font-synthesis: style;
}

/* 横幅が広いページで行が伸びすぎないように */
.hero .hero-inner,
.hero .container {
    max-width: 42ch;
}

/* Homepage hero typography overrides */
.page-home .hero-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 0, 0, 0.35);
}

.page-home .hero-lead {
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.85;
    /* 1.8→1.85 わずかに読みやすく */
    color: rgba(255, 255, 255, 0.995);
    /* より白く・くっきり */
    font-weight: 600;
    /* 文字の芯を太く */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 0, 0, 0.35);
    /* 影を強化 */
}

/* --- Hero scroll-out animation (title to left, lead to right) --- */
.page-home .hero-title,
.page-home .hero-lead {
    will-change: transform, opacity;
    transform: translateX(0);
    transition: transform 0s, opacity 0s;
}

@media (prefers-reduced-motion: reduce) {

    .page-home .hero-title,
    .page-home .hero-lead {
        transition: none;
    }
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =====================
   HOMEPAGE ONLY: Background & advanced hero
   ===================== */
body.page-home {
    /* 背景画像は ::before で固定レイヤーとして扱う */
    background: #000;
    padding-top: 64px;
    /* ヘッダー分 */
}

body.page-home::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url('../assets/images/main-background/main-background-05.webp') no-repeat center center;
    background-size: cover;
    pointer-events: none;
}


/* body の背景とヘッダー分のオフセット（about） */
body.page-about {
    /* 背景画像は ::before で固定レイヤーとして扱う */
    background: #000;
    padding-top: 64px;
    /* 固定ヘッダー分 */
}

body.page-about::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url('../assets/images/main-background/main-background-05.webp') no-repeat center center;
    /* PCなどの横幅が広い画面でも黒帯が出ないように、基本は cover にする */
    background-size: cover;
    pointer-events: none;
}

/* about 固有：ヒーロー見出しの上に少しだけ余白。
   ※ 余白の確保は padding-bottom に統一するため margin-bottom は 0 にする */
.page-about main.about-wrap {
    position: relative;
    z-index: 5;
    margin-top: 16px;
    /* 見出し下の小さな隙間 */
    margin-bottom: 0;
    /* ← ここ重要：以前の calc(...) を打ち消す */
    padding-top: 0;
    padding-bottom: calc(var(--footer-h, 96px) + 40px);
    /* ↑ 96px はデスクトップ時のフッター高さのデフォルト。必要なら調整OK */
}

/* --- Hero (overlay + fade) --- */
.page-home .hero {
    position: relative;
    text-align: center;
    color: #fff;
    min-height: 100vh;
    min-height: 100svh;
    /* iOS/Safari でも安定 */
    height: 100svh;
    display: grid;
    align-items: center;
    padding: 0 20px;
    overflow: hidden;
}

.page-home .hero-inner {
    position: fixed;
    left: 50%;
    /* top: 50%; */
    top: 50vh;
    /* スマホのブラウザでブレないようにする */
    top: 50svh;
    /* stabilize against mobile URL bar changes */
    transform: translate(-50%, -50%);
    z-index: 2;
    max-width: 880px;
    width: min(92vw, 880px);
    margin: 0 auto;
    padding: 0;
    text-align: center;
    animation: heroFadeIn 1.2s ease-out;
    pointer-events: none;
}

.page-home .hero-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, .25) 40%, rgba(0, 0, 0, .65) 100%);
    backdrop-filter: blur(4px);
    z-index: 0;
    pointer-events: none;
}

.page-home .viewport-fader {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 160px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 1) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Seamless transition: overlap next section slightly under the hero */
.stack.seamless {
    position: relative;
    margin-top: 0;
    padding-top: 24px;
}

/* optional soft top shadow so the cards feel anchored */
/* (kept comment: Removed .stack.seamless::before rule) */

/* =====================
   Section-cards
   ===================== */
/* ===== Section title readability (chip-like badge) ===== */
.section-cards {
    display: inline-block;
    margin: 0 0 18px;
    padding: 8px 14px;
    font-size: clamp(14px, 1.8vw, 18px);
    line-height: 1;
    color: #111;
    background: rgba(255, 255, 255, .65);
    border: 1px solid rgba(0, 0, 0, .06);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
}


/* =====================
   Cards
   ===================== */
/* ===== Cards ===== */
.card {
    display: flex;
    align-items: stretch;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.card-media {
    position: relative;
    flex: 0 0 42%;
    min-width: 240px;
    background: #ddd;
}

.card-media img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* NEWバッジ（cardに is-new が付いた時のみ表示） */
.card.is-new .badge-new {
    display: inline-flex;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 8px;
    border-radius: 999px;
}

.badge-new {
    display: none;
    color: #fff;
    background: #ff4d4f;
    box-shadow: 0 6px 20px rgba(255, 77, 79, .35);
}

.card-body {
    flex: 1 1 auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-title {
    font-size: clamp(18px, 2.6vw, 22px);
    font-weight: 700;
    letter-spacing: .01em;
}

.card-desc {
    margin: 0;
    color: var(--muted);
}

/* メタ（タグ群）をカード下部に吸着 */
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #2b2b2b;
    background: var(--chip-bg);
    border: 1px solid var(--chip-bd);
    padding: 4px 8px;
    border-radius: 999px;
}

/* =====================
   News & About (shared)  ← ここから置き換え
   ===================== */

/* 背景の上下ぼかし（news / about 共通：専用レイヤー要素 .page-overlay） */
.page-news .page-overlay,
.page-about .page-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, .45) 0%,
            rgba(0, 0, 0, .25) 40%,
            rgba(0, 0, 0, .65) 100%);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 0;
    pointer-events: none;
}

/* ヘッダー/フッターの見た目を統一 */
.page-news .site-header,
.page-news .site-footer,
.page-about .site-header,
.page-about .site-footer {
    background: rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}


/* メイン下にフッター分の余白を確保（両ページ共通） */
.page-news main,
.page-about main {
    padding-bottom: var(--footer-h);
}

/* フッターは固定配置（両ページ共通） */
.page-news .site-footer,
.page-about .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    height: var(--footer-h);
    background: rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}


/* メインの白いパネル（両ページ共通） */
.page-news main.container.news-wrap {
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    width: min(92vw, 960px);
    margin: 100px auto 96px;
    /* 上:100px / 下:96px はそのまま */
    padding: 48px 32px 96px;
    /* 下:96px はフッターの高さと同期 */
}


/* =====================
   News (including background overlays)
   ===================== */
/* Make news list scrollable within a fixed height */
.page-news .news-list {
    max-height: 40vh;
    /* adjust height as desired */
    overflow-y: auto;
    padding-right: 8px;
    /* avoid scrollbar overlap */
}

/* Optional: subtle scrollbar styling for better aesthetics */
.page-news .news-list::-webkit-scrollbar {
    width: 8px;
}

.page-news .news-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.page-news .news-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* News List (shared header/background) */
.news-wrap {
    padding: 48px 0 80px;
}

.news-wrap .section-title {
    text-align: center;
    font-size: clamp(22px, 3.2vw, 28px);
    margin: 0 0 24px;
}

.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-item {
    display: grid;
    grid-template-columns: 110px 96px 1fr;
    align-items: center;
    gap: 18px;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.news-date {
    color: black;
    font-variant-numeric: tabular-nums;
}

.news-cat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
}

.news-cat.is-news {
    background: #2563eb;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

.news-cat.is-event {
    background: #f97316;
    box-shadow: 0 6px 16px rgba(249, 115, 22, .28);
}

.news-cat.is-seminar {
    background: #10b981;
    box-shadow: 0 6px 16px rgba(16, 185, 129, .26);
}

.news-cat.is-case {
    background: #ef4444;
    box-shadow: 0 6px 16px rgba(239, 68, 68, .28);
}

.news-title {
    color: #1f2937;
    text-decoration: none;
    line-height: 1.5;
}

/* =====================
   About page
   ===================== */
/* =====================
   About page (fix header/footer layout to match news)
   ===================== */

.page-about .hero {
    position: relative;
    z-index: 5;
    /* above background overlay */
    text-align: center;
    padding: 24px 0 12px;
    /* space above/below */
    margin: 0;
    /* no extra top offset now that body is padded */
}

.page-about .hero .hero-title {
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

.about-images {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
}

.about-images img {
    width: min(92vw, 960px);
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* =====================
   Modal (mode selector)
   ===================== */
/* --- Modal (mode selector) --- */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
}

.modal[aria-hidden="false"] {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1001;
}

.modal-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    width: min(92vw, 560px);
    padding: 22px 22px 18px;
    z-index: 1002;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-dialog h3 {
    margin: 0 0 8px;
    font-size: 22px;
    text-align: center;
}

.modal-desc {
    margin: 0 0 18px;
    color: #555;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 6px 0 10px;
}

.btn-image img {
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-image:hover img {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.modal-actions .btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600
}

.btn-plain {
    background: #f2f4f8;
    border: 1px solid #d7dbe4;
    color: #1a2a3a
}

.btn-story {
    background: #111;
    color: #fff
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    color: #555;
    font-size: 14px
}

@media (hover:hover) {
    .modal-backdrop:hover {
        cursor: pointer
    }
}

/* =====================
   Responsive tweaks
   ===================== */
/* ===== Responsive（ホームのカードだけ） ===== */
@media (max-width:820px) {
    .card {
        flex-direction: column;
    }

    .card-media {
        flex-basis: auto;
        min-width: 100%;
    }
}

/* Compact news list on small screens */
@media (max-width: 640px) {
    .news-item {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 6px;
        padding: 14px 0;
    }

    .news-date {
        order: 1;
        font-size: 13px;
    }

    .news-cat {
        order: 2;
        width: max-content;
    }

    .news-title {
        order: 3;
    }
}






/* ===== Responsive: header/nav ===== */
@media (max-width: 720px) {
    .site-header {
        height: 56px;
    }

    .header-inner {
        padding: 0 10px;
    }

    .header-inner .brand {
        font-size: 17px;
        letter-spacing: .035em;
    }

    /* tighter spacing for mobile */
    .header-inner .nav a {
        font-size: 13.5px;
        line-height: 1;
        padding: 0;
        letter-spacing: -0.01em;
        font-feature-settings: "palt" 1, "kern" 1;
    }

    .header-inner .nav {
        gap: 4px;
    }

    .header-inner .nav nav[aria-label="SNS"] {
        gap: 6px;
    }

    .header-inner .nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        /* はみ出す場合は横スクロール */
        -webkit-overflow-scrolling: touch;
    }

    /* SNS icons: keep visible but smaller */
    .header-inner .nav nav[aria-label="SNS"] svg {
        width: 18px;
        height: 18px;
    }

    /* About page header/footer alignment for mobile */

    body.page-about {
        padding-top: 56px;
    }

    body.page-news {
        padding-top: 56px;
    }

    .page-about,
    .page-news {
        --footer-h: 68px;
    }
}

/* Very narrow screens: avoid overflow */
@media (max-width: 480px) {

    body.page-home::before {
        /* この以下3行をいれるとリサイズのブレが防げる */
        background-position: center top;
        background-size: auto 100vh;
        background-size: auto 100svh;
    }

    body.page-about::before {
        /* about もスマホでは高さ基準でフィットさせてブレを防ぐ */
        background-position: center top;
        background-size: auto 100vh;
        background-size: auto 100svh;
    }

    .header-inner {
        padding: 0 8px;
    }

    .header-inner .brand {
        font-size: 15px;
        letter-spacing: .01em;
        white-space: nowrap;
    }

    .header-inner .nav {
        gap: 3px;
    }

    .header-inner .nav nav[aria-label="SNS"] {
        gap: 4px;
    }

    .header-inner .nav a {
        font-size: 12.5px;
        letter-spacing: -0.01em;
        font-feature-settings: "palt" 1, "kern" 1;
    }

    .header-inner .nav nav[aria-label="SNS"] svg {
        width: 15px;
        height: 15px;
    }

    .page-about,
    .page-news {
        --footer-h: 64px;
    }
}

@media (max-width: 380px) {

    body.page-home::before {
        /* この以下3行をいれるとリサイズのブレが防げる */
        background-position: center top;
        background-size: auto 100vh;
        background-size: auto 100svh;
    }

    body.page-about::before {
        /* about もスマホ最小幅では高さ基準でフィット */
        background-position: center top;
        background-size: auto 100vh;
        background-size: auto 100svh;
    }


    .site-header {
        height: 52px;
    }

    .header-inner {
        padding: 0 6px;
    }

    .header-inner .brand {
        font-size: 14px;
        letter-spacing: .005em;
    }

    .header-inner .nav {
        gap: 2px;
    }

    .header-inner .nav nav[aria-label="SNS"] {
        gap: 3px;
    }

    .header-inner .nav a {
        font-size: 12px;
    }

    body.page-about {
        padding-top: 52px;
    }

    body.page-news {
        padding-top: 52px;
    }

    .page-about,
    .page-news {
        --footer-h: 60px;
    }
}

@media (max-width: 340px) {
    .header-inner .brand {
        font-size: 13px;
        letter-spacing: 0;
    }
}