/*
Theme Name: Minimal Portfolio Theme
Description: 上垣和子 公式サイト - ミニマルギャラリーテーマ
Version: 1.2
*/

/* ============================================================
   1. 変数と基本設定
   ============================================================ */
html {
    scroll-behavior: smooth;
}

:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --accent-color: #888888;
    --font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    --base-spacing: 40px;
    --container-width: 1200px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.container, .front-page-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--base-spacing);
}

@media (max-width: 768px) {
    .container, .front-page-container {
        padding: 0 20px;
    }
}

/* ============================================================
   表示切り替え用クラス（viewPc / viewSp）
   ============================================================ */

.viewPc, .viewSp {
    display: none !important;
}

@media (max-width: 768px) {
    .viewSp {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .viewPc {
        display: block !important;
    }
}

/* ============================================================
   2. ナビゲーション（カレント表示対応）
   ============================================================ */
.site-header { padding: var(--base-spacing) 0; }
.header-container { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.nav-list {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 30px;
}

.nav-list a {
    text-decoration: none;
    color: var(--accent-color);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding-bottom: 5px;
    transition: 0.3s;
}

.nav-list .current-menu-item a, 
.nav-list a:hover {
    color: var(--text-color);
    border-bottom: 1px solid #999;
}

/* ============================================================
   3. カルーセル（トップページ）
   ============================================================ */
.main-visual { width: 100%; margin-bottom: 80px; }

.swiper {
    width: 100%;
    height: 70vh !important; 
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center !important; 
}

.welcome-message {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
    line-height: 2.2;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.btn-minimal {
    display: inline-block;
    padding: 18px 50px;
    border: 1px solid #eee;
    text-decoration: none;
    color: #888;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    transition: 0.4s;
}

.btn-minimal:hover {
    border-color: #333;
    color: #333;
}

@media screen and (max-width: 767px) and (orientation: portrait) {
  .swiper {
        height: 40vh !important;
  }
}

/* ============================================================
   トップページ背景画像の設定
   ============================================================ */
body {
    background-image: url('https://kazukouegaki.com/wp/wp-content/uploads/2026/05/bg.jpg');
    background-size: cover;
    background-position: top center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6); 
    z-index: -1;
}

body .front-page-container,
body .site-header,
body .swiper {
    background-color: transparent !important;
}

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

.btn-minimal {
    display: inline-block;
    padding: 18px 50px;
    border: 1px solid #eee;
    text-decoration: none;
    color: #888;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    transition: all 0.4s ease;
}

.btn-minimal:hover {
    background-color: #fafafa;
    border-color: #333;
    color: #333;
}

/* ============================================================
   4. ギャラリー（一覧・グリッド）
   ============================================================ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 60px 40px;
}

.thumbnail-wrapper {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: #f7f7f7;
    margin-bottom: 15px;
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s;
}

.grid-item a:hover img { opacity: 0.7; }

.post-title {
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #999;
    text-align: center;
    text-transform: uppercase;
}

/* 年代区切り線 */
.era-title {
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #999; letter-spacing: 0.25em; margin: 100px 0 60px;
}
.era-title::before, .era-title::after {
    content: ""; flex-grow: 1; height: 1px; background: #eee; margin: 0 30px;
}

.gallery-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 80px;
}

.grid-item a {
    text-decoration: none !important;
}

.post-title {
    text-decoration: none;
    border-bottom: none;
}

.single-post .nav-list li a[href*="/gallery/"] {
    color: var(--text-color);
    border-bottom: 1px solid #999;
}

.single-post .nav-list li a[href*="gallery"] {
    color: var(--text-color) !important;
    border-bottom: 1px solid #999 !important;
}

.single-post .entry-title {
    font-size: 0.9rem;
    font-weight: normal;
    color: #666;
    letter-spacing: 0.1em;
    margin: 20px 0 40px;
    text-align: center;
}

.portfolio-grid .grid-item a {
    text-decoration: none !important;
}
.portfolio-grid .post-title {
    border-bottom: none !important;
}

/* ============================================================
   5. 個別ページ・ABOUT
   ============================================================ */
.single-post-container, .about-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.entry-title { text-align: center; font-size: 1.2rem; font-weight: normal; margin-bottom: 40px; }

.entry-content { line-height: 2; font-size: 0.9rem; }
.entry-content img { display: block; margin: 0 auto 30px; max-width: 100%; height: auto; }

.about-content h2, 
.about-content h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px; 
    color: #999; 
    letter-spacing: 0.25em; 
    margin: 100px 0 60px; 
    text-transform: uppercase;
}

