/* ============================================================
   ROOT VARIABLES — easy customization
   ============================================================ */
:root {
    /* Colors */
    --primary-color:   #003366;
    --secondary-color: #00509d;
    --accent-color:    #00a8cc;
    --text-dark:       #2d3436;
    --text-muted:      #636e72;
    --text-light:      #ffffff;
    --bg-light:        #ffffff;
    --bg-gray:         #f1f2f6;
    --border-color:    #dfe6e9;

    /* Sidebar — fluid between 260 px (small screens) and 340 px (wide screens) */
    --sidebar-width: clamp(260px, 22vw, 340px);

    /* Fluid spacing scale */
    --space-xs:  clamp(0.4rem,  1vw, 0.6rem);
    --space-sm:  clamp(0.75rem, 2vw, 1rem);
    --space-md:  clamp(1rem,    3vw, 1.5rem);
    --space-lg:  clamp(1.5rem,  4vw, 2.5rem);
    --space-xl:  clamp(2rem,    5vw, 3.5rem);

    /* Fluid type scale */
    --text-xs:   clamp(0.72rem, 1.2vw, 0.8rem);
    --text-sm:   clamp(0.8rem,  1.4vw, 0.9rem);
    --text-base: clamp(0.88rem, 1.6vw, 0.98rem);
    --text-md:   clamp(1rem,    1.8vw, 1.1rem);
    --text-lg:   clamp(1.1rem,  2vw,   1.4rem);
    --text-xl:   clamp(1.25rem, 2.5vw, 1.6rem);
}

/* ============================================================
   GLOBAL RESET
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Prevent font inflation on mobile */
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: var(--text-base);

    /* Two-column layout on wide screens */
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
aside {
    grid-column: 1;
    grid-row: 1;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: var(--space-xl) var(--space-md);
    /* Sticky on tall screens so it stays in view while scrolling main */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);

    /* Smooth scroll-bar on webkit */
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) transparent;
}

aside::-webkit-scrollbar        { width: 4px; }
aside::-webkit-scrollbar-track  { background: transparent; }
aside::-webkit-scrollbar-thumb  { background: var(--secondary-color); border-radius: 4px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main {
    grid-column: 2;
    grid-row: 1;
    padding: var(--space-xl) clamp(1.5rem, 5vw, 3.5rem);
    background: var(--bg-light);
    /* Cap line length for readability on ultra-wide monitors */
    /* max-width: min(100%, 960px); */
}

/* ============================================================
   PROFILE SECTION
   ============================================================ */
.profile-section {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.profile-img {
    width:  clamp(100px, 14vw, 150px);
    height: clamp(100px, 14vw, 150px);
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    object-fit: cover;
    margin-bottom: var(--space-sm);
    background: #fff;
    display: block;
    margin-inline: auto;
}

.profile-section h1 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: var(--text-xs);
    color: var(--accent-color);
    font-weight: 500;
}

.subtitle-academic {
    font-size: var(--text-xs);
    color: var(--text-light);
    opacity: 0.6;
    font-style: italic;
    margin-top: 2px;
    margin-bottom: 12px;
}

/* ============================================================
   CONTACT INFO (SIDEBAR)
   ============================================================ */
.contact-info {
    margin-bottom: var(--space-lg);
}

.contact-info p {
    font-size: var(--text-xs);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    opacity: 0.9;
    word-break: break-word;
}

.contact-info i {
    width: 20px;
    flex-shrink: 0;
    margin-right: var(--space-sm);
    color: var(--accent-color);
}

/* ============================================================
   LINKS
   ============================================================ */
.linkedin-link {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s;
}
.linkedin-link:hover { color: var(--accent-color); }

.sidebar-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.25s ease;
}
.sidebar-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.badge-link:hover img {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

/* ============================================================
   DOWNLOAD BUTTON
   ============================================================ */
.cv-download {
    margin-top: var(--space-md);
    text-align: center;
}

.download-btn {
    display: inline-block;
    background: var(--accent-color);
    color: var(--text-light);
    padding: clamp(8px, 1.5vw, 11px) clamp(14px, 2.5vw, 20px);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.download-btn:hover {
    background: #0087a3;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

#google_translate_element {
    margin-bottom: 15px;
    text-align: center;
}

#google_translate_element .goog-te-gadget-simple {
    background: var(--secondary-color);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: var(--text-xs);
    cursor: pointer;
}

#google_translate_element .goog-te-gadget-simple span {
    color: var(--text-light) !important;
}

