/* ===================================
   Academic Website - Jose A. Guridi
   Simple & Elegant Theme
   =================================== */

:root {
    --color-text: #1a2a3a;
    --color-text-light: #4a6070;
    --color-accent: #2563a0;
    --color-accent-light: #3b7bbf;
    --color-bg: #ffffff;
    --color-white: #ffffff;
    --color-border: #d8e2ec;
    --color-news-date: #1d5a8a;
    --color-border-subtle: #f0f0f0;
    --color-accent-bg: #f0f7ff;
    --color-recruitment-bg-start: #eef4fb;
    --color-recruitment-bg-end: #f0f7ff;
    --color-recruitment-border: #c5d9ed;
    --max-width: 780px;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
}

a {
    color: var(--color-accent);
    transition: color 0.2s;
}

a:hover {
    color: var(--color-accent-light);
}

/* Navigation */
header {
    position: sticky;
    top: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-name {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
}

.nav-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.lang-switch {
    font-size: 0.85rem;
    color: var(--color-text-light);
    border-left: 1px solid var(--color-border);
    padding-left: 1.2rem;
    margin-left: 0.4rem;
}

.lang-switch a {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.lang-switch a:hover {
    color: var(--color-accent);
}

.lang-switch .active-lang {
    font-weight: 600;
    color: var(--color-text);
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.hero-photo {
    flex-shrink: 0;
}

.hero-photo img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}

.hero .subtitle {
    font-size: 1.15rem;
    color: var(--color-text-light);
    margin-bottom: 0.1rem;
}

.hero .affiliation {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 1.2rem;
}

.social-links {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.social-links a {
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.social-links a:hover {
    border-bottom-color: var(--color-accent);
}

/* Sections */
.section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--color-border);
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

/* About */
.about-content p {
    margin-bottom: 1rem;
    color: var(--color-text);
}

.about-content p:last-child {
    margin-bottom: 0;
}

.committee {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

/* News Section */
.news-year {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text-light);
}

.news-year:first-of-type {
    margin-top: 0;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    list-style: none;
}

.news-item {
    display: flex;
    gap: 1.2rem;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-news-date);
    white-space: nowrap;
    min-width: 5.5rem;
}

.news-text {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.5;
}

.news-text strong {
    font-weight: 600;
}

/* Publications */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.pub-item {
    padding-left: 1rem;
    border-left: 3px solid var(--color-border);
}

.pub-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.02rem;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}

.pub-title a {
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: color 0.2s, border-color 0.2s;
}

.pub-title a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.2rem;
}

.pub-venue {
    font-size: 0.88rem;
    font-style: italic;
    color: var(--color-text-light);
}

.pub-links {
    margin-top: 0.3rem;
    display: flex;
    gap: 0.8rem;
}

.pub-links a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    border: 1px solid var(--color-border);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    transition: background-color 0.2s, border-color 0.2s;
}

.pub-links a:hover {
    border-color: var(--color-accent);
    background-color: var(--color-accent-bg);
}

.pub-year {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
}

.pub-section + .pub-section {
    margin-top: 2.5rem;
}

.pub-category {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1.2rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-text);
}

.view-all {
    display: inline-block;
    margin-top: 1.8rem;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.view-all:hover {
    border-bottom-color: var(--color-accent);
}

/* Projects */
.section-intro {
    margin-bottom: 2rem;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.project-item {
    padding-left: 1rem;
    border-left: 3px solid var(--color-accent);
}

.project-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

.project-layer {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin: 2rem 0 0.5rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--color-accent);
}

.project-layer:first-of-type {
    margin-top: 0;
}

.project-layer-desc {
    font-size: 0.92rem;
    color: var(--color-text-light);
    margin: 0 0 1rem 0;
    font-style: italic;
}

.project-desc {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.project-outputs {
    font-size: 0.88rem;
    color: var(--color-text-light);
}

.project-outputs-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.project-outputs ul {
    list-style: none;
    padding: 0;
    margin-top: 0.3rem;
}

.project-outputs li {
    padding: 0.2rem 0;
    padding-left: 1rem;
    position: relative;
}

.project-outputs li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--color-text-light);
}

