/**
 * Center of Thoracic Surgery (thoracoscopy.ru) - Doctors Module Stylesheet
 * Strict adherence to site design tokens, Figtree typography & responsiveness
 */

/* ==========================================================================
   Lucide Icon Helpers
   ========================================================================== */
.lucide-xs { width: 14px !important; height: 14px !important; vertical-align: -2px; }
.lucide-sm { width: 18px !important; height: 18px !important; vertical-align: -3px; }
.lucide-lg { width: 28px !important; height: 28px !important; }

/* ==========================================================================
   Page Hero Banner (Standard across thoracoscopy.ru)
   ========================================================================== */
.page-hero {
    background: linear-gradient(135deg, var(--pd, #083344) 0%, #0e7490 50%, #155e75 100%);
    padding: 120px 0 56px;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.page-hero-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    flex-wrap: wrap;
}

.page-hero-breadcrumbs a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.page-hero-breadcrumbs a:hover {
    color: #ffffff;
}

.page-hero-breadcrumbs span {
    color: #ffffff;
    font-weight: 500;
}

.page-hero .tag {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    margin-bottom: 20px;
}

.page-hero .tag-dot {
    background: var(--gl, #22d3ee);
}

.page-hero-title {
    font-family: 'Figtree', sans-serif;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
    max-width: 860px;
}

.page-hero-subtitle {
    margin-top: 14px;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.88);
    max-width: 820px;
    line-height: 1.6;
}

/* ==========================================================================
   Page Layout Grid & Typography (Matches page.php)
   ========================================================================== */
.page-content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 56px;
    align-items: start;
    width: 100%;
}

@media (max-width: 1024px) {
    .page-content-wrapper {
        grid-template-columns: 1fr;
    }
}

.page-content {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    font-size: 17px;
    line-height: 1.85;
    color: var(--txl, #475569);
    overflow: hidden;
}

.page-content p {
    margin-bottom: 24px;
}

.page-content h1, .page-content h2 {
    font-family: 'Figtree', sans-serif;
    font-size: clamp(22px, 2.8vw, 30px);
    font-weight: 700;
    color: var(--tx, #0f172a);
    margin: 44px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--c, #f1f5f9);
    letter-spacing: -0.02em;
}

.page-content h3 {
    font-family: 'Figtree', sans-serif;
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 600;
    color: var(--p, #0891b2);
    margin: 36px 0 16px;
}

.page-content ul, .page-content ol {
    margin: 24px 0;
    padding: 0;
    list-style: none;
}

.page-content ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 17px;
    color: var(--txl, #475569);
    line-height: 1.7;
}

.page-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--p, #0891b2), var(--g, #06b6d4));
    border-radius: 50%;
}

.page-content strong, .page-content b {
    color: var(--tx, #0f172a);
    font-weight: 600;
}

/* ==========================================================================
   E-E-A-T Medical Badge
   ========================================================================== */
.eeat-medical-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.06), rgba(14, 116, 144, 0.03));
    border: 1px solid rgba(8, 145, 178, 0.18);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 32px;
}

.eeat-author-img {
    width: 44px;
    height: 44px;
    background: var(--c, #f1f5f9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.eeat-author-info {
    font-size: 14px;
    line-height: 1.45;
}

.eeat-author-name {
    color: var(--tx, #0f172a);
    font-weight: 500;
}

.eeat-author-name strong {
    color: var(--p, #0891b2);
    font-weight: 700;
}

.eeat-author-title {
    color: var(--txl, #475569);
    font-size: 13px;
    margin-top: 2px;
}

.eeat-meta-date {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   Doctor Profile Specific Elements
   ========================================================================== */
.doctor-spec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 32px;
}

.doctor-spec-badge {
    background: rgba(8, 145, 178, 0.08);
    color: var(--pd, #0e7490);
    border: 1px solid rgba(8, 145, 178, 0.22);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
}

.doctor-section-text {
    margin-bottom: 32px;
}

.doctor-section-text p {
    margin-bottom: 16px;
}

/* ==========================================================================
   Certificates Swipe Carousel & Lightbox
   ========================================================================== */
.doctor-certs-section {
    margin: 40px 0 48px;
    padding-top: 12px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
}

.doctor-certs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--c, #f1f5f9);
}

.doctor-certs-header h2 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.doctor-certs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.certs-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--tx, #0f172a);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.certs-nav-btn:hover {
    background: var(--p, #0891b2);
    border-color: var(--p, #0891b2);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

.doctor-certs-carousel-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 10px 4px 16px;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(8, 145, 178, 0.3) transparent;
    cursor: grab;
    user-select: none;
    box-sizing: border-box;
}

.doctor-certs-carousel-container.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.doctor-certs-carousel-container::-webkit-scrollbar {
    height: 6px;
}

.doctor-certs-carousel-container::-webkit-scrollbar-thumb {
    background: rgba(8, 145, 178, 0.25);
    border-radius: 6px;
}

.doctor-certs-track {
    display: flex;
    gap: 18px;
    width: max-content;
}

.doctor-cert-slide {
    flex: 0 0 175px;
    scroll-snap-align: start;
    cursor: pointer;
}

.doctor-cert-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    aspect-ratio: 1 / 1.414;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.doctor-cert-card:hover {
    transform: translateY(-4px);
    border-color: rgba(8, 145, 178, 0.4);
    box-shadow: 0 12px 28px rgba(8, 145, 178, 0.16);
}

.doctor-cert-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.doctor-cert-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 51, 68, 0.75) 0%, rgba(8, 51, 68, 0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 14px;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.doctor-cert-card:hover .doctor-cert-overlay {
    opacity: 1;
}

.cert-zoom-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--p, #0891b2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cert-click-hint {
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.doctor-certs-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #64748b;
    margin-top: 8px;
}

/* Lightbox Modal */
.cert-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cert-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.cert-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cert-lightbox-dialog {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 80px;
    box-sizing: border-box;
}

.cert-lightbox-stage {
    max-width: min(85vw, 900px);
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-lightbox-image {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: #ffffff;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cert-lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10;
}

.cert-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cert-lightbox-counter {
    position: absolute;
    top: 28px;
    left: 28px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
}

.cert-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.cert-lightbox-arrow:hover {
    background: var(--p, #0891b2);
    border-color: var(--p, #0891b2);
    transform: translateY(-50%) scale(1.08);
}

.cert-lightbox-prev {
    left: 24px;
}

.cert-lightbox-next {
    right: 24px;
}

/* ==========================================================================
   RKN Consent Block Styles (Strictly Responsive & Clean)
   ========================================================================== */
.rkn-consent-block {
    margin: 14px 0 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-sizing: border-box;
}

.rkn-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.rkn-consent-checkbox {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    accent-color: var(--p, #0891b2);
    cursor: pointer;
    flex-shrink: 0;
}

.rkn-consent-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--txl, #64748b);
}

.rkn-consent-text a {
    color: var(--p, #0891b2);
    text-decoration: underline;
    font-weight: 500;
}

.rkn-disabled-btn {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   Doctor Sidebar & Action Card
   ========================================================================== */
.page-sidebar-box {
    position: sticky;
    top: 96px;
}

.page-action-card {
    background: #ffffff;
    border: 1px solid rgba(8, 145, 178, 0.2);
    border-radius: 24px;
    padding: 32px 28px;
    box-shadow: 0 10px 40px rgba(8, 145, 178, 0.08);
}

.doctor-sidebar-card {
    padding: 24px;
    text-align: left;
}

.doctor-card-avatar {
    border-radius: 18px;
    overflow: hidden;
    height: 340px;
    background: #f1f5f9;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.doctor-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.doctor-card-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0d9488;
    background: #f0fdfa;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.doctor-card-status .status-dot {
    width: 8px;
    height: 8px;
    background: #0d9488;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.doctor-card-title {
    font-family: 'Figtree', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: var(--tx, #0f172a);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.doctor-card-clinic {
    font-size: 13.5px;
    color: var(--txl, #475569);
    margin: 0 0 18px 0;
    line-height: 1.5;
}

.doctor-card-meta {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doctor-card-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.doctor-card-meta-row span {
    color: #64748b;
}

.doctor-card-meta-row strong {
    color: var(--tx, #0f172a);
    font-weight: 600;
}

.doctor-btn-phone {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.doctor-btn-whatsapp {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
    background: #25d366 !important;
    border-color: #25d366 !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.doctor-btn-whatsapp:hover {
    background: #1eb857 !important;
    border-color: #1eb857 !important;
}

/* ==========================================================================
   Doctors Grid & Cards (Block & Archive)
   ========================================================================== */
.doctors-section {
    position: relative;
    background: #f8fafc;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 88px 0;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 380px));
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
}

.doc-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(8, 145, 178, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doc-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(8, 145, 178, 0.12);
}

.doc-card-photo-wrap {
    position: relative;
    width: 100%;
    height: 320px;
    background: #f1f5f9;
    overflow: hidden;
}

.doc-card-img-link {
    display: block;
    width: 100%;
    height: 100%;
}

.doc-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.4s ease;
    display: block;
}

.doc-card:hover .doc-card-img {
    transform: scale(1.04);
}

.doc-card-photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.55) 0%, transparent 60%);
    pointer-events: none;
}

.doc-card-badges {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 2;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

.doc-badge-exp {
    background: var(--p, #0891b2);
    color: #ffffff;
}

.doc-badge-degree {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
}

.doc-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.doc-card-name {
    font-family: 'Figtree', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px 0;
    color: var(--tx, #0f172a);
}

.doc-card-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.doc-card-name a:hover {
    color: var(--p, #0891b2);
}

.doc-card-pos {
    font-size: 13.5px;
    line-height: 1.5;
    color: #475569;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.doc-tag {
    font-size: 11.5px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid rgba(8, 145, 178, 0.15);
}

.doc-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.btn-doc-more {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 12px;
    text-align: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-doc-more:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-doc-book {
    background: var(--p, #0891b2);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 12px;
    text-align: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-doc-book:hover {
    background: var(--pd, #155e75);
}

.doctors-bottom-cta {
    text-align: center;
    margin-top: 48px;
}

.btn-all-doctors {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    color: var(--p, #0891b2);
    border: 1px solid rgba(8, 145, 178, 0.3);
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.08);
    transition: all 0.3s ease;
}

.btn-all-doctors:hover {
    background: var(--p, #0891b2);
    color: #ffffff;
    border-color: var(--p, #0891b2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.22);
}

/* ==========================================================================
   Mobile & Responsive Tweaks
   ========================================================================== */
@media (max-width: 768px) {
    .page-hero {
        padding: 100px 0 36px;
    }
    .page-content-wrapper {
        gap: 36px;
    }
    .doctors-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 32px;
    }
    .doc-card-photo-wrap {
        height: 280px;
    }
    .doctor-card-avatar {
        height: 280px;
    }
    .doctor-sidebar-card {
        padding: 20px 16px;
    }
    .doctor-cert-slide {
        flex: 0 0 145px;
    }
    .cert-lightbox-dialog {
        padding: 40px 16px;
    }
    .cert-lightbox-arrow {
        width: 40px;
        height: 40px;
    }
    .cert-lightbox-prev {
        left: 8px;
    }
    .cert-lightbox-next {
        right: 8px;
    }
    .cert-lightbox-close {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
    }
    .cert-lightbox-counter {
        top: 16px;
        left: 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .doctor-cert-slide {
        flex: 0 0 135px;
    }
    .doc-card-actions {
        grid-template-columns: 1fr;
    }
}
