/* assets/css/site.css: tokens and layout for chadgiusti.com.
 * Implements PLAN.md section 5; values from docs/source-site/STYLE.md.
 * Sections: 1 tokens, 2 fonts, 3 base, 4 header and nav, 5 banner, 6 bands,
 * 7 grids and components, 8 footer, 9 responsive. Breakpoints follow the
 * original theme: 992px (nav collapses), 767px, 480px. */

/* 1. Tokens */
:root {
  --black: #000000;
  --white: #ffffff;
  --grey-text: #d5d5d5;
  --grey-dark: #2a2a2a;
  --grey-heading: #3f3f3f;
  --hairline: #e0e0e0;
  --light-band: #f0f4f6;
  --link: #3f5ae8;           /* P3: 5.5:1 on white; PLAN 5.5 records the departure from #5c77fb */
  --link-on-dark: #5c77fb;   /* the original blue, 5.5:1 on black */
  --teal: #175660;
  --banner-gradient: linear-gradient(90deg, #000000 0%, #175660 100%);   /* --black to --teal; literal because the Nu CSS checker rejects var() in color stops */
  --header-overlay: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 40%, rgba(0, 0, 0, 0) 100%);

  --font-fallback: 'Montserrat', sans-serif;
  --font-banner: 'Sansation', var(--font-fallback);
  --font-body: 'Roboto', var(--font-fallback);

  --container-max: 1200px;
  --pad-x: 40px;
  --pad-y: 60px;
  --banner-tall: 600px;
  --banner-short: 400px;
  --line-height: 1.75;
}

/* 2. Fonts (P2: self-hosted) */
@font-face {
  font-family: 'Sansation';
  src: url('../fonts/sansation-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face { font-family: 'Roboto'; src: url('../fonts/roboto-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('../fonts/roboto-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('../fonts/roboto-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('../fonts/roboto-bolditalic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/montserrat-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/montserrat-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* 3. Base */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--black);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p, ul, ol { margin: 0 auto 30px; }
h1, h2, h3, h4 { margin: 0 auto 30px; line-height: 1.25; font-weight: 700; }
h2 { font-size: 24px; }
h3 { font-size: 24px; }   /* the live site's subsection headings are Weebly h2 at 24px */
h4 { font-size: 18px; }
.h-xl { font-size: 48px; }   /* Weebly font size 7 */
.h-lg { font-size: 32px; }   /* size 6 */
.h-md { font-size: 24px; }   /* size 5 */
.h-sm { font-size: 18px; }   /* size 4 */
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--grey-heading); }
.container {
  position: relative;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
}
main a, .site-footer a {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  transition: opacity 300ms ease-in-out;
}
main a:hover { opacity: 0.75; }
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--white);
  color: var(--black);
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* 4. Header and nav */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 12;
  width: 100%;
  padding: 20px var(--pad-x);
  color: var(--white);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  max-height: 80px;
}
.site-header .logo { display: block; margin-right: 30px; transition: opacity 200ms ease; }
.site-header .logo:hover { opacity: 0.6; }
.site-header .logo img { max-width: 200px; max-height: 40px; width: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav--desktop ul { display: flex; flex-wrap: nowrap; }
.nav--desktop li { margin: 5px 5px 5px 0; }
.nav a {
  display: block;
  padding: 12px 20px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 300ms ease;
}
.nav--desktop a:hover { opacity: 0.6; }
.nav--desktop li.active > a { border-color: currentColor; }
.hamburger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
  position: absolute;
  left: 11px;
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  content: '';
  transition: transform 200ms ease-in-out;
}
.hamburger span { top: 21px; }
.hamburger span::before { left: 0; top: -8px; }
.hamburger span::after { left: 0; top: 8px; }
.hamburger--close span { background: transparent; }
.hamburger--close span::before { top: 0; transform: rotate(45deg); }
.hamburger--close span::after { top: 0; transform: rotate(135deg); }

.nav--mobile {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 15;
  overflow-y: auto;
  padding: 60px 20px 20px;
  background: var(--white);
  color: var(--black);
}
.nav--mobile[hidden] { display: none; }
.nav--mobile .hamburger { display: block; position: absolute; top: 8px; right: 12px; }
.nav--mobile li { margin: 0; }
.nav--mobile a { padding: 16px 10px; font-size: 16px; text-align: center; }
.nav--mobile li.active > a { text-decoration: underline; }
body.nav-open { overflow: hidden; }

/* 5. Banner */
.banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--banner-short);
  background-color: var(--black);
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
  color: var(--white);
  text-align: center;
}
.banner--tall { min-height: var(--banner-tall); }
.banner--gradient { background-image: var(--banner-gradient); }
.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: var(--header-overlay);
  pointer-events: none;
}
.banner .container { padding: 80px var(--pad-x); }
.banner h1 {
  position: relative;
  margin: 15px auto;
  font-family: var(--font-banner);
  font-size: 80px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 2px;
}

