/* ============================================
   Metacognition Research - Main Stylesheet
   Based on research.madsci.org structure
   ============================================ */

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

body {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(180deg, 
        #d4e8e8 0%, 
        #e8f0e8 15%,
        #f0f5e8 30%,
        #f8f8e8 50%,
        #f5f0d8 70%,
        #f0e8c8 85%,
        #e8e0b8 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

a {
    color: #1a4d7c;
    text-decoration: none;
}

a:hover {
    color: #c45a2c;
    text-decoration: underline;
}

/* Page Container */
#page {
    max-width: 960px;
    margin: 0 auto;
    background: transparent;
}

/* Header */
#header {
    /*padding: 20px;*/
    padding: 5px;
    border-bottom: 2px solid #1a4d7c;
    background: transparent;
}

#header img {
    /*max-height: 60px;*/
    max-height: 80px;
}

/* Top Navigation Cards */
#topnav {
    display: flex;
    justify-content: space-around;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#topnav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 150px;
}

#topnav a:hover {
    border-color: #1a4d7c;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
}

#topnav img {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

#topnav .navtitle {
    font-weight: bold;
    color: #1a4d7c;
    font-size: 15px;
}

#topnav .navdesc {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* Main Content Area */
#main {
    display: flex;
    min-height: 400px;
}

/* Sidebar */
#sidebar {
    width: 180px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

#sidebar a {
    display: block;
    padding: 8px 0;
    border-bottom: 1px dotted #ccc;
    font-size: 13px;
}

#sidebar a:last-child {
    border-bottom: none;
}

#sidebar a:hover {
    color: #c45a2c;
}

/* Content Area */
#content {
    flex: 1;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.4);
}

#content h1 {
    font-size: 24px;
    color: #1a4d7c;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

#content h2 {
    font-size: 18px;
    color: #333;
    margin-top: 25px;
    margin-bottom: 15px;
}

#content h3 {
    font-size: 16px;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

#content p {
    margin-bottom: 15px;
}

#content ul, #content ol {
    margin: 15px 0 15px 25px;
}

#content li {
    margin-bottom: 8px;
}

/* Definition Lists (for team members) */
#content dl {
    margin: 15px 0;
}

#content dt {
    font-weight: bold;
    margin-top: 15px;
}

#content dt a {
    color: #1a4d7c;
}

#content dd {
    margin-left: 20px;
    color: #666;
    font-style: italic;
}

/* News Section */
.news-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dotted #ddd;
}

.news-date {
    font-weight: bold;
    color: #c45a2c;
}

/* Highlight Box */
.highlight {
    background: #fff8e7;
    border: 1px solid #e8dfc4;
    border-left: 4px solid #c45a2c;
    padding: 20px;
    margin: 20px 0;
}

.highlight h2 {
    margin-top: 0;
}

/* Grant/Award Box */
.grant-box {
    background: #f0f8f0;
    border: 1px solid #c8e6c8;
    border-left: 4px solid #2e7d32;
    padding: 20px;
    margin: 20px 0;
}

.grant-box h2 {
    margin-top: 0;
    color: #2e7d32;
}

/* Publication Entry */
.publication {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-left: 3px solid #1a4d7c;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.publication .title {
    font-weight: bold;
    color: #1a4d7c;
    margin-bottom: 5px;
}

.publication .authors {
    margin-bottom: 5px;
}

.publication .venue {
    color: #666;
    font-style: italic;
    margin-bottom: 8px;
}

.publication .links {
    font-size: 13px;
}

/* Team Member */
.team-member {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    margin-bottom: 15px;
}

.team-member h3 {
    margin-top: 0;
    color: #1a4d7c;
}

.team-member .role {
    font-weight: bold;
    color: #c45a2c;
    margin-bottom: 5px;
}