.about-content h2::before, .about-content h2::after,
.about-content h3::before, .about-content h3::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background: #eee; 
    margin: 0 30px; 
}

.about-content h2:first-of-type,
.about-content h3:first-of-type {
    margin-top: 40px !important;
}

.wp-block-image figcaption,
.wp-caption,
.wp-caption-text,
.about-content figcaption {
    text-align: center !important;
    font-size: 0.8rem;
    color: #888;
    margin-top: 10px;
    letter-spacing: 0.05em;
}

.about-content img {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
}

/* ============================================================
   6. スマホ対応
   ============================================================ */
@media (max-width: 768px) {
    .swiper { height: 60vh; }
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 15px; }
}

.single-small_works .nav-list li a[href*="gallery"],
.post-type-archive-small_works .nav-list li a[href*="gallery"] {
    color: var(--text-color) !important;
    border-bottom: 1px solid #999 !important;
}

/* ============================================================
   SMALL WORKS ページ用の調整
   ============================================================ */

.post-type-archive-small_works .nav-list li a[href*="small_works"],
.single-small_works .nav-list li a[href*="small_works"] {
    color: var(--text-color) !important;
    border-bottom: 1px solid #999 !important;
}

.post-navigation {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #eee;
    width: 100%;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.nav-links a {
    text-decoration: none !important;
    color: #999;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    transition: 0.3s;
    text-transform: uppercase;
}

.nav-links a:hover {
    color: #333;
}

.nav-archive a {
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 3px;
}

@media (max-width: 768px) {
    .nav-links {
        font-size: 0.6rem;
    }
}

/* ============================================================
   GALLERY ページ：年代別アコーディオン
   ============================================================ */

.accordion-toggle {
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

.accordion-toggle:hover {
    color: #333 !important;
}

.toggle-label {
    position: relative;
    padding-right: 25px;
    display: inline-block;
}

.toggle-label::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 52%;
    transform: translateY(-50%);
    font-family: monospace;
    font-size: 16px;
    color: #aaa;
    transition: color 0.3s ease;
}

.accordion-toggle.is-active .toggle-label::after {
    content: "−";
    color: #333;
}

.accordion-wrapper {
    display: none;
    margin-top: 40px;
    margin-bottom: 80px;
}

.accordion-wrapper.is-open {
    display: block;
    animation: fadeInSlider 0.4s ease both;
}

@keyframes fadeInSlider {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================
   サイトタイトル（管理画面のタイトル）の自動折り返し
   ============================================================ */

@media (max-width: 768px) {
    .site-branding h1 {
        display: block;
        text-align: center; 
        word-wrap: break-word; 
        max-width: 100%; 
        margin: 0 auto; 
        line-height: 1.4; 
    }
}

/* ============================================================
   スマホ用ハンバーガーメニュー
   ============================================================ */

.menu-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: none !important;
        border: none !important;
        cursor: pointer;
        padding: 0;
        z-index: 9999;
        margin: 10px auto !important;
    }

    .menu-toggle .bar {
        display: block;
        width: 100%;
        height: 1px;
        background-color: #333 !important;
        transition: all 0.3s ease;
        transform-origin: left center;
    }

    .menu-toggle.is-active .bar:nth-child(1) {
        transform: rotate(45deg);
        margin-left: 3px;
    }
    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0 !important;
    }
    .menu-toggle.is-active .bar:nth-child(3) {
        transform: rotate(-45deg);
        margin-left: 3px;
    }

    #primary-menu.main-navigation {
        display: none !important;
        width: 100% !important;
        background-color: rgba(255, 255, 255, 0.98) !important;
        position: absolute !important;
        top: 180px;
        left: 0 !important;
        z-index: 9998 !important;
        padding: 20px 0 !important;
    }

    #primary-menu.main-navigation.is-open {
        display: block !important;
        animation: menuFadeIn 0.4s ease both;
    }

    #primary-menu .nav-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 25px !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    #primary-menu .nav-list li {
        margin: 0 !important;
    }

    #primary-menu .nav-list li a {
        font-size: 0.8rem !important;
        letter-spacing: 0.2em !important;
        padding: 5px 0 !important;
    }
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   ABOUTページ：経歴と画像の横並び（レスポンシブ対応）
   ============================================================ */

/* PC表示（デフォルト）の設定 */
.profile-flex-container {
    display: table; /* WeasyPrintや古い環境でも極めて安定して横並びを維持するテーブル構造 */
    width: 100%;
    margin: 30px 0;
}

