/*
Theme Name: Terasu Theme
Theme URI: https://toyfarm.co.jp/
Author: Toy Farm
Author URI: https://toyfarm.co.jp/
Description: 株式会社トイ・ファーム開発のオリジナルテーマ。一般社団法人てらす様向け。
Version: 1.0.6
*/

/* ==========================================================================
   共通設定
   ========================================================================== */
body {
    background-color: #ffffff;
    color: #111111;
    font-family: "Noto Sans JP", sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 鋭利なデザインのために角丸を無効化 */
* {
    border-radius: 0 !important;
}

/* 縦書き設定 */
.writing-vertical {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-feature-settings: "palt";
}

/* ==========================================================================
   ヘッダー・サイドバー・ナビゲーション
   ========================================================================== */
/* サイドバー（PC） */
@media (min-width: 1024px) {
    .sidebar-fixed {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        border-right: 1px solid #E5E5E5;
        z-index: 50;
        background: #fff;
    }
    .main-content {
        margin-left: 260px;
        border-left: 1px solid #E5E5E5;
    }
}

/* Nav Hover Effect */
.nav-item {
    position: relative;
    display: inline-block;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 0;
    height: 1px;
    background-color: #FFCC00;
    transition: width 0.3s ease;
}
.nav-item:hover::before {
    width: 15px;
}

/* ==========================================================================
   アニメーション・ローディング
   ========================================================================== */
/* ローディング画面 */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.6s cubic-bezier(0.87, 0, 0.13, 1);
}
#loader.loaded {
    transform: translateY(-100%);
}
.loader-logo-wrap {
    width: 280px;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards 0.2s;
}

/* フェードイン・スライドアップ (通常) */
.fade-in {
    opacity: 0;
    transition: opacity 1s ease;
}
.fade-in.is-visible {
    opacity: 1;
}

