/*
 * WANTRIPLOG homepage only: reorder the three place-group sections and the Journal section on phones.
 * Based on native WANTRIPLOG 0.4.13 front-page.php markup.
 * CSS-only; all links stay in the DOM and keep the original URLs.
 */
@media screen and (max-width: 540px) {
  .wt-place-group > .wt-shell,
  .wt-journal-section > .wt-shell {
    display: flex;
    flex-direction: column;
  }

  /* The section heading's children become items alongside the card grid. */
  .wt-place-group > .wt-shell > .wt-section-head,
  .wt-journal-section > .wt-shell > .wt-section-head {
    display: contents;
  }

  /* Kicker, title and introduction remain above the cards. */
  .wt-place-group > .wt-shell > .wt-section-head > div:first-child,
  .wt-journal-section > .wt-shell > .wt-section-head > div:first-child {
    order: 0;
    margin-bottom: 20px;
  }

  /* All article cards (or the no-results block) appear next. */
  .wt-place-group > .wt-shell > .wt-spot-grid,
  .wt-place-group > .wt-shell > .wt-home-group-empty,
  .wt-journal-section > .wt-shell > .wt-journal-grid,
  .wt-journal-section > .wt-shell > .wt-journal-empty {
    order: 1;
  }

  /* Move the same existing More link to the very end of this section. */
  .wt-place-group > .wt-shell > .wt-section-head > a.wt-view-all,
  .wt-journal-section > .wt-shell > .wt-section-head > a.wt-view-all {
    order: 2;
    align-self: stretch;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    margin-top: 22px;
    padding: 12px 18px;
    border: 1px solid #d4e4db;
    border-radius: 12px;
    background: #f5faf6;
    color: #204e43;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    box-sizing: border-box;
  }

  .wt-place-group > .wt-shell > .wt-section-head > a.wt-view-all svg,
  .wt-journal-section > .wt-shell > .wt-section-head > a.wt-view-all svg {
    width: 17px;
    height: 17px;
    flex: none;
  }

  .wt-place-group > .wt-shell > .wt-section-head > a.wt-view-all:focus-visible,
  .wt-journal-section > .wt-shell > .wt-section-head > a.wt-view-all:focus-visible {
    outline: 3px solid #3c8065;
    outline-offset: 3px;
  }
}
