/*
Theme Name: HCI Lab Theme
Theme URI: https://hci.cs.umanitoba.ca
Author: HCI Lab, University of Manitoba
Author URI: https://hci.cs.umanitoba.ca
Description: A clean, elegant academic theme for the Human-Computer Interaction Lab at the University of Manitoba. Features custom post type templates for People, Projects, and Publications.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hci-lab
Tags: academic, research, lab, custom-post-types, responsive
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
*/

/* ============================================================
   CSS VARIABLES & RESET
   ============================================================ */
:root {
    --color-primary: #1a5276;
    --color-primary-light: #2980b9;
    --color-primary-dark: #0e2f44;
    --color-accent: #d4a843;
    --color-accent-light: #f0d78c;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-bg-dark: #1a1a2e;
    --color-text: #2c3e50;
    --color-text-light: #6c757d;
    --color-text-muted: #95a5a6;
    --color-border: #e9ecef;
    --color-border-light: #f1f3f5;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
    --transition: 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary-dark);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.page-header {
    padding: 4rem 0 3rem;
    text-align: center;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

.content-section {
    padding: 4rem 0;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo .logo-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.site-logo .logo-subtitle {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.main-nav a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary);
    background: var(--color-bg-alt);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 0.75rem 1rem; width: 100%; }
}

/* ============================================================
   HERO SECTION (Homepage)
   ============================================================ */
.hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26,82,118,0.85) 0%, rgba(14,47,68,0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--color-accent);
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
    color: #ffffff;
}

.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.stat-item .stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

@media (max-width: 600px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESEARCH AREAS
   ============================================================ */
.research-areas {
    padding: 4rem 0;
    text-align: center;
}

.research-areas h2 {
    margin-bottom: 0.5rem;
}

.research-areas .subtitle {
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.research-tag {
    padding: 0.5rem 1.25rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-size: 0.9rem;
    color: var(--color-text);
    transition: all var(--transition);
}

.research-tag:hover {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* ============================================================
   CARDS
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--color-bg-alt);
}

.card-body {
    padding: 1.5rem;
}

.card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-body h3 a {
    color: var(--color-primary-dark);
}

.card-body h3 a:hover {
    color: var(--color-primary-light);
}

.card-body p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light);
}

/* ============================================================
   PEOPLE GRID
   ============================================================ */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.person-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.person-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.person-card .person-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--color-border);
}

.person-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.person-card h3 a {
    color: var(--color-primary-dark);
}

.person-card .person-role {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.person-card .person-email {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* Category filter tabs */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-tab {
    padding: 0.5rem 1.25rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--color-text);
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* ============================================================
   SINGLE PERSON PROFILE
   ============================================================ */
.person-profile {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    padding: 3rem 0;
}

.person-sidebar {
    text-align: center;
}

.person-sidebar .profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.person-sidebar .contact-info {
    text-align: left;
    background: var(--color-bg-alt);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.person-sidebar .contact-info dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

.person-sidebar .contact-info dt:first-child {
    margin-top: 0;
}

.person-sidebar .contact-info dd {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-top: 0.25rem;
}

.person-sidebar .external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.person-sidebar .external-link:hover {
    background: var(--color-primary-dark);
    color: #ffffff;
}

.person-main h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.person-main h2:first-child {
    margin-top: 0;
}

@media (max-width: 768px) {
    .person-profile {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PUBLICATIONS LIST
   ============================================================ */
.publications-list {
    list-style: none;
}

.publication-item {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    transition: all var(--transition);
}

.publication-item:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-sm);
}

.publication-item h3 {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.publication-item h3 a {
    color: var(--color-primary-dark);
}

.publication-item .citation {
    font-size: 0.85rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.publication-item .pub-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.publication-item .pub-meta a {
    color: var(--color-primary-light);
    font-weight: 500;
}

.year-group {
    margin-bottom: 3rem;
}

.year-group h2 {
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

/* ============================================================
   SINGLE PUBLICATION
   ============================================================ */
.publication-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
}

.publication-detail .pub-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.publication-detail .pub-citation {
    font-size: 0.95rem;
    color: var(--color-text-light);
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.publication-detail .pub-abstract {
    margin-top: 2rem;
}

.publication-detail .pub-abstract h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.publication-detail .pub-abstract p {
    line-height: 1.8;
    color: var(--color-text);
}

.publication-detail .pub-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ============================================================
   PROJECT DETAIL
   ============================================================ */
.project-detail {
    padding: 3rem 0;
}

.project-detail .project-hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.project-detail .project-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.project-detail .project-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.project-detail .project-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

/* ============================================================
   NEWS LIST
   ============================================================ */
.news-list {
    max-width: 800px;
    margin: 0 auto;
}

.news-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

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

.news-item .news-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-item h3 {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.news-item h3 a {
    color: var(--color-primary-dark);
}

.news-item .news-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
}

.about-content .lab-photo {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.about-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.about-content ul {
    list-style: none;
    padding: 0;
}

.about-content ul li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
}

.about-content ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-bg-dark);
    color: rgba(255,255,255,0.8);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-content h4 {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-content p,
.footer-content a {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

.footer-content a:hover {
    color: #ffffff;
}

.footer-content ul {
    list-style: none;
}

.footer-content ul li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
