/*
Theme Name: スタンプラリー
Theme URI: https://example.com/stamp-rally-theme
Author: Your Name
Description: スタンプラリーサイト専用のWordPressテーマ。モバイルファーストのデザインで、GPS連動スタンプラリーに最適化されています。
Version: 1.0.0
Text Domain: stamp-rally-theme
*/

/* -------------------------------------------------------
 * Google Fonts & CSS 変数
 * ----------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
    --sr-primary: #2864f0;
    --sr-primary-dk: #285ac8;
    --sr-dark: #143278;
    --sr-accent: #3264dc;
    --sr-light: #f7f5f5;
    --sr-surface: #ffffff;
    --sr-muted: #8c8989;
    --sr-border: #e9e7e7;
    --sr-radius: 12px;
    --sr-shadow: 0 0 1rem rgba(0, 0, 0, 0.1), 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
    --font-main: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
    --header-height: 60px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: #595959;
    background: var(--sr-light);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------
 * ヘッダー
 * ----------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: var(--sr-dark);
    height: var(--header-height);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.header-inner {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
}

.site-title a {
    text-decoration: none;
}

.stamp-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* カスタムロゴ */
.custom-logo-wrap {
    display: flex;
    align-items: center;
}

.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    max-height: 40px;
    width: auto;
    display: block;
}

/* -------------------------------------------------------
 * ボトムナビゲーション
 * ----------------------------------------------------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85px;
    background: var(--sr-primary);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ffffff;
    flex: 1;
    height: 100%;
    transition: color 0.2s, background 0.2s;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.bottom-nav-item:hover,
.bottom-nav-item:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.bottom-nav-icon {
    font-size: 28px;
    margin-bottom: 4px;
    line-height: 1;
}

.bottom-nav-icon-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 4px;
    display: block;
}

.bottom-nav-text {
    font-size: 14px;
    font-weight: 400;
}

/* -------------------------------------------------------
 * メインコンテンツ
 * ----------------------------------------------------- */
.site-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* トップページ以外の固定ページは、コンテンツ上部に余白を確保する
   （body の home クラスはフロントページにのみ付与される） */
body.page:not(.home) .site-main {
    padding-top: 24px;
}

/* -------------------------------------------------------
 * ページヘッダー画像（アイキャッチ／全幅）
 * .site-main の外側に出力されるため、幅の打ち消しは不要
 * ----------------------------------------------------- */
.sr-page-hero {
    width: 100%;
}

/* 画像を切り抜かず、元の縦横比のまま全幅で表示する。
   高さは幅に応じて決まるため、aspect-ratio や object-fit は指定しない。
   （WordPress が img に width / height 属性を出力するので、
     読み込み前もブラウザが高さを確保でき、レイアウトのズレは起きない） */
.sr-page-hero .sr-page-hero-img {
    width: 100%;
    height: auto;
    display: block;
}

/* WordPressのカバーブロックなどへの追加スタイル */
.wp-block-cover {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    overflow: hidden;
}

/* -------------------------------------------------------
 * ページタイトル
 * ----------------------------------------------------- */
.page-title {
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 700;
    margin-bottom: 20px;
    color: #323232;
    border-bottom: 3px solid var(--sr-primary);
    padding-bottom: 12px;
}

/* -------------------------------------------------------
 * ヒーローセクション（トップページ）
 * ----------------------------------------------------- */
.sr-hero {
    background: var(--sr-dark);
    color: #fff;
    border-radius: 0 0 var(--sr-radius) var(--sr-radius);
    padding: clamp(40px, 8vw, 80px) 20px;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.sr-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.sr-hero h1 {
    font-size: clamp(26px, 6vw, 48px);
    font-weight: 900;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
    position: relative;
}

.sr-hero-accent {
    color: #aac8ff;
}

.sr-hero p {
    font-size: clamp(14px, 3vw, 18px);
    opacity: 0.85;
    max-width: 500px;
    margin: 0 auto 28px;
    position: relative;
}

.sr-hero-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.sr-hero-btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 99px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sr-hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

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

.sr-hero-btn--secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* -------------------------------------------------------
 * フィーチャーグリッド
 * ----------------------------------------------------- */
.sr-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.sr-feature-card {
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow);
    padding: 24px 20px;
    text-align: center;
    transition: transform 0.25s;
}

.sr-feature-card:hover {
    transform: translateY(-4px);
}

.sr-feature-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.sr-feature-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.sr-feature-card p {
    font-size: 13px;
    color: var(--sr-muted);
}

