/* ===== 英雄区域内容样式 ===== */
/* 背景样式已统一移至ui-components.css */

.hero-section {
    --hero-photo-collapsed-height: 400px;
    /* View changes are atomic; only the photo itself fades in. */
    transition: none;
}

/* 导航栏的通用容器底部留白不应扩展英雄区与筛选栏的间距。 */
.hero-section > .container {
    margin-bottom: 0;
    padding-inline: 20px;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    position: relative;
    top: -0.5rem;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #DC143C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 440px);
    gap: 16px;
    margin: 0 auto;
}

.hero-actions > .btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 20px;
    font-size: 16px;
    line-height: 1.2;
    white-space: normal;
    align-self: stretch;
}

/* The loader reveals the complete hero as soon as its resources are ready. */

/* 普通页面共用同一移动端布局；首页视频使用自己的 hero-buttons。 */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .hero-content p {
        font-size: 0.8rem;
        line-height: 1.5;
        min-height: 3em;
        margin-bottom: 1rem;
    }

    .hero-actions {
        gap: 12px;
    }

    .hero-actions > .btn {
        min-height: 48px;
        padding: 12px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

}

/* ===== Booking photographs: one surface from original image into details ===== */
.hero-section.hero-photo-mode {
    padding: 0;
    margin-bottom: 0;
    border-radius: 0;
    min-height: 0;
    height: auto;
    background: var(--sm-surface, #1a1a1a);
    box-shadow: none;
    transition: none;
    overflow-anchor: none;
    isolation: isolate;
}

.hero-section.hero-photo-mode > .container {
    width: 100%;
    max-width: none;
    padding: 0;
    margin-bottom: 0;
}

.hero-section.hero-photo-mode::before,
.hero-section.hero-photo-mode::after { display: none; }

.hero-photo-viewer {
    width: 100%;
    height: var(--hero-photo-height, var(--hero-photo-collapsed-height));
    overflow: hidden;
    position: relative;
    transition: none;
}

.hero-photo-viewer.has-ready-photo { transition: height 280ms cubic-bezier(.22,.68,0,1); }

.hero-booking-photo-viewer,
.hero-booking-photo-viewer .photo-main,
.hero-booking-photo-viewer .photo-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-booking-photo-viewer .photo-main {
    border-radius: 0;
    box-shadow: none;
    background: var(--sm-surface, #1a1a1a);
    overflow: hidden;
}

.hero-booking-photo-viewer .photo-container {
    position: absolute;
    top: var(--hero-photo-top-inset, 72px);
    height: calc(100% - var(--hero-photo-top-inset, 72px));
    overflow: hidden;
    box-sizing: border-box;
}

.hero-booking-photo-viewer .photo-top-extension {
    position:absolute;
    inset:-24px -24px auto;
    height:calc(var(--hero-photo-top-inset,72px) + 56px);
    background-size:cover;
    background-position:center 25%;
    filter:blur(22px) saturate(.85);
    opacity:.8;
    pointer-events:none;
}

.hero-booking-photo-viewer .photo-top-extension::after {
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(to bottom,rgba(var(--sm-surface-rgb,26,26,26),.25),transparent);
}

/* The fade belongs to the image surface, not the clickable arrow or thumbnail row. */
.hero-booking-photo-viewer .photo-container::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: var(--hero-photo-gradient-height, var(--sm-hero-edge-height));
    background: var(--sm-hero-edge-gradient);
    pointer-events: none;
    z-index: 2;
}

.hero-booking-photo-viewer .photo-loading {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-booking-photo-viewer .photo-loading .sm-skeleton-shape {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.hero-booking-photo-viewer .main-photo {
    display: block;
    position: absolute;
    /* Keep the original ratio; the clipping window opens around its center. */
    top: calc(50% - var(--hero-photo-image-height, 100%) / 2);
    left: 0;
    width: 100%;
    height: var(--hero-photo-image-height, 100%);
    object-fit: cover;
    object-position: center;
    opacity: 0;
}

.hero-booking-photo-viewer .main-photo.is-ready { opacity: 1; }
.hero-booking-photo-viewer .photo-main[data-expanded="true"] .main-photo { object-fit: contain; }
.hero-booking-photo-viewer .photo-main[data-expandable="true"] .main-photo { cursor: zoom-in; }
.hero-booking-photo-viewer .photo-main[data-expandable="true"][data-expanded="true"] .main-photo { cursor: zoom-out; }
.hero-booking-photo-viewer .photo-expand-btn,
.hero-booking-photo-viewer .photo-nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #f5f6f7;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    z-index: 4;
    transition: opacity 180ms ease;
}

.hero-booking-photo-viewer .photo-expand-btn[hidden] { display: none; }
.hero-booking-photo-viewer .photo-expand-btn {
    bottom: 0;
    left: calc(50% - 22px);
}

.hero-booking-photo-viewer .photo-expand-btn:hover,
.hero-booking-photo-viewer .photo-nav:hover {
    opacity: .75;
}

.hero-booking-photo-viewer .photo-expand-btn:focus-visible,
.hero-booking-photo-viewer .photo-nav:focus-visible,
.hero-booking-photo-viewer .photo-thumbnail:focus-visible {
    outline: 2px solid #f5f6f7;
    outline-offset: 3px;
}

.hero-booking-photo-viewer .photo-expand-btn svg,
.hero-booking-photo-viewer .photo-nav svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.8));
}

