/*
Theme Name: ABROAD STUDY Theme
Description: 洗練された大手感と安心感を備えたハイクラステーマ（全デバイスハンバーガーメニュー対応版）
Version: 5.0.0
*/

:root {
    --color-text: #333333;
    --color-bg: #FAFAFA;
    --color-study: #00B900; 
    --color-tax: #0088CC;   
    --color-accent: #111111;
    --font-main: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: var(--font-main); color: var(--color-text); background: var(--color-bg); 
    line-height: 1.8; letter-spacing: 0.05em; font-feature-settings: "palt"; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; vertical-align: bottom; }
a { color: inherit; text-decoration: none; transition: 0.3s ease; }
.container { max-width: 1100px; margin: 0 auto; padding: 2% 4%; }
h1, h2, h3, h4, p { word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }

/* ==============================================
   ヘッダー (PC/スマホ共通)
============================================== */
.site-header { 
    position: fixed; top: 0; left: 0; width: 100%; 
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); 
    z-index: 1000; box-shadow: 0 1px 15px rgba(0,0,0,0.05); 
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.site-logo img { max-height: 50px; width: 100%;}
.site-logo a { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.05em; }

.header-line-links { display: flex; gap: 20px; align-items: center; margin-left: auto; margin-right: 30px; }
.h-line-item { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.h-line-icon { background: #00B900; color: #fff; font-size: 0.8rem; font-weight: bold; padding: 2px 10px; border-radius: 20px; margin-bottom: 2px; }
.h-line-text { font-size: 0.8rem; font-weight: bold; }
.h-line-item:hover { opacity: 0.7; }

/* ==============================================
   ハンバーガーボタン & ドロワーメニュー (全デバイス共通)
============================================== */
/* ボタン本体 */
.hamburger { 
    display: flex; flex-direction: column; justify-content: space-between; 
    width: 35px; height: 22px; background: none; border: none; cursor: pointer; 
    position: relative; z-index: 10001; 
}
.hamburger span { width: 100%; height: 3px; background: #333; border-radius: 2px; transition: 0.3s; }

/* 背景の暗幕 */
.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(0,0,0,0.6); z-index: 9998;
    opacity: 0; visibility: hidden; transition: 0.4s;
}
.drawer-overlay.is-active { opacity: 1; visibility: visible; }

/* 引き出しメニュー本体 */
.drawer-menu { 
    position: fixed; top: 0; right: -100%; 
    width: 100%; max-width: 400px; /* PCでは幅400px、スマホでは全幅 */
    height: 100vh; background: #fff; z-index: 9999; 
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    display: flex; flex-direction: column;
}
.drawer-menu.is-active { right: 0; }

.drawer-header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 20px 8%; border-bottom: 1px solid #eee; height: 80px;
}
.btn-close { 
    background: none; border: none; font-size: 1.8rem; 
    cursor: pointer; color: #333; font-weight: bold; line-height: 1;
}

/* メニュースクロール対応と点線デザイン */
.drawer-nav {
    overflow-y: auto; /* ★メニューが多い時のスクロールを可能にする★ */
    flex-grow: 1; 
    padding-bottom: 50px; 
}
.drawer-nav ul { list-style: none; padding: 0 8%; margin: 20px 0; }
.drawer-nav li a { 
    display: block; position: relative;
    padding: 18px 30px 18px 0; 
    font-size: 1.1rem; font-weight: 700; color: #444;
    border-bottom: 1px dashed #ccc; /* スライド2枚目の点線 */
}
.drawer-nav li a:hover { color: var(--color-study); }

/* 右側の矢印 (＞) をCSSで描画 */
.drawer-nav li a::after {
    content: ''; position: absolute; right: 5px; top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px; height: 8px;
    border-top: 2px solid #888; border-right: 2px solid #888;
    transition: 0.3s;
}
.drawer-nav li a:hover::after { border-color: var(--color-study); }

/* ==============================================
   メインビジュアル (FV)
============================================== */
.fv { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; background-size: cover; background-position: center; position: relative; }
.fv::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.20); }
.fv-content { position: relative; z-index: 10; color: #fff; width: 100%; animation: fadeUp 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.main-copy { font-size: clamp(1.6rem, 6vw, 3.2rem); font-weight: 700; text-shadow: 0 2px 15px rgba(0,0,0,0.4); line-height: 1.5; letter-spacing: 0.05em; margin: 0 auto; text-wrap: balance; word-break: keep-all; overflow-wrap: break-word; text-align: center;}
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(40px); } 100% { opacity: 1; transform: translateY(0); } }


