/* Smart hiking post: packing figure, country comparison table, flags,
   map links and the call-to-action box. The site has one (light) theme;
   the illustrations carry their own light tile, so they read the same
   whatever the OS colour scheme is. */

/* Flags are decorative (alt="" + aria-hidden): the country name is text. */
.blog-post-body .flag {
  display: inline-block; width: 20px; height: 15px; margin: 0 0.4rem 0 0;
  vertical-align: -2px; border-radius: 2px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(42, 42, 42, 0.25);
}
/* Nepal's flag is not a rectangle: no frame around the transparent part. */
.blog-post-body .flag[src$="/np.svg"] { box-shadow: none; }
.blog-post-body .flags { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-right: 0.15rem; }
.blog-post-body .flags .flag { margin-right: 2px; }
.blog-post-body .country-heading { display: flex; align-items: center; flex-wrap: wrap; }

/* Packing figure */
.blog-post-body .pack-figure img { max-width: 380px; border: 0; }

/* Comparison table: a real table on wide screens, stacked cards on narrow
   ones. The explicit ARIA roles keep the table semantics when the cells
   are restyled to display:block. */
.blog-post-body .country-compare { margin: 0 0 1.25rem; }
.blog-post-body .country-table { display: table; width: 100%; overflow: visible; font-size: 0.82rem; border-collapse: collapse; }
.blog-post-body .country-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 .country-table th[scope="row"] { white-space: normal; min-width: 7.5rem; }
.blog-post-body .country-table td, .blog-post-body .country-table th { overflow-wrap: break-word; }
/* Wide screens: the table breaks out of the 720px text column so the six
   columns get room. Below 1100px it becomes stacked cards. */
@media (min-width: 1100px) {
  .blog-post-body .country-compare { width: 1000px; margin-left: 50%; transform: translateX(-50%); }
}

@media (max-width: 1099px) {
  .blog-post-body .country-table,
  .blog-post-body .country-table tbody,
  .blog-post-body .country-table tr,
  .blog-post-body .country-table th,
  .blog-post-body .country-table td { display: block; width: 100%; }
  .blog-post-body .country-table caption { display: block; }
  /* Column headers stay in the accessibility tree, hidden visually. */
  .blog-post-body .country-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .blog-post-body .country-table tr {
    border: 1px solid var(--color-border); border-radius: var(--radius);
    margin: 0 0 0.85rem; background: var(--color-surface);
  }
  .blog-post-body .country-table th[scope="row"] {
    border: 0; border-bottom: 1px solid var(--color-border);
    font-size: 1rem; padding: 0.6rem 0.75rem;
  }
  .blog-post-body .country-table td { border: 0; padding: 0.4rem 0.75rem; }
  .blog-post-body .country-table td + td { border-top: 1px dashed var(--color-border); }
  /* Visible label per cell. The "/ ''" form hides it from assistive tech,
     which already announces the real column header. */
  .blog-post-body .country-table td::before {
    content: attr(data-label);
    content: attr(data-label) / "";
    display: block; font-weight: 700; color: var(--color-primary); font-size: 0.78rem;
  }
}

/* Map links */
.blog-post-body .map-links { display: inline; white-space: normal; }
.blog-post-body .map-link { font-size: 0.9em; }
.blog-post-body .country-maps { list-style: none; padding-left: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.35rem 1rem; }
.blog-post-body .country-maps li { margin: 0; }
.blog-post-body .country-maps .country-name { font-weight: 600; margin-right: 0.35rem; }
.blog-post-body .country-maps .map-links { display: block; padding-left: calc(20px + 0.4rem); }

/* Call to action: dark green on white, white on dark green, 3px focus ring.
   The box is marked by its heading text and border, not by colour alone. */
.blog-post-body .cta-box {
  clear: both; margin: 1.5rem 0; padding: 1.1rem 1.25rem;
  background: var(--color-surface); color: var(--color-text);
  border: 2px solid var(--color-primary); border-left-width: 6px; border-radius: var(--radius);
}
.blog-post-body .cta-box .cta-title { font-weight: 700; font-size: 1.05rem; color: var(--color-primary); margin: 0 0 0.5rem; }
.blog-post-body .cta-box p:last-child { margin-bottom: 0; }
.blog-post-body .cta-button {
  display: inline-block; padding: 0.7rem 1.2rem; border-radius: var(--radius);
  background: var(--color-primary); color: #ffffff; font-weight: 700; text-decoration: underline;
  text-underline-offset: 3px;
}
.blog-post-body .cta-button:hover, .blog-post-body .cta-button:focus { background: var(--color-primary-light); color: #ffffff; }
.blog-post-body .cta-button:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }

@media (forced-colors: active) {
  .blog-post-body .cta-button { border: 2px solid ButtonText; }
}

/* Each route group starts below the previous group's floated icon. */
.blog-post-body .country-heading { clear: both; margin-top: 1.75rem; }
