/*
 * SPECIALITY PAGE STYLES
 * Contains: Overview Grid, Deep-Dive Sections, Filter Logic, Speciality Cards
 */

/* =========================================
   1. SPECIALITY OVERVIEW SECTION
   ========================================= */
.speciality-overview-section {
    background: var(--secondary-bg);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.speciality-overview-section::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 87, 87, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

/* Filter Controls */
.speciality-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

/* Speciality Grid */
.speciality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* =========================================
   MOBILE SLIDER (Horizontal Scroll Snap)
   ========================================= */

/* Swipe hint label — only on mobile */
.swipe-hint {
    display: none;
}

@keyframes swipeAnim {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(6px);
    }
}

/* Speciality Card */
.spec-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spec-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--accent-color), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
}

.spec-card:hover {
    background: rgba(255, 87, 87, 0.04);
    border-color: rgba(255, 87, 87, 0.3);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(255, 87, 87, 0.1);
}

.spec-card:hover::before {
    opacity: 1;
}

.spec-card-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 87, 87, 0.08);
    border: 1px solid rgba(255, 87, 87, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--accent-color);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.spec-card:hover .spec-card-icon {
    background: rgba(255, 87, 87, 0.15);
    box-shadow: 0 0 20px rgba(255, 87, 87, 0.2);
    transform: scale(1.1);
}

.spec-card-body {
    flex: 1;
}

.spec-card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    background: rgba(255, 87, 87, 0.08);
    border: 1px solid rgba(255, 87, 87, 0.15);
    padding: 4px 10px;
    border-radius: 50px;
    margin-bottom: 10px;
}

.spec-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}

.spec-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.spec-card-source {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
}

.source-tag i {
    font-size: 0.65rem;
    color: var(--accent-color);
}

/* Filter Hide Animation */
.spec-card.hidden {
    display: none;
}

/* =========================================
   2. DEEP-DIVE SPECIALITY SECTIONS
   ========================================= */
.deepdive-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.deepdive-section:nth-child(odd) {
    background: var(--primary-bg);
}

.deepdive-section:nth-child(even) {
    background: var(--secondary-bg);
}

.deepdive-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
}

/* Deep Dive Layout */
.deepdive-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 60px;
    align-items: start;
}

.deepdive-sidebar {
    position: sticky;
    top: 100px;
}

.deepdive-number {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 12px;
    display: block;
}

.deepdive-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: left;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.deepdive-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.deepdive-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.deepdive-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.deepdive-stat-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 20px 24px;
    margin-top: 8px;
}

.deepdive-stat {
    flex: 1;
    min-width: 80px;
    text-align: left;
    position: relative;
    padding: 0 16px 0 0;
    transition: var(--transition-fast);
}

/* Divider between stats */
.deepdive-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 70%;
    background: rgba(255, 255, 255, 0.08);
}

.deepdive-stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-color);
    line-height: 1;
    display: block;
    letter-spacing: -1px;
    transition: var(--transition-fast);
    text-shadow: 0 0 20px rgba(255, 87, 87, 0);
}

.deepdive-stat:hover .deepdive-stat-value {
    text-shadow: 0 0 20px rgba(255, 87, 87, 0.5);
}

.deepdive-stat-label {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

/* Right Content: How I Learned Cards */
.deepdive-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* =========================================
   LEARN CARDS MOBILE SLIDER
   ========================================= */

.learn-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.learn-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: var(--transition-smooth);
}

.learn-card:hover {
    border-color: rgba(255, 87, 87, 0.2);
    background: rgba(255, 87, 87, 0.02);
    transform: translateX(6px);
}

.learn-card:hover::before {
    opacity: 1;
}

.learn-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.learn-card-icon-wrap {
    width: 44px;
    height: 44px;
    background: rgba(255, 87, 87, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.learn-card-meta {
    flex: 1;
}

.learn-card-type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 4px;
    display: block;
}

.learn-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}

.learn-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.learn-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.learn-card-link:hover {
    gap: 10px;
    color: #ff6b6b;
}

.learn-card-link i {
    font-size: 0.75rem;
}

