/* ================================
   Surgical Cases Detail Page
   detail_new.html 专用样式（sc- 前缀）
   ================================ */

/* ---------- Surgical Case 详情横幅面包屑（与模板：div.page-header-banner.sc-page-banner）---------- */
.page-header-banner.sc-page-banner .breadcrumb a {
    color: #ffffff ;
}
.page-header-banner.sc-page-banner .breadcrumb a:hover {
    color: var(--text-link-hover);
}
.page-header-banner.sc-page-banner .breadcrumb .separator {
    color: #ffffff !important;
}
.page-header-banner.sc-page-banner .breadcrumb .current,
.page-header-banner.sc-page-banner .breadcrumb .breadcrumb-category {
    color: var(--text-link-hover);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

@media (max-width: 992px) {
    .page-header-banner.sc-page-banner .breadcrumb .current,
    .page-header-banner.sc-page-banner .breadcrumb .breadcrumb-category {
        font-size: 14px;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .page-header-banner.sc-page-banner .breadcrumb .current,
    .page-header-banner.sc-page-banner .breadcrumb .breadcrumb-category {
        font-size: 13px;
        max-width: 200px;
    }
}

@media (max-width: 576px) {
    .page-header-banner.sc-page-banner .breadcrumb .current,
    .page-header-banner.sc-page-banner .breadcrumb .breadcrumb-category {
        font-size: 11px;
        max-width: 150px;
    }
}

.page-header-banner.sc-page-banner .breadcrumb-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-top: 20px;
    z-index: 3;
}

/* ---------- Content Section ---------- */
.sc-content-section {
    padding-top: 40px;
}

.sc-content-layout {
    display: flex;
    gap: 80px;
    align-items: flex-start;
}

.sc-content-main {
    flex: 1;
    min-width: 0;
}

.sc-content-sidebar {
    flex: 0 0 25%;
    min-width: 240px;
    position: sticky;
    top: 220px;
    align-self: flex-start;
}

.sc-content-section p {
    font-size: 20px;
    line-height: 28px;
    font-weight: lighter;
}

.sc-content-section img {
    display: inline-block;
}

/* 富文本参考图：与症状页 condition-section-image-gallery 一致（方图、cover、无圆角）；≤4 张一行均分；>4 张轨道横向滚动 + 左右箭头 */
.sc-ref-figures-carousel {
    position: relative;
    margin: 1.5rem 0 0;
    width: 100%;
    max-width: 100%;
}

.sc-ref-figures-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    min-height: 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.sc-ref-figures-track::-webkit-scrollbar {
    display: none;
}

/* ≤4 张：不滚动、均分整行 */
.sc-ref-figures-carousel:not(.sc-ref-figures-carousel--scroll) .sc-ref-figures-track {
    overflow-x: hidden;
    justify-content: space-between;
}

.sc-ref-figures-carousel:not(.sc-ref-figures-carousel--scroll) .sc-ref-figure-item {
    flex: 1 1 0;
    min-width: 0;
}

/* >4 张：与 .sc-photo-item 同宽，可滑动 */
.sc-ref-figures-carousel--scroll {
    padding: 0 48px;
}

.sc-ref-figures-carousel--scroll .sc-ref-figures-track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.sc-ref-figures-carousel--scroll .sc-ref-figure-item {
    flex: 0 0 calc(40% - 8px);
    min-width: calc(40% - 8px);
    max-width: calc(40% - 8px);
    scroll-snap-align: start;
}

/* 参考图容器：对齐 .condition-gallery-image-wrap（1:1、浅灰底、直角、无描边阴影） */
.sc-ref-figure-item {
    box-sizing: border-box;
}

.sc-ref-figure {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background-color: #f0f0f0;
    cursor: default;
}

.sc-ref-figure-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    box-shadow: none;
    background: transparent;
    vertical-align: middle;
}

.sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent-purple, #6f0b65);
}

.sc-content-section p:last-of-type {
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .sc-ref-figures-carousel--scroll {
        padding: 0 36px;
    }

    .sc-ref-figures-carousel--scroll .sc-ref-figure-item {
        flex: 0 0 min(calc(85% - 10px), 400px);
        min-width: min(calc(85% - 10px), 400px);
        max-width: min(calc(85% - 10px), 400px);
    }

    .sc-content-section .container,
    .sc-nav-section .container,
    .sc-articles-section .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

@media (max-width: 991px) {
    .sc-content-layout {
        flex-direction: column;
    }
    .sc-content-sidebar {
        display: none;
    }
}

/* ---------- Case Navigation (Prev/Next) ---------- */
.sc-nav-wrapper {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 904px;
}

.sc-nav-item {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    height: 96px;
    padding: 0;
    transition: opacity 0.3s ease;
    gap:12px;
}

.sc-nav-item:hover {
    background-color: #ffffff;
}

.sc-nav-item:hover .sc-nav-arrow {
    color: var(--accent-purple);
}

.sc-nav-item:hover .sc-nav-title {
    color: var(--accent-purple);
}

.sc-nav-item--prev {
    width: 320px;
}

.sc-nav-item--next {
    width: 320px;
}

.sc-nav-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #2A2A2A;
    flex-shrink: 0;
}

