/*
Theme Name:  東禅寺 (Tozenji)
Theme URI:   https://touunzan-touzenji.com/news/
Description: 洞雲山 東禅寺 公式サイト「行事・寺報」ページ用オリジナルテーマ
Author:      洞雲山 東禅寺
Version:     1.2.0
Text Domain: tozenji
*/

/* ============================================================
   東禅寺 WordPress テーマ スタイルシート
   静的サイトの style.css と同じ変数・共通スタイルを維持しつつ、
   WordPress 固有のクラスを追加します。
   ============================================================ */

/* ---- 1. CSS 変数 ---- */
:root {
    --bg-color:    #FAFAF7;
    --text-main:   #333333;
    --accent-wood: #C1AB86;
    --accent-green: #8B9662;
    --card-bg:     #FFFFFF;
}

/* ---- 2. リセット・基本 ---- */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.8;
    letter-spacing: 0.05em;
}

h1, h2, h3 { font-family: 'Shippori Mincho', serif; font-weight: 500; }
a { color: var(--text-main); text-decoration: none; }

/* hidden 属性を確実に効かせる（.header-btn の display:flex より優先させる） */
[hidden] { display: none !important; }

.container { padding: 40px 20px; max-width: 800px; margin: 0 auto; }

/* ---- 3. ヘッダー ---- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { font-family: 'Shippori Mincho', serif; font-size: 1.2rem; flex-shrink: 0; }

/* ---- グローバルナビゲーション ---- */
.global-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}
.global-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 28px; }
.global-nav a {
    font-size: 0.85rem; letter-spacing: 0.06em;
    position: relative; padding-bottom: 3px; white-space: nowrap;
}
.global-nav a::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 0; height: 1px; background-color: var(--accent-wood);
    transition: width 0.25s ease;
}
.global-nav a:hover::after,
.global-nav a[aria-current="page"]::after { width: 100%; }

/* ---- ハンバーガーボタン ---- */
.hamburger {
    display: none;
    flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    background: none; border: none; cursor: pointer;
    padding: 4px; width: 36px; height: 36px; margin-right: 4px; flex-shrink: 0;
}
.hamburger span {
    display: block; width: 22px; height: 2px;
    background-color: var(--text-main); border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- アクションボタン群 ---- */
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.header-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 16px; border-radius: 4px;
    font-size: 0.85rem; font-weight: bold; transition: opacity 0.3s ease;
}
.header-btn:hover { opacity: 0.8; }
.btn-mail { background-color: var(--accent-wood); color: #fff; }
.btn-line  { background-color: #06C755; color: #fff; }
.btn-icon  { font-size: 1rem; line-height: 1; }

/* ナビが6項目あるため、収まらなくなる手前で間隔と文字を詰める */
@media (max-width: 1150px) {
    .global-nav ul { gap: 18px; }
    .global-nav a  { font-size: 0.8rem; }
}

@media (max-width: 950px) {
    header { padding: 12px 15px; }
    .hamburger { display: flex; }
    .global-nav {
        /* header が position:sticky なので absolute の基準になる。
           高さを決め打ちせず top:100% で追従させる。 */
        display: none; position: absolute;
        top: 100%; left: 0; right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 6px 20px rgba(0,0,0,0.08);
        padding: 0; z-index: 99;
    }
    .global-nav.is-open { display: block; }
    .global-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
    .global-nav li { border-bottom: 1px solid rgba(0,0,0,0.05); }
    .global-nav a  { display: block; padding: 14px 24px; font-size: 1rem; }
    .global-nav a::after { display: none; }
}

@media (max-width: 600px) {
    .logo           { font-size: 1rem; }
    .header-actions { gap: 8px; }

    /* 狭い画面では、絵文字だと用途が伝わりにくいため
       「メール」「LINE」という短い文字に置き換える。
       font-size:0 で元の長い文字を隠し、::after で短い文字を表示している。
       元の文字（お問い合わせ／LINEでご相談）はHTML上に残るため、
       読み上げソフトでは従来どおり読まれる。 */
    .header-btn {
        padding: 9px 12px;
        gap: 0;
        font-size: 0;
        border-radius: 6px;
    }
    .header-btn .btn-icon { display: none; }
    .btn-mail::after { content: 'メール'; font-size: 0.78rem; }
    .btn-line::after { content: 'LINE';   font-size: 0.78rem; }
}

/* ---- 4. フッター ---- */
footer {
    background-color: #2C2C2C;
    color: #fff;
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
}
.footer-info { font-size: 0.9rem; margin-bottom: 20px; }

/* フッター内のリンク（メール・電話）を白抜きで読めるように */
footer a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { opacity: 0.75; }

/* ---- 5. ページヘッダー ---- */
.page-header {
    background-color: #EAE8E3;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}
.page-header h1 { margin: 0; font-size: 1.8rem; color: var(--text-main); }
.page-header p  { margin-top: 10px; font-size: 0.9rem; color: #666; }

/* ---- 6. コンテンツブロック ---- */
.content-block { margin-bottom: 60px; }
.content-block h2 {
    font-size: 1.4rem;
    color: var(--accent-green);
    border-bottom: 1px solid var(--accent-wood);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

/* ---- 7. お知らせ・行事リスト（WordPress ループで出力） ---- */
.news-list { list-style: none; padding: 0; margin: 0; }

.news-list li {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border-left: 4px solid var(--accent-wood);
}

.news-date  { color: #666; font-size: 0.85rem; display: block; margin-bottom: 5px; }
.news-title { font-size: 1.1rem; font-weight: 500; margin: 0 0 10px 0; font-family: 'Shippori Mincho', serif; }
.news-text  { font-size: 0.9rem; margin: 0; color: #555; }

/* ---- 8. 寺報アーカイブリスト ---- */
.archive-list { list-style: none; padding: 0; margin: 0; }

.archive-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.archive-info  { display: flex; flex-direction: column; gap: 2px; }
.archive-title { font-weight: 500; font-size: 1rem; }
.archive-date  { font-size: 0.8rem; color: #888; }

.pdf-btn {
    background-color: #EAE8E3;
    color: var(--text-main);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
    white-space: nowrap;
}
.pdf-btn:hover { background-color: var(--accent-wood); color: #fff; }

@media (max-width: 500px) {
    .archive-list li { flex-direction: column; align-items: flex-start; gap: 10px; }
    .pdf-btn { align-self: flex-start; }
}

/* ---- 9. 投稿詳細ページ（single.php）---- */
.post-body {
    font-size: 0.95rem;
    line-height: 2;
}
.post-body p  { margin-bottom: 1.5em; }
.post-body img { max-width: 100%; height: auto; border-radius: 4px; }

.back-link {
    display: inline-block;
    margin-top: 40px;
    padding: 10px 20px;
    border: 1px solid var(--accent-wood);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s, color 0.3s;
}
.back-link:hover { background-color: var(--accent-wood); color: #fff; }

/* ---- 10. WordPress のデフォルトブロック調整 ---- */
.wp-block-image { margin: 0 0 1.5em; }
.wp-block-image img { border-radius: 4px; }