.profile-text {
    display: table-cell;
    width: 55%;         /* 左側（経歴テキスト）の幅 */
    vertical-align: middle; /* 縦方向を中央揃えにする */
    line-height: 2.0;   /* 経歴の行間をゆったりと美しく */
}

.profile-image {
    display: table-cell;
    width: 45%;         /* 右側（画像）の幅 */
    vertical-align: middle; /* 縦方向を中央揃えにする */
    text-align: right;  /* 画像を右寄せにする */
}

.profile-image img {
    max-width: 100%;    /* 枠からはみ出さないように */
    height: auto;
    display: inline-block;
    border-radius: 4px; /* ほんの少しだけ角を滑らかに（お好みで） */
}

/* スマホ表示（768px以下）の時の切り替え設定 */
@media (max-width: 768px) {
    .profile-flex-container {
        display: block; /* 縦並びに戻す */
        margin: 20px 0;
    }

    .profile-text {
        display: block;
        width: 100%;
        margin-bottom: 30px; /* テキストと下の画像の間の余白 */
    }

    .profile-image {
        display: block;
        width: 100%;
        text-align: center; /* スマホの時は画像を中央に配置 */
    }
    
    .profile-image img {
        max-width: 80%; /* スマホ画面に対して程よい大きさに調整 */
    }
}

/* ============================================================
   固定ページ：過去の個展紹介（Exhibition Archive - 確定版）
   ============================================================ */

/* 1. テーマの横幅制限を受けない、ページ全体の最外枠 */
.exhibition-wide-layout {
    display: block !important;
    width: 100% !important;
    max-width: 1140px !important;            /* ギャラリー等と揃う理想の横幅 */
    margin: 60px auto 100px auto !important; /* 上下の余白と中央配置 */
    padding: 0 30px !important;
    box-sizing: border-box !important;
}

/* 2. イントロダクション文章 */
.exhibition-intro {
    text-align: center;
    margin-bottom: 80px;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--text-color);
}

/* 3. 2列を形成するグリッド構造（PC時） */
.ex-grid-inner {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* PC環境で確実に均等な2列 */
    column-gap: 60px !important;                      /* 左右の作品の間隔 */
    row-gap: 90px !important;                         /* 上下の作品の間隔 */
    width: 100% !important;
}

/* 4. 各個展のセクション外枠（アコーディオンの余計な装飾をリセット） */
.ex-section {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 5. 各個展のタイトル（中央揃え・繊細な下線） */
.exhibition-wide-layout .ex-accordion-toggle {
    cursor: default !important;
    text-align: center !important;                /* タイトルをセンター合わせ */
    padding: 0 0 15px 0 !important;
    margin-bottom: 25px !important;
    border-bottom: 1px solid #eee !important;
}

.ex-toggle-label {
    font-size: 1.05rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.1em !important;
    color: #333 !important;
    display: block;
}

.ex-toggle-label::after {
    display: none !important;                     /* 過去のプラスマイナス記号を完全に消去 */
}

/* 6. 開閉コンテンツとレイアウトの縦流れ化（常に100%表示） */
.ex-accordion-wrapper {
    display: block !important;
    padding: 0 !important;
}

.ex-flex-container {
    display: flex !important;
    flex-direction: column !important;            /* 上：画像 / 下：テキストの綺麗な縦流れ */
    gap: 15px !important;
}

.ex-image, 
.ex-details {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
}

/* 7. 案内状の画像（中央配置 ＆ 額装のような上品な影） */
.exhibition-wide-layout .ex-image {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.exhibition-wide-layout .ex-image img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.09) !important; /* 白背景から美しく分離する影 */
    border: 1px solid rgba(0, 0, 0, 0.03) !important;    /* 四隅を明快にするごく薄い境界線 */
}

/* 8. 紹介文のテキスト（ある場合のみ適用） */
.ex-description {
    font-size: 0.85rem;
    line-height: 1.8;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 15px;
    text-align: justify;
}

/* 9. 会期・会場のテーブル（中央寄せレイアウト） */
.exhibition-wide-layout .ex-info-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.05em;
    margin: 0 auto !important;
    max-width: 340px !important;                  /* 左に寄らないように幅を絞って中央配置 */
}

.ex-info-table th {
    width: 50px !important;
    text-align: left;
    vertical-align: top;
    padding: 5px 0 !important;
    font-weight: 400 !important;
    color: #999 !important;
}

.ex-info-table td {
    vertical-align: top;
    padding: 5px 0 !important;
    color: #444 !important;
    line-height: 1.5;
}

