/* APME 2027 — styled after the original mmsevents.ca/apme2027 site */

:root {
  --blue: #00318b;
  --blue-dark: #001387;
  --navy: #0d2c5e;
  --copper: #b07a2a;
  --link: #3a6fb0;
  --text: #222;
  --muted: #666;
  --box-bg: #f0f5fa;
  --box-border: #b9cfe8;
}

* { box-sizing: border-box; }
html { background: #fff; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-y: scroll; scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1170px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Navbar ---------- */
.navbar { background: var(--blue); border-bottom: 1px solid var(--blue-dark); position: sticky; top: 0; z-index: 50; }
.navbar-inner { display: flex; align-items: center; min-height: 50px; }
.logo { display: block; padding: 10px 14px 10px 0; }
.navbar ul { list-style: none; margin: 0; padding: 0; display: flex; }
.navbar nav a {
  display: block; padding: 15px 15px; color: #fff; font-size: 15px; line-height: 20px;
}
.navbar nav a:hover { background: var(--blue-dark); text-decoration: none; }
.navbar nav a.active { background: var(--blue-dark); }
.menu-toggle { display: none; }

@media (max-width: 767px) {
  .navbar-inner { flex-wrap: wrap; justify-content: space-between; min-height: 64px; }
  .logo img { width: 34px; height: auto; }
  .menu-toggle {
    display: block; background: transparent; border: 1px solid var(--blue-dark); border-radius: 4px;
    padding: 10px 12px; cursor: pointer;
  }
  .menu-toggle .bar { display: block; width: 24px; height: 3px; background: #fff; border-radius: 1px; }
  .menu-toggle .bar + .bar { margin-top: 5px; }
  .navbar nav { display: none; width: 100%; padding-bottom: 8px; }
  .nav-open .navbar nav { display: block; }
  .navbar ul { flex-direction: column; }
  .navbar nav a { padding: 12px 4px; font-size: 17px; }
}

/* ---------- Page ---------- */
main { padding-bottom: 48px; flex: 1 0 auto; width: 100%; }
.site-title {
  text-align: center; font-weight: bold; font-size: 26px; line-height: 1.25;
  margin: 28px auto 18px; max-width: 900px;
}
h1 { font-size: 40px; font-weight: normal; line-height: 1.15; margin: 24px 0 18px; }
h2 { font-size: 26px; margin: 40px 0 14px; }
h3 { font-size: 19px; margin: 20px 0 6px; }
p { margin: 0 0 14px; }
main > p, main > ul { max-width: 860px; }

/* ---------- Save the date (home) ---------- */
.std {
  display: grid; gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  grid-template-areas:
    "col top1 top2"
    "col head info";
}
.std .ph { position: relative; overflow: hidden; min-height: 0; }
.std .ph img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
/* Left photo column: the absolute stack adds no height, so it fills the row height set by the other columns */
.std-col { grid-area: col; position: relative; min-height: 0; }
.std-stack { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 10px; }
.std-stack .ph { flex: 1.55 1 0; }
.std-stack .ph:nth-child(2) { flex: 1 1 0; }
.std-stack .ph:first-child img { object-position: center 30%; }
.std-top1, .std-top2 { height: 0; padding-bottom: 41.667%; } /* 2.4:1 */
.std-top1 { grid-area: top1; }
.std-top2 { grid-area: top2; }
.std-head {
  grid-area: head; align-self: center; justify-self: center; margin: 0;
  font-family: "Oswald", "Arial Narrow", sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: clamp(60px, 9vw, 130px); line-height: .92; color: var(--navy);
}
.std-head span { display: block; }
.std-info { grid-area: info; align-self: center; padding: 24px 0 24px 28px; border-left: 2px solid #e2e5ea; }
.std .std-logo { width: 220px; height: auto; object-fit: contain; margin-bottom: 14px; }
.std-date { color: var(--copper); font-weight: bold; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.2; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 2px solid #e2e5ea; }
.std-label { font-family: "Oswald", "Arial Narrow", sans-serif; font-weight: 700; text-transform: uppercase; color: var(--copper); font-size: 15px; margin-bottom: 8px; }
.std-org { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.3; }
.std-org b { display: block; color: var(--navy); font-size: 19px; }

@media (max-width: 1023px) and (min-width: 768px) {
  .std-info { padding-left: 18px; }
  .std .std-logo { width: 170px; }
  .std-org b { font-size: 16px; }
}

@media (max-width: 767px) {
  .std {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "head head"
      "info info"
      "top1 top2"
      "col  col";
  }
  .std-stack { position: static; flex-direction: row; }
  .std-stack .ph, .std-stack .ph:nth-child(2) { flex: 1 1 0; height: 0; padding-bottom: 31%; }
  .std-top1, .std-top2 { padding-bottom: 66.667%; }
  .std-head { justify-self: start; font-size: 56px; margin-top: 4px; }
  .std-head span { display: inline; }
  .std-info { border-left: 0; padding: 0 0 12px; }
  .std .std-logo { width: 180px; }
}

/* ---------- Speakers ---------- */
h2.fancy {
  text-align: center; font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: clamp(32px, 4vw, 48px); color: var(--navy); margin: 56px 0 32px;
}
.speakers { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 24px; max-width: none; }
.speaker { text-align: center; }
.speaker img { width: 100%; max-width: 260px; aspect-ratio: 4 / 5; object-fit: cover; margin: 0 auto 14px; }
.speaker h3 { font-size: 18px; line-height: 1.3; margin: 0 0 8px; }
@media (max-width: 991px) { .speakers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .speakers { grid-template-columns: 1fr; } .speaker img { max-width: 300px; } }

.plain { list-style: none; padding: 0; margin: 0 0 14px; }
.plain li { margin-bottom: 4px; }
.invited li { margin-bottom: 6px; }
.invited .n { font-weight: bold; }

/* ---------- About ---------- */
.themes { padding-left: 22px; }
.themes li { margin-bottom: 8px; }

/* ---------- Boxes / notices ---------- */
.box { background: var(--box-bg); border: 1px solid var(--box-border); padding: 24px 28px; margin: 0 0 24px; max-width: 860px; }
.box-title { font-size: 20px; margin: 0 0 10px; line-height: 1.35; }
.box h3 { margin-top: 18px; }
.notice { border: 1px solid #d9443b; color: #d9443b; font-weight: bold; padding: 14px 20px; }
.alert { background: #b5261e; color: #fff; font-weight: bold; padding: 14px 20px; }

/* ---------- Contact form ---------- */
.form label { display: block; font-weight: bold; margin: 14px 0 6px; }
.form label:first-child { margin-top: 0; }
.form input, .form textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #ccc; border-radius: 4px;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: var(--link); }
.form button {
  margin-top: 18px; padding: 10px 22px; font: inherit; font-weight: bold; color: #fff;
  background: var(--blue); border: 0; border-radius: 4px; cursor: pointer;
}
.form button:hover { background: var(--blue-dark); }
.form button:disabled { opacity: .6; cursor: default; }
.form-status { margin: 14px 0 0; font-weight: bold; }
.form-status:empty { display: none; }
.form-status.ok { color: #1e7a34; }
.form-status.err { color: #b5261e; }

/* ---------- Bio pages ---------- */
.back { margin-top: 20px; font-size: 15px; }
.bio { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; max-width: 1000px; }
.bio h2 { margin-top: 0; }
@media (max-width: 680px) { .bio { grid-template-columns: 1fr; } .bio img { max-width: 260px; } h1 { font-size: 30px; } }

/* ---------- Footer ---------- */
.footer { background: var(--blue); color: #fff; padding: 28px 0; border-top: 6px solid var(--blue-dark); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 48px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.footer a { color: #fff; font-size: 15px; }

.to-top {
  position: fixed; right: 0; bottom: 120px; width: 48px; height: 48px;
  display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 26px; line-height: 1;
  border-radius: 6px 0 0 6px; text-decoration: none;
}
.to-top:hover { background: var(--blue-dark); text-decoration: none; }

@media (max-width: 767px) {
  .site-title { font-size: 20px; margin: 20px auto 14px; }
  .to-top { width: 40px; height: 40px; bottom: 16px; font-size: 22px; }
}

.std-top1 img { object-position: 45% center; }
