/* Procedures Page Styles */

/* Content Layout - 使用 div 分配，替代 row/col */
.procedures-content-layout {
    display: flex;
    gap: 80px;
    align-items: flex-start;
}

.procedures-content-main {
    flex: 1;
    min-width: 0;
    /* padding-right: 70px; */
}

.procedures-content-sidebar {
    flex: 0 0 25%;
    min-width: 240px;
    position: sticky;
    top: 220px; /* 60 + 160px，距离顶部 header 菜单 */
    align-self: flex-start;
}

@media (max-width: 991px) {
    .procedures-content-layout {
        flex-direction: column;
    }

    .procedures-content-main {
        padding-right: 0;
    }

    .procedures-content-sidebar {
        flex: none;
        width: 100%;
        min-width: auto;
        position: static;
    }
}

/* Overrides to match condition.css and global styles */

.condition-content-section p {
    font-size: 20px;
    line-height: 28px;
    color: var(--text-secondary);
    text-align: left;
    font-weight: 300;
    color: #2A2A2A;
    font-size: 300;
}

/* Specific content styles for procedures page */

.procedures-technique-content {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 40px;
}

.procedures-technique-content p {
    flex: 1;
    margin-bottom: 0;
}

.procedures-technique-image {
    width: 405px;
    height: 270px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.procedures-indications {
    margin-bottom: 24px;
}

.procedures-indications .indication-item {
    /* margin-bottom: 16px; */
}

.procedures-indications .indication-main-link,
.procedures-indications .indication-main-title {
    color: var(--text-primary);
    text-decoration: underline;
    display: inline-block;
    font-size: 16px;
    line-height: 2;
    transition: color 0.3s;
    font-weight: 500;
}

.procedures-indications .indication-main-link:hover {
    color: var(--accent-purple);
}

.procedures-indications .indication-main-title {
    text-decoration: none;
    font-weight: 600;
}

.procedures-indications .indication-children {
    margin: 12px 0 0 0;
    padding-left: 1.5rem;
    list-style: none;
}

.procedures-indications .indication-children li {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 2;
}

.procedures-indications .indication-children li a {
    color: var(--text-primary);
    text-decoration: underline;
    transition: color 0.3s;
}

.procedures-indications .indication-children li a:hover {
    color: var(--accent-purple);
}

.procedures-indications .indication-group {
    margin-bottom: 24px;
}

.procedures-indications .indication-group:last-child {
    margin-bottom: 0;
}

.procedures-indications .indication-group-title {
    font-size: 24px;
    line-height: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    margin-top: 0;
    /* padding-bottom: 8px; */
    /* border-bottom: 2px solid var(--divider-light-01); */
}

.procedures-indications .indication-group:first-child .indication-group-title {
    margin-top: 0;
}

.procedures-indications .indication-group-items {
    display: flex;
    flex-direction: column;
    /* gap: 8px; */
}

.procedures-indications a,
.procedures-indications-list a {
    color: var(--text-primary);
    text-decoration: underline;
    display: block;
    font-size: 16px;
    line-height: 2;
    transition: color 0.3s;
}

.procedures-indications a:hover,
.procedures-indications-list a:hover {
    color: var(--accent-purple);
}

.procedures-indications-subtitle {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: left;
}

.procedures-indications-list {
    margin-bottom: 24px;
}

/* Sidebar Specific */
.procedures-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 40px;
}

.procedures-sidebar-btn {
    background-color: var(--primary-green);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 4px;
}

.procedures-sidebar-btn:hover {
    background-color: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Case Study Section - Horizontal Scroll */
.surgical-cases-section {
    padding: 60px 0;
    background-color: var(--bg-white);
}

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

.surgical-cases-section .section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-purple);
    margin: 0;
}

.surgical-cases-section .all-cases-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-purple);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}

.surgical-cases-section .all-cases-link:hover {
    color: var(--primary-green);
}

/* procedures 页面 Case Study 区域独立样式，防止与其他页面冲突 */
.procedures-case-study-section .case-study-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    /* gap: 24px; */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    width: 100%;
}

.procedures-case-study-section .case-study-grid::-webkit-scrollbar {
    display: none;
}

.procedures-case-study-section .case-study-grid .case-card {
    flex: 0 0 calc((100% ) / 3) !important;
    min-width: calc((100% ) / 3) !important;
    max-width: calc((100% ) / 3) !important;
    width: calc((100% ) / 3) !important;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    border-radius: 0;
    overflow: hidden;
    scroll-snap-align: start;
    flex-shrink: 0;
    background-color: transparent;
    border: none;
    padding: 16px;

}