/* ==============================================
   TOP: フリーテキスト（つぶやき）
============================================== */
.free-text-zone {
    position: relative;
    z-index: 20;
    margin-top: -40px; /* FVに少し被せて一体感を出す */
    margin-bottom: 40px;
}
.free-text-inner {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}
.free-text-badge {
    background: var(--color-study);
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 6px 16px;
    border-radius: 50px;
    white-space: nowrap;
}
.free-text-content {
    flex-grow: 1;
}
/* 管理画面で書いた2-3行のテキストを整える */
.free-text-content p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

/* ==============================================
   TOP: ピックアップ3カラム
============================================== */
.pickup-grid { 
    display: flex; gap: 40px; position: relative; z-index: 20; 
    /* margin-top: -60px; を削除し 0 に変更（フリーテキストに被り枠を譲るため） */
    margin-top: 0; 
}
.pickup-item { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.06); flex: 1; text-align: center; transition: all 0.4s ease; }
.pickup-item:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }
.pickup-img { height: 220px; background-size: cover; background-position: center; }
.pickup-text { padding: 25px 20px; font-weight: 700; font-size: 1.1rem; color: var(--color-text); }


/* レスポンシブ (スマホ版) の @media (max-width: 768px) 内に以下を追記 */
@media (max-width: 768px) {
    .free-text-zone { margin-top: -30px; padding: 0; }
    .free-text-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
    .pickup-grid { margin-top: 0; gap: 20px; }
}


/* ==============================================
   TOP: 体験談・スタッフ
============================================== */
.staff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.staff-card { text-align: center; }
.staff-thumb { width: 140px; height: 140px; margin: 0 auto 20px; border-radius: 50%; overflow: hidden; background: #eee; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.staff-thumb img { width: 100%; height: 100%; object-fit: cover; }
.staff-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.staff-comment { font-size: 0.95rem; color: #555; text-align: left; }

/* Instagramダミー */
.insta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.insta-item { aspect-ratio: 1; background: #eee; border-radius: 8px; overflow: hidden; }

/* ==============================================
   フッター
============================================== */
.site-footer { background: #E1E8F0; padding: 60px 0 80px; margin-top: 100px; color: #333; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.footer-col h4 { text-align: center; border-bottom: 1px solid #ccc; padding-bottom: 10px; margin-bottom: 15px; font-size: 1.1rem; }
.footer-col p { font-size: 0.9rem; line-height: 1.8; text-align: left; }

/* 追従 LINE無料相談ボタン */
.floating-cv-group { position: fixed; bottom: 30px; right: 30px; z-index: 999; }
.btn-cv.cv-green { background: #00B900; color: #fff; font-weight: bold; font-size: 1.1rem; padding: 15px 35px; border-radius: 50px; box-shadow: 0 5px 20px rgba(0, 185, 0, 0.4); display: inline-flex; align-items: center; justify-content: center; transition: 0.3s; }
.btn-cv.cv-green:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0, 185, 0, 0.6); color:#fff; }

/* 新規追加：フッター上部社名テキスト */
.footer-main-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 50px;
    letter-spacing: 0.05em;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .footer-main-title {
        font-size: 1.4rem;
        margin-bottom: 30px;
    }
}

/* ==============================================
   下層ページ (2階層目)
============================================== */
.page-fv { height: 70vh; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; position: relative; margin-top: 80px; }
.page-fv::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.2); }
.page-title { position: relative; z-index: 10; color: #fff; font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: 0.05em; }
.entry-content { 
    padding: 80px 10px 120px; 
    max-width: 900px; /* 1100pxから900pxに縮小 */
    margin: 0 auto;   /* 画面の中央に配置 */
}
section { padding: 120px 0; }
.section-title { text-align: center; font-size: 2.2rem; margin-bottom: 60px; font-weight: 700; letter-spacing: 0.05em; }

/* ==============================================
   レスポンシブ (スマホ版)
============================================== */
@media (max-width: 768px) {
    section { padding: 80px 0; }
    .section-title { font-size: 1.8rem; margin-bottom: 40px; }
    .header-line-links { display: flex; gap: 10px; align-items: center; margin-left: auto; margin-right: 10px; margin-left: 5px;}
    .h-line-icon { background: #00B900; color: #fff; font-size: 0.7rem; font-weight: bold; padding: 2px 8px; border-radius: 20px; margin-bottom: 2px; }
    .h-line-text { font-size: 0.5rem; font-weight: bold; }
    .pickup-grid { flex-direction: column; padding: 0; gap: 20px; margin-top: -30px; }
    .staff-grid { grid-template-columns: 1fr; gap: 40px; }
    .insta-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    .page-fv { height: 35vh; }
    
    /* 追従ボタンのスマホ最適化 */
    .floating-cv-group { bottom: 20px; right: 15px; width: auto; flex-direction: column; }
    .btn-cv.cv-green { padding: 12px 24px; font-size: 0.9rem; border-radius: 50px; box-shadow: 0 4px 15px rgba(0, 185, 0, 0.3); }
}


/* Instagramセクションのスタイル追加 */
.insta-section {
    padding-top: 100px;
    padding-bottom: 50px;
}

.insta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* PCは3列 */
    gap: 15px;
    max-width: 900px; /* 少しタイトに見せると洗練されます */
    margin: 0 auto;
}

.insta-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    display: block;
    background: #f0f0f0;
}

.insta-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.insta-item:hover img {
    transform: scale(1.1);
}

/* スマホ表示 */
@media (max-width: 768px) {
    .insta-grid {
        grid-template-columns: repeat(2, 1fr); /* スマホは2列 */
        gap: 10px;
        padding: 0 4%;
    }
}

/* アクセスページの地図 */
.access-map-wrapper {
    margin: 40px 0;
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9の比率 */
    background: #eee;
}
.access-map-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    border-radius: 8px;
}

