/* ============================================
    リセット & ベース設定
============================================ */
:root {
    --main-bg: #fafafa;
    --section-bg-fs: #FDF1EF;
    --section-bg-sc: #ffffff;
    --text-color: #5a5a5a;
  /* タイポグラフィ（本文 PC 17px / スマホ 16px） */
    --font-family-body: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
    --font-family-heading: 'Hiragino Mincho ProN', 'Yu Mincho', '游明朝', serif;
    --font-body: 1.0625rem;
    --font-body-mobile: 1rem;
    --line-body: 1.9;
    --font-lead: 1.0625rem;
    --font-h1: 2rem;
    --font-h1-mobile: 1.625rem;
    --font-h2: 1.75rem;
    --font-h2-mobile: 1.375rem;
    --font-h3: 1.25rem;
    --font-h3-mobile: 1.125rem;
    --font-small: 0.875rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-body);
    font-size: var(--font-body);
    color: #333;
    line-height: var(--line-body);
    background: var(--main-bg);
    -webkit-font-smoothing: antialiased;
}

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

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

/* ============================================
    タイポグラフィ
    ============================================ */
h1, h2, h3 {
    font-weight: 400;
    letter-spacing: 0.05em;
}

h1 {
    font-family: var(--font-family-heading);
    font-size: var(--font-h1);
    margin-bottom: 2rem;
}

/* 見出し：明朝系（細め・上品） */
h2 {
    font-family: var(--font-family-heading);
    font-size: var(--font-h2);
    margin-bottom: 2rem;
}

h3 {
    font-family: var(--font-family-heading);
    font-size: var(--font-h3);
    margin-bottom: 1rem;
}

/* 本文：可読性の高いゴシック、行間広め */
p {
    font-size: inherit;
    line-height: var(--line-body);
    color: #555;
}

/* ============================================
    コンテナ & レイアウト
    ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.pagetop-info .container {
    max-width: 1100px;
}

.pagetop-info .container p {
    font-size: var(--font-lead);
    line-height: 2;
}

.section {
    padding: 80px 0;
}

.section-large {
    padding: 120px 0;
}

/* ============================================
    ヘッダー & メニュー
    ============================================ */
header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    --mobile-header-height: 5rem;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-family: 'Hiragino Mincho ProN', 'Yu Mincho', '游明朝', serif;
    font-size: 1.5rem;
    color: #5a5a5a;
    font-weight: 400;
    flex-shrink: 0;
}

.logo img {
    height: 50px;
    width: auto;
    flex-shrink: 0;
}

/* PC用メニュー */
.header-inner > nav[aria-label="メインメニュー"] {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    margin-left: 12px;
}

.main-nav {
    display: flex;
    gap: 2px;
    list-style: none;
    flex-wrap: nowrap;
    flex: 1;
    max-width: 100%;
}

.main-nav li {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
}

.main-nav-item > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    min-height: 3.4em;
    padding: 8px 6px;
    color: #5a5a5a;
    font-size: 0.92rem;
    line-height: 1.35;
    white-space: normal;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.main-nav-item > a:hover {
    background: #f5f5f5;
    color: #8b7864;
}

.main-nav-item > a.is-current {
    background: #fff0eb;
    color: #6b3f5e;
    font-weight: 600;
    box-shadow: inset 0 -3px 0 #ff97d5;
}

.main-nav-item > a.is-current:hover {
    color: #5a2d4d;
    background: #ffe8e2;
    box-shadow: inset 0 -3px 0 #ff97d5;
}

.main-nav-item {
    position: relative;
}

.main-nav-item.has-dropdown > a::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #999;
}

.main-nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1100;
    min-width: 13em;
    max-width: 18em;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.main-nav-item:hover .main-nav-dropdown,
.main-nav-item:focus-within .main-nav-dropdown {
    display: block;
}

.main-nav-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #5a5a5a;
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: normal;
    text-align: left;
    border-radius: 0;
    min-height: 0;
}

.main-nav-dropdown a:hover {
    background: #fdf1ef;
    color: #8b7864;
}

/* メニューボタン（スマホ用） */
.header-mobile-actions {
    display: none;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-phone-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #5a5a5a;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-phone-btn:hover {
    background: #e8e8e8;
    color: #8b7864;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #5a5a5a;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: #e8e8e8;
}

.menu-toggle.active {
    background: #8b7864;
    color: #fff;
    border-color: #8b7864;
}