.hero-booking-photo-viewer .photo-expand-btn svg {
    transition: transform 280ms cubic-bezier(.22,.68,0,1);
}

.hero-booking-photo-viewer .photo-main[data-expanded="true"] .photo-expand-btn svg {
    transform: rotate(180deg);
}

.hero-booking-photo-viewer .photo-nav {
    top: min(calc(var(--sm-navbar-bottom, 96px) + 76px), calc(100% - 80px));
}
.hero-booking-photo-viewer .photo-nav.prev { left: 12px; }
.hero-booking-photo-viewer .photo-nav.next { right: 12px; }

.hero-booking-photo-viewer .photo-counter {
    position: absolute;
    top: calc(var(--sm-navbar-bottom, 96px) + 14px);
    left: 50%;
    transform: translateX(-50%);
    color: #f5f6f7;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
    pointer-events: none;
    z-index: 4;
}
.hero-photo-viewer.compact-photo .photo-thumbnails-overlay { display: none; }
.hero-photo-viewer.compact-photo .photo-counter { top: 0; }

.hero-booking-photo-viewer .photo-thumbnails-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    left: auto;
    max-width: calc(50% - 52px);
    z-index: 4;
}

.hero-booking-photo-viewer .photo-thumbnails {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px;
    margin: -4px;
}
.hero-booking-photo-viewer .photo-thumbnails::-webkit-scrollbar { display: none; }

.hero-booking-photo-viewer .photo-thumbnail {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border-radius: 12px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    border: 0;
    opacity: .5;
    transition: opacity 180ms ease;
}

.hero-booking-photo-viewer .photo-thumbnail.active {
    opacity: 1;
}

.hero-booking-photo-viewer .photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .hero-section { --hero-photo-collapsed-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-photo-viewer,
    .hero-photo-viewer.has-ready-photo,
    .hero-booking-photo-viewer .photo-expand-btn,
    .hero-booking-photo-viewer .photo-expand-btn svg,
    .hero-booking-photo-viewer .photo-nav,
    .hero-booking-photo-viewer .photo-thumbnail { transition: none; }
}

/* Licensed local photography belongs to ordinary page heroes only. */
body:not(.index-page) .hero-section:not(.hero-photo-mode) {
    background-color: var(--sm-surface, #1a1a1a);
    background-image: var(--hero-background-photo);
    background-position: var(--hero-background-position, center);
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 0;
    box-shadow: none;
    isolation: isolate;
}
body:not(.index-page) .hero-section:not(.hero-photo-mode)::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Keep the photograph's natural light; readability is local to the copy. */
    background: linear-gradient(180deg, rgba(12,14,18,.06), rgba(12,14,18,.10) 76%, rgba(12,14,18,.18));
    pointer-events: none;
}


