/* ==========================================================================
   Cornell CS Theory Club - Main Stylesheet
   Modeled after Cornell Physics Wiki (Jekyll Minima + custom wiki navigation)
   ========================================================================== */

/* --- Reset & Base Settings --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    color: #111111;
    background-color: #fdfdfd;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

/* --- Container & Layout --- */
.wrapper {
    max-width: 860px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 25px;
    padding-left: 25px;
    width: 100%;
}

.page-content {
    padding: 35px 0;
    flex: 1 0 auto;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: #111111;
    font-weight: 400;
    line-height: 1.3;
}

.page-heading, h1 {
    font-size: 30px;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    font-weight: 400;
}

h2 {
    font-size: 22px;
    letter-spacing: -0.3px;
    margin-top: 36px;
    margin-bottom: 15px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8e8e8;
}

h3 {
    font-size: 18px;
    font-weight: 500;
    margin-top: 24px;
    margin-bottom: 10px;
}

h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

p, blockquote, pre, ul, ol, dl, figure {
    margin-bottom: 18px;
}

p {
    font-size: 16px;
    color: #1a1a1a;
}

a {
    color: #b31b1b;
    text-decoration: none;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

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

a:visited {
    color: #8e1515;
}

ul, ol {
    margin-left: 28px;
}

li {
    margin-bottom: 6px;
}

/* --- Header & Navigation Bar (Cornell Physics Wiki Format) --- */
.site-header {
    border-top: 5px solid #b31b1b; /* Cornell Carnelian brand accent bar */
    border-bottom: 1px solid #e8e8e8;
    min-height: 56px;
    background-color: #fdfdfd;
    position: relative;
    z-index: 100;
}

.navbar {
    background-color: #fdfdfd;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 25px;
    position: relative;
}

.site-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    height: 38px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.site-title {
    font-size: 22px;
    font-weight: 400;
    line-height: 54px;
    letter-spacing: -0.5px;
    color: #333333;
    text-decoration: none;
    display: inline-block;
}

.site-title:hover {
    text-decoration: none;
    color: #b31b1b;
}

.site-title:visited {
    color: #333333;
}

.site-title span.cornell {
    color: #b31b1b;
    font-weight: 500;
}

/* Nav Menu & Contents */
.navbar-contents {
    display: flex;
    align-items: center;
}

.navbar-contents > ul {
    list-style-type: none;
    margin-bottom: 0;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-contents li {
    line-height: 30px;
    position: relative;
}

.navbar-contents a {
    display: block;
    padding: 8px 14px;
    color: #222222;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar-contents a:hover {
    background-color: #f1f1f1;
    color: #b31b1b;
    text-decoration: none;
}

.navbar-contents li.active > a {
    font-weight: 600;
    color: #b31b1b;
    background-color: #fbebeb;
}

.nav-search-btn {
    font-size: 1.2em !important;
    line-height: 1;
    padding: 8px 12px !important;
}

/* In-Page Subnav / Jump Pills */
.subnav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 24px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #eeeeee;
}

.subnav-pills a, button {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 16px;
    background: #f1f1f1;
    color: #444444;
    text-decoration: none;
    border: 1px solid #e2e2e2;
    transition: all 0.15s ease;
}

.subnav-pills a:hover, button:hover {
    background: #b31b1b;
    color: #ffffff;
    border-color: #b31b1b;
    text-decoration: none;
}

/* --- Wiki Elements & Callouts --- */
span.tag {
    background: #e9e9e9;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 6px;
    display: inline-block;
    color: #333333;
    vertical-align: middle;
}

span.tag.carnelian {
    background: #fbebeb;
    color: #b31b1b;
    border: 1px solid #f6d1d1;
}

span.tag.blue {
    background: #eef4fe;
    color: #1a56b2;
    border: 1px solid #d4e4fc;
}

.info-box {
    background-color: #fbfbfb;
    border-left: 4px solid #b31b1b;
    border-top: 1px solid #eeeeee;
    border-right: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
    padding: 18px 22px;
    border-radius: 0 6px 6px 0;
    margin: 24px 0;
}

.info-box h3 {
    margin-top: 0;
    color: #b31b1b;
    font-size: 18px;
    margin-bottom: 8px;
}

.info-box p {
    margin-bottom: 8px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.meeting-highlight {
    font-size: 17px;
    font-weight: 600;
    color: #111111;
}

/* Images & Figures */
figure {
    margin: 25px 0;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

figcaption {
    font-size: 14px;
    color: #666666;
    margin-top: 8px;
    font-style: italic;
}

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.topic-item {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-left: 4px solid #b31b1b;
    padding: 16px 18px;
    border-radius: 0 6px 6px 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.topic-item h4 {
    color: #b31b1b;
    margin-bottom: 4px;
    font-size: 16px;
}

.topic-item p {
    color: #555555;
    font-size: 14px;
    margin-bottom: 0;
    line-height: 1.5;
}

/* --- Schedule & Talk Cards --- */
.search-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
    border-color: #b31b1b;
    box-shadow: 0 0 0 3px rgba(179, 27, 27, 0.15);
}

.talk-list {
    margin: 20px 0;
}

.talk-card {
    display: flex;
    gap: 18px;
    padding: 16px 20px;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.talk-card:hover {
    transform: translateY(-2px);
    border-color: #c8c8c8;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.talk-card img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #b31b1b;
    flex-shrink: 0;
}

.talk-content {
    flex: 1;
}

.talk-title {
    font-weight: 600;
    font-size: 16px;
    color: #111111;
    margin-bottom: 6px;
    line-height: 1.4;
}

.talk-meta {
    color: #666666;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.talk-details-btn {
    font-size: 13px;
    color: #b31b1b;
    margin-left: auto;
    font-weight: 500;
    text-decoration: underline;
}

/* --- Leadership Directory --- */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 24px;
    margin-bottom: 30px;
}

.leadership-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    padding: 22px 16px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.leadership-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.leadership-img-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #b31b1b;
    margin: 0 auto 12px auto;
    overflow: hidden;
}

.leadership-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Custom zooms preserved from original design */
.zoom-nancy {
    transform: scale(1.8);
    transform-origin: center center;
}

.zoom-max {
    transform: scale(1.5);
    transform-origin: center center;
}

.zoom-ahan {
    transform: scale(1.3);
    transform-origin: center bottom;
}

.zoom-elizabeth {
    object-position: center top;
}

.leadership-card h4 {
    color: #111111;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.leadership-card p.role {
    color: #b31b1b;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.leadership-card p.bio-snippet {
    color: #666666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 0;
}

/* --- Quick Links / Cards --- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 25px 0;
}

.action-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: #b31b1b;
    box-shadow: 0 4px 12px rgba(179, 27, 27, 0.08);
    text-decoration: none;
}

.action-card h3 {
    color: #b31b1b;
    font-size: 17px;
    margin-top: 0;
    margin-bottom: 6px;
}

.action-card p {
    color: #555555;
    font-size: 14px;
    margin-bottom: 0;
}

/* --- Tables (Wiki Style) --- */
table {
    margin-bottom: 30px;
    width: 100%;
    text-align: left;
    color: #3f3f3f;
    border-collapse: collapse;
    border: 1px solid #e8e8e8;
    font-size: 15px;
}

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

table th, table td {
    padding: 10px 15px;
}

table th {
    background-color: #f0f0f0;
    border: 1px solid #dedede;
    border-bottom-color: #c9c9c9;
    font-weight: 600;
    color: #222222;
}

table td {
    border: 1px solid #e8e8e8;
}

/* --- Modal Dialog (Speaker Abstract & Bio) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #ffffff;
    width: min(720px, 92%);
    margin: 60px auto;
    padding: 30px 35px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
    overflow-y: auto;
    border-top: 4px solid #b31b1b;
}

.modal-content h2 {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
    color: #111111;
}

.modal-content h3 {
    margin-top: 20px;
    color: #b31b1b;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

#modal-bio, #modal-abstract {
    white-space: pre-wrap;
    line-height: 1.65;
    font-size: 15px;
    color: #222222;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888888;
    transition: color 0.15s ease;
}

.close:hover {
    color: #b31b1b;
}

/* --- Footer (Jekyll Minima / Cornell Physics Wiki Format) --- */
.site-footer {
    border-top: 1px solid #e8e8e8;
    padding: 35px 0;
    background-color: #fdfdfd;
    margin-top: auto;
}

.footer-heading {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #222222;
}

.footer-col-wrapper {
    font-size: 14px;
    color: #666666;
    margin-left: -15px;
}

.footer-col-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

.footer-col {
    float: left;
    margin-bottom: 15px;
    padding-left: 15px;
}

.footer-col-1 {
    width: calc(35% - 15px);
}

.footer-col-2 {
    width: calc(25% - 15px);
}

.footer-col-3 {
    width: calc(40% - 15px);
}

.contact-list, .footer-links {
    list-style: none;
    margin-left: 0;
}

.contact-list li, .footer-links li {
    margin-bottom: 6px;
}

.contact-list a, .footer-links a {
    color: #555555;
    text-decoration: none;
}

.contact-list a:hover, .footer-links a:hover {
    color: #b31b1b;
    text-decoration: underline;
}

.footer-col-3 p {
    font-size: 14px;
    line-height: 1.55;
    color: #666666;
}

.footer-bottom {
    border-top: 1px solid #f0f0f0;
    margin-top: 15px;
    padding-top: 15px;
    text-align: center;
    font-size: 13px;
    color: #888888;
}

/* --- Responsive Adjustments --- */
@media screen and (max-width: 1000px) {
    .navbar-container {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .navbar-contents {
        width: 100%;
        margin-top: 5px;
    }

    .navbar-contents ul {
        flex-wrap: wrap;
        width: 100%;
    }

    .navbar-contents li {
        margin-bottom: 4px;
    }
}

@media screen and (max-width: 800px) {
    .wrapper {
        padding-right: 18px;
        padding-left: 18px;
    }

    .footer-col-1, .footer-col-2 {
        width: calc(50% - 15px);
    }

    .footer-col-3 {
        width: calc(100% - 15px);
    }

    .talk-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
    }

    .talk-meta {
        justify-content: center;
    }

    .talk-details-btn {
        margin-left: 0;
        margin-top: 8px;
    }
}

@media screen and (max-width: 600px) {
    .site-title {
        font-size: 20px;
    }

    .site-logo {
        height: 32px;
    }

    .footer-col {
        float: none;
        width: calc(100% - 15px);
    }

    .navbar-contents a {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* --- General / Utilities --- */
.hidden {
    display: none;
}