/* スマホ用メニュー */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 20px;
    max-height: calc(100dvh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav a {
    display: block;
    padding: 15px 0;
    color: #5a5a5a;
    font-size: 1rem;
}

.mobile-nav a:hover {
    color: #8b7864;
}

.mobile-nav a.is-current {
    color: #6b3f5e;
    font-weight: 700;
    padding-left: 10px;
    border-left: 4px solid #ff97d5;
    background: #fff0eb;
}

.mobile-nav-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 0;
    background: #fafafa;
}

.mobile-nav-sub li {
    border-bottom: 1px solid #eee;
}

.mobile-nav-sub a {
    padding: 12px 16px 12px 28px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #666;
}

.mobile-nav-sub a:hover {
    color: #8b7864;
    background: #fff;
}

.mobile-nav-item.has-sub > a {
    font-weight: 600;
}

h2[id],
section[id] {
    scroll-margin-top: 80px;
}

/* セクション余白 */
.section-padding {
    padding: 140px 0;
}

.decor-section, .decor-section-hasu {
    position: relative;
    background: var(--section-bg);
    padding: 3rem 1.25rem;
    overflow: visible;
}

/* =========================
蓮の花の装飾（before）
========================= */
.decor-section-hasu::before {
    content: "";
    position: absolute;
    top: -200px;
    left: 20px;
    width: 350px;
    height: 350px;

    background-image: url("/static/img/hasu.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% 100%;

    pointer-events: none;
}

/* =========================
上側 境界装飾（before）
========================= */
.decor-section::before {
    content: "";
    position: absolute;
    top: -90px;
    left: 0;
    width: 100%;
    height: 90px;

    background-image: url("/static/img/top_wave_white.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% 100%;

    pointer-events: none;
}

/* =========================
下側 境界装飾（after）
========================= */
.decor-section::after {
    content: "";
    position: absolute;
    bottom: -70px;
    left: 0;
    width: 100%;
    height: 70px;

    background-image: url("/static/img/bottom_wave_white.png");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% 100%;

    pointer-events: none;
}

/* =========================
上下どちらか無効化
========================= */
.no-top::before {
    display: none;
}

.no-bottom::after {
    display: none;
}

/* =========================
タブレット・スマホ最適化
========================= */
/* タブレット対応（1024px以下） */
@media (max-width: 1024px) {
    .decor-section-hasu::before {
        top: -200px;
        left: 10px;
        width: 350px;
        height: 350px;
    }
}

/* スマホ対応（768px以下） */
@media (max-width: 768px) {
    .decor-section {
        padding: 2.5rem 1rem;
    }

    .decor-section::before {
        top: -32px;
        height: 32px;
    }

    .decor-section::after {
        bottom: -40px;
        height: 40px;
    }

    .decor-section-hasu::before {
        top: -150px;
        left: 5px;
        width: 250px;
        height: 250px;
    }
}

/* 小型スマホ対応（480px以下） */
@media (max-width: 480px) {
    .decor-section-hasu::before {
        top: -100px;
        left: 0;
        width: 180px;
        height: 180px;
    }
}

/* ============================================
    　ファーストビュー
    ============================================ */
.first-view {
    position: relative;
    width: 100%;
    background: #f5f5f5; /* 余白部分の背景色 */
}

.first-view img,
.first-view video {
    width: 100%;
    height: auto; /* 動画のアスペクト比を維持（縦幅が切れない） */
    display: block;
}

.btn {
    display: inline-block;
    padding: 16px 40px;
    background: rgba(255,255,255,0.95);
    color: #333;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    font-weight: 500;
}

.btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-color: #8b7864;
}

.btn-primary {
    background: rgba(139, 120, 100, 0.9);
    color: #fff;
    border-color: rgba(139, 120, 100, 0.9);
}

.btn-primary:hover {
    background: rgba(139, 120, 100, 1);
    border-color: rgba(139, 120, 100, 1);
}

.btn-secondary {
    background: #fff;
    color: #8b7864;
    border: 2px solid #8b7864;
}

.btn-secondary:hover {
    background: #8b7864;
    color: #fff;
}

/* ============================================
    　清元院について
    ============================================ */
    .about {
    background: #FDF1EF;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.about-content > div:last-child {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    background: #e8e8e8;
}

.about-text {
    font-size: var(--font-body);
    line-height: var(--line-body);
}

/* 縦書きテキスト用スタイル（スマホでも縦書き維持） */
.about-text-vertical {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: var(--font-family-body);
    font-size: var(--font-body);
    line-height: 2.2;
    letter-spacing: 0.08em;
    margin: 0 auto;
    display: inline-block;
}

.about-text-vertical h3 {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    margin-bottom: 2rem;
    text-align: center;
}

.about-text-vertical p {
    writing-mode: vertical-rl;
    text-orientation: upright;
    margin-bottom: 1.5rem;
}

/* ============================================
    　CTAボタンセクション
    ============================================ */
.cta-section {
    background: #fff;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* ============================================
    　目的別導線（3カード）
    ============================================ */
.purpose-section {
    background: #FDF1EF;
}

.purpose-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.text-center {
    text-align: center;
}

.purpose-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.purpose-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.purpose-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e8e8e8;
}

.purpose-card-content {
    padding: 30px;
}

.purpose-card h3 {
    font-size: var(--font-h3);
    margin-bottom: 1rem;
    color: #5a5a5a;
}

.purpose-card p {
    font-size: inherit;
    line-height: var(--line-body);
    margin-bottom: 1.5rem;
}

.purpose-card-link {
    color: #8b7864;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.purpose-card-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.purpose-card:hover .purpose-card-link::after {
    transform: translateX(5px);
}

/* ============================================
    　今おすすめの体験
    ============================================ */
.recommended-events {
    background: #fff;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.event-card {
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.event-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e8e8e8;
}

.event-card-content {
    padding: 20px;
}

.event-card-category {
    font-size: 0.85rem;
    color: #8b7864;
    margin-bottom: 0.5rem;
}

.event-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.event-card-date {
    font-size: 0.9rem;
    color: #666;
}

/* ============================================
    　供養・終活
    ============================================ */
.memorial {
    background: #FDF1EF;
}

.memorial-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.memorial-text {
    font-size: inherit;
    line-height: var(--line-body);
    margin-bottom: 2rem;
}

/* ============================================
    　はじめての方の不安Q&A
    ============================================ */
.faq {
    background: #fff;
}

.faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: #fff;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.faq-question {
    padding: 25px 30px;
    font-size: inherit;
    font-weight: 600;
    color: #5a5a5a;
    cursor: pointer;
    position: relative;
    padding-right: 50px;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 30px;
    font-size: 1.5rem;
    color: #8b7864;
}

