/* Magic Mushrooms Information Hub - Main Stylesheet */

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Color Variables */
:root {
    --deep-purple: #5D3F6A;
    --earthy-brown: #8B5A2B;
    --calm-blue: #4A6D8C;
    --soft-green: #7CAA98;
    --warm-orange: #E67E22;
    --light-lavender: #D8BFD8;
    --off-white: #F8F8F8;
    --light-gray: #E0E0E0;
    --dark-gray: #333333;
    --medium-gray: #777777;
    --focus-outline: #4A90E2;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--deep-purple);
    color: white;
    padding: 8px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--focus-outline);
    outline-offset: 2px;
}

/* Typography */
body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark-gray);
    background-color: var(--off-white);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    font-size: 2.25rem;
    color: var(--deep-purple);
}

h2 {
    font-size: 1.75rem;
    color: var(--deep-purple);
    border-bottom: 2px solid var(--light-lavender);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.375rem;
    color: var(--earthy-brown);
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--deep-purple);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--earthy-brown);
    text-decoration: underline;
}

/* Scientific Terms */
.scientific-term {
    font-family: 'Roboto Mono', monospace;
    color: var(--calm-blue);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

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

.main-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sidebar {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    align-self: start;
    position: sticky;
    top: 100px;
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--deep-purple);
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
}

nav li {
    position: relative;
    margin-left: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 600;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--deep-purple);
    text-decoration: none;
}

nav a[aria-current="page"] {
    color: var(--deep-purple);
    border-bottom: 2px solid var(--deep-purple);
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
    left: 0;
}

.dropdown-content a {
    color: var(--dark-gray);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: normal;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: var(--light-lavender);
    color: var(--deep-purple);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--deep-purple);
    cursor: pointer;
    padding: 0.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(93, 63, 106, 0.8), rgba(93, 63, 106, 0.8)), url('../images/mushroom-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--warm-orange);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: #d35400;
    text-decoration: none;
    color: white;
}

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

.btn-secondary:hover {
    background-color: var(--light-lavender);
    color: var(--deep-purple);
}

/* Page Header */
.page-header {
    background-color: var(--light-lavender);
    padding: 3rem 0;
    text-align: center;
}

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

/* Featured Sections */
.featured-sections {
    padding: 4rem 0;
}

.section-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-img {
    height: 200px;
    background-color: var(--light-lavender);
    background-size: cover;
    background-position: center;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card-link {
    display: inline-block;
    margin-top: auto;
    padding-top: 1rem;
    color: var(--deep-purple);
    font-weight: 600;
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

/* Latest Research */
.latest-research {
    background-color: var(--light-lavender);
    padding: 4rem 0;
}

/* Knowledge Graph Preview */
.knowledge-graph-preview {
    padding: 4rem 0;
    background-color: var(--calm-blue);
    color: white;
    text-align: center;
}

.knowledge-graph-preview h2 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.knowledge-graph-teaser {
    max-width: 800px;
    margin: 0 auto;
}

.knowledge-graph-teaser p {
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

/* Table of Contents */
.toc {
    margin-bottom: 2rem;
}

.toc h3 {
    margin-bottom: 1rem;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    text-decoration: none;
    color: var(--calm-blue);
    transition: color 0.3s;
}

.toc-list a:hover {
    color: var(--deep-purple);
}

/* Related Content */
.related-content h3 {
    margin-bottom: 1rem;
}

.related-links {
    list-style: none;
}

.related-links li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
}

.related-links li:last-child {
    border-bottom: none;
}

.related-links a {
    text-decoration: none;
    color: var(--deep-purple);
    font-weight: 600;
    transition: color 0.3s;
}

.related-links a:hover {
    color: var(--earthy-brown);
}

/* Figures */
.figure {
    margin: 2rem 0;
    text-align: center;
}

.figure-img {
    width: 100%;
    max-width: 600px;
    height: 300px;
    background-color: var(--light-lavender);
    margin: 0 auto 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--medium-gray);
}

.figure-caption {
    font-size: 0.875rem;
    color: var(--medium-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

th {
    background-color: var(--light-lavender);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--light-gray);
}

tr:nth-child(even) {
    background-color: var(--off-white);
}

/* References */
.references {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light-gray);
}

.references h2 {
    margin-bottom: 1.5rem;
}

.reference-list {
    list-style: none;
}

.reference-list li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    text-indent: -2rem;
    font-size: 0.875rem;
}

/* Info and Warning Boxes */
.info-box, .warning-box, .important-notice {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.info-box {
    background-color: rgba(74, 109, 140, 0.1);
    border-left: 4px solid var(--calm-blue);
}

.warning-box {
    background-color: rgba(230, 126, 34, 0.1);
    border-left: 4px solid var(--warm-orange);
}

.important-notice {
    background-color: rgba(93, 63, 106, 0.1);
    border-left: 4px solid var(--deep-purple);
}

/* Disclaimer */
.disclaimer {
    background-color: var(--light-gray);
    padding: 2rem 0;
    text-align: center;
}

.disclaimer p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 0.875rem;
    color: var(--medium-gray);
}

/* Footer */
footer {
    background-color: var(--dark-gray);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: var(--light-gray);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.875rem;
    color: var(--light-gray);
}

/* Timeline */
.timeline {
    margin: 2rem 0;
}

.timeline-item {
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--deep-purple);
    background-color: rgba(93, 63, 106, 0.05);
    border-radius: 0 8px 8px 0;
}

.timeline-item h3 {
    margin-top: 0;
}

/* Research Areas */
.research-area {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--light-gray);
}

.research-area:last-child {
    border-bottom: none;
}

/* Institution Grid */
.institution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.institution {
    background-color: var(--off-white);
    padding: 1.5rem;
    border-radius: 8px;
}

/* Knowledge Graph Visualization */
.knowledge-graph-container {
    width: 100%;
    height: 600px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 2rem 0;
    position: relative;
}

.graph-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.graph-legend {
    margin: 2rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Conclusion */
.conclusion {
    margin-top: 3rem;
    padding: 1.5rem;
    background-color: var(--off-white);
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 992px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .knowledge-graph-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .header-container {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .logo {
        margin-right: auto;
    }
    
    nav {
        flex-basis: 100%;
        order: 3;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav li {
        margin: 0;
        width: 100%;
        text-align: center;
    }
    
    nav a {
        display: block;
        padding: 0.75rem 0;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        width: 100%;
        display: none;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .content-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .knowledge-graph-container {
        height: 400px;
    }
    
    .institution-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.375rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .knowledge-graph-container {
        height: 350px;
    }
    
    .graph-controls {
        top: 10px;
        right: 10px;
    }
}

/* Print Styles */
@media print {
    header, footer, .sidebar, .hero, .disclaimer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container, .content-container, .main-content {
        width: 100%;
        margin: 0;
        padding: 0;
        display: block;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    img, table, figure {
        page-break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
}