.slide-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* スタッガリング用 */
.fade-up-stagger {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up-stagger.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* スライドショー用 */
.slide-img:nth-child(1) { animation-delay: 0s; }
.slide-img:nth-child(2) { animation-delay: 6s; }
.slide-img:nth-child(3) { animation-delay: 12s; }
.slide-img:nth-child(4) { animation-delay: 18s; }

/* ニュースティッカー */
.news-ticker-wrap {
    height: 48px;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   コンポーネント・パーツ
   ========================================================================== */
/* 画像ズームエフェクト */
.img-wrap {
    overflow: hidden;
    display: block;
    position: relative;
}
.img-wrap img {
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.img-wrap:hover img {
    transform: scale(1.05);
}

/* グリッドボーダー */
.grid-border > * {
    border-bottom: 1px solid #E5E5E5;
    border-right: 1px solid #E5E5E5;
}

/* ガイドカテゴリー */
.guide-cat {
    background-color: #000;
    position: relative;
    overflow: hidden;
}
.guide-cat h3, .guide-cat p, .guide-cat i {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* フィルターボタン */
.filter-btn {
    white-space: nowrap;
}
.filter-btn.active {
    background-color: #111;
    color: #fff;
    border-color: #111;
}

/* ニュースアイテムホバー */
.news-item-img {
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.group:hover .news-item-img {
    transform: scale(1.03);
}

/* ガイドアイテムカード */
.card-img-wrap {
    overflow: hidden;
    position: relative;
}
.card-img-wrap img {
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.group:hover .card-img-wrap img {
    transform: scale(1.05);
}

/* ==========================================================================
   記事本文エリア（Single Page Entry Content）
   ========================================================================== */
.entry-content {
    line-height: 1.8;
    color: #333;
    font-size: 1rem;
}
.entry-content p {
    margin-bottom: 1.8em;
    text-align: justify;
}

/* --- 見出し --- */
.entry-content h2 {
    font-size: 1.75rem;
    font-weight: 900;
    margin-top: 2.5em;
    margin-bottom: 0.8em;
    padding-left: 1.25rem;
    border-left: 8px solid #FFCC00;
    line-height: 1.3;
    letter-spacing: 0.05em;
}
.entry-content h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 2em;
    margin-bottom: 0.6em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.entry-content h3::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #111;
}
.entry-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.8em;
    margin-bottom: 0.5em;
}
.entry-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 2em;
    border: 1px solid #E5E5E5;
}

/* --- リスト --- */
.entry-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 2em;
}
.entry-content ul > li {
    position: relative;
    padding-left: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.6;
}
.entry-content ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background-color: #FFCC00;
}

.entry-content li > ul,
.entry-content li > ol {
    margin-top: 1em !important;
    margin-bottom: 1em !important;
}

.entry-content ul > li > ul > li {
    padding-left: 1.2em;
}
.entry-content ul > li > ul > li::before {
    background-color: transparent;
    content: '-';
    font-weight: bold;
    color: #111;
    font-size: 1.2em;
    line-height: 1;
    top: 0;
    width: auto;
    height: auto;
}

.entry-content ol {
    list-style: none;
    padding-left: 0;
    margin-bottom: 2em;
    counter-reset: my-ol-counter;
}
.entry-content ol > li {
    position: relative;
    padding-left: 2.5em;
    margin-bottom: 0.75em;
    line-height: 1.6;
}
.entry-content ol > li::before {
    counter-increment: my-ol-counter;
    content: counter(my-ol-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #111;
    border-bottom: 2px solid #FFCC00;
    line-height: 1.2;
}
.entry-content ol > li > ol {
    counter-reset: my-ol-sub-counter;
}
.entry-content ol > li > ol > li::before {
    counter-increment: my-ol-sub-counter;
    content: counter(my-ol-sub-counter) ".";
    font-size: 0.9em;
    border-bottom: none;
    color: #555;
}

/* 引用 */
.entry-content blockquote {
    background-color: #fafafa;
    padding: 2em;
    margin: 2em 0;
    border-left: 4px solid #111;
    font-style: italic;
    color: #444;
    position: relative;
}
.entry-content blockquote::before {
    content: '\f10d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 0.8em;
    left: 1em;
    color: #e5e5e5;
    font-size: 1.25rem;
}

.entry-content a {
    color: #111;
    text-decoration: none;
    background-image: linear-gradient(transparent 70%, #FFCC00 70%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transition: all 0.3s;
    font-weight: 700;
}
.entry-content a:hover {
    background-image: linear-gradient(transparent 0%, #FFCC00 0%);
}

/* --- テーブル刷新 (AboutページのORGANIZATIONと同じデザイン) --- */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 3em 0;
    border: none;
    /* 全体を黒の太線で挟む */
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
}

.entry-content th {
    background-color: transparent;
    color: #111;
    font-weight: bold;
    text-align: left;
    /* たっぷりとした余白 */
    padding: 2rem 1rem;
    /* 行間は細いグレー線 */
    border-bottom: 1px solid #E5E5E5;
    border-right: none;
    vertical-align: middle;
    /* PCでは30%程度の幅 */
    width: 30%;
    box-sizing: border-box;
}

.entry-content td {
    background-color: transparent;
    color: #374151; /* 少しグレー (gray-700) */
    font-weight: 500;
    /* たっぷりとした余白 */
    padding: 2rem 1rem;
    border-bottom: 1px solid #E5E5E5;
    border-right: none;
    vertical-align: middle;
    box-sizing: border-box;
}

/* 最後の行のボーダー処理 */
/* Aboutページと同様、最後の行の下線はテーブル自体の太枠(border-bottom)に任せるため、セルの下線は消す */
.entry-content tr:last-child th,
.entry-content tr:last-child td {
    border-bottom: none;
}

/* アクセントバーなどは削除 */
.entry-content th::before {
    content: none;
}

/* スマホ対応 */
.wp-block-table {
    overflow-x: auto;
    margin: 0 0 3em 0;
    -webkit-overflow-scrolling: touch;
}
.wp-block-table table {
    min-width: 500px;
}

@media (min-width: 768px) {
    .entry-content h2 { font-size: 2rem; }
}

/* ==========================================================================
   エリアガイド詳細（Gallery Grid）
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background-color: #E5E5E5;
    border: 1px solid #E5E5E5;
}
.gallery-item {
    background-color: #fff;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   GTranslate（言語選択）のカスタマイズ
   ========================================================================== */
.lang-selector {
    position: relative;
    width: 100%;
}
.lang-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #111;
    background-color: #fff;
    color: #111;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    font-family: "Jost", sans-serif;
    font-size: 0.875rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.lang-selector select:hover {
    background-color: #FFCC00;
    border-color: #FFCC00;
}
.lang-selector::after {
    content: '\f078';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.75rem;
    color: #111;
}
.goog-te-gadget-icon { display: none !important; }
.goog-te-gadget-simple { background-color: transparent !important; border: none !important; padding: 0 !important; }

/* Active Nav Item */
.nav-item.active-nav::before {
    width: 15px;
}

/* ==========================================================================
   GTranslate（言語選択）のカスタマイズ（修正版）
   ========================================================================== */
.lang-selector {
    position: relative;
    width: 100%;
    overflow: hidden; /* はみ出し防止 */
}

/* Googleが生成するSelectボックスを強制スタイリング */
.lang-selector select,
.goog-te-combo {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid #111 !important;
    background-color: #fff !important;
    color: #111 !important;
    border-radius: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    font-family: "Jost", sans-serif !important;
    font-size: 0.875rem !important;
    font-weight: bold !important;
    letter-spacing: 0.05em !important;
    cursor: pointer !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.lang-selector select:hover,
.goog-te-combo:hover {
    background-color: #FFCC00 !important;
    border-color: #FFCC00 !important;
}

/* 矢印アイコン */
.lang-selector::after {
    content: '\f078';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.75rem;
    color: #111;
    z-index: 10;
}

/* Google翻訳のツールバー（上部に出るバー）を消す */
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}
body {
    top: 0px !important;
}

/* Googleロゴなどを隠す */
.goog-logo-link {
    display: none !important;
}
.goog-te-gadget {
    color: transparent !important;
    font-size: 0 !important;
}
.goog-te-gadget > span {
    display: none !important;
}