/* ========================================
   EXPERIENCE ITEMS
   ======================================== */

/* Experience Items - highlight state */
.exp-item.highlight-active {
    background-color: var(--card-bg) !important;
    border-left: 3px solid var(--accent-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transform: translateX(10px);
}

.exp-item.highlight-active h3 {
    color: var(--accent-color);
}

.exp-desc {
    display: none;
}

/* Ensure expanded items are fully visible even if they have opacity set */
.exp-item.expanded {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Expand/Collapse - toggle button for expanded state */
.exp-toggle-btn {
    background: transparent;
    border: none;
    color: var(--secondary-text);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.exp-item:hover .exp-toggle-btn {
    color: var(--text-color);
}

.exp-item.expanded .exp-toggle-btn {
    transform: rotate(180deg);
}

.exp-details-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease, margin-top 0.5s ease;
    opacity: 0;
    margin-top: 0;
}

.exp-item.expanded .exp-details-wrapper {
    opacity: 1;
    margin-top: 0.75rem;
}

.exp-details-content {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.03);
    width: 90%; /* 10% smaller width */
}

/* Content Styling inside details */
.exp-details-content ul {
    list-style: none;
    padding-left: 0;
}

.exp-details-content li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
}

.exp-details-content li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6rem; /* Center vertically relative to first line */
    width: 5px;
    height: 5px;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0.7;
}

/* Modern Job Summary Styling */
.job-summary {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: var(--font-main); /* Ensure consistency */
    font-style: italic;
    opacity: 0.9;
}

/* Modern Highlights Styling */
.job-highlights ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.job-highlights li {
    padding-left: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.9;
}

/* --- LAYOUT LEGO V1: THE SWISS BLOCK --- */
/* Title on Row 1. Firm + Date + Location on Row 2 as interlocking blocks */

.exp-item {
    display: grid;
    grid-template-columns: 12rem 1fr auto 12rem; /* Date | Firm | Links | Location */
    grid-template-areas:
        "title title title title"
        "date firm links location"
        "details details details details";
    column-gap: 0.5rem;
    row-gap: 0.25rem;
    margin-bottom: 2.5rem;
    background: transparent !important;
    padding: 0;
    border: none;
    box-shadow: none !important;
    cursor: pointer;
    opacity: 0;
    transform: translateY(25px);
    transition: all 0.3s ease;
}

body.show-details .exp-item {
    opacity: 1;
    transform: translateY(0);
}

body.show-details .exp-item:nth-child(1) { transition-delay: 0.1s; }
body.show-details .exp-item:nth-child(2) { transition-delay: 0.15s; }
body.show-details .exp-item:nth-child(3) { transition-delay: 0.2s; }
body.show-details .exp-item:nth-child(4) { transition-delay: 0.25s; }
body.show-details .exp-item:nth-child(5) { transition-delay: 0.3s; }
body.show-details .exp-item:nth-child(6) { transition-delay: 0.35s; }
body.show-details .exp-item:nth-child(7) { transition-delay: 0.4s; }

.exp-item:hover {
    background-color: transparent !important;
}

/* Student Jobs Collapsible Section */
.student-jobs-section {
    margin-top: 1.5rem;
}

.student-jobs-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--secondary-text);
    transition: color 0.3s ease;
}

.student-jobs-toggle:hover {
    color: var(--text-color);
}

.student-jobs-toggle .toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.student-jobs-toggle .toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.student-jobs-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.student-jobs-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}

.student-jobs-content.expanded {
    grid-template-rows: 1fr;
}

.student-jobs-inner {
    overflow: hidden;
}

/* Flatten the DOM structure to allow grid placement */
.exp-role {
    grid-area: title;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exp-header-row,
.exp-header-row > div {
    display: contents;
}

.exp-role h2 {
    /* grid-area title removed, handled by parent flex */
    font-size: 2.2rem; /* Reduced from 2.5rem */
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0;
    padding-bottom: 0.1rem;
}

.exp-company {
    grid-area: firm;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem; /* Reduced from 0.85rem */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 2px;
    align-self: start;
    display: flex;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    height: 1.5rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    gap: 0.5rem; /* Space between text and icon */
}

.linkedin-icon,
.website-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white; /* Or inherit */
    opacity: 0.8;
    transition: opacity 0.2s;
    flex-shrink: 0;
    margin-top: -2px; /* Slight visual adjustment */
}

.website-icon {
    margin-left: auto; /* Push icons to the right */
}

.linkedin-icon:hover,
.website-icon:hover {
    opacity: 1;
}

.exp-date {
    grid-area: date;
    background: rgba(0,0,0,0.1);
    color: var(--text-color);
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 2px;
    align-self: start;
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    height: 1.5rem;
}

.exp-location {
    grid-area: location;
    background: rgba(0,0,0,0.05); /* Slightly lighter than date */
    color: var(--secondary-text);
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 2px;
    align-self: start;
    display: flex;
    width: 100%;
    justify-content: flex-start; /* Left Align */
    align-items: center;
    height: 1.5rem;
    white-space: nowrap;
}

.exp-links {
    grid-area: links;
    background: rgba(0,0,0,0.05);
    color: var(--text-color);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 1.5rem;
    align-self: start;
}

.exp-links:empty {
    display: none;
}

/* Sub-job styling for Student Jobs details */
.sub-job {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.sub-job:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.sub-job-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: baseline;
    margin-bottom: 0.5rem;
}
.sub-job-role {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}
.sub-job-company {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-text);
}
.sub-job-location {
    font-size: 0.85rem;
    color: var(--secondary-text);
    opacity: 0.8;
    margin-left: auto;
}
.sub-job-date {
    font-size: 0.85rem;
    color: var(--secondary-text);
    font-weight: 500;
}
.sub-job .job-highlights {
    margin-top: 0.5rem;
}
.sub-job-role span { margin: 0 0.2rem; }

/* Override for grid area details wrapper */
.exp-details-wrapper {
    grid-area: details;
    margin-top: 0.75rem;
    display: flex;
    justify-content: center; /* Center horizontally */
    width: 100%;
}

.exp-details-content {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.03);
    width: 98%; /* Wider but centered */
    max-width: 98%;
}