/* ページ内大見出しの装飾（大手感） */
.section-title {
    text-align: center;
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--color-study);
}

/* ==============================================
   アーカイブページ (一覧) の洗練されたカードデザイン
============================================== */
.archive-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}
.archive-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); /* 繊細な影で上品に */
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f9f9f9;
}
.archive-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.archive-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9; /* サムネイル比率を統一して綺麗に */
    overflow: hidden;
    background: #f8f9fa;
}
.archive-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.archive-card:hover .archive-card-thumb img {
    transform: scale(1.05);
}
.archive-card-thumb .no-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #aaa; font-size: 0.9rem;
}
.archive-card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.archive-card-meta {
    margin-bottom: 12px;
}
.archive-date {
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 0.05em;
}
.archive-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 15px;
    color: var(--color-text);
}
.archive-card-excerpt {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-top: auto;
}

/* ==============================================
   ページネーション（番号付きリンク）
============================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 60px;
}
.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--color-text);
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--color-study);
    color: #fff;
}

/* レスポンシブ */
@media (max-width: 992px) {
    .archive-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .archive-card-grid { grid-template-columns: 1fr; gap: 30px; }
    .archive-card-thumb { aspect-ratio: 3 / 2; }
}

/* ==============================================
   サムネイル付きのシンプルなテキストリスト
============================================== */
.archive-list {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
}

/* 1行ずつの設定 */
.archive-list-item-simple {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px dotted #ccc;
    transition: background-color 0.3s ease;
    color: var(--color-text);
}
.archive-list-item-simple:hover {
    background-color: #fafafa;
}

/* 小さめのサムネイル */
.archive-thumb-small {
    width: 80px;  /* ここでサムネイルの幅を調整 */
    height: 56px; /* 黄金比に近いサイズ感 */
    flex-shrink: 0;
    margin-right: 20px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}
.archive-thumb-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.archive-thumb-small .no-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; color: #aaa;
}

