@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;600&display=swap');
:root {
  --primary: #004B87;

  --accent: #F0B7A4;
  --bg: #A8DADC;
  --text: #457B9D;
  --accent-light: #F1FAEE;

  --primary-dark: #003961;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

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

.page-title {
  text-align: center;
}
body {
  font-family: 'Roboto Mono', monospace;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
.container {
  padding-left: 1rem;
  padding-right: 1rem;
  margin: 0 auto;
  max-width: 100%;
  flex: 1;
}
header {
  background: var(--primary);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
header .logo img {
  height: 150px;
}
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  margin-left: auto;
  width: 44px;
  height: 44px;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  position: relative;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: #0B3D91;
  flex-direction: column;
}

.mobile-menu li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu li:last-child {
  border-bottom: none;
}

.mobile-menu.open {
  display: block;
}

.talk-cta,
.view-all a,
.mobile-menu-toggle {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  display: inline-block;
}
header .site-nav .nav-list {
  display: flex;
  gap: 1rem;
}
header .site-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem;
}
  header .site-nav a:hover {
  text-decoration: underline;
  color: #457b9d;
}
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
}
footer {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 0.5rem 1rem;
  width: 100%;
}
footer a {
  color: #fff;
}
footer a:hover {
  color: #457b9d;
}
a:active,
footer a:active,
header .site-nav a:active {
  color: #A8DADC;
}
a {
  color: var(--primary);
}
a:hover {
  color: #003961;
}
.talk .images {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.talk-header {
  display: flex;

  flex-direction: row;
  align-items: center;
  gap: 1rem;
}
.talk-header .talk-meta {
  text-align: left;
}
.talk-header h1,
.talk-header p {
  margin: 0;
}
.talk-header h1 {
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: bold;
}
.talk-header .speaker {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.talk-header .affiliation {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.talk-header .date {
  margin-top: 0.5rem;
  font-size: 1.5rem;
}
.talk-header .date .rsvp-link {
  background: var(--primary);
  color: var(--accent-light);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
}

.talk {
  padding-left: 1rem;
  padding-right: 1rem;
}

.talk .speaker-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  border: 3px solid var(--primary);

}
.video iframe {
  width: 100%;
  max-width: 560px;
  height: 315px;
}
.talk-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.talk-table th,
.talk-table td {
  border: 1px solid #444;
  padding: 0.5rem;
}
.talk-table th {
  background: var(--primary);
  color: #fff;
}
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}
.calendar-table th,
.calendar-table td {
  border: 1px solid #444;
  text-align: center;
  padding: 0.25rem;
}
.calendar-table .event-day {
  background: var(--accent);
  color: #000;
  font-weight: bold;
}

.upcoming-talk {
  background: #457b9d;
  color: #f1faee;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);

  margin: 1rem auto 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 2px solid var(--primary);

}
.upcoming-talk a {
  color: #f1faee;
}
.upcoming-talk a:hover {
  text-decoration: underline;
  color: #F0B7A4;
}
.upcoming-talk:hover,
.upcoming-talk:focus-within {
  box-shadow: 0 0 0 3px #F0B7A4;
}
.upcoming-talk h2 {
  margin-top: 0;
  text-align: center;
}
.upcoming-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.upcoming-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.upcoming-date {
  font-weight: bold;
  margin-right: 1rem;
  white-space: nowrap;
  min-width: 7rem;
}
.upcoming-details {
  text-align: left;
  flex: 1;
}
.upcoming-details .title {
  font-size: 1.1rem;
  font-weight: 600;
}
.upcoming-details .affiliation {
  font-size: 0.9rem;
}
.upcoming-details .meta {
  font-size: 1.1rem;
}

/* Card layout for previous talks and lecture series */
.previous-talks-cards,
.lecture-series-cards {
  display: none;
}

.previous-talks-cards .talk-card,
.lecture-series-cards .talk-card {
  background: #457b9d;
  color: #f1faee;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 2px solid var(--primary);
}
.previous-talks-cards .talk-date,
.previous-talks-cards .talk-title,
.previous-talks-cards .talk-speaker,
.previous-talks-cards .talk-affiliation,
.lecture-series-cards .talk-date,
.lecture-series-cards .talk-title,
.lecture-series-cards .talk-speaker,
.lecture-series-cards .talk-affiliation {
  margin-bottom: 0.25rem;
}

.previous-talks-cards .talk-card a,
.lecture-series-cards .talk-card a {
  color: #f1faee;
}

.previous-talks-cards .talk-card a:hover,
.lecture-series-cards .talk-card a:hover {
  text-decoration: underline;
  color: #F0B7A4;
}
@media (max-width: 600px) {
  header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  header .logo img {
    height: 75px;
  }
  header .site-nav .nav-list {
    flex-direction: column;
    width: auto;
    align-items: flex-end;
    text-align: right;
  }
  header .site-nav a {
    padding: 0.25rem 0;
    font-size: 0.85rem;
  }
  .talk-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .talk .speaker-photo {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1 / 1;
  }
  .talk-table,
  .calendar-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .lecture-table {
    white-space: normal;
  }
  .lecture-table td {
    white-space: normal;
    word-break: break-word;
  }

  .talk-header h1 {
    font-size: 1.75rem;
  }

  .talk-header .speaker,
  .talk-header .affiliation,
  .talk-header .date {
    font-size: 1.2rem;
  }

  .talk-table th,
  .talk-table td {
    font-size: 0.85rem;
    padding: 0.25rem;
  }

  .upcoming-talk {
    max-width: 100%;
    padding: 0.75rem;
  }

  /* Stack upcoming talk details vertically */
  .upcoming-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .upcoming-date {
    margin-right: 0;
    margin-bottom: 0.25rem;
    min-width: auto;
  }

  /* Convert previous talks table to card layout */
  .talk-table {
    display: block;
    border: none;
  }
  .talk-table thead {
    display: none;
  }
  .talk-table tr {
    display: block;
    border: 1px solid #444;
    margin-bottom: 1rem;
    padding: 0.5rem;
  }
  .talk-table td {
    display: block;
    border: none;
    text-align: left;
    padding: 0.25rem 0;
    font-size: 0.9rem;
  }
  .talk-table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: inline-block;
    width: 45%;
    margin-right: 0.5rem;
  }
}

