.pub-layout {
  display: flex;
  flex-direction: column; /* mobile-first: stack */
  gap: 1rem;
}

.pub-side {
  flex: 1;
  display: flex;              /* make it a flexbox */
  flex-direction: column;     /* stack heading + paragraph */
  justify-content: flex-start; /* align to top (default) */
  padding: 0rem;
  border-bottom: 1px solid #ccc; 
}

.pub-container-narrow {
  max-width: 750px;
}

.pub-container-slim {
  max-width: 600px;
}

.pub-divider {
  color: #888; /* or #6c757d for Bootstrap-muted tone */
  padding: 0 0.25rem;
}

.pub-logos {
  display: flex;
  flex-direction: column-reverse; /* right logos appear above left on mobile */
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pub-logo-left img,
.pub-logo-right img {
  height: 60px;
  object-fit: contain;
}

.pub-logo-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.pub-title {
  font-family: Harding, Palatino, serif;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #212529;
}

.pub-meta,
.pub-authors {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Oxygen-Sans",
               Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  color: #555;
  line-height: 1.3;
  margin-bottom: 0rem;
}

.pub-image img {
  width: 100vw;   /* full viewport width */
  max-width: 100%; /* prevent overflow on desktop */
  height: auto;   /* keep aspect ratio */
  object-fit: cover; /* optional: crop to fill */
  display: block;
}

html[data-theme="dark"] .pub-image img {
  border: 1px solid #4a90e2 !important;
}

@media (min-width: 1000px) {
  .pub-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch; 
  }

  .pub-layout--right{
    justify-content: flex-end; 
    padding-right: 2rem;
  }

  .pub-side {
    max-width: 400px; /*keep your existing constraint */
    text-align: right; /* new: right-align text */
    padding-right: 1.5rem; /* space before divider */
    border-bottom: none;       /* remove horizontal divider */
    border-right: 1px solid #ccc; /* vertical divider for desktop */
  }

  .pub-side--bottom {
    justify-content: flex-end; /* push content to bottom */
  }

  .pub-side--top {
    justify-content: flex-start; /* push content to top */
  }

  .pub-image {
    flex: 1;          /* image column matches text column height */
    display: flex;    /* so the img can fill it */
    overflow: hidden; /* clip overshoot */
  }

  .pub-image img {
    width: 100%;
    height: 100%;       /* force to match parent height */
    object-fit: cover;  /* crop proportionally */
  }

  .pub-logos {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .pub-logo-left img,
  .pub-logo-right img {
    height: 80px;
  }

  .pub-container-right {
    margin-left: 1.5rem;  
    margin-right: 0;
    flex: 2; /* text column grows naturally */
  }
}



.pub-layout--vert {
  display: flex;
  flex-direction: column; /* mobile-first: stack */
  gap: 1rem;
}

.pub-side--vert {
  padding: 0rem;
  border-bottom: 1px solid #ccc; 
}

@media (min-width: 1000px) {
  .pub-layout--vert {
    flex-direction: column;
  }
}