.team-member .affiliation {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.team-member .bio {
    font-size: 13px;
    margin-bottom: 10px;
}

.team-member .links {
    font-size: 13px;
}

/* Demo Button */
.demo-button {
    display: inline-block;
    padding: 15px 30px;
    background: #1a4d7c;
    color: #fff !important;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none !important;
    border-radius: 3px;
    transition: background 0.2s;
}

.demo-button:hover {
    background: #0f3a5d;
}

/* Demo Box */
.demo-box {
    background: #fff8e7;
    border: 1px solid #e8dfc4;
    padding: 30px;
    text-align: center;
    margin: 25px 0;
}

/* Dimension List */
.dimension-list {
    list-style: none;
    margin-left: 0;
}

.dimension-list li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
}

.dimension-list li:before {
    content: "◆";
    color: #c45a2c;
    position: absolute;
    left: 0;
}

/* Citation Box */
.citation {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 15px;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-x: auto;
}


/* Source Code catalog styles
   -----------------------------------------------
   Scoped under #content for specificity so they
   override the default #content p/ul/li/h3/a rules.
   ----------------------------------------------- */
#content .source-intro {
    color: #4a5568;
    font-size: 0.95em;
    margin-bottom: 1.8em;
    line-height: 1.6;
}

#content details.source-entry {
    margin: 0 0 1em 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    transition: box-shadow 0.2s;
}
#content details.source-entry[open] {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#content details.source-entry summary {
    padding: 1em 1.2em;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    font-size: 0.95em;
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    transition: background 0.2s;
}
#content details.source-entry summary::-webkit-details-marker { display: none; }
#content details.source-entry summary::before {
    content: "\25B6";
    font-size: 0.7em;
    color: #1a4d7c;
    margin-top: 0.35em;
    flex-shrink: 0;
    transition: transform 0.2s;
}
#content details.source-entry[open] summary::before {
    transform: rotate(90deg);
}
#content details.source-entry summary:hover {
    background: rgba(255, 255, 255, 0.8);
}

#content .source-entry-header {
    flex: 1;
}
#content .source-entry-header .entry-title {
    font-weight: bold;
    color: #1a4d7c;
    font-size: 1.05em;
    margin: 0 0 0.25em 0;
    padding: 0;
}
#content .source-entry-header .entry-venue {
    font-size: 0.85em;
    color: #718096;
    margin: 0;
    padding: 0;
}
#content .source-entry-header .entry-summary {
    font-size: 0.88em;
    color: #4a5568;
    margin: 0.4em 0 0 0;
    padding: 0;
    line-height: 1.5;
}

#content .source-entry-body {
    padding: 1.2em 1.4em;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.93em;
    line-height: 1.6;
}
#content .source-entry-body h3 {
    font-size: 1em;
    color: #1a4d7c;
    margin: 1.2em 0 0.4em 0;
    padding: 0;
}
#content .source-entry-body h3:first-child {
    margin-top: 0;
}
#content .source-entry-body ul {
    margin: 0.4em 0 0.8em 1.4em;
    padding: 0;
}
#content .source-entry-body li {
    margin-bottom: 0.35em;
}

#content .source-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    margin: 0.8em 0;
}
#content .source-links a {
    display: inline-block;
    padding: 0.5em 1em;
    background: #1a4d7c;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 3px;
    font-size: 0.88em;
    font-weight: bold;
    transition: background 0.2s;
}
#content .source-links a:hover {
    background: #0f3a5d;
    color: #fff !important;
    text-decoration: none !important;
}
#content .source-links a.secondary {
    background: #718096;
}
#content .source-links a.secondary:hover {
    background: #4a5568;
}
/* /Source Code catalog styles */



/* Email Icon */
img.icon-mail {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 5px;
}

/* Footer */
#footer {
    padding: 20px;
    border-top: 2px solid #1a4d7c;
    text-align: center;
    background: rgba(255, 255, 255, 0.3);
    font-size: 13px;
}

#footer p {
    margin-bottom: 8px;
}

#footer .copyright {
    color: #666;
    font-size: 12px;
}

#footer .validators {
    font-size: 11px;
}

#footer .validators a {
    margin: 0 5px;
}

/* Responsive */
@media (max-width: 768px) {
    #topnav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    #topnav a {
        width: 100%;
        max-width: 200px;
    }
    
    #main {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    #sidebar a {
        border-bottom: none;
        padding: 5px 15px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 0, 0, 0.15);
        border-radius: 3px;
    }
}
