/* 
   Marek Hatala - Academic Profile Theme
   Lively Minimalist (Accessible & SEO Optimized) | 2026 Edition
*/

:root {
    /* LIGHT THEME */
    --bg-color: #ffffff;
    --text-primary: #222222;
    --text-secondary: #555555;
    --text-tertiary: #888888;
    
    /* Lively Accents */
    --accent-color: #0056b3; /* Classic Blue */
    --accent-pop: #ba2839; /*#ffcf75;   /* Warm Gold */
    --focus-ring: #0056b3;
    
    --border-color: #f0f0f0;
    --nav-bg: rgba(255, 255, 255, 0.98);

    --section-gap: 5rem;
    --container-width: 760px;
}

/* DARK THEME (Warm/Paper) */
[data-theme="dark"] {
    --bg-color: #232121;
    --text-primary: #e8e6e3;
    --text-secondary: #b3b0aa;
    --text-tertiary: #8f8b86;
    
    --accent-color: #64b5f6; /* Lighter Blue */
    --accent-pop: #ffb74d;   /* Warmer Gold */
    --focus-ring: #64b5f6;
    
    --border-color: #3a3535;
    --nav-bg: rgba(35, 33, 33, 0.98);
}

:root {
  --nav-offset: 50px; /* tweak: set to your header height + ~10px */
}

html {
  scroll-padding-top: var(--nav-offset);
  scroll-behavior: smooth;
}

/* Backup for browsers/behaviors that rely on element margins */
section[id] {
  scroll-margin-top: var(--nav-offset);
}

/* ACCESSIBILITY: Focus States */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ACCESSIBILITY: Skip Link (Hidden by default) */
.skip-link {
    position: absolute;
    top: -999px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 1rem;
    z-index: 2000;
    text-decoration: none;
    font-weight: bold;
}
.skip-link:focus {
    top: 0;
}

/* Base Setup */
html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base for REM scaling */
}

/* ACCESSIBILITY: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-color);
    margin: 0;
    padding-top: 70px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

main {
    animation: fadeIn 0.6s ease-out;
}

/* Typography */
h1, h2, h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.75rem; margin-bottom: 0.5rem; line-height: 1.1; }
h2 { 
    font-size: 1.75rem; 
    margin-bottom: 2rem; 
    border-left: 5px solid var(--accent-pop); 
    padding-left: 15px;
    line-height: 1;
}
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.5rem; color: var(--text-secondary); }

/* Lively Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: color 0.2s ease;
}

/* Link Hover Animation */
a:not(.nav-brand):not(.icon-link):not(.skip-link):hover {
    color: var(--accent-color);
}
a:not(.nav-brand):not(.icon-link):not(.skip-link)::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-pop);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}
a:not(.nav-brand):not(.icon-link):not(.skip-link):hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: var(--section-gap) 0;
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    height: 65px;
    display: flex;
    align-items: center;
    transition: background 0.3s ease;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0; padding: 0;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 0; /* Touch Target Size */
}
.nav-links a:hover { color: var(--accent-color); }

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px; /* Larger Touch Target */
    border-radius: 50%;
    display: flex;
    transition: all 0.2s;
}
.theme-toggle:hover {
    color: var(--accent-pop);
    border-color: var(--accent-pop);
    transform: rotate(15deg);
}

/* Hero Section */
.profile-section { padding-top: 4rem; margin-bottom: 3rem; }

.profile-header {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-pic {
    width: 200px; height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    transition: transform 0.3s ease;
}
.profile-pic:hover {
    transform: scale(1.05) rotate(-0deg);
    border-color: var(--accent-pop);
}

.profile-info { flex: 1; }
.profile-info .title { font-size: 1.1rem; margin-bottom: 0.2rem; }
.profile-info .affiliation { color: var(--text-tertiary); margin: 0 0 1.5rem 0; }

.social-links { display: flex; gap: 20px; font-size: 0.9rem; flex-wrap: wrap; }
.icon-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: transform 0.2s;
    padding: 5px 0; /* Touch Target */
}
.icon-link:hover { color: var(--accent-color); transform: translateY(-2px); }

/* Content Blocks */
.mission-statement {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.project-card { margin-bottom: 2.5rem; }
.project-card:hover h3 { color: var(--accent-color); transition: color 0.2s; }

/* Publications */
.publication-list { list-style: none; padding: 0; }
.publication-list li {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid transparent;
    transition: border-left 0.2s;
}
.publication-list li:hover { border-left-color: var(--accent-pop); }
.pub-title { display: block; font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; }
.pub-meta { font-size: 0.95rem; color: var(--text-secondary); }

/* Spacious Student List */
.current-students-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1.5rem; /* Gap between students */
}

.current-students-list li {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
}

.current-students-list li:hover {
    border-color: var(--accent-pop);
    transform: translateX(5px); /* Subtle nudge */
    background-color: var(--bg-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.current-students-list li strong {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: block;
}

.current-students-list .detail {
    display: block;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.25rem;
}
.table-responsive { overflow-x: auto; margin-top: 2rem; -webkit-overflow-scrolling: touch; }
.alumni-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.25;
}

.alumni-table th {
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    padding: 0.4rem 0.5rem;   /* tighter header */
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.alumni-table td {
    padding: 0.35rem 0.5rem;  /* tight rows */
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
/* Subtle hover without “big” visual jump */
.alumni-table tbody tr:hover td {
    color: var(--text-primary);
    background: rgba(0,0,0,0.02);
    cursor: default;
}
[data-theme="dark"] .alumni-table tbody tr:hover td {
    background: rgba(255,255,255,0.03);
}
/* Prospective Callout */
.prospective-card {
    background: var(--bg-color); 
    border: 2px dashed var(--border-color); 
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}
.prospective-card:hover { border-color: var(--accent-pop); }
.prospective-steps { text-align: left; margin: 2rem 0; }
.prospective-steps ol { padding-left: 1.5rem; }
.prospective-steps li { margin-bottom: 0.5rem; }

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Mobile Responsiveness */
@media (max-width: 700px) {
    body { padding-top: 100px; }
    .nav-container { flex-direction: column; padding: 10px; }
    .nav-links { gap: 15px; font-size: 0.85rem; }
    .profile-header { flex-direction: column; text-align: center; gap: 20px; }
    .social-links { justify-content: center; }
    h1 { font-size: 2.25rem; }
}

/* PRINT STYLES (Save as PDF) */
@media print {
    .navbar, .theme-toggle, .skip-link, footer { display: none !important; }
    body { padding-top: 0; color: #000; background: #fff; }
    a { text-decoration: none; color: #000; }
    /* Show URL after links when printing */
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
    .container { max-width: 100%; padding: 0; }
    h2 { border-left-color: #000; }
}
