/* Hiking in Denmark post: the route overview table. Linked after
   smart-hiking.css, which supplies the map links, the CTA box and the
   route headings.

   One table at every width. Below 640px each row becomes a card: the route
   name (row header) is the card title and every cell gets its column name
   from data-label. Changing `display` on table parts drops their table
   semantics in some browsers, so the markup carries explicit ARIA table
   roles and screen readers still get a real table. */

.blog-post-body .route-overview { margin: 0 0 1.5rem; }
.blog-post-body .route-table { display: table; width: 100%; overflow: visible; font-size: 0.88rem; border-collapse: collapse; }
.blog-post-body .route-table caption { caption-side: top; text-align: left; font-size: 0.88rem; color: var(--color-text-muted); padding: 0 0 0.5rem; }
.blog-post-body .route-table th, .blog-post-body .route-table td { vertical-align: top; overflow-wrap: break-word; }
.blog-post-body .route-table th[scope="row"] { white-space: normal; }

@media (max-width: 639px) {
  .blog-post-body .route-table,
  .blog-post-body .route-table tbody,
  .blog-post-body .route-table tr,
  .blog-post-body .route-table th[scope="row"],
  .blog-post-body .route-table td { display: block; width: auto; }
  .blog-post-body .route-table caption { display: block; }
  /* The column headers are repeated in each card by data-label. They stay
     in the accessibility tree, only visually hidden. */
  .blog-post-body .route-table thead tr {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .blog-post-body .route-table tbody tr {
    border: 1px solid var(--color-border); border-radius: var(--radius);
    background: var(--color-surface); margin: 0 0 0.75rem; padding: 0.55rem 0.8rem 0.6rem;
  }
  .blog-post-body .route-table th[scope="row"] {
    border: 0; border-bottom: 1px solid var(--color-border); background: none;
    padding: 0 0 0.4rem; margin: 0 0 0.35rem; font-size: 0.98rem; color: var(--color-primary);
  }
  .blog-post-body .route-table td {
    border: 0; padding: 0.15rem 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem;
  }
  .blog-post-body .route-table td::before { content: attr(data-label); font-weight: 700; color: var(--color-text); }
}

@media (forced-colors: active) {
  .blog-post-body .route-table tbody tr { border-color: CanvasText; }
}