.procedures-case-study-section .case-study-grid .case-card:hover {
    background-color: #ffffff;
    box-shadow: 0px 4px 16px 0px rgba(0,0,0,0.16);
    padding: 16px;
    transform: translateY(-8px);
}

/* 少于3项时隐藏箭头 */
.procedures-case-study-section .cases-carousel-wrapper:has(.case-study-grid .case-card:only-child) .gallery-nav,
.procedures-case-study-section .cases-carousel-wrapper:has(.case-study-grid .case-card:nth-child(2):last-child) .gallery-nav {
    display: none !important;
}

.procedures-case-study-section .case-study-grid .case-card:hover .case-title a {
    color: var(--accent-purple);
}

.procedures-case-study-section .case-study-grid .case-card:hover .card-img img {
    transform: scale(1.05);
        /* margin: 16px; */


}

.procedures-case-study-section .case-study-grid .case-card .card-img {
    overflow: hidden;
    width: 100%;
    height: 300px;
    background-color: transparent;
}

.procedures-case-study-section .case-study-grid .case-card .card-img img {
    background-color: transparent;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.procedures-case-study-section .case-study-grid .case-card .card-body {
    padding: 13px 16px 20px 16px;
}

.procedures-case-study-section .case-study-grid .case-card .case-type {
    color: var(--accent-purple);
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 12px;
    line-height: 20px;
}

.procedures-case-study-section .case-study-grid .case-card .case-title {
    font-size: 16px;
    font-weight: lighter;
    color: var(--text-primary);
    line-height: 28px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 3em;
}

.procedures-case-study-section .case-study-grid .case-card .case-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.procedures-case-study-section .case-study-grid .case-card:hover .case-title a {
    color: var(--accent-purple);
}

.procedures-case-study-section .cases-carousel-wrapper {
    position: relative;
}

.procedures-case-study-section .cases-carousel-wrapper .gallery-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;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.procedures-case-study-section .cases-carousel-wrapper .gallery-nav.prev {
    left: -128px;
}

.procedures-case-study-section .cases-carousel-wrapper .gallery-nav.next {
    right: -128px;
}

.procedures-case-study-section .cases-carousel-wrapper .gallery-nav:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.procedures-case-study-section .cases-carousel-wrapper .gallery-nav:hover svg {
    stroke: var(--accent-purple);
}

.procedures-case-study-section .cases-carousel-wrapper .gallery-nav svg {
    width: 64px;
    height: 64px;
    stroke: currentColor;
    transition: stroke 0.3s ease;
}

/* Related Articles Section */
.related-articles-section {
    padding: 60px 0;
    background-color: var(--bg-light-gray);
}

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

.related-articles-header .section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #6F0B65;
    margin: 0;
}

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

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

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

.article-card:hover .card-tag {
    background-color: #b2c6c2;
    color: #004235;
    animation: 1;
}

.article-card:hover .card-title {
    color: #6F0B65;
    animation: 1;
}


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

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

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

.card-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    align-self: flex-start;
    border-radius: 0;
    background: rgba(111, 11, 101, 0.5);
    color: #6F0B65;
}

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

.article-card .card-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;
}

.article-card .card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Responsive */
@media (max-width: 991px) {
    .procedures-technique-content {
        flex-direction: column;
    }

    .procedures-technique-image {
        width: 100%;
        height: auto;
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-nav {
        display: none;
    }
}

@media (max-width: 1200px) {
    .procedures-case-study-section .case-study-grid .case-card {
        flex: 0 0 calc((100% - 32px) / 2) !important;
        min-width: calc((100% - 32px) / 2) !important;
        max-width: calc((100% - 32px) / 2) !important;
        width: calc((100% - 32px) / 2) !important;
    }

    .procedures-case-study-section .cases-carousel-wrapper .gallery-nav {
        width: 64px;
        height: 64px;
    }

    .procedures-case-study-section .cases-carousel-wrapper .gallery-nav.prev {
        left: -64px;
    }

    .procedures-case-study-section .cases-carousel-wrapper .gallery-nav.next {
        right: -64px;
    }

    .procedures-case-study-section .cases-carousel-wrapper .gallery-nav svg {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 768px) {
    .procedures-case-study-section .case-study-grid .case-card {
        flex: 0 0 clamp(240px, 75vw, 320px);
        min-width: clamp(240px, 75vw, 320px);
        max-width: clamp(240px, 75vw, 320px);
    }

    .procedures-case-study-section .cases-carousel-wrapper .gallery-nav {
        display: none;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}