/* 6. Bands */
.band { width: 100%; background: var(--white); }
.band--dark { background: var(--black); color: var(--white); }
.band--dark p, .band--dark li, .band--dark figcaption { color: var(--grey-text); }
.band--dark h2, .band--dark h3 { color: var(--white); }
.band--dark a { color: var(--link-on-dark); }   /* P3: the white-page link blue is only 3.8:1 on black */
.band--light { background: var(--light-band); }
.spacer { height: 30px; }

/* 7. Grids and components */
.grid { display: grid; gap: 0 30px; align-items: start; }
.grid > * { min-width: 0; }
.grid > p { margin: 0; }   /* a bare image line inside a markdown="1" grid becomes a <p> (PLAN 3.5) */
.grid--two { grid-template-columns: 1fr 1fr; gap: 0 110px; }
.grid--news { grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.grid--who { grid-template-columns: 1fr 2fr 1fr; gap: 0 20px; align-items: center; }
.grid--members { grid-template-columns: repeat(4, 1fr); }
.grid--icon { grid-template-columns: 23fr 77fr; align-items: center; margin-bottom: 45px; }   /* breathing room before the next heading */
.grid--footer { grid-template-columns: 1fr 1fr 1fr; align-items: start; }
.grid--footer .footer-address { grid-column: 3; }

.news-item { text-align: center; }
/* Fixed image box so the three headings align regardless of figure aspect (REVIEW_v0 O8). */
.news-item img { height: 280px; width: auto; max-width: 100%; object-fit: contain; margin: 10px auto; border: 1px solid var(--hairline); }
.news-item--row { display: grid; grid-template-columns: 1fr 2fr; gap: 0 30px; align-items: center; text-align: left; margin-bottom: 40px; }
.news-item--row img { margin: 0; height: auto; }
.news-item--row h3 { text-align: left; }
.news-list { max-width: 900px; margin: 0 auto; }

.member { margin: 0 0 30px; text-align: center; }
.member img { margin: 10px auto; }
.member figcaption { font-size: 24px; font-weight: 700; line-height: 1.25; }
.member .member-link { display: block; font-size: 16px; font-weight: 400; }
.former-group { margin-bottom: 30px; }
.former-group h3 { font-size: 18px; margin-bottom: 20px; }
.plain-list { list-style: none; padding: 0; }
.plain-list > li { margin-bottom: 20px; }
.plain-list ul { list-style: disc; margin: 0 0 0 20px; }   /* solid bullets as on the live page, not the nested-list default */

.jump-links a {
  display: inline-block;
  margin: 0 10px 10px 0;
  padding: 12px 28px;
  border: 1px solid var(--black);
  color: var(--black);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
}
.jump-links a:hover { opacity: 0.6; }
.tool-list { list-style: none; padding: 0; }
.tool-list li { margin-bottom: 20px; }
.tool-list .authors { display: block; }
.tool-list .remark { display: block; color: var(--grey-heading); }

.pub { display: grid; grid-template-columns: 3fr 2fr; gap: 0 30px; align-items: center; margin-bottom: 45px; }
.pub--text-only { grid-template-columns: 1fr; }
.pub p { margin-bottom: 0; }
.pub .pub-links a { margin-right: 20px; }
.pub img { margin: 0 auto; }

/* Reserved for chunk 3 content pages: .topic (research intro columns), .headshot (personal page). */
.topic { text-align: center; }
.topic img { margin: 10px auto; max-width: 216px; }
.topic > p:first-child {   /* equal-height image box, bottom-aligned, so the two h3 titles share a row (hotfix, PLAN 5) */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 236px;   /* 216px tallest topic image + 10px margins */
}
.topic ol, .topic ul { display: inline-block; text-align: left; }   /* centered block, left-aligned items */
.headshot { max-width: 318px; margin: 0 auto; }

/* 8. Footer */
.site-footer { font-size: 14px; color: var(--grey-dark); }
.footer-logo { max-width: 233px; margin: 10px 0; }
.footer-address { text-align: right; margin: 50px 0 0; }

/* 9. Responsive (theme breakpoints: 992px, 767px, 480px) */
@media (max-width: 992px) {
  :root { --pad-x: 20px; --pad-y: 30px; }
  .site-header { padding: 5px 20px; }
  .nav--desktop { display: none; }
  .hamburger { display: block; }
  .banner .container { padding: 60px 20px; }
  .banner h1 { font-size: 50px; }
  .grid--two, .grid--news, .grid--who, .grid--icon, .grid--footer { grid-template-columns: 1fr; }
  .grid--members { grid-template-columns: 1fr 1fr; }
  .grid--footer .footer-address { grid-column: auto; text-align: left; margin-top: 10px; }
  .grid--who img { margin: 0 auto; }
}
@media (max-width: 767px) {
  .pub, .news-item--row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .banner h1 { font-size: 9vw; }
  .grid--members { grid-template-columns: 1fr; }
}