/* -------------------------------------------------------
 * コンテンツ本文
 * ----------------------------------------------------- */
.entry-content p {
    margin-bottom: 1em;
}

/* 見出し（h1〜h6）の指定は「見出し」セクションに集約 */

.entry-content ul {
    padding-left: 20px;
    margin-bottom: 1em;
}

/* -------------------------------------------------------
 * フッター
 * ----------------------------------------------------- */
.site-footer {
    background: var(--sr-dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 24px 16px;
    font-size: 13px;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
}

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

/* -------------------------------------------------------
 * 見出し（h1〜h6）
 *
 * 以下3系統の見出しを、同じ体系（レベルが下がるほど小さく・
 * 左ラインを細く）で表示する。
 *   .sr-section-title … プラグインのセクション見出し
 *   .wp-block-heading … ブロックエディタの見出し
 *   .entry-content 内の素の見出し … クラシックエディタ等の見出し
 *
 * プラグイン側 stamp-rally.css にも .sr-section-title の定義があるが、
 * テーマCSSが後に読み込まれるため、見た目の決定箇所はここに集約している。
 * ----------------------------------------------------- */

/* --- 共通の装飾 --- */
.sr-section-title,
.wp-block-heading,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    font-weight: 700;
    border-left: 4px solid var(--sr-primary);
    border-bottom: none;
    padding-left: 10px;
    padding-bottom: 0;
    line-height: 1.5;
}

/* --- h1：ページ内の最上位見出し --- */
h1.sr-section-title,
h1.wp-block-heading,
.entry-content h1 {
    font-size: 28px;
    border-left-width: 6px;
    padding-left: 14px;
    margin: 48px 0 24px;
}

/* --- h2：大見出し --- */
h2.sr-section-title,
h2.wp-block-heading,
.entry-content h2 {
    font-size: 24px;
    border-left-width: 5px;
    padding-left: 12px;
    margin: 40px 0 20px;
}

/* --- h3：中見出し --- */
h3.sr-section-title,
h3.wp-block-heading,
.entry-content h3 {
    font-size: 20px;
    border-left-width: 4px;
    padding-left: 10px;
    margin: 32px 0 16px;
}

/* --- h4：小見出し --- */
h4.sr-section-title,
h4.wp-block-heading,
.entry-content h4 {
    font-size: 18px;
    border-left-width: 3px;
    padding-left: 9px;
    margin: 28px 0 14px;
}

/* --- h5：補助見出し --- */
h5.sr-section-title,
h5.wp-block-heading,
.entry-content h5 {
    font-size: 16px;
    border-left-width: 2px;
    padding-left: 8px;
    margin: 24px 0 12px;
}

/* --- h6：最小見出し（文字色を落として区別） --- */
h6.sr-section-title,
h6.wp-block-heading,
.entry-content h6 {
    font-size: 14px;
    border-left-width: 2px;
    padding-left: 8px;
    margin: 24px 0 12px;
    color: #6b6b6b;
}

/* -------------------------------------------------------
 * フッター
 * ----------------------------------------------------- */
.site-footer {
    padding: 40px 20px;
    background-color: transparent;
    border-top: 1px solid #eee;
    text-align: center;
    margin-bottom: 70px;
    /* ボトムナビにかぶらないように余白を確保 */
}

.site-footer .copyright {
    font-size: 14px;
    color: #8c8989;
    margin: 0;
}

@media (max-width: 600px) {
    .site-footer {
        padding: 30px 20px;
        margin-bottom: 80px;
    }
}

/* -------------------------------------------------------
 * ドロワーメニュー
 * ----------------------------------------------------- */
.sr-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.sr-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.sr-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--sr-primary);
    z-index: 2001;
    transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.sr-drawer.is-open {
    left: 0;
}

.sr-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sr-drawer-title {
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
}