.faq-answer {
    padding: 0 30px 25px;
    color: #666;
    line-height: 2;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* ============================================
    　最新のお知らせ（2レーン）
    ============================================ */
.news {
    background: #FDF1EF;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.news-section {
    background: #fafafa;
    border-radius: 8px;
    padding: 30px;
}

.news-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #5a5a5a;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
}

.news-item {
    padding: 20px 0;
    border-bottom: 1px solid #e8e8e8;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.news-item-title {
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
}

.news-item-link {
    color: #8b7864;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: inline-block;
}

/* ============================================
    　アクセス・来院案内
    ============================================ */
.access {
    background: #fff;
}

.access-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.access-info {
    font-size: 1.05rem;
    line-height: 2.2;
}

.access-info h3 {
    margin-bottom: 1.5rem;
}

.access-map {
    width: 100%;
    height: 400px;
    background: #e8e8e8;
    border-radius: 8px;
}

/* ============================================
    　フッター
    ============================================ */
footer {
    background: #2a2a2a;
    color: #ccc;
    padding: 60px 0 30px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ccc;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #999;
    margin-top: 30px;
}

/* ============================================
    スマホ対応（レスポンシブ）
    ============================================ */
@media screen and (max-width: 768px) {
    /* ヘッダー & メニュー（スマホ） */
    .main-nav {
        display: none;
    }

    .main-nav-dropdown {
        display: none !important;
    }

    .header-mobile-actions {
        display: flex;
        position: relative;
        z-index: 1002;
    }

    .header-inner > .logo {
        position: relative;
        z-index: 1002;
    }
    
    .menu-toggle {
        display: flex;
    }

    .mobile-nav {
        position: fixed;
        top: var(--mobile-header-height);
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 12px 20px 24px;
        max-height: calc(100dvh - var(--mobile-header-height));
        box-sizing: border-box;
        z-index: 1001;
    }

    .mobile-nav.active {
        display: block;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
    
    .purpose-cards {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-content,
    .access-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-large {
        padding: 80px 0;
    }
    
    /* スマホでは装飾画像の高さを小さく */
    .section-decor-top::before {
        height: 40px;
    }
    
    .section-decor-bottom::after {
        height: 40px;
    }
    
    h1 {
        font-size: var(--font-h1-mobile);
    }

    h2 {
        font-size: var(--font-h2-mobile);
    }

    h3 {
        font-size: var(--font-h3-mobile);
    }

    body {
        font-size: var(--font-body-mobile);
    }

    .pagetop-info .container p,
    .about-text,
    .about-text-vertical {
        font-size: var(--font-body-mobile);
    }

    .about-text-vertical {
        line-height: 2;
        letter-spacing: 0.06em;
    }
}