.sc-nav-arrow svg {
    width: 32px;
    height: 32px;
    stroke-width: 1;
}

.sc-nav-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.sc-nav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-nav-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 200px;
}

.sc-nav-label {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    line-height: 24px;
    color: #2A2A2A;
    opacity: 0.5;
}

.sc-nav-title {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #2A2A2A;
    font-weight: normal;
    margin: 0;
}

.sc-nav-item--disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.45;
}

.sc-nav-item--disabled .sc-nav-arrow {
    color: #b0b0b0;
}

.sc-nav-item--disabled .sc-nav-label,
.sc-nav-item--disabled .sc-nav-title {
    color: #b0b0b0;
    opacity: 1;
}

.sc-nav-item--disabled:hover {
    background-color: #ffffff;
}

.sc-nav-item--disabled:hover .sc-nav-arrow,
.sc-nav-item--disabled:hover .sc-nav-title {
    color: #b0b0b0;
}

.sc-nav-thumb--placeholder {
    background: #e8e8e8;
}

/* ---------- Section Title & Content ---------- */
.sc-section-title {
    font-size: 40px;
    line-height: 56px;
    font-weight: 700;
    color: #6F0B65;
    margin-bottom: 24px;
}

.sc-section-content {
    /* 内容区基础 */
}
.sc-section-content a {
    color: var(--text-link);
    text-decoration: underline;
   
}
.sc-section-content a:hover {
    color: var(--accent-purple-dark);
    text-decoration: underline;
}

/* ---------- Related Photos Carousel ---------- */
.sc-photos-carousel {
    position: relative;
    margin-top: 24px;
}

.sc-photos-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    width: 100%;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sc-photos-track::-webkit-scrollbar {
    display: none;
}

.sc-photo-item {
    flex: 0 0 calc(40% - 10px);
    min-width: calc(40% - 10px);
    width: calc(40% - 10px);
}

.sc-photo-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 400 / 267;
    overflow: hidden;
    cursor: pointer;
    background-color: #000;
    transition: transform 0.3s;
}

.sc-photo-wrapper:hover {
    transform: scale(1.02);
}

.sc-photo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.4s ease;
    opacity: 1;
}

/* 注释层样式见 condition.css 中 .icw-image-caption-overlay 共用选择器（含 .sc-photo-label） */
.sc-photo-wrapper::before {
    display: none;
}

.sc-photos-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 128px;
    height: 128px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.sc-photos-nav svg {
    width: 64px;
    height: 64px;
    display: block;
    transition: stroke 0.3s ease;
}

.sc-photos-nav:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sc-photos-nav:hover svg {
    stroke: var(--accent-purple);
}

.sc-photos-nav.prev {
    left: -128px;
}

.sc-photos-nav.next {
    right: -128px;
}

/* 富文本参考图：箭头不伸出容器外，覆盖上方负 left/right */
.sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

.sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav.prev {
    left: 4px !important;
    right: auto !important;
}

.sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav.next {
    right: 4px !important;
    left: auto !important;
}

@media (max-width: 1200px) {
    .sc-photos-nav {
        width: 80px;
        height: 80px;
    }
    .sc-photos-nav.prev {
        left: -80px;
    }
    .sc-photos-nav.next {
        right: -80px;
    }
    .sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav.prev {
        left: 4px !important;
    }
    .sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav.next {
        right: 4px !important;
    }
}

@media (max-width: 991px) {
    /* 仅「相关照片」轮播在窄屏隐藏侧栏箭头；参考图 >4 张仍显示箭头并依赖轨道滑动 */
    .sc-photos-carousel > .sc-photos-nav {
        display: none;
    }
    .sc-photos-track {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .sc-photo-item {
        scroll-snap-align: start;
    }
    .sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav {
        display: flex;
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    .sc-ref-figures-carousel--scroll .sc-photos-nav.sc-ref-figures-nav svg {
        width: 22px;
        height: 22px;
    }
    .sc-ref-figures-carousel--scroll .sc-ref-figures-track {
        scroll-snap-type: x mandatory;
    }
}


/* ---------- Image Lightbox ---------- */
.sc-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
}

.sc-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.sc-lightbox-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    z-index: 3;
}

.sc-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.sc-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    z-index: 3;
}

.sc-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.sc-lightbox-prev {
    left: -70px;
}

.sc-lightbox-next {
    right: -70px;
}

.sc-lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sc-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.sc-lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    max-width: 80%;
}

@media (max-width: 768px) {
    .sc-lightbox-prev {
        left: 10px;
    }
    .sc-lightbox-next {
        right: 10px;
    }
    .sc-lightbox-close {
        top: 10px;
        right: 10px;
    }
    .sc-lightbox-image {
        max-height: 75vh;
    }
}

/* ---------- Sidebar ---------- */
.sc-sidebar {
    margin-top: 200px;
}

