/*
Theme Name:  朝日町地域商社
Theme URI:   https://asahi-town.jp/
Author:      Asahi Town Comprehensive Industrial Development
Author URI:  https://asahi-town.jp/
Description: 朝日町ニュースポータル用テーマ。四季に連動したスクロールカラーテーマ、Three.js パーティクル背景、GSAP スクロールアニメーションを搭載。
Version:     1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: asahi-town
Tags:        one-page, full-width-template, custom-colors, custom-menu, featured-images, scroll-effect
*/

/* ==========================================================================
   CSS カスタムプロパティ（四季テーマ / スクロールで JS が動的更新）
   ========================================================================== */

:root {
    /* 初期値: 春 (Spring Light) */
    --bg-color:      #edf7f1;
    --text-color:    #1c3a28;
    --accent-gold:   #b06a10;
    --glass-bg:      rgba(237, 247, 241, 0.65);
    --border-color:  rgba(30, 100, 60, 0.18);

    /* レイアウト */
    --container-max: 1152px;
    --section-py:    10rem;        /* py-40 相当 */
    --header-h:      88px;

    /* タイポグラフィ */
    --font-serif:    'Zen Old Mincho', serif;
    --font-cinzel:   'Cinzel', serif;
    --font-gothic:   'Zen Kaku Gothic New', sans-serif;

    /* トランジション */
    --transition-base: 0.3s ease;
    --transition-slow: 0.7s ease;
}


/* ==========================================================================
   リセット / ベース
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* WordPress が出力する .alignnone / .aligncenter などのデフォルト上書き */
.wp-block-image img,
.wp-block-cover img {
    height: auto;
}


/* ==========================================================================
   タイポグラフィ ユーティリティ
   ========================================================================== */

.font-cinzel {
    font-family: var(--font-cinzel);
}

.font-gothic {
    font-family: var(--font-gothic);
}


/* ==========================================================================
   Three.js 背景キャンバス
   ========================================================================== */

#canvas-webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}


/* ==========================================================================
   グラスモーフィズム パネル
   ========================================================================== */

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
}


/* ==========================================================================
   ヘッダー
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.site-header .site-branding {
    font-family: var(--font-gothic);
    font-weight: 500;
    letter-spacing: 0.25em;
    line-height: 1.2;
    color: var(--text-color);
}

.site-header .site-branding .site-title-ja {
    display: block;
    font-size: 1.25rem;
}

.site-header .site-branding .site-title-en {
    display: block;
    font-size: 0.625rem;
    letter-spacing: 0.25em;
    margin-top: 0.125rem;
    opacity: 0.5;
}


/* ==========================================================================
   ナビゲーション
   ========================================================================== */

.main-navigation {
    display: none;
}

@media (min-width: 768px) {
    .main-navigation {
        display: flex;
        gap: 3rem;
        font-size: 0.75rem;
        letter-spacing: 0.2em;
        font-family: var(--font-gothic);
        color: var(--text-color);
        opacity: 0.75;
    }
}

/* ハンバーガーボタン（モバイル） */
.menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-color);
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

.menu-toggle span {
    display: block;
    width: 2rem;
    height: 1px;
    background: currentColor;
    margin-bottom: 0.5rem;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.menu-toggle span:last-child {
    margin-bottom: 0;
}

/* ナビリンク ホバーアンダーライン */
.nav-link {
    position: relative;
    transition: opacity var(--transition-base);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-gold);
    transition: width var(--transition-base);
}

.nav-link:hover {
    opacity: 1;
}

.nav-link:hover::after {
    width: 100%;
}

/* WordPress メニューのデフォルト ul / li を上書き */
.main-navigation ul,
.main-navigation ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 3rem;
    flex-wrap: nowrap;
}

.main-navigation ul li,
.main-navigation ul.menu li {
    margin: 0;
    float: none;
    display: list-item;
}


/* ==========================================================================
   ヒーローセクション
   ========================================================================== */

.hero-section {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, transparent, var(--bg-color));
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-subtitle {
    font-size: 0.875rem;
    letter-spacing: 0.4em;
    font-family: var(--font-cinzel);
    color: var(--accent-gold);
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1rem;
    }
}

.hero-title {
    font-size: 3rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.2;
    color: var(--text-color);
    margin: 0 0 2rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 6rem;
    }
}

.hero-caption {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    font-weight: 300;
    color: var(--text-color);
    opacity: 0.55;
}

