/* ==========================================================================
   Katherine E. Whitaker — astrowhit.com static recreation
   Shared stylesheet — grey / black / off-white palette
   ========================================================================== */

:root {
  --color-bg: #f0efec;
  --color-bg-alt: #e7e5e1;
  --color-text: #1c1c1c;
  --color-text-light: #5a5a5a;
  --color-accent: #2c2c2c;
  --color-accent-dark: #101010;
  --color-border: #d3d1cc;
  --max-width: 1000px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* "Shorelines Script" is not on any free CDN — self-host it (see README) and it will be
     picked up automatically here once assets/fonts/ShorelinesScript-Bold.woff2 exists. */
  --script: "Shorelines Script", "Segoe Script", "Bradley Hand", cursive;
}

@font-face {
  font-family: "Shorelines Script";
  src: url("../fonts/ShorelinesScript-Bold.woff2") format("woff2"),
       url("../fonts/ShorelinesScript-Bold.woff") format("woff"),
       url("../fonts/ShorelinesScript-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--color-text);
  background: #ffffff;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-accent-dark);
  margin: 1.6em 0 0.6em;
}
h1 { font-size: 2.1rem; }
.section-heading-small { font-size: 1.3rem; }
h2 { font-size: 1.3rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.3em; }
h2.no-underline { border-bottom: none; padding-bottom: 0; font-size: 1.3rem; }
.heading-date { font-size: 0.6em; font-weight: 400; color: var(--color-text-light); }
.semester-note { font-size: 0.65em; font-weight: 400; }
h3 { font-size: 1.2rem; }
.research-topic h3 .paper-cite { font-size: 0.7em; font-weight: 700; font-style: normal; color: var(--color-text-light); }
.funding-note { font-size: 0.75em; }
h4 { font-size: 1.05rem; font-style: italic; color: var(--color-text); }

p { margin: 0.9em 0; }

ul, ol { padding-left: 1.4em; }
li { margin: 0.35em 0; }

blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--color-text-light);
  border-left: 3px solid #999;
  margin: 1.4em 0;
  padding: 0.2em 0 0.2em 1.2em;
}

blockquote.plain-quote {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.93em;
  color: var(--color-text);
}
blockquote.plain-quote p { margin: 0.9em 0; }

blockquote.quote-large { font-family: var(--serif); font-size: 1.7rem; line-height: 1.3; text-align: center; border-left: none; padding: 0.2em 0; }
@media (max-width: 640px) {
  blockquote.quote-large { font-size: 1.25rem; }
}
.quote-attribution { font-size: 0.55em; }
.quote-source { font-size: 0.7em; }

.underline-links a { text-decoration: underline; }

hr {
  clear: both;
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.2em 0;
}

/* ---------- Layout wrappers ---------- */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { padding: 0 0 3rem; }

.text-compact p { font-size: 0.93em; }

/* ---------- Header ---------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1.6rem 0 0;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
  text-align: center;
}
.site-title {
  font-family: var(--script);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.site-title:hover { text-decoration: none; opacity: 0.7; }
.tagline {
  margin: 0.2em 0 1em;
  color: var(--color-text-light);
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: 300;
}
.site-nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.3rem 1.1rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.92rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.site-nav a {
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
  padding: 0.3rem 0.1rem;
}
.site-nav a:hover { color: var(--color-accent-dark); text-decoration: none; border-bottom: 2px solid var(--color-accent-dark); }
.site-nav a.active { color: var(--color-accent-dark); border-bottom: 2px solid var(--color-accent-dark); }
.twitter-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* ---------- Page banner (per-page top image) ---------- */
.page-banner {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: var(--color-accent-dark);
  border-top: 4px solid #999;
}
.page-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(25%) contrast(1.02);
  opacity: 0.85;
}
.page-banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.8rem;
  background: linear-gradient(180deg, rgba(16,16,16,0.05) 0%, rgba(16,16,16,0.55) 75%, rgba(16,16,16,0.75) 100%);
}
.page-banner-overlay h1 {
  color: #fff;
  margin: 0;
  font-size: 2.3rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.page-banner-short { height: 160px; }
.page-banner-short img { object-position: top; }

@media (max-width: 640px) {
  .page-banner { height: 200px; }
  .page-banner-short { height: 100px; }
  .page-banner-overlay h1 { font-size: 1.6rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  padding: 2.2rem 0 1.4rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1.6rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-image {
  width: 169px;
  height: 169px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  filter: grayscale(40%);
}
.footer-contact { text-align: left; }
.footer-contact p { margin: 0.15em 0; font-size: 0.92rem; color: var(--color-text-light); }
.footer-contact strong { color: var(--color-accent-dark); font-family: var(--serif); font-size: 1.05rem; }

/* ---------- Hero / home ---------- */
.home-hero {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  background: var(--color-accent-dark) center / cover no-repeat fixed url("../images/banner_uncover_github_v3_long.jpg");
  border-top: 4px solid #999;
}

@media (max-width: 900px) {
  /* background-attachment: fixed is unreliable on touch devices; fall back to normal scroll */
  .home-hero { background-attachment: scroll; }
}

.home-gallery {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  height: 640px;
  gap: 6px;
  margin: 0.6rem 0 0;
}
.home-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #999;
  filter: grayscale(15%);
  transition: filter 0.2s ease;
}
.home-gallery img:hover { filter: grayscale(0%); }

.gallery-portrait   { grid-column: 1 / 4;  grid-row: 1 / 11; }
.gallery-podium     { grid-column: 4 / 6;  grid-row: 1 / 3;  }
.gallery-control    { grid-column: 4 / 6;  grid-row: 3 / 5;  }
.gallery-office     { grid-column: 6 / 11; grid-row: 1 / 5;  object-position: top; }
.gallery-silhouette { grid-column: 4 / 7;  grid-row: 5 / 11; }
.gallery-telescope  { grid-column: 7 / 9;  grid-row: 5 / 11; }
.gallery-newspaper  { grid-column: 9 / 11; grid-row: 5 / 11; }

@media (max-width: 800px) {
  .home-gallery { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; height: auto; }
  .home-gallery img { grid-column: auto !important; grid-row: auto !important; height: 190px; }
}

.teaching-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: 420px;
  gap: 6px;
  margin: 1rem 0 1.8rem;
}
.teaching-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #999;
  filter: grayscale(15%);
  transition: filter 0.2s ease;
}
.teaching-gallery img:hover { filter: grayscale(0%); }

