/*
 * サーフポイントディレクトリ（/surf/spots/ トップのメインビジュアル）CSS
 * 2026-07-26 新設。デザインは潮見表トップ(assets/css/tide-directory.css)のヒーローに準拠。
 * .surf-directory ラッパーの内側にだけ効くようスコープ済み。
 * ヒーロー配下のみを対象とし、既存の検索フォーム・一覧には一切影響しない。
 */

.surf-directory,
.surf-directory *,
.surf-directory *::before,
.surf-directory *::after {
    box-sizing: border-box;
}

.surf-directory {
    --surf-navy: #082f53;
    --surf-blue: #157bb4;
    --surf-ink: #102e4b;
    --surf-muted: #617488;
    --surf-border: #dbe6ee;
    --surf-radius: 14px;
    --surf-shadow: 0 10px 30px rgba(6, 43, 75, 0.09);
    color: var(--surf-ink);
    font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    /* #page(max-width:1100px)内から画面幅いっぱいに広げるブレイクアウト */
    position: relative;
    left: 50%;
    width: 100vw;
    /* 上はパンくずの余白を打ち消してヒーローを直結、下はコンテンツ枠と直結 */
    margin: -25px 0 0 -50vw;
}

.surf-directory h1,
.surf-directory p {
    margin: 0;
    padding: 0;
}

.surf-directory button,
.surf-directory input {
    color: inherit;
    font: inherit;
}

.surf-directory a {
    color: inherit;
    text-decoration: none;
}

.surf-directory a:focus-visible,
.surf-directory button:focus-visible,
.surf-directory input:focus-visible {
    outline: 3px solid #62c8ff;
    outline-offset: 3px;
}

.surf-container {
    width: calc(100% - 64px);
    max-width: 1220px;
    margin-inline: auto;
}

/* ===== ヒーロー ===== */
.surf-directory-hero {
    position: relative;
    overflow-x: clip;
    overflow-y: visible; /* 検索サジェストを下にはみ出して表示させる */
    background:
        radial-gradient(circle at 82% 10%, rgba(84, 181, 224, 0.26) 0, transparent 33%),
        linear-gradient(135deg, #edf7fc 0%, #f9fcfd 58%, #eaf5fa 100%);
}

.surf-directory-hero__decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.surf-directory-hero__decor::after {
    position: absolute;
    right: -7%;
    bottom: -145px;
    width: 56%;
    height: 280px;
    background: rgba(63, 169, 209, 0.11);
    border-radius: 50% 50% 0 0;
    content: "";
    transform: rotate(-7deg);
}

.surf-directory-hero__watermark {
    position: absolute;
    right: 3%;
    bottom: -31px;
    color: rgba(13, 91, 137, 0.045);
    font-family: Arial, sans-serif;
    font-size: clamp(70px, 12vw, 175px);
    font-weight: 900;
    letter-spacing: -0.07em;
    line-height: 1;
    white-space: nowrap;
}

.surf-directory-hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 400px;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 0.82fr);
    align-items: center;
    gap: 70px;
    padding-block: 60px;
}

.surf-directory-hero h1 {
    margin: 0;
    font-size: clamp(35px, 4.1vw, 47px);
    letter-spacing: 0.03em;
    line-height: 1.35;
}

.surf-directory-hero__copy > p:not(.surf-eyebrow) {
    margin: 16px 0 19px;
    color: #526b80;
    font-size: 13px;
    font-weight: 600;
}

.surf-eyebrow {
    margin: 0 0 6px;
    color: var(--surf-blue);
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    line-height: 1.35;
}

/* ===== 検索カード ===== */
.surf-point-search {
    position: relative;
    padding: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: var(--surf-radius);
    box-shadow: var(--surf-shadow);
    backdrop-filter: blur(8px);
}

.surf-point-search > label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 800;
}

.surf-point-search__field {
    position: relative;
    display: flex;
}

.surf-point-search__field > span {
    position: absolute;
    top: 17px;
    left: 16px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--surf-blue);
    border-radius: 50%;
}

.surf-point-search__field > span::after {
    position: absolute;
    right: -6px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    background: var(--surf-blue);
    content: "";
    transform: rotate(45deg);
}

.surf-point-search input {
    min-width: 0;
    min-height: 50px;
    flex: 1;
    padding: 12px 14px 12px 43px;
    background: #fff;
    border: 1px solid var(--surf-border);
    border-radius: 7px;
    font-size: 12px;
}

.surf-point-search__secondary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
}

.surf-point-search__status {
    margin: 0;
    color: var(--surf-muted);
    font-size: 9px;
}

.surf-jump-link {
    padding: 0;
    color: var(--surf-blue);
    background: none;
    border: 0;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.surf-jump-link > span {
    margin-right: 4px;
}

.surf-jump-link[disabled] {
    opacity: 0.5;
    cursor: default;
}

/* 「条件から絞り込む」は現在地ボタンより控えめに */
.surf-jump-link--sub {
    color: var(--surf-muted);
    font-weight: 700;
}

.surf-point-search__secondary {
    flex-wrap: wrap;
}

.surf-point-search__secondary > .surf-jump-link + .surf-jump-link {
    margin-left: -4px;
}

/* ===== サジェスト ===== */
.surf-point-suggest {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--surf-border);
    border-radius: 10px;
    box-shadow: var(--surf-shadow);
}

