/* --- Academic Documentation Stylesheet --- */

/* 1. Reset & Viewport Fix */
* {
    box-sizing: border-box;
}

body {
    background-color: #1a202c;
    font-family: "Times New Roman", Times, serif;
    color: #000;
    margin: 0;
    padding: 20px 0;
    line-height: 1.4;
}

/* 2. Responsive Paper Container */
.page-container {
    width: 95%;
    max-width: 850px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px 20px;
    border: 1px solid #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    word-wrap: break-word;
}

/* Navigation */
nav {
    margin-bottom: 30px;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

nav a {
    color: #000;
    text-decoration: underline;
    font-weight: bold;
    font-size: 15px;
}

/* Header & Profile */
header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 20px;
}

.details-left { 
    flex: 1; 
}

.details-left h1 {
    font-size: clamp(24px, 5vw, 34px);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    line-height: 1.1;
}

.info-item { font-size: 16px; margin-bottom: 4px; }

.contact-info {
    margin-top: 10px;
    padding: 8px 0;
    border-top: 1px dotted #000;
    border-bottom: 1px dotted #000;
    font-style: italic;
    word-break: break-all;
}

.summary-text {
    margin-top: 15px;
    font-size: 16px;
    text-align: left;
}

.profile-photo {
    width: 250px;
    height: auto;
    border: 1px solid #000;
    padding: 4px;
    background: #fff;
}

/* Sections */
h2 {
    font-size: 19px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    margin: 35px 0 12px 0;
    padding-bottom: 3px;
}

/* Lists & Grids */
.project-list, .foundation-links {
    list-style: square;
    padding-left: 20px;
}

.project-item { margin-bottom: 20px; }

.foundations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.foundation-category h3 {
    font-size: 16px;
    margin: 0 0 8px 0;
    text-decoration: underline;
}

/* Footer Buttons */
footer {
    margin-top: 50px;
    padding-top: 15px;
    border-top: 1px solid #000;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    padding: 5px 10px;
    border: 1px solid #000;
    text-decoration: none;
    color: #000;
    font-size: 13px;
    background: #fff;
    display: inline-block;
}

.btn:hover { background: #000; color: #fff; }

/* Note Specifics & Math */
.math-block { 
    background: #f4f4f4; 
    padding: 15px; 
    border-left: 3px solid #000; 
    margin: 20px 0; 
    overflow-x: auto;
}

/* Page Credit */
.page-credit {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    font-style: italic;
}

.page-credit a {
    color: #000;
}


/* =============================================
   Announcement Banner
   ============================================= */
#announcement-banner {
    width: 100%;
    background-color: #fff;
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 14px;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 2px solid #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#announcement-banner.banner-visible {
    transform: translateY(0);
}

#announcement-banner.banner-hidden {
    transform: translateY(-100%);
}

.banner-inner {
    max-width: 850px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.banner-text {
    flex: 1;
    line-height: 1.5;
}

.banner-link {
    color: #000;
    text-decoration: underline;
    font-weight: bold;
    margin: 0 4px;
}

.banner-link:hover {
    color: #555;
}

.banner-close {
    background: none;
    border: 1px solid #000;
    color: #000;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 7px;
    font-family: "Times New Roman", Times, serif;
    flex-shrink: 0;
}

.banner-close:hover {
    background: #000;
    color: #fff;
}

@media (max-width: 700px) {
    .banner-inner {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* =============================================
   Search Bar
   ============================================= */
.search-wrapper {
    position: relative;
    margin: 0 0 25px 0;
}

.notes-search {
    width: 100%;
    padding: 7px 32px 7px 10px;
    border: 1px solid #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 15px;
    background: #fff;
    color: #000;
    outline: none;
}

.notes-search::placeholder {
    color: #888;
    font-style: italic;
}

.notes-search:focus {
    border-width: 2px;
}

.search-clear {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    cursor: pointer;
    color: #555;
    display: none;
    user-select: none;
}

.search-clear:hover {
    color: #000;
}

/* No results message */
.no-results {
    font-style: italic;
    font-size: 15px;
    color: #555;
    margin: 0 0 20px 0;
}

/* Search highlight on matching links */
a.search-highlight {
    background: #f0f0a8;
    padding: 1px 2px;
}

/* =============================================
   Notes Table
   ============================================= */
.notes-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 15px;
}

.notes-table th,
.notes-table td {
    border: 1px solid #000;
    padding: 9px 12px;
    text-align: left;
    vertical-align: top;
}

.notes-table thead tr {
    background-color: #000;
    color: #fff;
}

.notes-table tbody tr:nth-child(even) {
    background-color: #f7f7f7;
}

@media (max-width: 700px) {
    .notes-table {
        display: block;
        overflow-x: auto;
    }
}

/* =============================================
   Per-Category Show More / Show Less
   ============================================= */
.subtopic-hidden {
    display: none;
}

.btn-show-more {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    border: 1px solid #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 13px;
    background: #fff;
    color: #000;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.btn-show-more:hover {
    background: #000;
    color: #fff;
}

/* --- MOBILE SPECIFIC OVERRIDES --- */
@media (max-width: 700px) {
    .page-container {
        padding: 30px 15px;
    }

    header { 
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .details-left {
        padding-right: 0;
        width: 100%;
    }

    .profile-photo { 
        width: 100%; 
        max-width: 300px;
        margin: 0 0 20px 0; 
    }

    .foundations-grid { 
        grid-template-columns: 1fr;
    }

    .contact-info {
        text-align: center;
    }
}