/* ==========================================================================
   Evolvo Ergo Sum — shared component styles
   Colours come from the --ees-* custom properties defined in theme.scss
   (light) and theme-dark.scss (dark), so everything here works in both modes.
   ========================================================================== */

/* --- Typographic rhythm ------------------------------------------------- */

h1, h2, h3, h4, h5, h6,
.quarto-title h1.title,
.navbar-title {
  letter-spacing: 0.01em;
}

h1, .quarto-title h1.title {
  font-size: 2.6rem;
  font-weight: 600;
}

h2 {
  font-size: 1.9rem;
  border-bottom: 1px solid var(--ees-rule);
  padding-bottom: 0.3rem;
  margin-top: 2.2rem;
}

h3 { font-size: 1.5rem; }

.subtitle {
  font-family: var(--ees-font-display);
  font-size: 1.25rem;
  color: var(--ees-muted);
}

blockquote {
  border-left: 3px solid var(--ees-accent-2);
  padding-left: 1.1rem;
  font-style: italic;
  color: var(--ees-muted);
}

/* --- Navbar -------------------------------------------------------------- */

.navbar {
  font-family: var(--ees-font-display);
  /* Light mode: the green navbar already separates from the cream page.
     Dark mode: this edge stops it disappearing into the background. */
  border-bottom: 1px solid var(--ees-navbar-edge);
}

.navbar .navbar-title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.navbar .nav-link,
.navbar .dropdown-item {
  font-size: 1.05rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Between the hamburger breakpoint and a roomy desktop there are a lot of nav
   items competing with the brand, which Quarto truncates with an ellipsis.
   Shrinking both a little lets the full site title survive. */
@media (min-width: 992px) and (max-width: 1300px) {
  .navbar .navbar-title { font-size: 1.15rem; }
  .navbar .nav-link,
  .navbar .dropdown-item { font-size: .92rem; }
  .navbar .navbar-nav { gap: 0; }
}

/* --- About ("jolla") homepage -------------------------------------------- */

.quarto-about-jolla .about-image {
  border: 6px solid var(--ees-surface);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
}

.quarto-about-jolla main {
  max-width: 44rem;
}

.quarto-about-jolla .about-sep {
  width: 4rem;
  margin: 2rem auto 1.6rem;
  border: 0;
  border-top: 2px solid var(--ees-accent-2);
  opacity: 1;
}

.quarto-about-jolla .about-links {
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.quarto-about-jolla .about-link {
  border: 1px solid var(--ees-rule);
  border-radius: 2rem;
  padding: 0.35rem 0.95rem;
  color: var(--ees-accent);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.quarto-about-jolla .about-link:hover,
.quarto-about-jolla .about-link:focus {
  background-color: var(--ees-accent);
  border-color: var(--ees-accent);
  color: var(--ees-on-accent);
  text-decoration: none;
}

/* --- Blog listings ------------------------------------------------------- */

.quarto-listing .listing-title {
  font-family: var(--ees-font-display);
  font-size: 1.45rem;
}

.quarto-listing .listing-date,
.quarto-listing .listing-reading-time {
  color: var(--ees-muted);
  font-size: .85rem;
}

.quarto-category {
  border: 1px solid var(--ees-rule) !important;
  background: transparent !important;
  color: var(--ees-muted) !important;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* --- Project / research cards -------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--ees-surface);
  border: 1px solid var(--ees-rule);
  border-radius: .5rem;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .14);
}

.project-card img {
  width: 100%;
  height: 11rem;
  object-fit: cover;
  display: block;
}

.project-card-body {
  padding: 1.1rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.project-card h3 {
  font-size: 1.35rem;
  margin: 0 0 .15rem;
}

.project-card h3 a {
  text-decoration: none;
  color: var(--ees-accent);
}

.project-card h3 a:hover { text-decoration: underline; }

.project-card .project-tagline {
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ees-accent-2);
  margin-bottom: .6rem;
}

.project-card p {
  font-size: .95rem;
  margin-bottom: 1rem;
}

.project-card .project-more {
  margin-top: auto;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ees-accent);
  text-decoration: none;
}

