/**
 * Patient detail page (body.pgsa-single).
 * Depends on base.css and on the design tokens defined in cards.css.
 */

body.pgsa-single {
    background: var(--pgsa-bg);
    overflow-x: clip;
}

/* The gallery plugin's patient container is left empty: the layout is printed around it */
body.pgsa-single #pgsa-container { display: none; }

/* Hero */
.pgsa-hero--single { padding: 56px 0 48px; }
.pgsa-hero--single .pgsa-hero__inner { grid-template-columns: minmax(0, 1fr) auto; }
.pgsa-hero--single .pgsa-hero__title { font-size: clamp(30px, 3.5vw, 44px); }
.pgsa-hero__adjacent {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px 24px;
}
.pgsa-link--light { color: #fff; font-size: 11px; }
.pgsa-link--light:hover { color: rgba(255, 255, 255, .8); }

/* Pictures, sidebar and "About this result" */
.pgsa-single-main { padding: 56px 0 80px; }
.pgsa-single-main__inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    grid-template-areas:
        "pictures sidebar"
        "about    sidebar";
    grid-template-rows: auto 1fr;
    gap: 0 48px;
    align-items: start;
}
.pgsa-single-main__pictures { grid-area: pictures; }
.pgsa-single-main__sidebar { grid-area: sidebar; }
.pgsa-single-main__about { grid-area: about; }

body.pgsa-single--sticky .pgsa-single-main__sidebar {
    position: sticky;
    top: calc(24px + var(--wp-admin--admin-bar--height, 0px));
}

.pgsa-single-picture { margin: 0 0 24px; }
.pgsa-single-picture__media { position: relative; }
.pgsa-single-picture__media img { display: block; width: 100%; height: auto; }
.pgsa-single-picture__pair { display: flex; gap: 4px; }
.pgsa-single-picture__side { position: relative; flex: 1 1 0; min-width: 0; }
.pgsa-single-picture__side img { height: 100%; object-fit: cover; }
.pgsa-single-picture__label {
    position: absolute;
    bottom: 12px;
    z-index: 2;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #333;
    background: #fff;
    pointer-events: none;
}
.pgsa-single-picture__side--before .pgsa-single-picture__label { left: 12px; }
.pgsa-single-picture__side--after .pgsa-single-picture__label { right: 12px; }
.pgsa-single-picture__side:has(.photogallery_swappable_image) .pgsa-single-picture__label { filter: blur(4px); }
.pgsa-single-picture__caption {
    margin-top: 10px;
    font-size: 12px;
    color: var(--pgsa-muted);
}
.pgsa-single-main__disclaimer {
    margin: 0;
    font-size: 11px;
    color: var(--pgsa-muted);
}

.pgsa-single-main__about { max-width: 720px; padding-top: 40px; }
.pgsa-single-main__about-text { font-size: 15px; line-height: 1.7; color: var(--pgsa-text); }
.pgsa-single-main__about-text p:last-child { margin-bottom: 0; }

/* Sidebar */
.pgsa-single-sidebar {
    background: var(--pgsa-surface);
    padding: 36px 24px;
    font-size: 13px;
    color: var(--pgsa-text);
}
.pgsa-single-sidebar__block {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--pgsa-border);
}
.pgsa-single-sidebar .pgsa-eyebrow { margin-bottom: 8px; }
.pgsa-single-sidebar__rows { margin: 0; }
.pgsa-single-sidebar__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 0;
}
.pgsa-single-sidebar__row dt { color: var(--pgsa-muted); font-weight: 400; }
.pgsa-single-sidebar__row dd { margin: 0; text-align: right; }
.pgsa-single-sidebar__tags { display: flex; flex-wrap: wrap; gap: 8px; }