.tg-1 { grid-column: 1 / 5;  grid-row: 1 / 2; }
.tg-2 { grid-column: 5 / 9;  grid-row: 1 / 2; }
.tg-3 { grid-column: 9 / 13; grid-row: 1 / 2; }
.tg-4 { grid-column: 1 / 4;  grid-row: 2 / 3; }
.tg-5 { grid-column: 4 / 7;  grid-row: 2 / 3; }
.tg-6 { grid-column: 7 / 10; grid-row: 2 / 3; }
.tg-7 { grid-column: 10 / 13; grid-row: 2 / 3; }

@media (max-width: 800px) {
  .teaching-gallery { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; height: auto; }
  .teaching-gallery img { grid-column: auto !important; grid-row: auto !important; height: 160px; }
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  margin: 1.4rem 0 2rem;
}
.image-strip img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: grayscale(10%);
}
.gallery-5col { grid-template-columns: repeat(5, 1fr); }
.gallery-6col { grid-template-columns: repeat(6, 1fr); }
.image-strip-bordered img { border: 2px solid #999; }
@media (max-width: 900px) {
  .gallery-5col { grid-template-columns: repeat(3, 1fr); }
  .gallery-6col { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .gallery-6col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .gallery-5col { grid-template-columns: repeat(2, 1fr); }
}

.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.6rem;
}
.photo-row img {
  height: 90px;
  width: auto;
  object-fit: cover;
  border: 1px solid #999;
  border-radius: 3px;
  filter: grayscale(10%);
}

.headshot-block {
  float: right;
  width: 240px;
  margin: 0 0 1.2rem 1.6rem;
}
.headshot-block .headshot {
  width: 100%;
  border: 2px solid #999;
  border-radius: 4px;
  filter: grayscale(20%);
}
.headshot-block blockquote {
  margin: 1rem 0 0;
  font-size: 1rem;
}
.feature-figure {
  float: left;
  width: 300px;
  margin: 0.3rem 1.6rem 1rem 0;
}
.feature-figure img {
  display: block;
  width: 100%;
  border: 2px solid #999;
  border-radius: 4px;
  filter: grayscale(15%);
}
.feature-figure figcaption {
  font-style: italic;
  font-size: 0.85em;
  color: var(--color-text-light);
  margin-top: 0.5rem;
}
.feature-figure-wide { width: 340px; }
.feature-figure-crop-shift img { aspect-ratio: 100/66; object-fit: cover; object-position: center 83%; }
.feature-image {
  float: left;
  width: 300px;
  margin: 0.3rem 1.6rem 1rem 0;
  border: 2px solid #999;
  border-radius: 4px;
  filter: grayscale(15%);
}
.feature-audio {
  display: block;
  width: calc((100% - 326px) * 0.6);
  margin-left: calc(326px + (100% - 326px) * 0.2);
}
.video-embed {
  float: left;
  width: 300px;
  height: 169px;
  margin: 0.3rem 1.6rem 1rem 0;
  border: 2px solid #999;
  border-radius: 4px;
}
.video-embed-vertical {
  float: left;
  width: 220px;
  height: 378px;
  margin: 0 1.6rem 1rem 0;
  border: 2px solid #999;
  border-radius: 4px;
  overflow: hidden;
}
.video-embed-vertical iframe {
  width: 220px;
  height: 480px;
  border: none;
}
.deadline-note {
  margin-left: 326px;
  font-style: italic;
}
.clearfix::after { content: ""; display: table; clear: both; }

.split-section {
  display: flex;
  gap: 2.2rem;
  align-items: stretch;
  margin: 1.4rem 0 2rem;
}
.split-col { flex: 1; min-width: 0; }
.split-col-left {
  border-right: 1px solid var(--color-border);
  padding-right: 2.2rem;
}
.video-embed-stacked {
  display: block;
  width: 100%;
  height: 260px;
  margin: 0.3rem 0 1rem;
  border: 2px solid #999;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .headshot-block { float: none; width: 200px; margin: 0 auto 1.2rem; }
  .feature-image { float: none; width: 100%; max-width: 320px; margin: 0 auto 1rem; display: block; }
  .feature-figure { float: none; width: 100%; max-width: 320px; margin: 0 auto 1rem; }
  .feature-audio { width: 60%; margin-left: auto; margin-right: auto; }
  .video-embed { float: none; width: 100%; max-width: 320px; height: 180px; margin: 0 auto 1rem; display: block; }
  .video-embed-vertical { float: none; width: 100%; max-width: 240px; height: 427px; margin: 0 auto 1rem; display: block; }
  .deadline-note { margin-left: 0; }
  .split-section { flex-direction: column; gap: 0; }
  .split-col-left { border-right: none; border-bottom: 1px solid var(--color-border); padding-right: 0; padding-bottom: 1.6rem; margin-bottom: 1.6rem; }
  .video-embed-stacked { height: 200px; }
}

/* ---------- News teasers ---------- */
.news-teasers { list-style: none; padding: 0; margin: 1.4rem 0; }
.news-teaser {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-border);
}
.news-teaser:first-child { border-top: 1px solid var(--color-border); }
.news-teaser a.news-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-accent-dark);
}
.news-date { display: block; font-size: 0.82rem; color: var(--color-text-light); margin-top: 0.15em; }

