/*
Theme Name: Thai Massage Base
Theme URI: https://github.com/yossie8000/thai-massage
Description: 全テナント共通ベーステーマ。CSS変数でテナント個性を表現。
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.1
License: proprietary
Text Domain: thai-massage-base
*/

/* =============================================
   CSS カスタムプロパティ（テナント個性）
   実際の値は functions.php で wp_head に出力される
   ============================================= */
:root {
    --color-primary:   #c0392b;
    --color-secondary: #2c3e50;
    --color-bg:        #ffffff;
    --color-text:      #333333;
    --font-base:       'Noto Sans JP', sans-serif;
}

/* =============================================
   リセット・ベース
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-base);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
}

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================
   レイアウト
   ============================================= */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* =============================================
   ヘッダー
   ============================================= */
.site-header {
    background-color: var(--color-primary);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ハンバーガーボタン（PCでは非表示） */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-logo {
    height: 48px;
    width: auto;
}

.site-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.site-nav a:hover { text-decoration: none; opacity: 0.8; }

@media (max-width: 680px) {
    .nav-toggle { display: flex; }


    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--color-primary);
        z-index: 99;
        white-space: nowrap;
    }
    .site-nav.is-open { display: block; }
    .site-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
    }
    .site-nav ul li a {
        display: block;
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
}

/* =============================================
   フッター
   ============================================= */
.site-footer {
    background-color: var(--color-secondary);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.85rem;
}

/* =============================================
   ボタン
   ============================================= */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover { opacity: 0.85; text-decoration: none; }

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: #fff;
}

/* =============================================
   H1（キャッチコピー）
   ヒーロー画像あり → hero-h1 で画像下部にオーバーレイ
   ヒーロー画像なし → site-h1 で独立見出しとして表示
   ============================================= */
.hero-h1 {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0;
    padding: 3rem 1.25rem 1.1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
    text-align: center;
    text-wrap: balance;
    font-size: 1.05rem;
    line-height: 1.5;
    pointer-events: none;
}

.hero-h1 span {
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

.site-h1 {
    text-align: center;
    margin: 0;
    padding: 1.75rem 1.25rem;
    font-size: 1.15rem;
    line-height: 1.6;
}

.site-h1 span {
    font-weight: 700;
    color: var(--color-secondary);
}

.site-h1::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2px;
    margin: 0.6rem auto 0;
    background: var(--color-primary);
    opacity: 0.55;
}

/* =============================================
   各セクション（骨格）
   ============================================= */

/* トップイメージ / ケン・バーンズスライダー */
.section-hero { padding: 0; }

.hero-slider {
    position: relative;
    width: 100%;
    min-height: 220px;
    overflow: hidden;
    background: #111;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.hero-slide.active { opacity: 1; }

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
}

/* animation は JS で inline style に設定 */

@keyframes kenburns {
    from { transform: scale(1.0); }
    to   { transform: scale(1.1); }
}

/* 予約 */
.section-reservation .tel-link {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* コースと料金 */
.price-table {
    width: 100%;
    border-collapse: collapse;
}

.price-table th,
.price-table td {
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    text-align: left;
}

.price-table th {
    background-color: var(--color-secondary);
    color: #fff;
}

.price-table tr:nth-child(even) td { background-color: #f9f9f9; }

/* クーポン */
.coupon-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.coupon-item img {
    width: 95%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.coupon-caption {
    width: 95%;
    margin: 0.5rem auto 0;
    font-size: 0.9rem;
    color: #555;
    text-align: center;
}

/* ページコンテンツ（about / notes）タイポグラフィ */
.page-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin: 1.75rem 0 0.6rem;
    padding-left: 0.6rem;
    border-left: 4px solid var(--color-primary);
}

.page-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.page-content ul,
.page-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.page-content li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

#notes .page-content ul {
    list-style: none;
    padding-left: 0;
}

#notes .page-content ul li::before {
    content: "⚠ ";
    color: var(--color-primary);
    font-size: 0.85em;
    margin-right: 0.3em;
}

/* アクセス */
.access-info {
    line-height: 2;
    margin-bottom: 1.5rem;
}

.access-map {
    margin-bottom: 2rem;
}

.route-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.route-step img {
    width: 95%;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.route-step-caption {
    width: 95%;
    margin: 0.5rem auto 0;
    font-size: 0.95rem;
    color: #555;
    text-align: center;
}

/* ══════════════════════════════════════════════
   Gallery — Justified layout
══════════════════════════════════════════════ */
#gallery {
    background: #111;
}

#gallery .section-title {
    color: #fff;
}

#gallery .gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    /* overflow: hidden prevents sub-pixel rounding gaps on right edge */
    overflow: hidden;
}

.gallery-item {
    overflow: hidden;
    cursor: zoom-in;
    background: #222;
    flex-shrink: 0;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease, opacity 0.2s;
    opacity: 0.92;
}

.gallery-item:hover img {
    transform: scale(1.04);
    opacity: 1;
}

/* ══════════════════════════════════════════════
   Gallery Lightbox
══════════════════════════════════════════════ */
#gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#gallery-lightbox.is-open {
    display: flex;
}

body.lb-open {
    overflow: hidden;
}

.lb-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
}

.lb-stage {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 92vh;
}

.lb-img {
    display: block;
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    transition: opacity 0.15s;
}

.lb-img.lb-loading {
    opacity: 0.4;
}

/* ボタン共通 */
.lb-close,
.lb-prev,
.lb-next {
    position: fixed;
    z-index: 2;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

.lb-close {
    top: 1rem;
    right: 1rem;
    font-size: 1.4rem;
    padding: 0.35em 0.55em;
}

.lb-prev,
.lb-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.4rem;
    padding: 0.2em 0.45em;
}

.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

.lb-counter {
    position: fixed;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    z-index: 2;
    pointer-events: none;
}

@media (max-width: 600px) {
    .lb-prev { left: 0.4rem; }
    .lb-next { right: 0.4rem; }
    .lb-prev, .lb-next { font-size: 1.8rem; padding: 0.3em 0.4em; }
}