@media (min-width: 768px) {
    .hero-caption {
        font-size: 0.875rem;
    }
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.hero-scroll-indicator .scroll-line {
    width: 1px;
    height: 6rem;
    background: var(--border-color);
    opacity: 0.6;
}

.hero-scroll-indicator .scroll-label {
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    writing-mode: vertical-rl;
    color: var(--text-color);
    opacity: 0.35;
}

/* GSAP 対象 */
.gs-hero-text {
    display: block;
}


/* ==========================================================================
   セクション 共通
   ========================================================================== */

.section-container {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.section-header {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    margin-bottom: 5rem;
    padding-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .section-header {
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

.section-heading {
    font-size: 2.5rem;
    font-family: var(--font-cinzel);
    color: var(--text-color);
    margin: 0;
}

@media (min-width: 768px) {
    .section-heading {
        font-size: 4.5rem;
    }
}

.section-heading-en {
    display: none;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    font-family: var(--font-cinzel);
    color: var(--accent-gold);
}

@media (min-width: 768px) {
    .section-heading-en {
        display: block;
    }
}

.section-label {
    font-family: var(--font-cinzel);
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 1.5rem;
}


/* ==========================================================================
   商品開発事業セクション (#philosophy)
   ========================================================================== */

#philosophy {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
    width: 100%;
}

.philosophy-grid {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .philosophy-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.philosophy-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    order: 2;
}

@media (min-width: 768px) {
    .philosophy-image-wrap {
        order: 1;
    }
}

.philosophy-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.philosophy-body {
    order: 1;
    text-align: right;
}

@media (min-width: 768px) {
    .philosophy-body {
        order: 2;
        text-align: left;
    }
}

.philosophy-body h2 {
    font-size: 2.5rem;
    font-family: var(--font-cinzel);
    color: var(--text-color);
    margin: 0 0 3rem;
}

@media (min-width: 768px) {
    .philosophy-body h2 {
        font-size: 3.75rem;
    }
}

.philosophy-body p {
    font-size: 0.875rem;
    line-height: 2;
    letter-spacing: 0.05em;
    color: var(--text-color);
    opacity: 0.75;
    text-align: justify;
}

@media (min-width: 768px) {
    .philosophy-body p {
        font-size: 1rem;
    }
}


/* ==========================================================================
   観光事業セクション (#business) - ビジネスカード
   ========================================================================== */

#business {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
    position: relative;
}

.business-card {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .business-card {
        height: 60vh;
        flex-direction: row;
        padding-top: 0;
        padding-bottom: 0;
    }

    .business-card.reverse {
        flex-direction: row-reverse;
    }
}

.business-card-body {
    width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    z-index: 10;
    pointer-events: none;
}

@media (min-width: 768px) {
    .business-card-body {
        width: 50%;
        padding-left: 5rem;
    }

    .business-card.reverse .business-card-body {
        padding-left: 1.5rem;
        padding-right: 5rem;
        text-align: right;
    }
}

.business-card-body h3 {
    font-size: 1.875rem;
    color: var(--text-color);
    margin: 0 0 1.5rem;
}

@media (min-width: 768px) {
    .business-card-body h3 {
        font-size: 3rem;
    }
}

.business-card-body p {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-color);
    opacity: 0.65;
    max-width: 28rem;
}

.business-card.reverse .business-card-body p {
    margin-left: auto;
}

.business-card-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
    margin-top: 2rem;
    opacity: 0.7;
    transition: opacity var(--transition-slow);
}

@media (min-width: 768px) {
    .business-card-image {
        width: 50%;
        height: 100%;
        margin-top: 0;
    }
}

.business-card:hover .business-card-image {
    opacity: 1;
}

.business-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    filter: grayscale(100%);
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 1s ease, filter var(--transition-slow);
}

.business-card:hover .business-card-image img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

/* カード画像にかかるグラデーション（JS で色を同期） */
.card-grad-right {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: linear-gradient(to right, var(--bg-color), transparent);
    pointer-events: none;
}

.card-grad-left {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: linear-gradient(to left, var(--bg-color), transparent);
    pointer-events: none;
}


/* ==========================================================================
   イベント事業セクション (#events)
   ========================================================================== */

#events {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
    position: relative;
}

.events-image-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 4rem;
    aspect-ratio: 16 / 7;
}

.events-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.events-body {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-bottom: 4rem;
}

.events-body p {
    font-size: 0.875rem;
    line-height: 2;
    color: var(--text-color);
    opacity: 0.75;
}

@media (min-width: 768px) {
    .events-body p {
        font-size: 1rem;
    }
}