.news-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin: 1rem 0;
}
.news-card {
  display: block;
  color: var(--color-text);
  text-align: center;
}
.news-card:hover { text-decoration: none; }
.news-card img {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  border: 2px solid #999;
  border-radius: 3px;
  margin: 0 auto 0.6rem;
  filter: grayscale(15%);
  transition: filter 0.2s ease;
}
.news-card:hover img { filter: grayscale(0%); }
.news-card img.crop-left { object-position: left; }
.news-card .news-card-text { min-width: 0; }
.news-card .news-card-title {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-accent-dark);
  line-height: 1.3;
}
.news-card:hover .news-card-title { text-decoration: underline; }
.news-card .news-card-date {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 0.15em;
}

/* ---------- News article pages ---------- */
.article-meta { color: var(--color-text-light); font-size: 0.88rem; margin-bottom: 1.2rem; }
.article-gallery { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0; }
.article-gallery img { width: 220px; height: 165px; object-fit: cover; filter: grayscale(10%); }
.article-nav { display: flex; justify-content: space-between; margin-top: 2.4rem; font-size: 0.9rem; gap: 1rem; }
.article-nav a { flex: 1; }
.article-nav a.next { text-align: right; }

/* ---------- Research group / people ---------- */
.person {
  display: flex;
  gap: 1.4rem;
  margin: 1.8rem 0;
  align-items: flex-start;
}
.person img {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  filter: grayscale(20%);
}
.person .person-body h3 { margin-top: 0; }
.person .role { color: var(--color-text-light); font-style: italic; margin: -0.4em 0 0.6em; font-size: 0.88rem; }
.person .person-body p { font-size: 0.9rem; }

.rg-main > p { font-size: 0.88rem; }

.people-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
  margin: 1.4rem 0;
  text-align: center;
}
.people-grid figure { margin: 0; }
.people-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  filter: grayscale(20%);
}
.people-grid figcaption { font-size: 0.9rem; }

.alumni-list h4 { margin-top: 1.4em; color: var(--color-accent); font-style: normal; }
.alumni-list ul { font-size: 0.88rem; }

