/* ─── Layout: project pages can use the full viewport ─────────────── */
body:not(.page-layout-full) main.content {
  max-width: 1140px;
}

/* ─── Sticky side-map on project pages ────────────────────────────── */
.sticky-map {
  position: sticky;
  top: 88px;
  align-self: start;
}
.sticky-map .map-caption {
  margin-top: 10px;
  font-size: 0.84rem;
  color: #4a5560;
  line-height: 1.5;
}
.sticky-map iframe {
  display: block;
  width: 100%;
  height: 820px;
  max-height: calc(100vh - 80px);
  min-height: 640px;
  border: 1px solid #c8bfa8;
  border-radius: 10px;
  background: #fbf9f4;
  box-shadow: 0 1px 2px rgba(28, 34, 40, 0.04),
              0 8px 24px rgba(28, 34, 40, 0.06);
}
@media (max-width: 991.98px) {
  .sticky-map { position: static; }
  .sticky-map iframe { height: 860px; max-height: none; min-height: 720px; }
}

/* ─── Project cards (projects/index.qmd) ──────────────────────────── */
.project-card {
  background: #ffffff;
  border: 1px solid #e6dfd0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.1rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  position: relative;
}
.project-card::before {
  content: "";
  position: absolute;
  left: 0; top: 18%;
  width: 3px; height: 64%;
  background: linear-gradient(180deg, #134e60, #c25d3b);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.project-card:hover {
  box-shadow: 0 1px 2px rgba(28, 34, 40, 0.04),
              0 10px 24px rgba(28, 34, 40, 0.08);
  border-color: #c8bfa8;
  transform: translateY(-1px);
}
.project-card:hover::before { opacity: 1; }
.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
  font-family: "Newsreader", Georgia, serif;
  letter-spacing: -0.01em;
}
.project-card h3 a { color: #134e60; }
.project-card h3 a:hover { color: #c25d3b; text-decoration: none; }
.project-card p { margin-bottom: 0.5rem; color: #4a5560; }
.project-card .tags {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7a8492;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.2rem 0;
  border-top: 1px dashed #e6dfd0;
  width: 100%;
}

/* ─── Publication cards (publications.qmd) ───────────────────────── */
.publication {
  padding: 0.85rem 0;
  border-bottom: 1px solid #e6dfd0;
}
.publication:last-child { border-bottom: none; }
.publication::after { content: ""; display: block; clear: both; }

/* Inline cover thumbnail for book chapters / proceedings entries */
.publication .book-icon {
  float: left;
  width: 56px;
  height: auto;
  margin: 4px 16px 4px 0;
  border-radius: 3px;
  border: 1px solid #e6dfd0;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(28, 34, 40, 0.08),
    0 4px 10px rgba(28, 34, 40, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.publication.with-cover:hover .book-icon {
  transform: translateY(-1px);
  box-shadow:
    0 1px 2px rgba(28, 34, 40, 0.10),
    0 8px 18px rgba(28, 34, 40, 0.12);
}

/* Journal-article badge (styled "fake cover" generated locally) */
.publication .journal-icon {
  float: left;
  width: 56px;
  height: auto;
  margin: 4px 16px 4px 0;
  border-radius: 3px;
  border: 1px solid #e6dfd0;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(28, 34, 40, 0.06),
    0 4px 10px rgba(28, 34, 40, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.publication.with-cover:hover .journal-icon {
  transform: translateY(-1px);
  box-shadow:
    0 1px 2px rgba(28, 34, 40, 0.10),
    0 8px 16px rgba(28, 34, 40, 0.10);
}
.publication a {
  color: #1c2228;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.publication a:hover {
  color: #c25d3b;
  border-bottom-color: #c25d3b;
}
.publication .pub-venue {
  display: inline-block;
  font-style: italic;
  color: #4a5560;
  font-size: 0.93rem;
  margin-top: 0.15rem;
}
.publication .pub-title {
  font-weight: 600;
}

/* ─── Map iframe caption on AtET / SOC project pages ─────────────── */
.map-caption b {
  color: #1c2228;
}

/* ─── Buttons / CTAs ─────────────────────────────────────────────── */
.btn.btn-primary {
  background-color: #134e60;
  border-color: #134e60;
  color: #fff;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 6px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn.btn-primary:hover {
  background-color: #0a3543;
  border-color: #0a3543;
  transform: translateY(-1px);
  color: #fff;
}

/* ─── Figures (matplotlib screenshots, paper figs) ───────────────── */
figure.quarto-figure img,
main img:not(.about-image) {
  border-radius: 8px;
  border: 1px solid #e6dfd0;
  background: #fff;
}
figure.quarto-figure figcaption {
  font-size: 0.86rem;
  color: #4a5560;
  margin-top: 0.55rem;
  line-height: 1.5;
}

/* ─── About page list spacing ────────────────────────────────────── */
main ul li { margin-bottom: 0.25rem; }

/* ─── Book-cover gallery (publications page) ─────────────────────── */
.book-gallery {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  margin: 1rem 0 1.75rem;
  align-items: end;
  max-width: 760px;
}
/* Quarto wraps consecutive inline elements in <p>; flatten so each tile
   is a direct child of the grid container. */
.book-gallery > p { display: contents; }
@media (max-width: 900px) {
  .book-gallery { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 600px) {
  .book-gallery { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 400px) {
  .book-gallery { grid-template-columns: repeat(3, 1fr); }
}
.book-tile {
  display: block;
  text-decoration: none;
  transition: transform 0.22s ease;
}
.book-tile img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  background: #fff;
  border: 1px solid #e6dfd0;
  box-shadow:
    0 1px 2px rgba(28, 34, 40, 0.08),
    0 4px 10px rgba(28, 34, 40, 0.08),
    inset 1px 0 0 rgba(255, 255, 255, 0.6);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.book-tile:hover { transform: translateY(-3px); text-decoration: none; }
.book-tile:hover img {
  box-shadow:
    0 1px 2px rgba(28, 34, 40, 0.10),
    0 12px 24px rgba(28, 34, 40, 0.16);
}
.book-gallery-note {
  font-size: 0.84rem;
  color: #4a5560;
  font-style: italic;
  margin: -0.25rem 0 1.5rem;
  max-width: 56ch;
}

/* ─── Awards / certificates gallery (cv.qmd) ─────────────────────── */
.award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 1.25rem 0 2rem;
}
.award-grid > p { display: contents; }   /* flatten Quarto's <p> wrap */

.award-card {
  background: #ffffff;
  border: 1px solid #e6dfd0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.award-card:hover {
  box-shadow:
    0 1px 2px rgba(28, 34, 40, 0.06),
    0 10px 22px rgba(28, 34, 40, 0.12);
  transform: translateY(-2px);
}
.award-card .cert-image {
  display: block;
  width: 100%;
  aspect-ratio: 320 / 250;
  object-fit: contain;
  object-position: center;
  background: #f7f3eb;
  border-bottom: 1px solid #e6dfd0;
}
.award-card .cert-placeholder {
  width: 100%;
  aspect-ratio: 320 / 250;
  background:
    repeating-linear-gradient(135deg, #f7f3eb 0 18px, #f3ecd9 18px 36px);
  border-bottom: 1px solid #e6dfd0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9c8e75;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.award-card .cert-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.award-card .cert-title {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  color: #1c2228;
  line-height: 1.3;
}
.award-card .cert-venue {
  font-size: 0.82rem;
  color: #4a5560;
  line-height: 1.4;
}
.award-card .cert-year {
  margin-top: auto;
  font-size: 0.72rem;
  color: #9c8e75;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding-top: 6px;
  border-top: 1px dashed #e6dfd0;
}

/* ─── Page footer ────────────────────────────────────────────────── */
.nav-footer .nav-footer-center { text-align: center; }
.nav-footer a { color: #4a5560; }
.nav-footer a:hover { color: #c25d3b; }