.sc-sidebar-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-green);
    border: none;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 0 !important;
    margin-bottom: 12px;
}

.sc-sidebar-btn:hover {
    background-color: var(--primary-green) !important;
    color: #CBFFB5 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ---------- Other Cases Section ---------- */
.sc-other-section {
    padding: 60px 0;
    background-color: #E8E6E6;
}

.sc-other-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.sc-other-header .sc-section-title {
    margin-bottom: 0;
}

.sc-other-carousel {
    position: relative;
}

.sc-other-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 128px;
    height: 128px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border-radius: 0;
    box-shadow: none;
}

.sc-other-nav.prev {
    left: -128px;
}

.sc-other-nav.next {
    right: -128px;
}

.sc-other-nav:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sc-other-nav:hover svg {
    stroke: var(--accent-purple);
}

.sc-other-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 33px;
}

.sc-other-card {
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.sc-other-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sc-other-card:hover .sc-other-card-title a {
    color: var(--accent-purple);
}

.sc-other-card-img {
    overflow: hidden;
    width: 100%;
    height: 200px;
}

.sc-other-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sc-other-card-img-placeholder {
    width: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.sc-other-card-body {
    padding: 16px;
}

.sc-other-card-type {
    color: var(--accent-purple);
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.sc-other-card-title {
    font-size: 16px;
    margin-top: 8px;
    font-weight: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: 3em;
}

.sc-other-card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

@media (max-width: 1200px) {
    .sc-other-nav {
        width: 80px;
        height: 80px;
    }
    .sc-other-nav.prev {
        left: -80px;
    }
    .sc-other-nav.next {
        right: -80px;
    }
}

@media (max-width: 991px) {
    .sc-other-nav {
        display: none;
    }
    .sc-other-grid {
        display: flex;
        overflow-x: auto;
        gap: 20px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .sc-other-grid::-webkit-scrollbar {
        display: none;
    }
    .sc-other-card {
        flex: 0 0 clamp(240px, 75vw, 320px);
        scroll-snap-align: start;
    }
}

@media (max-width: 992px) {
    .sc-other-section {
        padding: 40px 0;
    }
}

@media (max-width: 768px) {
    .sc-other-section {
        padding: 32px 0;
    }
}

@media (max-width: 576px) {
    .sc-other-section {
        padding: 24px 0;
    }
}

/* ---------- Related Articles Section ---------- */
.sc-articles-section {
    /* background-color: #E8E6E6; */
    padding: 60px 0;
}

.sc-articles-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.sc-articles-header .sc-section-title {
    font-size: 40px;
    line-height: 56px;
    font-weight: 700;
    color: #6F0B65;
    margin: 0;
}

.sc-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.sc-article-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.sc-article-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sc-article-card-img {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.sc-article-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-article-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sc-article-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 10px;
    align-self: flex-start;
    border-radius: 0;
    background: rgba(111, 11, 101, 0.5);
    color: #6F0B65;
}

.sc-article-tag.news {
    background: #00423573;
    color: #004235;
}

.sc-article-title {
    font-size: 20px;
    font-weight: lighter;
    color: #2A2A2A;
    line-height: 28px;
    margin: 0;
    transition: color 0.25s;
    font-family: 'Lato';
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-article-title a {
    color: var(--text-primary);
    text-decoration: none;
}

@media (max-width: 991px) {
    .sc-articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sc-articles-section {
        padding: 40px 0;
    }
}

@media (max-width: 768px) {
    .sc-articles-section {
        padding: 32px 0;
    }

    /* 相关文章统一为横向滑动卡片 */
    .sc-articles-grid {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sc-articles-grid::-webkit-scrollbar {
        display: none;
    }

    .sc-article-card {
        flex: 0 0 clamp(240px, 78vw, 320px);
        scroll-snap-align: start;
    }

    /* 上一篇/下一篇精简：仅保留箭头+Previous/Next */
    .sc-nav-item {
        height: 56px;
        width: auto;
        min-width: 128px;
        gap: 6px;
        padding: 0 4px;
    }

    .sc-nav-item--disabled {
        height: auto;
        min-height: 56px;
        padding: 8px 4px;
        align-items: center;
    }

    .sc-nav-thumb,
    .sc-nav-title {
        display: none !important;
    }

    /* 无上一篇/下一篇时仍显示灰色「No Case」文案 */
    .sc-nav-item--disabled .sc-nav-title {
        display: block !important;
        font-size: 12px;
        line-height: 1.25;
        margin-top: 2px;
    }

    .sc-nav-info {
        width: auto;
        justify-content: center;
    }

    .sc-nav-item--disabled .sc-nav-info {
        align-items: flex-start;
    }

    .sc-nav-label {
        font-size: 14px;
        line-height: 1;
        opacity: 1;
        white-space: nowrap;
    }

    .sc-nav-arrow {
        width: 24px;
        height: 24px;
    }

    .sc-nav-arrow svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 576px) {
    .sc-articles-section {
        padding: 24px 0;
    }
}