/* ============================================================
   スマホ表示（768px以下）のレイアウト切り替え
   ============================================================ */
@media (max-width: 768px) {
    .exhibition-wide-layout {
        margin: 40px auto 60px auto !important;
        padding: 0 20px !important;
    }
    
    /* スマホでは1列の美しいタイル状に落とす */
    .ex-grid-inner {
        grid-template-columns: 1fr !important;
        row-gap: 60px !important;
    }

    .exhibition-wide-layout .ex-accordion-toggle {
        padding-bottom: 10px !important;
        margin-bottom: 15px !important;
    }

    .ex-toggle-label {
        font-size: 0.95rem !important;
    }
    
    .ex-info-table {
        font-size: 0.78rem !important;
    }
}


/* ============================================================
   404 Page (ページが見つからない時のエラー画面)
   ============================================================ */

/* 404全体の配置調整 */
.error-404-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh; /* 画面中央付近に配置されるように調整 */
    text-align: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.error-404-content {
    max-width: 600px;
    width: 100%;
}

/* 「404」の大文字タイトル */
.error-title {
    font-size: 3.5rem;
    font-weight: 200; /* 細めのフォントでスタイリッシュに */
    letter-spacing: 0.15em;
    color: #ccc;      /* 主張しすぎない淡いグレー */
    margin-bottom: 30px;
}

/* エラーメッセージの文章 */
.error-message {
    font-size: 0.85rem;
    line-height: 2.2;
    letter-spacing: 0.08em;
    color: #666;
    margin-bottom: 50px;
}

/* ホームへ戻るボタンのリンク設定 */
.btn-home-back {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    padding: 12px 45px;
    border-radius: 0; /* カチッとしたミニマルな四角形 */
    transition: all 0.3s ease;
    background-color: transparent;
}

/* ボタンにマウスを乗せたときの静かな変化 */
.btn-home-back:hover {
    color: #fff !important;
    background-color: #333;
    border-color: #333;
}

/* スマホ表示（768px以下）での微調整 */
@media (max-width: 768px) {
    .error-404-container {
        min-height: 50vh;
    }
    
    .error-title {
        font-size: 2.8rem;
        margin-bottom: 20px;
    }
    
    .error-message {
        font-size: 0.8rem;
        line-height: 2.0;
    }
    
    .btn-home-back {
        padding: 10px 35px;
    }
}

/* ============================================================
   共通ギミック：スクロール連動フェードイン
   ============================================================ */

/* 1. アニメーションが始まる前の初期状態（透明 ＆ 少し下に配置） */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1.0s cubic-bezier(0.215, 0.610, 0.355, 1.000), 
                transform 1.0s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    will-change: opacity, transform; /* ブラウザの描画を最適化する隠し味 */
}

/* 2. 画面内に入った時の状態（スッと浮き上がって100%表示） */
.scroll-fade-in.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ============================================================
   共通ギミック：ページトップへ戻るボタン（確定版）
   ============================================================ */

/* 1. ボタンの初期状態（右下に固定、最初は透明で少し下に隠す） */
.return-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9990; /* メニューの裏に回り込むように調整 */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9); /* ほんのり透ける白 */
    border: 1px solid #ddd;                      /* 繊細な細い枠線 */
    color: #444;                                 /* 矢印の色 */
    text-decoration: none !important;
    font-size: 1.1rem;
    font-family: sans-serif;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s ease;
    cursor: pointer;
}

/* 2. 400pxスクロールした時にスッと浮き上がって表示 */
.return-top.is-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 3. パソコンでマウスを乗せたときの静かな変化（反転） */
.return-top:hover {
    background-color: #333;
    border-color: #333;
    color: #fff !important;
}

/* 4. スマホ表示（768px以下）での位置微調整 */
@media (max-width: 768px) {
    .return-top {
        bottom: 20px;
        right: 20px;
        width: 36px;  /* スマホではほんの少しだけコンパクトに */
        height: 36px;
        font-size: 1rem;
        background-color: rgba(255, 255, 255, 0.95); /* スマホで見えやすいよう白を濃く */
    }
}

/* 横向きの案内状（1列にする）ための特別設定 */
@media (min-width: 769px) {
    .ex-grid-inner .ex-section.is-landscape {
        grid-column: 1 / -1 !important; /* 2列分のスペースをぶち抜いて1列にする */
        max-width: 1000px !important;    /* 横に広がりすぎないように適切な最大幅を設定 */
        margin: 0 auto !important;      /* 1列にしたときに中央に配置する */
    }
}