/* Only the lower edge dissolves into the page; the photograph above keeps its light. */
body:not(.index-page) .hero-section:not(.hero-photo-mode)::after {
    content: '';
    display: block;
    position: absolute;
    inset: auto 0 0;
    height: var(--sm-hero-edge-height);
    background: var(--sm-hero-edge-gradient);
    border-radius: 0;
    box-shadow: none;
    filter: none;
    transform: none;
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}
body:not(.index-page) .hero-section:not(.hero-photo-mode) .hero-content h1 {
    color: #f4f5f7;
    background: none;
    -webkit-text-fill-color: currentColor;
    text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 3px 14px rgba(0,0,0,.7);
}
body:not(.index-page) .hero-section:not(.hero-photo-mode) .hero-content p {
    color: #fff;
    text-shadow: 0 1px 2px #000, 0 2px 8px rgba(0,0,0,.8);
}
.booking-page { --hero-background-photo: url('/_static/repair-20261015-r130/assets/hero/hall.webp'); --hero-background-position: center 60%; }
.events-page { --hero-background-photo: url('/_static/repair-20261015-r130/assets/hero/serve.webp'); --hero-background-position: center 56%; }
.community-page { --hero-background-photo: url('/_static/repair-20261015-r130/assets/hero/community.webp'); --hero-background-position: center 20%; }
.news-page { --hero-background-photo: url('/_static/repair-20261015-r130/assets/hero/news.webp'); --hero-background-position: center 45%; }
.profile-page { --hero-background-photo: url('/_static/repair-20261015-r130/assets/hero/racket.webp'); --hero-background-position: center 52%; }
.messages-page { --hero-background-photo: url('/_static/repair-20261015-r130/assets/hero/paddles.webp'); --hero-background-position: center 66%; }
@media (max-width: 768px) {
    .booking-page { --hero-background-position: 44% center; }
    .community-page { --hero-background-position: 32% center; }
    .events-page { --hero-background-position: 64% center; }
    .news-page { --hero-background-position: 44% center; }
    .profile-page { --hero-background-position: 70% center; }
    .messages-page { --hero-background-position: 60% center; }
}