.project-card .project-more:hover { text-decoration: underline; }

/* --- Publications -------------------------------------------------------- */

.pub-filter {
  width: 100%;
  padding: .55rem .9rem;
  margin: 1rem 0 .4rem;
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
  background: var(--ees-surface);
  border: 1px solid var(--ees-rule);
  border-radius: .35rem;
}

.pub-filter:focus {
  outline: 2px solid var(--ees-accent);
  outline-offset: 1px;
}

.pub-count {
  font-size: .88rem;
  color: var(--ees-muted);
  margin-bottom: 1.2rem;
}

/* One publication: year in a narrow left column, citation on the right. */
.pub-item {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--ees-rule);
}

.pub-item:last-child { border-bottom: 0; }

.pub-when {
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  color: var(--ees-muted);
  padding-top: .15rem;
}

.pub-title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

a.pub-title { color: var(--ees-accent); text-decoration: none; }
a.pub-title:hover,
a.pub-title:focus { text-decoration: underline; }

.pub-authors {
  font-size: .9rem;
  color: var(--ees-muted);
  margin-top: .25rem;
}

.pub-authors b { color: inherit; font-weight: 600; }

.pub-venue {
  font-size: .9rem;
  margin-top: .1rem;
}

.pub-status {
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .1rem .5rem;
  border: 1px solid var(--ees-rule);
  border-radius: 1rem;
  color: var(--ees-muted);
  white-space: nowrap;
}

a.pub-status--link {
  color: var(--ees-accent);
  border-color: var(--ees-accent);
  text-decoration: none;
}

.pub-empty {
  color: var(--ees-muted);
  font-style: italic;
  padding: 1rem 0;
}

/* --- Photo gallery ------------------------------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.photo-grid figure,
.photo-grid .quarto-figure {
  margin: 0;
}

.photo-grid img {
  width: 100%;
  height: 14rem;
  object-fit: cover;
  border-radius: .4rem;
  display: block;
  transition: transform .2s ease, filter .2s ease;
}

.photo-grid img:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.photo-grid figcaption {
  font-size: .82rem;
  color: var(--ees-muted);
  margin-top: .35rem;
  text-align: left;
}

/* --- "Now" page ---------------------------------------------------------- */

.now-updated {
  font-size: .9rem;
  color: var(--ees-muted);
  border-left: 3px solid var(--ees-accent-2);
  padding-left: .85rem;
  margin-bottom: 2rem;
}

.now-list h3 {
  margin-top: 1.8rem;
  font-size: 1.35rem;
  color: var(--ees-accent);
}

/* --- Footer -------------------------------------------------------------- */

.nav-footer {
  border-top: 1px solid var(--ees-rule);
  font-size: .9rem;
  color: var(--ees-muted);
}

/* --- Legacy callouts kept from the previous theme ------------------------ */

.render-commit-push,
.pull {
  padding: .5em .5em 0 3em;
  margin: 5px 0;
  background-color: var(--ees-tint);
  background-repeat: no-repeat;
  border-top: 1px solid var(--ees-accent);
  border-bottom: 1px solid var(--ees-accent);
}

.render-commit-push {
  background-image: url("figures/render-commit-push.png");
  background-size: 2em;
  background-position: .5em .5em;
}

.pull {
  background-image: url("figures/pull.png");
  background-size: 1em;
  background-position: 1em .5em;
}

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 575.98px) {
  h1, .quarto-title h1.title { font-size: 2.05rem; }
  h2 { font-size: 1.6rem; }
  .pub-item { grid-template-columns: 1fr; gap: .15rem; }
  .pub-when { font-weight: 600; }
  .photo-grid img { height: 12rem; }
}