/* =========================================
   3. SPECIALITY HERO ACCENT OVERRIDES
   ========================================= */
.speciality-hero-accent {
    position: relative;
}

/* =========================================
   4. CALL TO ACTION SECTION (Bottom)
   ========================================= */
.speciality-cta-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a0a 50%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.speciality-cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 87, 87, 0.06) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.speciality-cta-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.speciality-cta-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    background: rgba(255, 87, 87, 0.1);
    border: 1px solid rgba(255, 87, 87, 0.2);
    padding: 8px 16px;
    border-radius: 50px;
    margin-bottom: 24px;
}

.speciality-cta-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 20px;
}

.speciality-cta-title span {
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.speciality-cta-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 40px;
    line-height: 1.7;
}

.speciality-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================
   5. RESPONSIVE ADJUSTMENTS
   ========================================= */

@media (max-width: 768px) {

    /* ── Section padding ─────────────────────── */
    .speciality-overview-section,
    .deepdive-section { padding: 60px 0; }

    /* Remove overflow:hidden so sliders & stat row aren't clipped */
    .deepdive-section { overflow: visible; }

    /* ── Filter row → horizontal scroll strip ── */
    .speciality-filter-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 0 16px 8px;
        margin-bottom: 32px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    .speciality-filter-row::-webkit-scrollbar { display: none; }

    .speciality-filter-row .filter-btn {
        flex-shrink: 0;
        scroll-snap-align: start;
        white-space: nowrap;
        padding: 9px 20px;
        border-radius: 30px;
        font-size: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .speciality-filter-row .filter-btn.active {
        border-color: transparent;
    }

    /* ── Spec-card grid → horizontal snap slider ── */
    .speciality-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding: 0 16px 16px;
        margin: 0 -16px; /* bleed to viewport edge */
        align-items: stretch;
    }
    .speciality-grid::-webkit-scrollbar { display: none; }

    .spec-card {
        flex: 0 0 82vw;
        max-width: 320px;
        scroll-snap-align: center;
        margin: 0 8px;
    }
    .spec-card:first-child { margin-left: calc(9vw - 8px); }
    .spec-card:last-child  { margin-right: calc(9vw - 8px); }

    /* ── Deepdive layout → single column stack ── */
    .deepdive-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Sidebar: un-sticky on mobile */
    .deepdive-sidebar {
        position: static;
        top: auto;
    }

    /* ── Stat row → vertical stack on mobile ── */
    .deepdive-stat-row {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 16px;
        padding: 20px;
    }

    .deepdive-stat {
        padding: 0;
        min-width: unset;
    }
    /* Remove all dividers when stacked vertically */
    .deepdive-stat::after { display: none; }

    /* ── Learn cards → horizontal snap slider ── */
    .deepdive-content {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding: 0 16px 16px;
        margin: 0 -16px;
        align-items: stretch;
    }
    .deepdive-content::-webkit-scrollbar { display: none; }

    .learn-card {
        flex: 0 0 82vw;
        max-width: 340px;
        scroll-snap-align: center;
        margin: 0 8px;
        /* Disable hover slide-in on mobile */
        transform: none !important;
    }
    .learn-card:first-child { margin-left: calc(9vw - 8px); }
    .learn-card:last-child  { margin-right: calc(9vw - 8px); }

    /* ── Swipe hint → show on mobile ── */
    .swipe-hint {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.75rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.35);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 0 0 12px 16px;
        animation: swipeAnim 1.4s ease-in-out infinite;
    }

    /* ── Deepdive tags → single-row scroll ── */
    .deepdive-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 4px;
        -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
        mask-image: linear-gradient(to right, black 80%, transparent 100%);
    }
    .deepdive-tags::-webkit-scrollbar { display: none; }
    .deepdive-tag { flex-shrink: 0; }

    /* ── CTA section ── */
    .speciality-cta-section { padding: 60px 0; }
    .speciality-cta-title { font-size: clamp(2rem, 8vw, 3rem); }
    .speciality-cta-buttons { flex-direction: column; align-items: center; }
}