@media (max-width: 700px) {
  .people-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Research Group two-column layout (main content 2/3, spotlights 1/3) ---------- */
.research-group-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.rg-spotlights {
  border-left: 1px solid var(--color-border);
  padding-left: 1.6rem;
}
.rg-spotlights h2 { font-size: 1.25rem; }
.rg-spotlights .spotlight { margin: 1.6rem 0; }
.rg-spotlights .spotlight img { width: 100%; }
.rg-spotlights .spotlight p { font-size: 0.85rem; }
.rg-spotlights .spotlight .citation { font-size: 0.8rem; }

.astrowit-graphic {
  display: block;
  width: 368px;
  max-width: 100%;
  margin: 0.5rem auto 1rem;
}

.astrowit-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 90%;
  margin: 1rem auto 1.5rem;
}
.astrowit-row .astrowit-graphic {
  width: 280px;
  margin: 0;
  flex-shrink: 0;
}
.astrowit-row blockquote {
  margin: 0;
}
@media (max-width: 640px) {
  .astrowit-row { flex-direction: column; }
}

.group-photo {
  display: block;
  width: 90%;
  height: 405px;
  object-fit: cover;
  object-position: center 35%;
  border: 2px solid #999;
  border-radius: 4px;
  margin: 0.5rem auto 1rem;
}
@media (max-width: 640px) {
  .group-photo { width: 100%; height: 280px; }
}

@media (max-width: 800px) {
  .research-group-layout { grid-template-columns: 1fr; }
  .rg-spotlights { border-left: none; border-top: 1px solid var(--color-border); padding-left: 0; padding-top: 1.6rem; }
}

/* ---------- Research topics / publications spotlights ---------- */
.research-topic { margin: 2.4rem 0; padding-bottom: 1.6rem; border-bottom: 1px solid var(--color-border); }
.research-topic::after { content: ""; display: table; clear: both; }
.research-topic img { float: left; width: 380px; margin: 0.2rem 1.6rem 1rem 0; border-radius: 4px; filter: grayscale(10%); }
.research-topic h3 { margin-top: 0; }

@media (max-width: 640px) {
  .research-topic img { float: none; width: 100%; max-width: 320px; margin: 0 auto 1rem; display: block; }
}

.spotlight { margin: 2rem 0; }
.spotlight img { max-width: 420px; margin: 0.6rem 0; filter: grayscale(10%); }
.spotlight .citation { font-size: 0.92rem; color: var(--color-text-light); }

/* ---------- Publications list ---------- */
.pub-year { margin-top: 2rem; font-family: var(--serif); color: var(--color-accent); border-bottom: none; }
.pub-list { list-style: none; padding: 0; }
.pub-list li { margin: 0.7em 0; font-size: 0.82rem; line-height: 1.45; }
.pub-list .pub-title { font-weight: 600; }
.pub-note { font-size: 0.85rem; color: var(--color-text-light); font-style: italic; }

.ads-button-wrap { text-align: center; margin: 2.5rem 0 1rem; }
.ads-button-wrap-right { text-align: right; margin: 0.4rem 0 0.3rem; }
.page-top-space { padding-top: 1.4rem; }
.ads-button {
  display: inline-block;
  padding: 0.7em 1.6em;
  background: var(--color-accent-dark);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.95rem;
  border-radius: 4px;
  text-decoration: none;
}
.ads-button:hover { opacity: 0.85; text-decoration: none; }

/* ---------- Misc content blocks ---------- */
.callout {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.2rem 1.4rem;
  margin: 1.4rem 0;
}
figure { margin: 1rem 0; }
figcaption { font-size: 0.85rem; color: var(--color-text-light); margin-top: 0.3em; }

.figure-float {
  float: left;
  width: 240px;
  margin: 0.3rem 1.6rem 1rem 0;
}
.figure-float img {
  border-radius: 4px;
  filter: grayscale(10%);
}
@media (max-width: 640px) {
  .figure-float { float: none; width: 100%; max-width: 320px; margin: 0 auto 1rem; }
}

.figure-float-right {
  float: right;
  width: 240px;
  margin: 0.3rem 0 1rem 1.6rem;
}
.figure-float-right img {
  border-radius: 4px;
  filter: grayscale(10%);
}
.figure-float-right.figure-large { width: 400px; }
.figure-float-right.figure-square { width: 300px; }
.figure-float-right.figure-square img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center bottom;
}
.figure-float-right.figure-square figcaption { font-style: italic; }
@media (max-width: 640px) {
  .figure-float-right { float: none; width: 100%; max-width: 320px; margin: 0 auto 1rem; }
  .figure-float-right.figure-large { max-width: 400px; }
  .figure-float-right.figure-square { max-width: 300px; }
  .figure-float-right.figure-square img { height: 260px; }
}

iframe { max-width: 100%; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
table th, table td { border: 1px solid var(--color-border); padding: 0.5rem 0.7rem; text-align: left; font-size: 0.92rem; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .news-cards { grid-template-columns: 1fr; }
  .home-hero { height: 320px; }
  .person { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
  h1 { font-size: 1.7rem; }
  .site-title { font-size: 1.6rem; }
}