.sr-drawer-close {
    background: none;
    border: none;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.sr-drawer-content {
    padding: 10px 0 40px;
    overflow-y: auto;
}

.sr-drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sr-drawer-menu li a {
    display: block;
    padding: 16px 24px;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.sr-drawer-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sr-drawer-menu li:last-child a {
    border-bottom: none;
}

.sr-menu-item-login a,
.sr-menu-item-logout a {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.8) !important;
}

.sr-menu-item-login a:hover,
.sr-menu-item-logout a:hover {
    color: #ffffff !important;
}

.sr-menu-item-login a .fa-solid,
.sr-menu-item-logout a .fa-solid {
    width: 1.2em;
    text-align: center;
    margin-right: 6px;
}

.sr-drawer-translate {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 10px;
}

/* ドロワー内のGTranslateウィジェットの色調整 */
.sr-drawer-translate .gt_switcher-popup {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 10px 15px !important;
    display: inline-flex !important;
    align-items: center !important;
}

.sr-drawer-translate .gt_switcher-popup span {
    color: #ffffff !important;
    font-size: 15px !important;
}

.sr-drawer-translate select {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 8px !important;
    border-radius: 6px !important;
    width: 100% !important;
}

/* -------------------------------------------------------
 * 特典一覧ページ (sr_benefit)
 * ----------------------------------------------------- */
.sr-benefits-page {
    padding: 20px 0;
}

.sr-benefits-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
}

.sr-benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.sr-benefit-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.sr-benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.sr-benefit-image {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
}

.sr-benefit-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.sr-benefit-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.sr-benefit-name {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
}

.sr-benefit-condition {
    margin-bottom: 15px;
}

.sr-cond-label {
    display: inline-block;
    padding: 4px 10px;
    background: #ebf3ff;
    color: #2864f0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.sr-benefit-description {
    font-size: 14px;
    color: #595959;
    line-height: 1.6;
    margin-bottom: 20px;
}

.sr-benefit-footer {
    margin-top: auto;
}

/* ボタン状態 */
.sr-btn--locked {
    background: #cccccc !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.sr-btn--redeemed {
    background: #00963c !important;
    cursor: default;
}

.sr-btn--cleared {
    background: #00963c !important;
    cursor: default;
}

/* グレーアウト状態 (locked) の演出 */
.sr-benefit--locked {
    filter: grayscale(0.8);
    opacity: 0.8;
}

.sr-benefit--locked:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 応募済み状態の演出 */
.sr-benefit--redeemed {
    border: 2px solid #00963c;
}

.sr-no-benefits {
    text-align: center;
    padding: 40px;
    color: #8c8989;
}

@media (max-width: 480px) {
    .sr-benefits-list {
        grid-template-columns: 1fr;
    }
}
/* -------------------------------------------------------
 * SNSアプリ内ブラウザの警告
 * 表示・非表示は theme.js が hidden 属性で制御する
 * ----------------------------------------------------- */
.sr-inapp-notice {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* hidden 属性を確実に優先させる（display 指定に負けないよう明示） */
.sr-inapp-notice[hidden] {
    display: none;
}

.sr-inapp-notice-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.sr-inapp-notice-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    padding: 28px 22px 22px;
    box-sizing: border-box;
    text-align: center;
}

.sr-inapp-notice-icon {
    font-size: 36px;
    line-height: 1;
    margin: 0 0 12px;
}

.sr-inapp-notice-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 14px;
    /* 見出し共通の左ラインは打ち消す */
    border-left: none;
    padding-left: 0;
}

.sr-inapp-notice-lead {
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 16px;
}

.sr-inapp-notice-list {
    margin: 0 0 18px;
    padding: 14px 16px 14px 34px;
    background: #fff7f7;
    border: 1px solid #f3d4d4;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    line-height: 1.7;
}

.sr-inapp-notice-list li + li {
    margin-top: 8px;
}

.sr-inapp-notice-guide {
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 14px;
}

.sr-inapp-notice-copy {
    display: block;
    width: 100%;
    background: var(--sr-primary);
    color: #fff;
    border: none;
    border-radius: 99px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.3s;
}

.sr-inapp-notice-copy:hover {
    background: var(--sr-primary-dk);
}

.sr-inapp-notice-copied {
    font-size: 12px;
    line-height: 1.6;
    color: #1a7a40;
    margin: 10px 0 0;
}

/* URL欄は通常は隠し、コピー失敗時のみ手動選択用に表示する */
.sr-inapp-notice-url {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.sr-inapp-notice-url--show {
    position: static;
    width: 100%;
    height: auto;
    opacity: 1;
    margin-top: 10px;
    padding: 10px;
    font-size: 12px;
    box-sizing: border-box;
    border: 1.5px solid var(--sr-border);
    border-radius: 8px;
}

.sr-inapp-notice-close {
    display: block;
    width: 100%;
    margin: 14px 0 0;
    background: none;
    border: none;
    color: var(--sr-muted);
    font-size: 13px;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* 警告表示中は背後をスクロールさせない */
body.sr-inapp-notice-open {
    overflow: hidden;
}