/* テキストをまとめる枠 */
.archive-text-wrap {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

/* 日付部分 */
.archive-date-simple {
    font-size: 1rem;
    font-weight: 700;
    color: #999;
    width: 110px; /* 日付幅を固定してタイトルを綺麗に縦揃え */
    flex-shrink: 0;
}

/* タイトル部分 */
.archive-title-simple {
    font-size: 1rem;
    line-height: 1.5;
}

/* スマホ表示の調整 */
@media (max-width: 768px) {
    .archive-list-item-simple {
        align-items: flex-start; /* 上揃えに変更 */
        padding: 12px 0;
    }
    .archive-thumb-small {
        width: 60px;
        height: 42px;
        margin-right: 12px;
    }
    .archive-text-wrap {
        flex-direction: column; /* 日付とタイトルを縦並びに */
        align-items: flex-start;
    }
    .archive-date-simple {
        font-size: 0.85rem;
        margin-bottom: 4px;
        width: auto;
    }
    .archive-title-simple {
        font-size: 0.95rem;
    }
}




/* ==============================================
   投稿本文（.main-text）の自動整形・レスポンシブ
============================================== */
/* 全体のベース設定（行間と文字間を広めにとって読みやすく） */
.main-text {
    line-height: 1.8;
    letter-spacing: 0.03em;
    color: var(--color-text);
    font-size: 1rem;
}

/* 段落（Enterキーでの改行）の余白を自動で空ける */
.main-text p {
    margin-bottom: 2em;
}

/* 画像がスマホ画面からはみ出さないように自動縮小＋角丸 */
.main-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0 2em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* うっすら影をつけて上質に */
}

/* ==============================================
   見出しの自動デザイン（入力するだけで装飾される）
============================================== */
/* H2（大見出し） */
.main-text h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 3.5em 0 1.5em; /* 上に大きな余白、下に中くらいの余白 */
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--color-study); /* サイトのメインカラーの線 */
}
/* 記事の一番最初のH2は上の余白を減らす */
.main-text h2:first-child {
    margin-top: 0;
}

/* H3（中見出し） */
.main-text h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2.5em 0 1.2em;
    padding-left: 12px;
    border-left: 4px solid var(--color-study); /* 左にアクセントの線 */
}

/* H4（小見出し） */
.main-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2em 0 1em;
}

/* 箇条書き（リスト）も綺麗に整える */
.main-text ul, .main-text ol {
    margin-bottom: 2em;
    padding-left: 1.5em;
    background: #f9f9f9;
    padding: 1.5em 1.5em 1.5em 2.5em;
    border-radius: 8px;
}
.main-text li {
    margin-bottom: 0.5em;
}

/* ==============================================
   スマホ表示の自動調整（デバイスごとの最適化）
============================================== */
@media (max-width: 768px) {
    /* スマホでは文字サイズと余白を少し縮小して画面に収める */
    .main-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    .main-text p {
        margin-bottom: 1.5em;
    }
    .main-text h2 {
        font-size: 1.35rem;
        margin: 2.5em 0 1.2em;
    }
    .main-text h3 {
        font-size: 1.15rem;
        margin: 2em 0 1em;
    }
    .main-text ul, .main-text ol {
        padding: 1.2em 1.2em 1.2em 2em;
    }
}

/* ==============================================
   テーブル（表）のデザインとスマホ横スクロール
============================================== */
/* テーブル全体の基本デザイン（PC・スマホ共通） */
.main-text table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2em;
    font-size: 0.95rem;
    background: #ffffff;
}

/* セルの線と余白 */
.main-text th, 
.main-text td {
    border: 1px solid #e1e1e1;
    padding: 15px;
    text-align: left;
    line-height: 1.6;
}

/* 見出しセル（th）のデザイン */
.main-text th {
    background-color: #f4f6f9; /* 淡いグレーで視認性アップ */
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap; /* 見出しはなるべく改行させない */
}

/* ▼ スマホでの横スクロール設定 ▼ */

/* 1. ブロックエディタ標準のテーブル枠がある場合（推奨） */
.main-text .wp-block-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* スマホで滑らかにスクロールさせる */
    margin-bottom: 2em;
    border-right: 1px solid #e1e1e1; /* 右端のスクロール切れ目を見やすく */
}
.main-text .wp-block-table table {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    /* 2. 直接 <table> タグだけを書いた場合の保険設定 */
    .main-text table {
        display: block; /* テーブルをブロック要素にしてスクロール可能にする */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* スマホで表が潰れないように、各セルの最低幅を保証する */
    .main-text th, 
    .main-text td {
        min-width: 120px; /* ここを調整すると横幅が変わります */
    }
}