/* ### START MOBILE OVERRIDES ### */
/* Place this block at the end of your existing stylesheet: */

@media screen and (max-width: 640px) {

  /* 1. Ensure the main container pads the viewport edges */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .previous-talks-table,
  .lecture-series-table {
    display: none;
  }
  .previous-talks-cards,
  .lecture-series-cards {
    display: block;
  }

  /* Remove styling on previous talk cards in mobile view */
  .previous-talks-cards .talk-card,
  .lecture-series-cards .talk-card {
    background: none;
    border: none;
    color: inherit;
  }
  .previous-talks-cards .talk-card a,
  .lecture-series-cards .talk-card a {
    color: var(--text);
  }

  /* 2. Collapse upcoming talk layout into a vertical card */
  .upcoming .talk-card {
    display: block !important;
  }
  .upcoming .talk-card img,
  .upcoming .talk-card .media,
  .upcoming .talk-card .content {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
  }

  /* 3. Stack the past-talks grid into one column */
  .past-list {
    display: block !important;
  }
  .past-list .talk-card {
    width: 100% !important;
    margin-bottom: 1rem !important;
  }

  /* 4. Tweak typography for small screens */
  h2 {
    font-size: 1.2rem !important;
    margin-top: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  .talk-title {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }
  .talk-date,
  .talk-speaker,
  .talk-affiliation {
    font-size: 0.85rem !important;
  }

  /* 5. Adjust call-to-action links and footers */
  .talk-cta,
  .view-all a {
    font-size: 1rem !important;
    padding: 0.75rem 1rem !important;
    display: inline-block !important;
  }

  /* 6. Prevent horizontal overflow */
  body, html {
    overflow-x: hidden !important;
  }
  img, iframe, table {
    max-width: 100% !important;
    height: auto !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
}

/* ### END MOBILE OVERRIDES ### */