/* ボタン */
.btn-outline {
    display: inline-block;
    padding: 1rem 3.5rem;
    font-size: 0.875rem;
    letter-spacing: 0.3em;
    font-family: var(--font-cinzel);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    background: transparent;
    cursor: pointer;
    transition: opacity var(--transition-base);
}

.btn-outline:hover {
    opacity: 0.7;
}


/* ==========================================================================
   ふるさと納税セクション
   ========================================================================== */

.furusato-section {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.furusato-panel {
    max-width: 64rem;
    margin-left: auto;
    margin-right: auto;
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
    .furusato-panel {
        padding: 6rem;
    }
}

.furusato-panel .panel-label {
    font-family: var(--font-cinzel);
    font-size: 1.125rem;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 1.5rem;
}

.furusato-panel h2 {
    font-size: 1.875rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0 0 2.5rem;
}

@media (min-width: 768px) {
    .furusato-panel h2 {
        font-size: 3rem;
    }
}

.furusato-panel h2 span {
    display: inline-block;
    border-bottom: 1px solid var(--accent-gold);
    padding-bottom: 0.5rem;
}

.furusato-panel .intro-text {
    font-size: 0.875rem;
    line-height: 2;
    color: var(--text-color);
    opacity: 0.7;
    max-width: 42rem;
    margin: 0 auto 3.5rem;
}

/* バナーグリッド */
.banner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

.banner-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    aspect-ratio: 16 / 7;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform var(--transition-slow);
}

.banner-item:hover img {
    transform: scale(1.05);
}

.banner-item .banner-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
}

.banner-item .banner-label span {
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    font-family: var(--font-cinzel);
}


/* ==========================================================================
   フッター
   ========================================================================== */

.site-footer {
    padding-top: 5rem;
    padding-bottom: 2.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.4);
    color: var(--text-color);
}

.footer-inner {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        align-items: flex-end;
    }
}

.footer-logo {
    font-size: 2.5rem;
    font-family: var(--font-cinzel);
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 1.5rem;
}

.footer-tagline {
    font-size: 0.75rem;
    line-height: 1.75;
    font-family: var(--font-cinzel);
    letter-spacing: 0.1em;
    color: var(--text-color);
    opacity: 0.45;
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 2rem;
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.5;
}

.footer-social a {
    transition: opacity var(--transition-base);
}

.footer-social a:hover {
    opacity: 1;
}

.footer-bottom {
    max-width: 80rem;
    margin: 5rem auto 0;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    opacity: 0.35;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .footer-bottom-links {
        margin-top: 0;
    }
}

.footer-bottom-links a {
    transition: opacity var(--transition-base);
}

.footer-bottom-links a:hover {
    opacity: 1;
}

/* フッター ページリンク */
.footer-page-links a {
    position: relative;
    transition: opacity var(--transition-base);
}

.footer-page-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-gold);
    transition: width var(--transition-base);
}

.footer-page-links a:hover::after {
    width: 100%;
}

@media (min-width: 768px) {
    .footer-page-links {
        align-items: flex-end;
    }
}


/* ==========================================================================
   アニメーション ユーティリティ
   ========================================================================== */

/* 文字単位アニメーション用（JS で span に分割） */
.char-span {
    opacity: 0;
    display: inline-block;
}

/* GSAP / ScrollTrigger 対象クラス */
.js-title-slide {
    /* 初期状態は JS 側 (fromTo) で管理 */
}

.js-text-type {
    /* 文字スパンへの分割は initGSAP 内で実行 */
}

.js-scroll-color {
    filter: grayscale(100%);
    /* ScrollTrigger で grayscale(0%) へ */
}


/* ==========================================================================
   WordPress ブロックエディタ 互換スタイル（将来の拡張用）
   ========================================================================== */

/* アライメント */
.alignwide {
    max-width: 100%;
}

.alignfull {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* ブロック: カバー */
.wp-block-cover {
    min-height: 50vh;
}

/* ブロック: ボタン */
.wp-block-button__link {
    font-family: var(--font-cinzel);
    letter-spacing: 0.2em;
    border-radius: 0;
}

/* ブロック: 引用 */
.wp-block-quote {
    border-left: 2px solid var(--accent-gold);
    padding-left: 1.5rem;
    margin-left: 0;
}

/* ブロック: 見出し */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    font-family: var(--font-cinzel);
    color: var(--text-color);
    line-height: 1.3;
}

/* ブロック: 段落 */
.entry-content p {
    line-height: 2;
    color: var(--text-color);
    opacity: 0.8;
}


/* ==========================================================================
   メディアクエリ補足
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #canvas-webgl {
        display: none;
    }
}