/* The map expands the hero and pushes the list down; closing restores its original footprint. */
.booking-map-shell { position: absolute; inset: 0; z-index: 2; display: none; }
.booking-map-frame { height: 100%; overflow: hidden; position: relative; }
.booking-map-canvas { width: 100%; height: 100%; background: var(--sm-surface, #1a1a1a); }
.booking-map-frame::after { content: ''; position: absolute; inset: auto 0 0; height: var(--sm-hero-edge-height); z-index: 1; pointer-events: none; background: var(--sm-hero-edge-gradient); }
.booking-page .hero-section.hero-map-mode:not(.hero-photo-mode) { padding: 0; background-image: none; background-color: var(--sm-surface, #1a1a1a); height: var(--booking-hero-height,400px); min-height: var(--booking-hero-height,400px); }
.booking-page .hero-section.hero-map-mode:not(.hero-photo-mode)::before { display:none; }
.booking-page .hero-section.hero-map-mode:not(.hero-photo-mode)::after { height:var(--booking-hero-edge-height,var(--sm-hero-edge-height)); border-radius:32px 32px 0 0; z-index:3; transform:translateY(var(--booking-sheet-pull,0px)); transition:transform 340ms cubic-bezier(.22,.8,.2,1); }
.booking-page .hero-section.hero-map-mode.is-map-pulling::after { transition:none; }
.hero-section.hero-map-mode:not(.hero-photo-mode) > .booking-map-shell { display: block; }
.hero-section.hero-map-mode:not(.hero-photo-mode) > .container { display: none; }
.booking-page .hero-section.hero-map-morph:not(.hero-photo-mode) { overflow:visible; transition:none; }
.booking-page .hero-section.hero-map-morph:not(.hero-photo-mode)::after { height:var(--booking-hero-edge-height,var(--sm-hero-edge-height)); border-radius:32px 32px 0 0; z-index:3; }
.hero-section.hero-map-morph:not(.hero-photo-mode) > .booking-map-shell { display:block; position:fixed; inset:0 0 auto; overflow:hidden; }
.hero-section.hero-photo-mode > .booking-map-shell { display: none; }
.booking-page .hero-section.hero-map-mode:not(.hero-photo-mode) .hero-content h1 { color: var(--sm-text, #fff); -webkit-text-fill-color: currentColor; text-shadow: none; }
.booking-page .hero-section.hero-map-mode:not(.hero-photo-mode) .hero-content p { color: var(--sm-text-muted, #aeb4bd); text-shadow: none; }
.booking-map-toolbar { position: absolute; z-index: 3; inset: calc(var(--sm-navbar-bottom, 96px) + 16px) 24px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; }
.booking-map-heading, .booking-map-preview, .booking-map-results button { background: var(--sm-sticky-surface, rgba(26,26,26,.65)); backdrop-filter: var(--sm-sticky-blur, blur(20px)); -webkit-backdrop-filter: var(--sm-sticky-blur, blur(20px)); color: var(--sm-text, #fff); border: 0; box-shadow: none; }
.booking-map-heading { display: grid; gap: 5px; min-width: 0; max-width: 480px; max-height: 100%; overflow-y: auto; overflow-wrap: anywhere; overscroll-behavior: contain; scrollbar-width: thin; padding: 13px 16px; border-radius: 14px; text-align: left; pointer-events: auto; }
.booking-map-title { font-size: 15px; font-weight: 550; line-height: 1.4; }
.booking-map-status { font-size: 12px; line-height: 1.5; color: var(--sm-text-muted, #bcc3ca); }
.booking-map-actions { display: flex; flex-shrink: 0; gap: 8px; pointer-events: auto; --sm-text-muted: #17201b; --sm-text: #0d1712; }
.booking-map-actions svg { width: 21px; height: 21px; flex-shrink: 0; }
/* Status, empty and error content share one normal-flow panel. Its bounds
   follow the actual navbar and hero; long localized copy can scroll inside. */
.booking-map-message { min-width: 0; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; white-space: normal; color: var(--sm-text, #fff); }
.booking-map-message > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.booking-map-message button { flex-shrink: 0; pointer-events: auto; }
.booking-map-preview button { background: transparent; color: inherit; border: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.booking-map-results { display: flex; position: absolute; z-index: 2; inset: auto 24px 32px; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.booking-map-results button { flex-shrink: 0; padding: 9px 14px; border-radius: 99px; font: inherit; font-size: 12px; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-map-preview { position: absolute; z-index: 3; bottom: 84px; left: 24px; right: 24px; width: fit-content; max-width: calc(100% - 48px); border-radius: 16px; padding: 16px 20px; display: flex; gap: 24px; align-items: center; text-align: left; }
.booking-map-preview > div { display: grid; gap: 5px; min-width: 0; }
.booking-map-preview strong { font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }
.booking-map-preview span { font-size: 12px; color: var(--sm-text-muted, #bcc3ca); overflow-wrap: anywhere; }
.booking-map-preview button { font-size: 13px; }
.booking-map-frame [hidden] { display: none; }
.booking-map-frame button:not(.btn,.sm-text-action):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 768px) {
    .booking-map-toolbar { inset-inline: 14px; top: calc(var(--sm-navbar-bottom, 72px) + 12px); bottom: 12px; }
    .booking-map-results { inset-inline: 12px; }
    .booking-map-preview { left: 14px; right: 14px; max-width: calc(100% - 28px); gap: 14px; padding: 14px; }
    .booking-map-heading { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .booking-map-shell, .booking-page .hero-section.hero-map-mode::after { transition: none; } }

.hero-actions > .btn > :is(i,.hero-button-icon) { width: 20px; height: 20px; flex: 0 0 20px; font-size: 18px; line-height: 20px; text-align: center; }
.hero-actions > .btn > .hero-button-icon { width: 24px; height: 24px; flex-basis: 24px; }
.booking-page .hero-section.hero-map-mode:not(.hero-photo-mode) .hero-actions > .btn-outline { color: var(--sm-text, #fff); }

/* Map titles are placed by the provider at their venue; the second click opens details. */
.booking-map-venue-title { display:block; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:10px 14px; border:1px solid rgba(145,160,151,.35); border-radius:99px; font:500 12px/1.5 var(--spinmatch-font-family,sans-serif); color:var(--sm-text,#fff); background:var(--sm-sticky-surface,rgba(26,30,29,.88)); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); box-shadow:0 3px 14px rgba(0,0,0,.15); cursor:pointer; transition:background 180ms ease,box-shadow 180ms ease; }
.booking-map-venue-title:hover { box-shadow:0 4px 18px rgba(0,0,0,.25); }
.booking-map-results.booking-map-accessible-results { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.booking-map-results.booking-map-accessible-results:focus-within { width:auto; height:auto; clip-path:none; }
.booking-map-preview { bottom:28px; right:auto; width:360px; max-width:calc(100% - 48px); padding:0; display:block; max-height:calc(100% - var(--sm-navbar-bottom,96px) - 120px); overflow:auto; overscroll-behavior:contain; }
.booking-map-preview .booking-map-card-grid { width:100%; margin:0; min-height:0; position:relative; }
.booking-map-preview .booking-grid .booking-card.booking-card { position:relative; width:100%; margin:0; border-radius:16px; background-color:transparent; }
.booking-map-preview .booking-grid .booking-card .booking-description { -webkit-line-clamp:3; }
.booking-map-preview .booking-card:focus-visible { outline:2px solid #b8d4c3; outline-offset:-3px; }
@media(max-width:600px) { .booking-map-preview { left:14px; max-width:calc(100% - 28px); bottom:26px; } }

.booking-map-venue-stack { display:grid; justify-items:start; gap:5px; max-height:148px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:3px; }
.booking-map-card-loading { display:grid; gap:18px; padding:22px; min-height:160px; align-content:start; }
.booking-map-card-loading::after { content:''; height:60px; border-radius:10px; background:rgba(var(--sm-ink-rgb,255,255,255),.07); }
.booking-map-preview > button { display:grid; gap:8px; width:100%; padding:22px; text-align:left; text-decoration:none; white-space:normal; }

.hero-booking-photo-viewer .main-photo { touch-action:pan-y; }

.hero-booking-photo-viewer .photo-drag-neighbor { position:absolute; top:calc(50% - var(--hero-photo-image-height,100%) / 2); left:0; width:100%; height:var(--hero-photo-image-height,100%); object-fit:cover; object-position:center; pointer-events:none; border-radius:14px; }
.hero-booking-photo-viewer.is-dragging-photo .main-photo { cursor:grabbing!important; border-radius:14px; }
.hero-booking-photo-viewer .photo-thumbnail { transition:opacity .24s ease, transform .3s cubic-bezier(.22,.8,.2,1), box-shadow .24s ease; }
.hero-booking-photo-viewer .photo-thumbnail.active { box-shadow:none; transform:scale(1.07); filter:brightness(1.12); }
.hero-booking-photo-viewer .photo-thumbnail:hover { transform:translateY(-2px); opacity:1; }
.hero-booking-photo-viewer .photo-thumbnail.active:hover { transform:translateY(-2px) scale(1.07); }

@media(prefers-reduced-motion:reduce) { .hero-booking-photo-viewer .photo-thumbnail { transition:none; } }

/* Keep the returning hero controls above its dissolving bottom edge on every frame. */
.hero-section.hero-map-morph:not(.hero-photo-mode) > .container { position:relative; z-index:4; }
