/* =========================================================
   soraniar トップページ (index.html) 専用
   soraniar-ui.css のあとに読み込むこと
   ========================================================= */

body.sn-top {
    background:
            radial-gradient(circle at 50% -8%, rgba(104, 199, 244, .3), transparent 34rem),
            #eef8fd;
}

.sn-shell {
    width: min(100%, 1220px);
    margin: 0 auto;
    min-height: 100dvh;
    background: #fff;
    box-shadow: 0 0 70px rgba(40, 100, 140, .08);
    overflow: hidden;
    position: relative;
}

.sn-wrap {
    width: min(calc(100% - 36px), var(--content));
    margin-inline: auto;
}

/* ---------------------------------------------------------
   ヘッダー
   --------------------------------------------------------- */
.sn-top-header {
    position: relative;
    z-index: 10;
    padding: calc(16px + var(--safe-top)) max(18px, calc((100% - var(--content)) / 2)) 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
}

.sn-top-header .sn-brand { justify-self: center; grid-column: 1 / -1; }
.sn-top-header .sn-icon-button { grid-column: 2; grid-row: 1; justify-self: end; }

.sn-tagline {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    text-align: center;
    color: var(--sky-deep);
    font-weight: 800;
    font-size: clamp(.8rem, 3.2vw, .98rem);
}

/* ---------------------------------------------------------
   ヒーロー
   --------------------------------------------------------- */
.sn-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .95fr);
    align-items: center;
    gap: clamp(24px, 5vw, 68px);
    padding-block: 34px 60px;
}