.surf-point-suggest[hidden] {
    display: none;
}

.surf-point-suggest a {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid #eef4f8;
    font-size: 13px;
}

.surf-point-suggest a:last-child {
    border-bottom: 0;
}

.surf-point-suggest a:hover,
.surf-point-suggest a.is-active {
    background: #eff6fb;
}

.surf-point-suggest a > small {
    display: block;
    color: var(--surf-muted);
    font-size: 11px;
    font-weight: 600;
}

.surf-point-suggest__empty {
    padding: 14px;
    color: var(--surf-muted);
    font-size: 12px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 1100px) {
    .surf-container {
        width: calc(100% - 44px);
    }

    .surf-directory-hero__content {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
        gap: 38px;
    }
}

@media (max-width: 767px) {
    .surf-container {
        width: calc(100% - 32px);
    }

    .surf-directory-hero__content {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 27px;
        padding-block: 45px;
    }

    .surf-directory-hero h1 {
        font-size: clamp(30px, 9vw, 41px);
    }

    .surf-directory-hero__copy > p:not(.surf-eyebrow) br {
        display: none;
    }

    .surf-point-search {
        padding: 20px 16px;
    }
}

/* ===== SNS共有バーの位置調整 =====
 * 旧位置(コンテンツ1100px用の left:-1183px)はヒーロー見出しに重なるため、
 * 潮見表トップ(tide-directory.css)と同じ考え方で本文カラム1220pxの左16px外側へ再計算。
 * 収まらない1101〜1360pxは他ページのSP同様、下部追従バーへ切り替える。
 * body付きセレクタは旧クリティカルCSS(.share{left:-1183px})に読み込み順へ依存せず勝つための詳細度。 */
@media (min-width: 1361px) {
    body .share {
        left: -1302px; /* -1302 = カラム1220 + 82 */
    }
}

@media (min-width: 1101px) and (max-width: 1360px) {
    body .share {
        margin: 0 auto;
        bottom: 0;
        width: 100%;
        left: 0;
        right: 0;
        top: inherit;
    }

    body .share li {
        display: inline-block;
        width: 25%;
        vertical-align: top;
    }

    body .share li a {
        padding: 21px 0 4px;
        line-height: 1.5;
    }
}

/* =====================================================================
 * 検索条件のアコーディオン（/surf/spots/ 絞り込みフォーム・2026-07-26）
 * 既存の .surf_table 配下のCSS（ラベル幅・枠線）をそのまま活かすため、
 * テーブル構造は変えず <tr> の表示/非表示だけで開閉する。
 * ===================================================================== */
.surf_table tr.surf-acc-body[hidden] {
    display: none;
}

/* 見出しの配色: 既存のグレーのベタ塗り(#f0f0f0・同色ボーダーで境目が見えない)から、
 * 潮見表トップで使っている薄いブルー(--tide-soft #eff6fb)と枠線色(--tide-border #dbe6ee)へ。
 * このCSSは /surf/spots/ でのみ読み込むため他ページには影響しない。 */
.surf_table th {
    background-color: #eff6fb;
    border: 1px solid #dbe6ee;
}

.surf_table tr.surf-acc-head th {
    padding: 0;
    border-top: 1px solid #dbe6ee;
}

.surf-acc-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    color: inherit;
    background: none;
    border: 0;
    font: inherit;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
}

.surf-acc-toggle:hover {
    background: #e2eef7;
}

.surf-acc-label {
    flex: 0 0 auto;
}

/* 選択件数バッジ */
.surf-acc-count {
    padding: 1px 8px;
    color: #fff;
    background: #157bb4;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
}

.surf-acc-count[hidden] {
    display: none;
}

/* 開閉マーク（右端の矢印） */
.surf-acc-mark {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid #157bb4;
    border-bottom: 2px solid #157bb4;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 180ms ease;
}

.surf-acc-toggle[aria-expanded="true"] .surf-acc-mark {
    transform: translateY(2px) rotate(-135deg);
}

/* =====================================================================
 * .post_title の上ボーダーを解除（/surf/spots/ のみ・2026-07-26）
 * style.css で以下3箇所が border-top:#2c7eb9 4px solid を指定しているため、
 * 同じ詳細度で打ち消す（このCSSは当ページでのみ読み込むので他ページは従来どおり）。
 *   .post_title / .type-page .post_title / .type-page .post_title,.type-post .post_title
 * ===================================================================== */
.post_title,
.type-page .post_title,
.type-post .post_title {
    border-top: none;
}

/* =====================================================================
 * body の背景色を解除（/surf/spots/ のみ・2026-07-26）
 * style.css:1967 の body{background-color:#f0f0f0} を打ち消して白地にする。
 * @media の外で指定されているためPC・SPとも対象。
 * このCSSは当ページでのみ読み込むので他ページの背景は従来どおり。
 * ===================================================================== */
