/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
@font-face {
    font-family: 'Barlow Condensed';
    src: url('../fonts/barlow-condensed/BarlowCondensed-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow Condensed';
    src: url('../fonts/barlow-condensed/BarlowCondensed-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    --sp-accent: #2a7de1;
    /* Saberproject Blue */
    --sp-bg-dark: #0a0a0a;
    --sp-bg-card: rgba(0, 0, 0, 0.4);
    --sp-text-main: #ededed;
    --sp-text-muted: #aaaaaa;
    --sp-border-color: #444;
    --sp-border: 1px solid var(--sp-border-color);
    --sp-radius: 8px;
    --sp-blur: blur(10px);
    --sp-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.sp-portfolio-body {
    margin: 0;
    padding: 0;
    background-color: var(--sp-bg-dark);
    color: var(--sp-text-main);
    font-family: 'Barlow Condensed', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Keep WP admin bar working but don't mess up our layout */
html {
    margin-top: 0 !important;
}

body.admin-bar {
    padding-top: 32px;
}

/* ==========================================================================
   Layout (Split Screen on Desktop)
   ========================================================================== */
.sp-portfolio-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 900px) {
    .sp-portfolio-container {
        flex-direction: row;
        flex-wrap: wrap;
        /* Allow footer to wrap below columns */
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* ==========================================================================
   Sidebar (Left / Top)
   ========================================================================== */
.sp-portfolio-sidebar,
.sp-sidebar-inner {
    display: contents;
}

.sp-sidebar-header {
    text-align: center;
    order: 1;
}

/* Avatar styling is handled below under "Avatar refinements consolidated" */


.sp-portfolio-content {
    order: 2;
}

/* Order helpers for display:contents mode */
.sp-order-last {
    order: 4;
}

.sp-order-footer {
    order: 5;
}

.sp-sidebar-sabers-section {
    order: 3;
    text-align: center;
}

.sp-sidebar-inner {
    width: 100%;
}

@media (min-width: 900px) {
    .sp-portfolio-sidebar {
        display: flex;
        flex-direction: column;
        width: 35%;
        border: none;
        background: transparent;
        padding: 60px 40px;
        order: unset;
    }

    .sp-sidebar-inner {
        display: block;
        /* Reset back to normal container */
        width: 100%;
        max-width: 400px;
        text-align: center;
        margin: 0 auto;
    }

    .sp-sidebar-header {
        background: transparent;
        padding: 0;
        border-bottom: none;
        order: unset;
    }

    .sp-portfolio-content {
        flex: 1;
        min-width: 0;
        order: unset;
    }

    .sp-order-last,
    .sp-order-footer {
        order: unset;
    }
}

/* Avatar refinements consolidated */
.sp-avatar-wrapper {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    border-radius: 50%;
    position: relative;
    /* Removed overflow:hidden to allow glow to show */
    box-shadow: 0 0 30px color-mix(in srgb, var(--sp-accent), transparent 30%);
}

.sp-avatar-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 3px solid var(--sp-accent);
    pointer-events: none;
    z-index: 2;
}

.sp-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.sp-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #444;
    border-radius: 50%;
}

/* Text elements */
.sp-name {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sp-nickname {
    display: block;
    font-size: 18px;
    color: var(--sp-accent);
    font-weight: 500;
}

.sp-role {
    color: var(--sp-text-muted);
    font-size: 16px;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sp-role i {
    margin-right: 5px;
    color: var(--sp-accent);
}

.sp-jedi-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
    top: -2px;
    fill: var(--sp-accent);
}

/* Buttons & Contact Info */
.sp-primary-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.sp-contact-info {
    margin-bottom: 30px;
    text-align: center;
}

.sp-contact-item {
    margin-bottom: 8px;
    color: var(--sp-text-muted);
    font-size: 15px;
}

.sp-contact-item i {
    color: var(--sp-accent);
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.sp-contact-item a {
    color: var(--sp-text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.sp-contact-item a:hover {
    color: var(--sp-accent);
}

.sp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: var(--sp-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    text-align: center;
    cursor: pointer;
    border: none;
    font-family: 'Barlow Condensed', sans-serif;
}

.sp-btn i {
    font-size: 14px;
}

.sp-btn-primary {
    background-color: var(--sp-accent);
    color: #fff;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--sp-accent), transparent 80%);
}

.sp-btn-primary:hover {
    background-color: color-mix(in srgb, var(--sp-accent), #000 10%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--sp-accent), transparent 70%);
}

.sp-btn-primary:active {
    background-color: color-mix(in srgb, var(--sp-accent), #000 20%);
    transform: translateY(1px);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--sp-accent), transparent 90%);
}

.sp-btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sp-text-main);
    border: 1px solid var(--sp-border-color);
    backdrop-filter: var(--sp-blur);
}

.sp-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #666;
    color: #fff;
}

.sp-btn-secondary:active {
    background-color: rgba(255, 255, 255, 0.02);
    transform: translateY(1px);
}

/* Socials */
.sp-social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.sp-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--sp-text-main);
    font-size: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid color-mix(in srgb, var(--sp-accent), transparent 60%);
}

.sp-social-icon:hover {
    background: var(--sp-accent);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 15px color-mix(in srgb, var(--sp-accent), transparent 60%);
}

.sp-social-icon.sp-homepage:hover {
    background: var(--sp-accent);
}

.sp-sp-logo {
    fill: var(--sp-accent);
    transition: fill 0.2s ease;
}

.sp-social-icon:hover .sp-sp-logo {
    fill: #fff;
}

.sp-social-icon.sp-homepage {
    border-color: var(--sp-accent);
    width: auto;
    padding: 0 20px;
    border-radius: 30px;
    gap: 12px;
}

.sp-homepage-text {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.sp-homepage-link-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.sp-back-link a {
    color: var(--sp-text-muted);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sp-back-link a:hover {
    opacity: 1;
    color: #fff;
}

/* ==========================================================================
   Main Content Right
   ========================================================================== */
.sp-portfolio-content {
    padding: 20px;
}

.sp-card {
    background-color: var(--sp-bg-card);
    border: var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 30px;
    box-shadow: var(--sp-shadow);
    backdrop-filter: var(--sp-blur);
    -webkit-backdrop-filter: var(--sp-blur);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.sp-section-title {
    margin-top: 0;
    color: #ffffff;
    font-size: 22px;
    border-bottom: 1px solid var(--sp-border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .sp-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .sp-section-title {
        font-size: 18px;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    @media (min-width: 900px) {
        .sp-portfolio-content {
            padding: 60px 40px;
        }
    }

    @media (min-width: 900px) {
        .sp-portfolio-content {
            padding: 60px 60px;
        }
    }

    /* Highlights List Styling */
    .sp-highlights-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .sp-highlights-list li {
        background: rgba(255, 255, 255, 0.05);
        padding: 12px 18px;
        border-radius: 6px;
        border-left: 3px solid var(--sp-accent);
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 15px;
        transition: all 0.2s ease;
    }

    .sp-highlights-list li:hover {
        background: rgba(255, 255, 255, 0.08);
        transform: translateX(5px);
    }

    .sp-highlights-list i {
        color: var(--sp-accent);
        font-size: 18px;
    }
}

/* Base Bio Text refined */
.sp-bio-text {
    color: var(--sp-text-main);
    font-size: 16px;
    line-height: 1.7;
    opacity: 0.9;
}

/* Videos */
.sp-video-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sp-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.sp-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Gallery */
.sp-gallery-slider-wrapper {
    position: relative;
    width: 100%;
}

.sp-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid var(--sp-border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 10;
}

.sp-gallery-arrow:hover {
    background: var(--sp-accent);
    transform: scale(1.1);
}

.sp-gallery-arrow-left {
    left: 10px;
}

.sp-gallery-arrow-right {
    right: 10px;
}

.sp-gallery-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 5px 15px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Hide scrollbar for a cleaner slider look */
.sp-gallery-grid::-webkit-scrollbar {
    display: none;
}

.sp-gallery-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sp-gallery-item {
    flex: 0 0 calc(65% - 15px);
    /* Slightly larger than half so next image is visible */
    scroll-snap-align: start;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #333;
}

@media (min-width: 900px) {
    .sp-gallery-arrow {
        display: none;
    }

    .sp-gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        overflow-x: visible;
        padding-bottom: 0;
    }

    .sp-gallery-item {
        flex: none;
        /* Reset flex */
    }
}

.sp-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sp-gallery-item img:hover {
    transform: scale(1.05);
}

/* Footer */
.sp-portfolio-footer {
    text-align: center;
    padding: 20px 0;
    color: var(--sp-text-muted);
    font-size: 13px;
    margin-top: 40px;
    width: 100%;
    /* Take full width */
}

/* ==========================================================================
   Lightsaber Section (Sidebar)
   ========================================================================== */
/* Spacing is now handled by the outer section on mobile */

.sp-section-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--sp-text-main);
    font-weight: 600;
}

.sp-sidebar-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--sp-text-main);
    margin-bottom: 20px;
}

.sp-sidebar-sabers-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.sp-sidebar-saber-item {
    flex: 1 1 40%;
    max-width: 45%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sp-sidebar-saber-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* Use the inline CSS variable for the custom glow */
    filter: drop-shadow(0 0 15px var(--saber-glow)) drop-shadow(0 0 5px var(--saber-glow));
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.sp-sidebar-saber-item img:hover {
    transform: scale(1.05) translateZ(0);
    filter: drop-shadow(0 0 25px var(--saber-glow)) drop-shadow(0 0 10px var(--saber-glow));
}

/* ==========================================================================
   Global Link Bubble
   ========================================================================== */
.sp-global-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sp-bubble-content {
    background: var(--sp-bg-card);
    backdrop-filter: var(--sp-blur);
    border: 1px solid var(--sp-accent);
    padding: 8px 15px 8px 8px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 20px color-mix(in srgb, var(--sp-accent), transparent 70%);
    max-width: 250px;
    transition: all 0.3s ease;
}

.sp-global-bubble img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--sp-accent);
}

.sp-bubble-title {
    color: var(--sp-text-main);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-global-bubble:hover {
    transform: scale(1.05) translateY(-5px);
}

.sp-global-bubble:hover .sp-bubble-content {
    background: rgba(42, 125, 225, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 30px color-mix(in srgb, var(--sp-accent), transparent 40%);
    border-color: #fff;
}

@media (max-width: 600px) {
    .sp-global-bubble {
        bottom: 20px;
        right: 20px;
    }

    .sp-bubble-title {
        display: block;
        max-width: 150px;
        animation: sp-bubble-title-fade 1.5s forwards;
        animation-delay: 4s;
        /* Stay visible for 4s, then fade */
    }

    .sp-bubble-content {
        padding: 6px 15px 6px 6px;
        border-radius: 50px;
        gap: 12px;
        animation: sp-bubble-wrap-shrink 1.5s forwards;
        animation-delay: 4s;
    }
}

@keyframes sp-bubble-title-fade {
    0% {
        opacity: 1;
        max-width: 150px;
    }

    100% {
        opacity: 0;
        max-width: 0;
        visibility: hidden;
        margin: 0;
    }
}

@keyframes sp-bubble-wrap-shrink {
    0% {
        padding-right: 15px;
        border-radius: 50px;
        gap: 12px;
    }

    100% {
        padding-right: 6px;
        border-radius: 50%;
        gap: 0;
    }
}