.badge-link img {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: 8px;
}

/* ============================================================
   SIDEBAR SECTIONS
   ============================================================ */
.sidebar-section {
    margin-bottom: var(--space-lg);
}

.sidebar-section h3 {
    font-size: var(--text-sm);
    letter-spacing: 1px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-sm);
    color: var(--accent-color);
}

/* ============================================================
   SKILL TAGS
   ============================================================ */
.skill-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 4px clamp(8px, 1.5vw, 14px);
    border-radius: 20px;
    font-size: var(--text-xs);
    margin: 3px 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.skill-tag:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* ============================================================
   MAIN CONTENT — SECTIONS & HEADINGS
   ============================================================ */
section {
    margin-bottom: var(--space-xl);
}

h2 {
    font-size: var(--text-lg);
    color: var(--primary-color);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
    margin-left: var(--space-sm);
}

/* ============================================================
   EXPERIENCE & EDUCATION ITEMS
   ============================================================ */
.job, .edu {
    margin-bottom: var(--space-lg);
}

.job-header, .edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;          /* wraps cleanly if titles are long */
    gap: var(--space-xs);
    margin-bottom: 4px;
}

.job-header span:first-child,
.edu-header span:first-child {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-dark);
}

.job-header span:last-child,
.edu-header span:last-child {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.company {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: var(--space-xs);
}

/* ============================================================
   BULLET LISTS
   ============================================================ */
ul { list-style: none; }

ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: var(--space-xs);
    font-size: var(--text-base);
    color: var(--text-dark);
}

ul li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* ============================================================
   BREAKPOINT: TABLET  (900px and below)
   Sidebar collapses to top bar; main takes full width.
   ============================================================ */
@media (max-width: 900px) {
    body {
            grid-template-columns: 1fr;
            grid-template-rows: auto 1fr;
            display: block;
            min-height: unset;
        }

    aside {
        grid-column: 1;
        grid-row: 1;
        position: static;
        height: auto;
        min-height: unset;
        overflow-y: visible;
        width: 100%;
        padding: var(--space-lg) var(--space-md);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
    main {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        max-width: 100%;
        padding: var(--space-lg) var(--space-md);
    }

    /* Lay profile + contact side-by-side on tablet */
    .sidebar-inner {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: var(--space-md) var(--space-lg);
        align-items: start;
    }

    .profile-section {
        text-align: left;
        margin-bottom: 0;
    }

    .profile-img {
        margin-inline: 0;
    }

    /* Skill tags can wrap freely */
    .sidebar-section { margin-bottom: var(--space-md); }
}

/* ============================================================
   BREAKPOINT: MOBILE  (580px and below)
   Everything stacks; sidebar becomes a compact header block.
   ============================================================ */
@media (max-width: 580px) {
    :root {
        /* Tighten spacing on phones */
        --space-lg: 1.25rem;
        --space-xl: 1.75rem;
    }

    .sidebar-inner {
        grid-template-columns: 1fr;   /* stack profile above contact */
    }

    .profile-section {
        text-align: center;
    }

    .profile-img {
        margin-inline: auto;
    }

    .job-header, .edu-header {
        flex-direction: column;
    }

    .job-header span:last-child,
    .edu-header span:last-child {
        margin-top: 2px;
    }

    h2 { white-space: normal; }
}

/* ============================================================
   ULTRA-WIDE  (1600px and above)
   Wider sidebar + constrain main column for readability.
   ============================================================ */
@media (min-width: 1600px) {
    :root {
        --sidebar-width: 340px;
    }

    main {
        padding-inline: clamp(3rem, 6vw, 6rem);
        max-width: 100%;
    }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    body {
        display: block;
        background: white;
        font-size: 10pt;
        color: black;
    }

    aside {
        position: static;
        width: 100%;
        height: auto;
        background: white !important;
        color: black !important;
        box-shadow: none;
        border-bottom: 2px solid #ccc;
        padding: 1rem;
        overflow: visible;
    }

    main {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }

    .skill-tag {
        border: 1px solid #bbb;
        color: black;
        background: transparent;
    }

    .download-btn { display: none; }

    h2::after { background: #ccc; }

    a { color: inherit; text-decoration: none; }
}