/* site.css: cohesive polish layer for the Richardson Lab / kinemage site.
   Loaded AFTER kinweb.css and Bootstrap, so it refines the shared chrome
   (typography, links, nav, cards, footer) without disturbing the legacy
   kinweb.css fixed-width table pages. Selectors are kept intentionally
   low-specificity and scoped so legacy .hdr1/.download/etc. classes win. */

:root {
    --cream:      #fbfdf2;  /* page background, kept from the original site */
    --paper:      #ffffff;  /* cards, nav, footer surfaces */
    --ink:        #211e1a;  /* body text */
    --muted:      #55504a;  /* captions, secondary text */
    --brown:      #663300;  /* signature accent / rules */
    --brown-soft: #f3ead9;  /* warm tint for hover states */
    --link:       #0a4e8a;  /* deepened blue */
    --link-hover: #063a68;
    --rule:       #e4e0d3;  /* hairline borders */

    --radius: 8px;
    --shadow: 0 6px 20px rgba(40, 30, 10, 0.10);
    --lift:   transform 0.18s ease, box-shadow 0.18s ease;

    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-head: 'Albert Sans', 'Optima', 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ---- Base typography -------------------------------------------------- */

body {
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* Cohesive link color site-wide. Leave text-decoration to Bootstrap so
   nav/card/dropdown links stay un-underlined while body links underline. */
a {
    color: var(--link);
}
a:hover {
    color: var(--link-hover);
}

:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---- Top navigation --------------------------------------------------- */

.navbar.bg-light {
    background-color: var(--paper) !important;
    border-bottom: 1px solid var(--rule);
    padding-top: 0.15rem;
    padding-bottom: 0.35rem;
}

.navbar .navbar-brand {
    color: var(--muted);
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.navbar .nav-link {
    color: var(--ink);
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    position: relative;
}
.navbar .nav-link strong {
    font-weight: 600;
}

/* Heritage-colored underline that sweeps in on hover / open, an homage to the
   old pastel bar. Each item's hue comes from --nav-accent (set inline in
   basemenu.html); items without one fall back to brown. Hidden at rest. */
.navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0;
    height: 4px;
    /* Reset Bootstrap's .dropdown-toggle::after caret borders; they share this
       pseudo-element and would otherwise paint a dark strip over the bar. */
    border: 0;
    border-radius: 2px;
    background: var(--nav-accent, var(--brown));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.18s ease;
    vertical-align: initial;
    margin: 0;
}
.navbar .nav-link:hover::after,
.navbar .nav-link:focus::after,
.navbar .nav-item.show .nav-link::after {
    transform: scaleX(1);
}
.navbar .nav-link:hover,
.navbar .nav-item.show .nav-link {
    color: var(--brown);
}

.navbar .dropdown-menu {
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.35rem;
}
.navbar .dropdown-item {
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    white-space: normal;
}
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: var(--brown-soft);
    color: var(--ink);
}
.navbar .dropdown-item.active,
.navbar .dropdown-item:active {
    background-color: var(--brown);
    color: #fff;
}

/* MolProbity logo tucked to the right of the nav. */
.navbar .navbar-molprobity {
    margin-left: auto;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
}

/* ---- Page banner ------------------------------------------------------ */

.pageheader img {
    max-width: 100%;
    height: auto;
}

/* ---- Cards ------------------------------------------------------------ */

.card {
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--paper);
    transition: var(--lift);
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.card .card-title {
    font-family: var(--font-head);
    font-weight: 600;
}
/* Card-title links read as headings, not blue links. */
.card .card-title a {
    color: var(--ink);
    text-decoration: none;
}
.card:hover .card-title a {
    color: var(--brown);
}
.card-img-top {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

/* Landing "tiles" (teaching / software) normalize mismatched images to a
   uniform band so the grid stays even. Scoped so home/about cards are
   untouched. */
.tile-card .card-img-top {
    height: 168px;
    object-fit: cover;
    background: var(--brown-soft);
}

/* Member headshots normalized to a uniform band so the People grid stays even;
   top-anchored so faces aren't cropped (About page). */
.member-card .card-img-top {
    height: 240px;
    object-fit: cover;
    object-position: top;
}

/* Selected-publications reference list: readable measure + separated entries,
   plain text (no boxes). */
.pub-list {
    max-width: 74ch;
    padding-left: 0;
    list-style: none;
}
.pub-list li {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
}
.pub-list li:last-child {
    border-bottom: 0;
}
.pub-list .pub-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.pub-list .pub-meta {
    color: var(--muted);
}
.pub-list .pub-meta a {
    color: var(--link);
}

/* ---- Prose reading measure ------------------------------------------- */
/* Long-form text pages wrap their body in .prose so lines stay a comfortable
   length (~85 characters) instead of running the full window width. Centered,
   with real paragraph rhythm; images and floated figures reflow. */
.prose {
    max-width: 85ch;
    margin: 1.5rem 0 2.5rem;
    padding: 0 1rem;
}
.prose > :first-child {
    margin-top: 0;
}
.prose p {
    margin-bottom: 1rem;
}
.prose h2,
.prose h3,
.prose h4 {
    margin-top: 1.9rem;
    margin-bottom: 0.5rem;
}
.prose ul,
.prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}
.prose li {
    margin-bottom: 0.25rem;
}
.prose img {
    max-width: 100%;
    height: auto;
}
.prose hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 1.75rem 0;
}
/* Figures set beside the text on desktop, stacked on mobile. */
.prose .prose-figure {
    max-width: 320px;
}

/* ---- Hero (homepage) -------------------------------------------------- */

.hero {
    padding: 2.1rem 0 1.6rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 1.6rem;
}
.hero h1 {
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    margin: 0 0 0.5rem;
}
.hero .hero-lede {
    color: var(--muted);
    font-size: 1.08rem;
    margin: 0;
}
.hero .hero-accent {
    color: var(--brown);
}

/* Section intro used on the rebuilt landing pages. */
.section-intro {
    color: var(--muted);
}

/* ---- Migration notice ------------------------------------------------- */
/* A plain muted line set off by hairline rules, not a callout box (no accent
   bar, no tinted background, no rounded border). */
.site-notice {
    color: var(--muted);
    font-size: 0.925rem;
    padding: 0 0 0.9rem;
    border-bottom: 1px solid var(--rule);
}
.site-notice a {
    color: var(--link);
    font-weight: 600;
}

/* ---- Shared footer ---------------------------------------------------- */

.site-footer {
    margin-top: 3rem;
    border-top: 2px solid var(--brown);
    background: var(--paper);
    color: var(--muted);
    font-size: 0.9rem;
}
.site-footer h2 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 0.4rem;
}
.site-footer a {
    color: var(--link);
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}
.site-footer .footer-meta {
    color: var(--muted);
    font-size: 0.825rem;
}

/* ---- Small niceties --------------------------------------------------- */

/* Keep wide legacy tables from forcing horizontal page scroll on phones. */
.table-responsive-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
    .card,
    .navbar .nav-link::after {
        transition: none;
    }
    .card:hover {
        transform: none;
    }
}
