@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Standard flyer dimensions */
  --flyer-width-letter: 8.5in; /* US Letter (most common) */
  --flyer-height-letter: 11in;
  --flyer-width-a4: 8.27in; /* A4 International */
  --flyer-height-a4: 11.69in;
  --flyer-width-half: 5.5in; /* Half-sheet */
  --flyer-height-half: 8.5in;
  --flyer-width-tabloid: 11in; /* Large format */
  --flyer-height-tabloid: 17in;

  /* Current format - can be changed by updating these variables */
  --flyer-width: var(--flyer-width-letter);
  --flyer-height: var(--flyer-height-letter);
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #000000;
  color: #ffffff;
  line-height: 1.6;
}

.flyer {
  max-width: var(--flyer-width);
  min-height: var(--flyer-height);
  width: var(--flyer-width);
  margin: 2rem auto;
  background: #000000 url("background/background.png") no-repeat center center;
  background-size: cover;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.flyer-logos {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: absolute;
  top: 2rem;
  left: 3rem;
  right: 3rem;
  z-index: 10;
}

.princeton-logo-link,
.orfe-logo-link {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  display: block;
}

.princeton-logo-link:hover,
.orfe-logo-link:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.princeton-logo,
.orfe-logo {
  height: 60px;
  width: auto;
  display: block;
}

.header {
  text-align: center;
  margin-top: 6rem;
  padding-bottom: 1rem;
}

.university h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.university h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.event-info {
  margin-top: 0.1rem;
}

.event-title {
  font-size: 1.8rem;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 1.2rem;
  letter-spacing: -0.005em;
}

.event-details {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.event-location,
.event-time {
  font-size: 1.2rem;
  color: #cccccc;
  margin-bottom: 0;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.location-icon,
.time-icon {
  color: #e87722;
  flex-shrink: 0;
}

.speakers-grid {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-bottom: 2rem;
  border-top: 1px solid #333333;
}

/* Preview index specific styles: simplified flyer list rows */
.flyer-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.flyer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.flyer-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flyer-name {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.format-links {
  display: flex;
  gap: 8px;
}

.format-link { color: #0a5ec2; text-decoration: none; }
.format-link .badge { background: #e87722; color: #fff; padding: 4px 8px; border-radius: 999px; font-size: 0.8rem; }
.format-link.html-link .badge { background: #0a5ec2; }

.speaker {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #333333;
  transition: background-color 0.2s ease;
}

/* Fit-to-page. index.html is printed on one sheet, so when a semester has
   enough speakers - or long enough talk titles - to overflow, the layout
   tightens in steps rather than spilling the footer onto a second page.
   Applied by script.js only when it measures an overflow. */
.flyer.density-1 .speaker { padding: 0.7rem 0; }
.flyer.density-1 .speakers-grid { margin-bottom: 1.25rem; }
.flyer.density-1 .speaker-talk-title { font-size: 0.88rem; }

.flyer.density-2 .speaker { padding: 0.45rem 0; gap: 2rem; }
.flyer.density-2 .speakers-grid { margin-bottom: 0.85rem; }
.flyer.density-2 .speaker-name { font-size: 1.15rem; }
.flyer.density-2 .speaker-talk-title { font-size: 0.84rem; line-height: 1.3; }
.flyer.density-2 .events-qr { width: 68px; height: 68px; }

.flyer.density-3 .speaker { padding: 0.25rem 0; gap: 1.5rem; }
.flyer.density-3 .speakers-grid { margin-bottom: 0.5rem; }
.flyer.density-3 .speaker-name { font-size: 1.05rem; }
.flyer.density-3 .speaker-photo,
.flyer.density-3 .speaker-photo-spacer { width: 74px; height: 74px; }
.flyer.density-3 .speaker-talk-title { font-size: 0.8rem; line-height: 1.25; }
.flyer.density-3 .events-qr { width: 60px; height: 60px; }

.speaker:hover {
  background-color: rgba(232, 119, 34, 0.05);
}

.speaker-datetime {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.speaker-date {
  font-size: 1.2rem;
  font-weight: 600;
  color: #e87722;
  text-align: left;
}

.speaker-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: #cccccc;
  text-align: left;
  margin-left: 0.5rem;
}

.speaker-location .location-icon {
  width: 16px;
  height: 16px;
  color: #e87722;
}

.speaker-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: #cccccc;
  text-align: left;
  margin-left: 0.5rem;
}

.speaker-time .time-icon {
  width: 16px;
  height: 16px;
  color: #e87722;
}

.speaker-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Holds the photo column open when only some speakers on a flyer have one, so
   the names still line up. Nothing is drawn - this is not a placeholder. */
.speaker-photo-spacer {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.speaker-photo-link {
  display: block;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  border-radius: 50%;
  flex-shrink: 0;
}

.speaker-photo-link:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.speaker-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e87722;
  box-shadow: 0 4px 15px rgba(232, 119, 34, 0.2);
  flex-shrink: 0;
  display: block;
}

.speaker-details {
  flex: 1;
  text-align: left;
}

.speaker-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.speaker-title {
  font-size: 0.95rem;
  color: #aaaaaa;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.speaker-affiliation {
  font-size: 0.9rem;
  color: #888888;
  margin-bottom: 1rem;
  line-height: 1.4;
  font-style: italic;
}

.speaker-talk {
  font-size: 1rem;
  font-weight: 500;
  color: #e87722;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.speaker-abstract {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.5;
  text-align: left;
  max-height: 120px;
  overflow: hidden;
}

.footer {
  text-align: center;
  margin-top: auto;
}

.contact p {
  font-size: 0.95rem;
  color: #cccccc;
  margin-bottom: 0.5rem;
}

.website {
  font-weight: 500;
  color: #e87722;
}

.event-title-note {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid #e87722;
  border-radius: 999px;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e87722;
  vertical-align: middle;
}

.events-qr-link {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1rem;
  text-decoration: none;
  color: inherit;
}

/* White plate behind the code: the flyer is dark, and scanners want dark
   modules on a light field. The padding is the QR quiet zone. */
.events-qr-frame {
  display: block;
  background: #ffffff;
  padding: 0.3rem;
  border-radius: 4px;
  line-height: 0;
  flex-shrink: 0;
}

.events-qr {
  display: block;
  width: 84px;
  height: 84px;
}

.events-qr-caption {
  text-align: left;
}

.events-qr-lead {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e87722;
}

.events-qr-url {
  display: block;
  font-size: 0.8rem;
  color: #cccccc;
}

/* Talk title, under the speaker's name. */
.speaker-talk-title {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #e0e0e0;
  font-weight: 500;
}

@media print {
  body {
    background: black;
    margin: 0;
    padding: 0;
    height: 100vh;
  }

  .flyer {
    margin: 0;
    box-shadow: none;
    max-width: none;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    background: #000000 url("background/background.png") no-repeat center top !important;
    background-size: 100% 100% !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  }

  .speaker:hover {
    transform: none;
    box-shadow: none;
  }

  .speaker-photo {
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  .flyer {
    margin: 1rem;
    padding: 2rem;
  }

  .speakers-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .university h1 {
    font-size: 2rem;
  }

  .event-title {
    font-size: 1.5rem;
  }
}