.project-outputs a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.project-outputs a:hover {
    border-bottom-color: var(--color-accent);
}

/* Contact */
.contact-info {
    font-size: 1rem;
    line-height: 1.8;
}

.contact-info a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.contact-info a:hover {
    border-bottom-color: var(--color-accent);
}

/* Footer */
footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Recruitment Callout */
.recruitment-callout {
    margin: 2rem 0 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--color-recruitment-bg-start) 0%, var(--color-recruitment-bg-end) 100%);
    border: 1px solid var(--color-recruitment-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 6px;
    position: relative;
}

.recruitment-callout-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.recruitment-callout-desc {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.recruitment-callout-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.recruitment-callout-buttons a {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.recruitment-btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.recruitment-btn-primary:hover {
    background-color: var(--color-accent-light);
    color: var(--color-white);
}

.recruitment-btn-secondary {
    background-color: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.recruitment-btn-secondary:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.recruitment-dismiss {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    transition: color 0.2s;
}

.recruitment-dismiss:hover {
    color: var(--color-text);
}

/* Skip to Content */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
    left: 0;
}

/* Focus Indicators */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Hamburger Menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    color: var(--color-text);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Publication Filters */
.pub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.pub-filter-btn {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-bg);
    color: var(--color-text-light);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.pub-filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.pub-filter-btn.active {
    background: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.pub-section[hidden] {
    display: none;
}

/* Responsive - Tablet */
@media (max-width: 780px) {
    .nav-toggle {
        display: block;
    }

    nav {
        flex-wrap: wrap;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        padding-top: 0;
    }

    .nav-links.open {
        max-height: 400px;
        padding-top: 0.5rem;
    }

    .nav-links a,
    .nav-links .lang-switch {
        padding: 0.6rem 0;
        font-size: 1rem;
    }

    .lang-switch {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        border-top: 1px solid var(--color-border);
        padding-top: 0.8rem;
        margin-top: 0.2rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    .hero {
        padding: 2.5rem 0 2rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-photo img {
        width: 130px;
        height: 130px;
    }

    .social-links {
        justify-content: center;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

    .section {
        padding: 2rem 0;
    }

    .news-item {
        flex-direction: column;
        gap: 0.2rem;
    }

    .news-date {
        min-width: auto;
    }

    .recruitment-callout {
        padding: 1.2rem 1rem;
        margin: 1.5rem 0 0;
    }

    .recruitment-callout-buttons {
        flex-direction: column;
    }

    .recruitment-callout-buttons a {
        text-align: center;
    }

    .pub-filters {
        gap: 0.4rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.3rem;
    }

    .pub-filter-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        flex-shrink: 0;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --color-text: #e0e8f0;
        --color-text-light: #a0b4c8;
        --color-accent: #e8937a;
        --color-accent-light: #f0a892;
        --color-bg: #0f1419;
        --color-white: #0f1419;
        --color-border: #2a3a4a;
        --color-news-date: #e8937a;
        --color-border-subtle: #1a2a3a;
        --color-accent-bg: #2a1e1a;
        --color-recruitment-bg-start: #2a1e1a;
        --color-recruitment-bg-end: #2e221e;
        --color-recruitment-border: #5a3a2a;
    }

    .recruitment-callout {
        border-left-color: var(--color-accent);
    }

    .pub-filter-btn {
        background: #0f1419;
    }

    .pub-filter-btn.active {
        color: #ffffff;
    }

    .recruitment-btn-primary,
    .recruitment-btn-primary:hover {
        color: #ffffff;
    }

    .recruitment-btn-secondary:hover {
        color: #ffffff;
    }

    img {
        filter: brightness(0.95);
    }
}

/* Print Stylesheet */
@media print {
    header, footer, .skip-to-content, .recruitment-callout,
    .view-all, .pub-filters, .nav-toggle {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    main {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    .hero {
        padding: 1rem 0;
        border-bottom: 1px solid #ccc;
    }

    .hero-photo img {
        width: 80px;
        height: 80px;
    }

    .section {
        padding: 1.5rem 0;
        border-bottom: 1px solid #ccc;
    }

    .pub-item {
        break-inside: avoid;
    }

    .project-item {
        break-inside: avoid;
    }
}