.pgsa-single-surgeon {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pgsa-single-surgeon + .pgsa-single-surgeon { margin-top: 16px; }
.pgsa-single-surgeon__photo {
    flex: 0 0 auto;
    width: 44px;
    height: 56px;
    object-fit: cover;
}
.pgsa-single-surgeon__name {
    margin: 0 0 4px;
    font-family: var(--pgsa-serif);
    font-size: 18px;
    line-height: 1.2;
}
.pgsa-single-sidebar .pgsa-link { font-size: 10px; }

.pgsa-single-location {
    font-style: normal;
    line-height: 1.7;
}
.pgsa-single-location + .pgsa-single-location { margin-top: 16px; }
.pgsa-single-location__phone { color: var(--pgsa-accent); text-decoration: none; }

.pgsa-single-sidebar__actions { display: flex; flex-direction: column; gap: 12px; }
.pgsa-single-sidebar__actions .pgsa-button { padding: 12px 16px; }
.pgsa-button--outline-dark { border-color: var(--pgsa-text); color: var(--pgsa-text); background: transparent; }

/* The last block keeps no divider when the buttons are turned off */
.pgsa-single-sidebar > .pgsa-single-sidebar__block:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

/* More results */
.pgsa-single-more { background: var(--pgsa-surface); }
.pgsa-single-more__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: 32px;
}
.pgsa-single-more .pgsa-section-title { margin-bottom: 0; }
.pgsa-single-more .pgsa-related__media { margin-bottom: 12px; }
.pgsa-single-more .pgsa-related__title { font-size: 18px; margin-bottom: 4px; }
.pgsa-single-more__procedure { margin: 0; font-size: 11px; color: var(--pgsa-muted); }

/*
 * More results carousel (more than 4 results).
 * Swiper's core rules, rewritten with the plugin's own class names (see assets/js/single-more.js)
 * instead of loading swiper-bundle.css, so other Swiper stylesheets (Elementor, themes) never apply.
 */
.pgsa-single-more__track {
    position: relative;
    z-index: 1;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pgsa-single-more__slides {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    height: 100%;
    box-sizing: content-box;
    transform: translate3d(0, 0, 0);
    transition-property: transform;
}
.pgsa-swiper-horizontal { touch-action: pan-y; }
.pgsa-single-more__slide {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    height: auto;
    transition-property: transform;
}
/* Before Swiper runs (or without JS): 4 / 2 / 1 columns, like the grid */
.pgsa-single-more__track:not(.pgsa-swiper-initialized) .pgsa-single-more__slides { gap: 24px; }
.pgsa-single-more__track:not(.pgsa-swiper-initialized) .pgsa-single-more__slide { width: calc((100% - 72px) / 4); }
.pgsa-swiper-slide-blank { visibility: hidden; }
.pgsa-swiper-notification {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1000;
    opacity: 0;
    pointer-events: none;
}

.pgsa-single-more__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}
.pgsa-single-more__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--pgsa-border);
    border-radius: 50%;
    background: var(--pgsa-surface);
    color: var(--pgsa-dark);
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.pgsa-single-more__arrow:hover,
.pgsa-single-more__arrow:focus-visible { border-color: var(--pgsa-accent); color: var(--pgsa-accent); }
.pgsa-single-more__arrow.pgsa-swiper-button-disabled { opacity: .35; cursor: default; pointer-events: none; }
.pgsa-single-more__pagination.pgsa-swiper-pagination-lock,
.pgsa-single-more__arrow.pgsa-swiper-button-lock { display: none; }
.pgsa-single-more__pagination {
    display: flex;
    gap: 8px;
}
.pgsa-single-more__pagination .pgsa-swiper-bullet {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pgsa-border);
}
.pgsa-single-more__pagination.pgsa-swiper-pagination-clickable .pgsa-swiper-bullet { cursor: pointer; }
.pgsa-single-more__pagination .pgsa-swiper-bullet-active { background: var(--pgsa-accent); }

/* CTA band without text */
.pgsa-single .pgsa-inspired .pgsa-section-title:not(:has(+ .pgsa-inspired__text)) { margin-bottom: 40px; }

/* Responsive */
@media (max-width: 1024px) {
    .pgsa-single-more__track:not(.pgsa-swiper-initialized) .pgsa-single-more__slide { width: calc((100% - 24px) / 2); }
}

@media (max-width: 900px) {
    .pgsa-hero--single { padding: 40px 0; }
    .pgsa-hero--single .pgsa-hero__inner { grid-template-columns: minmax(0, 1fr); }
    .pgsa-hero__adjacent { justify-content: space-between; }

    .pgsa-single-main { padding: 32px 0 56px; }
    .pgsa-single-main__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "pictures"
            "sidebar"
            "about";
        grid-template-rows: auto;
    }
    body.pgsa-single--sticky .pgsa-single-main__sidebar { position: static; }
    .pgsa-single-main__sidebar { margin-top: 24px; }
}

@media (max-width: 640px) {
    .pgsa-single-more__track:not(.pgsa-swiper-initialized) .pgsa-single-more__slide { width: 100%; }
    .pgsa-single-picture__label { bottom: 8px; padding: 2px 5px; font-size: 9px; }
    .pgsa-single-picture__side--before .pgsa-single-picture__label { left: 8px; }
    .pgsa-single-picture__side--after .pgsa-single-picture__label { right: 8px; }
}
