/**
 * Personal Bio Page Styles
 *
 * Redesigned to match homepage look & feel with text wrapping layout
 * Uses CSS variables from homepage for consistent design system
 *
 * @package ZeroEffort\Bio
 * @updated 2025-11-20 - Bio Page Redesign (branch 002-bio-page-redesign)
 */

/* ============================================================================
   CSS Reset & Base Styles
   ========================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
}

/* ============================================================================
   Skip Link for Accessibility
   ========================================================================= */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px;
    background-color: var(--fg);
    color: var(--bg);
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ============================================================================
   Accessibility Helpers
   ========================================================================= */

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================================
   Container
   ========================================================================= */

.bio-container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 3vw, 2rem);
}

/* ============================================================================
   Hero Section (Name, Title, Tagline)
   ========================================================================= */

.bio-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.bio-name {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--fg);
    line-height: 1.2;
}

.bio-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 400;
    margin: 0 0 1rem 0;
    color: var(--accent);
    line-height: 1.3;
}

.bio-tagline {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    margin: 0;
    color: var(--accent);
    font-style: italic;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ============================================================================
   Biography Content with Text Wrapping Layout
   ========================================================================= */

.bio-content {
    margin-bottom: 3rem;
}

/* Mobile: Stacked layout (default, no float) */
.bio-photo-float {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto 2rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.bio-text {
    /* Natural flow, no special layout on mobile */
}

.bio-text p {
    margin: 0 0 1.5rem 0;
    line-height: 1.8;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: var(--fg);
}

.bio-text p:last-child {
    margin-bottom: 0;
}

/* Desktop: Text wrapping layout (640px breakpoint) */
@media (min-width: 640px) {
    .bio-photo-float {
        float: right;
        width: 400px;
        height: 400px;
        max-width: 40%;           /* Responsive: shrinks on narrow viewports */
        margin: 0 0 2rem 2rem;    /* Space on left/bottom, flush top/right */
    }

    /* Clear float after bio section */
    .bio-content::after {
        content: "";
        display: table;
        clear: both;
    }
}

/* Tablet adjustment: smaller photo on medium screens */
@media (min-width: 640px) and (max-width: 1023px) {
    .bio-photo-float {
        width: 320px;
        height: 320px;
        max-width: 45%;
    }
}

/* ============================================================================
   Social Links Section
   ========================================================================= */

.bio-social {
    margin-bottom: 3rem;
    text-align: center;
}

.bio-social h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin: 0 0 2rem 0;
    color: var(--fg);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1rem, 2vw, 1.5rem);
    justify-content: center;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: clamp(0.5rem, 1vw, 0.75rem) clamp(1rem, 2vw, 1.5rem);
    background: var(--veil);
    color: var(--fg);
    text-decoration: none;
    border-radius: var(--radius);
    transition: opacity var(--speed) var(--easing),
                transform var(--speed) var(--easing);
    min-height: 44px;  /* WCAG touch target size */
    min-width: 44px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,.04);
    /* Button reset for when used on <button> elements */
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

.social-link:hover,
.social-link:focus-visible {
    opacity: 0.9;
    transform: translateY(-1px);
}

.social-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ============================================================================
   Skills Section
   ========================================================================= */

.bio-skills {
    margin-bottom: clamp(2rem, 5vw, 4rem);
}

.bio-skills h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin: 0 0 2rem 0;
    color: var(--fg);
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.skill-category {
    background: var(--veil);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.04);
}

.skill-category h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--fg);
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-list li {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: calc(var(--radius) / 2);
    font-size: 0.875rem;
    color: var(--accent);
}

/* Responsive adjustments for skills */
@media (min-width: 768px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skill-category h3 {
        font-size: 1.25rem;
    }

    .skill-list li {
        font-size: 1rem;
    }
}

/* ============================================================================
   Experience Section
   ========================================================================= */

.bio-experience {
    margin-bottom: clamp(2rem, 5vw, 4rem);
}

.bio-experience h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin: 0 0 2rem 0;
    color: var(--fg);
    text-align: center;
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.experience-item {
    padding: 1.5rem;
    background: var(--veil);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.experience-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--fg);
}

.experience-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--accent);
}

.experience-org {
    font-weight: 500;
}

.experience-period {
    font-style: italic;
}

.experience-summary {
    margin: 0 0 1rem 0;
    line-height: 1.7;
    color: var(--accent);
    font-style: italic;
}

.experience-bullets {
    margin: 0;
    padding: 0 0 0 1.5rem;
    list-style-type: disc;
}

.experience-bullets li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--fg);
}

.experience-bullets li:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments for experience */
@media (min-width: 768px) {
    .experience-title {
        font-size: 1.5rem;
    }

    .experience-meta {
        font-size: 1rem;
    }

    .experience-item {
        padding: 2rem;
    }
}

/* ============================================================================
   Focus Visible Support (better than :focus for keyboard navigation)
   ========================================================================= */

/* Remove default outline for all elements */
*:focus {
    outline: none;
}

/* Add custom outline only for keyboard focus */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================================================
   Reduced Motion Support (WCAG 2.1 AA compliance)
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    /* Disable hover effects with transform */
    .social-link:hover {
        transform: none !important;
    }
}