body {
    background-color: #fff;
}

/* コンテンツ枠内に置く場合はブレイクアウト(100vw)を打ち消す。
 * 潮見表トップの .tide-directory--inline と同じ考え方（2026-07-26） */
.surf-directory.surf-directory--inline {
    position: static;
    left: auto;
    width: auto;
    margin: 0;
}

.surf-directory--inline .surf-container {
    width: 100%;
    max-width: none;
}

/* =====================================================================
 * 閲覧履歴（/surf/spots/・2026-07-26）
 * 潮見表トップ(tide-directory.css)の .tide-history-* を .surf-history-* として移植。
 * ===================================================================== */
.surf-history-section {
    padding: 36px 0 12px;
    background: #fff;
}

/* 見出しは潮見表(tide-directory.css の .tide-section-heading)・天気予報と同じ
 * 「オーシャンライン」に統一(2026-08-01)。
 * 単色の border-bottom をやめ、濃紺→水色→薄グレーの3色ラインを疑似要素で描く */
.surf-section-heading {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 23px;
    padding: 0 0 0.55em 7px;
}

.surf-section-heading::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    content: "";
    background: linear-gradient(90deg, #0759a7 0 16%, #81d7f0 16% 28%, var(--slb-color-border, #dce7f0) 28% 100%);
}

.surf-section-heading h2 {
    margin: 0;
    color: var(--surf-navy);
    font-size: clamp(21px, 2vw, 23px);
    line-height: 1.4;
    letter-spacing: 0.02em;
}

/* 見出し右側の補足（閲覧履歴の件数など） */
.surf-section-heading > span {
    color: var(--surf-muted);
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.surf-history-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.surf-history-list[hidden] {
    display: none;
}

.surf-history-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--surf-border);
    border-radius: 10px;
    box-shadow: 0 5px 17px rgba(6, 43, 75, 0.05);
}

.surf-history-card__link {
    display: block;
    min-height: 100px;
    padding: 17px 42px 17px 16px;
    transition: background 220ms ease;
}

.surf-history-card__link:hover {
    background: #eff6fb;
}

.surf-history-card__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.surf-history-card__head {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.surf-history-card__badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    color: #fff;
    background: var(--surf-blue);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
}

.surf-history-card__head > strong {
    overflow: hidden;
    color: var(--surf-navy);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.surf-history-card__copy > small {
    margin-top: 4px;
    overflow: hidden;
    color: var(--surf-muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* カード下部の波の装飾（潮見表の履歴カードと同デザイン・同色） */
.surf-history-card__deco {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 35px;
    pointer-events: none;
}

.surf-history-card__deco path {
    fill: #92c1df; /* 潮見表トップの波と同色（tide-directory.css と揃える） */
}

.surf-history-card__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    color: var(--surf-muted);
    background: #f3f7f9;
    border: 0;
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.surf-history-card__remove:hover {
    color: #fff;
    background: var(--surf-navy);
}

.surf-history-empty {
    display: flex;
    min-height: 112px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    color: var(--surf-muted);
    background: #f8fbfc;
    border: 1px dashed #cfdde6;
    border-radius: 10px;
    text-align: center;
}

.surf-history-empty[hidden] {
    display: none;
}

@media (max-width: 1100px) {
    .surf-history-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .surf-history-section {
        padding: 26px 0 8px;
    }

    .surf-history-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* 潮見表・天気予報と同じく、狭い幅では見出しと件数を縦積みにする
     * （h2のサイズは clamp(21px, 2vw, 23px) の下限で21pxになるため個別指定は不要） */
    .surf-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

/* ===== ダークモード対策(2026-08-01) =====
   旧#darkBodyの汎用ルールとの組み合わせで、白背景の閲覧履歴カード等が読めなくなるため明示指定。
   新シェル(html[data-theme="dark"])と旧(#darkBody)の両方に対応（weather-directory.cssと同方式） */
#darkBody .surf-history-section,
html[data-theme="dark"] .surf-history-section {
    background: #282828;
}
#darkBody .surf-section-heading h2,
html[data-theme="dark"] .surf-section-heading h2 {
    color: #e8f1f8 !important;
}
#darkBody .surf-section-heading > span,
html[data-theme="dark"] .surf-section-heading > span {
    color: #a8b8b5;
}
#darkBody .surf-history-card,
html[data-theme="dark"] .surf-history-card {
    background: #333;
    border-color: #555;
    box-shadow: none;
}
#darkBody .surf-history-card__link:hover,
html[data-theme="dark"] .surf-history-card__link:hover {
    background: #3d474f;
}
#darkBody .surf-history-card__head > strong,
html[data-theme="dark"] .surf-history-card__head > strong {
    color: #e8f1f8;
}
#darkBody .surf-history-card__copy > small,
html[data-theme="dark"] .surf-history-card__copy > small {
    color: #a8b8b5;
}
#darkBody .surf-history-card__remove,
html[data-theme="dark"] .surf-history-card__remove {
    color: #ccc;
    background: #4a545c;
}