.sn-hero::before {
    content: "";
    position: absolute;
    inset: -190px -90px auto;
    height: 520px;
    z-index: 0;
    background:
            radial-gradient(circle at 16% 62%, rgba(255, 255, 255, .95) 0 44px, transparent 46px),
            radial-gradient(circle at 84% 54%, rgba(255, 255, 255, .85) 0 62px, transparent 64px),
            linear-gradient(180deg, var(--sky-light) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.sn-hero > * { position: relative; z-index: 1; }

.sn-hero h1 {
    margin: 0;
    font-size: clamp(2.7rem, 11vw, 4.6rem);
    line-height: 1.16;
    letter-spacing: -.055em;
    text-wrap: balance;
}

.sn-hero h1 em {
    color: var(--coral);
    font-style: normal;
}

.sn-hero-sub {
    width: fit-content;
    margin: 22px 0 0;
    font-weight: 800;
    font-size: clamp(.98rem, 3.6vw, 1.25rem);
    position: relative;
}

.sn-hero-sub::after {
    content: "";
    position: absolute;
    left: 42%;
    right: 0;
    bottom: -4px;
    height: 5px;
    border-radius: 99px;
    background: var(--yellow);
    transform: rotate(-2deg);
}

.sn-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.sn-status {
    min-height: 1.5em;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .88rem;
}

/* ヒーロー写真カード */
.sn-hero-visual { display: grid; place-items: center; }

.sn-photo-card {
    width: min(100%, 430px);
    padding: 12px;
    background: #fff;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    transform: rotate(3deg);
    position: relative;
}

/* whale_sample.jpg は 900x1340（およそ 2:3）。
   スポット名チップと「Wow!」は画像に焼き込み済みなので、
   CSS側で重ねるオーバーレイは持たせない。 */
.sn-photo-frame {
    aspect-ratio: 900 / 1340;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(#55c8f4, #d9f5ff);
}

.sn-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------------------------------------------------------
   周辺のARスポット（ミニマップ）
   --------------------------------------------------------- */
.sn-nearby { padding-bottom: 8px; }

.sn-map-card {
    display: grid;
    grid-template-columns: minmax(240px, .78fr) minmax(320px, 1.22fr);
    gap: 18px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
    border: 1px solid #e9f4fa;
}

.sn-map-card-copy { align-self: center; padding: 4px; }
.sn-map-card-copy > p { color: var(--muted); margin: 8px 0 6px; }
.sn-map-card-copy .sn-section-head { margin-bottom: 4px; justify-content: flex-start; }

/* 今いる場所で撮影できる件数 */
.sn-shootable {
    margin: 0 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(37, 185, 178, .13);
    color: #14807b;
    font-size: .82rem;
    font-weight: 800;
}

.sn-shootable::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.sn-shootable.is-none { background: #eef4f9; color: var(--muted); }
.sn-shootable[hidden] { display: none; }

/* 地図プレビュー（実際のGoogle Map。全面がタップ可能） */
.sn-map-preview {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: #e7f3e7;
    aspect-ratio: 1200 / 604;
    isolation: isolate;
}

/* 地図が描画されるまでの下敷き。Maps APIが読めなければこのまま見え続ける */
.sn-map-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-map-preview #topMap {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity .35s ease;
}

.sn-map-preview.is-map-ready #topMap { opacity: 1; }

/* 地図全体をタップ可能にする透明ボタン（プレビューなので地図操作は無効） */
.sn-map-preview-hit {
    position: absolute;
    inset: 0;
    z-index: 5;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.sn-map-preview-hit:active { background: rgba(25, 127, 197, .1); }

/* ---------------------------------------------------------
   横スクロールするカード列
   --------------------------------------------------------- */
.sn-section { padding-top: 52px; }

.sn-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(46%, 250px);
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 16px;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
}

.sn-rail > * { scroll-snap-align: start; }

.sn-spot-card {
    display: block;
    text-align: left;
    padding: 0;
    border: 1px solid #edf4f8;
    cursor: pointer;
    transition: transform .18s ease;
}

.sn-spot-card:active { transform: scale(.98); }
@media (hover: hover) {
    .sn-spot-card:hover { transform: translateY(-4px); }
}

.sn-spot-card-body { padding: 13px 14px 16px; }

.sn-spot-card-body h3 {
    margin: 0 0 4px;
    font-size: 1.02rem;
    line-height: 1.4;
}

.sn-spot-card-body p {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sn-spot-card-body p svg { width: 11px; height: 13px; flex-shrink: 0; }

/* 特集カードのキャッチコピー（2行で切る） */
.sn-featured-message {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* 最新情報 */
.sn-news-card {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    text-align: left;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sn-news-thumb {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 13px;
    /* themeFor() が theme-1〜3 を付けなかった場合の既定色 */
    background: linear-gradient(150deg, #b6ecff 0%, #e9fbff 52%, #a8dcb4 52%, #8bc69a 100%);
    overflow: hidden;
    position: relative;
}

.sn-news-thumb img {
    max-width: 76%;
    max-height: 82%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 8px rgba(0, 60, 95, .25));
}

.sn-news-thumb .sn-new-flag {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--yellow);
    color: var(--ink);
    font-size: .58rem;
    padding: 1px 6px;
    border-radius: 999px;
    letter-spacing: .04em;
}

.sn-news-card h3 {
    margin: 0;
    font-size: .95rem;
    line-height: 1.5;
    font-weight: 700;
}

.sn-empty {
    margin: 0;
    padding: 20px;
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
}

/* ---------------------------------------------------------
   使い方 3ステップ
   --------------------------------------------------------- */
.sn-howto { padding-block: 60px 70px; }

.sn-howto > h2 {
    text-align: center;
    margin: 0 0 24px;
    font-size: clamp(1.35rem, 5.2vw, 2.1rem);
}

.sn-howto strong {
    color: var(--sky-deep);
    font-size: 1.35em;
}

.sn-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 2px solid var(--line);
    background: var(--line);
    box-shadow: var(--shadow);
}

.sn-step {
    position: relative;
    text-align: center;
    padding: 34px 20px 26px;
    background: #fff;
}

.sn-step-number {
    position: absolute;
    left: 14px;
    top: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--teal);
    font-weight: 900;
    font-size: .95rem;
}

/* ステップのイラスト。①はマップ検索とQR読み込みの2枚を並べる */
.sn-step-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 132px;
}

.sn-step-icons img {
    width: auto;
    height: 118px;
    max-width: 44%;
    object-fit: contain;
}

.sn-step-icons.single img { max-width: 68%; height: 132px; }

.sn-step-or {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    white-space: nowrap;
}

.sn-step h3 { margin: 14px 0 6px; font-size: 1.08rem; }
.sn-step p { margin: 0; color: var(--muted); font-size: .86rem; }

/* ---------------------------------------------------------
   フッター
   --------------------------------------------------------- */
.sn-footer {
    padding: 40px 20px calc(36px + var(--safe-bottom));
    text-align: center;
    color: var(--ink);
    background: linear-gradient(180deg, #e7f8ff, #bde9fb);
}

.sn-footer p { margin: 4px; font-size: .9rem; }

/* ---------------------------------------------------------
   レスポンシブ
   --------------------------------------------------------- */
@media (max-width: 860px) {
    .sn-hero {
        grid-template-columns: 1fr;
        padding-top: 20px;
        gap: 30px;
    }

    .sn-hero-copy { text-align: left; }
    .sn-photo-card { width: min(94%, 420px); transform: rotate(1.5deg); }

    .sn-map-card { grid-template-columns: 1fr; padding: 14px; }

    .sn-steps { grid-template-columns: 1fr; }
    .sn-step { padding: 24px 20px 22px 20px; }
    .sn-step-number { left: 16px; top: 18px; }
    .sn-step-icons { min-height: 118px; }
    .sn-step-icons img { height: 104px; }
    .sn-step-icons.single img { height: 118px; }
}

@media (max-width: 520px) {
    .sn-wrap { width: calc(100% - 28px); }
    .sn-hero-actions .sn-button { width: 100%; }
    .sn-rail { grid-auto-columns: minmax(62%, 240px); }
}

/* ヒーローを画像とテキストの2カラムにできる十分な幅がある場合のみ回転演出を強める */
@media (min-width: 1024px) {
    .sn-photo-card:hover { transform: rotate(1deg) scale(1.01); transition: transform .3s ease; }
}
