/* Mobile journal adjustments. Desktop keeps its existing layout. */
@media (max-width: 770px) {
  #journal .sectionheader {
    grid-template-columns: minmax(0, 1fr);
  }
  #journal .sectionheader > *,
  #journal :is(.sectiontitle, .summary, .blogcards, .postcontent) {
    min-width: 0;
    max-width: 100%;
  }
  #journal .sectiontitle {
    font-size: clamp(28px, 7.5vw, 35px);
    overflow-wrap: anywhere;
  }
  #journal .blogcards {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
  }
  #journal .blogcards .post,
  #journal .blogcards .post:first-child,
  #journal .blogcards:has(.postart img) > .post {
    display: flex !important;
    flex-direction: column !important;
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100%;
    min-width: 0;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #journal .blogcards .post .postart:has(img),
  #journal .blogcards .post:first-child .postart:has(img) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: none !important;
    width: 100% !important;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 16px !important;
    overflow: visible !important;
  }
  #journal .blogcards .post .postart:has(img)::after {
    content: none !important;
  }
  #journal .blogcards .post .postart img {
    display: block !important;
    position: static !important;
    inset: auto !important;
    flex: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 200px !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
  }
  #journal .blogcards .post .postcontent,
  #journal .blogcards .post:first-child .postcontent {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 20px !important;
    overflow: visible !important;
  }
  #journal .postcontent :is(h3, p, span, small) {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #journal .blogcards .post :is(h3, p) span {
    font: inherit !important;
    letter-spacing: inherit;
  }
}
/* Keep the header inside narrow phone screens instead of widening the page. */
@media (max-width: 400px) {
  .siteheader .nav { gap: 10px; }
  .siteheader .brand { min-width: 0; }
  .siteheader .brand img { max-width: 100%; }
}


/* Larger desktops gain usable space without changing the approved laptop layout. */
@media (min-width: 1600px) {
  .container { width: min(1480px, calc(100% - 100px)); }
  .shell { max-width: 1548px; }
  .hero h1, .pagehero h1 {
    font-size: clamp(72px, 4.5vw, 88px);
  }
  .sectiontitle, .intro h2 {
    font-size: clamp(52px, 3vw, 64px);
  }
  .summary, .hero p, .pagehero p {
    font-size: clamp(16px, 1.05vw, 18px);
  }
  .articlebody { max-width: 920px; }
  .articlebody p { font-size: 18px; }
  #journal .blogcards:has(.postart img) > .post {
    grid-template-columns: clamp(220px, 14vw, 280px) minmax(0, 1fr) !important;
  }
}
@media (min-width: 2200px) {
  .container { width: min(1840px, calc(100% - 140px)); }
  .shell { max-width: 1908px; }
}
