/*
 * The only CSS written for the rebuild. Everything else in /legacy/ is the
 * WordPress theme's own, lifted from the rendered pages.
 * Uses the theme's preset variables so it follows its palette.
 */

/* Booking box under posts (partials/booking_banner). */
.asm-cta {
  margin-top: var(--wp--preset--spacing--50);
  padding: 30px;
  border: 1px solid var(--wp--preset--color--tertiary);
  border-radius: 5px;
  background: #fafafa;
}
.asm-cta h2 { margin-top: 0; }
.asm-cta .wp-block-buttons { gap: 12px; flex-wrap: wrap; }

/* Affiliate disclosure under the booking box. */
.asm-disclosure { font-size: var(--wp--preset--font-size--small, 14px); }

/* Photo credit under a generated post's header image (Pexels requires it).
   The theme styles every link in a featured image as display:block, which
   would break the credit onto its own line. */
.asm-credit {
  font-size: var(--wp--preset--font-size--small, 14px);
  color: var(--wp--preset--color--secondary);
  margin-top: 8px;
}
.wp-block-post-featured-image .asm-credit a { display: inline; height: auto; color: inherit; }

/*
 * Article page elements (App\Support\ArticleComponents). Off on this site
 * (config/site.php → article_style.components is empty); kept for sites
 * forked from it. Theme tokens only, so they follow each site's palette.
 */
.asm-box {
  margin-block: var(--wp--preset--spacing--40, 2rem);
  padding: 20px 24px;
  border: 1px solid var(--wp--preset--color--tertiary, #ddd);
  border-radius: 5px;
  background: color-mix(in srgb, var(--wp--preset--color--tertiary, #eee) 25%, transparent);
}
.asm-box > :first-child { margin-top: 0; }
.asm-box > :last-child { margin-bottom: 0; }
.asm-box-title { margin: 0 0 8px; }
.asm-tip { border-left: 4px solid var(--wp--preset--color--contrast, #000); }
.asm-warning { border-left: 4px solid var(--wp--preset--color--accent, #b3261e); }
.asm-verdict { border-width: 2px; border-color: var(--wp--preset--color--contrast, #000); }
.asm-facts table { width: 100%; border-collapse: collapse; margin: 0; }
.asm-facts th, .asm-facts td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--wp--preset--color--tertiary, #ddd); vertical-align: top; }
.asm-facts th { width: 38%; padding-right: 16px; font-weight: 600; }
.asm-facts tr:last-child th, .asm-facts tr:last-child td { border-bottom: 0; }
.asm-steps ol { margin: 0; padding-left: 1.4em; }
.asm-steps li + li { margin-top: 6px; }
.asm-quote { margin-block: var(--wp--preset--spacing--50, 3rem); padding: 0; border-block: 1px solid var(--wp--preset--color--contrast, #000); text-align: center; }
.asm-quote blockquote { margin: 0; padding: 24px 0; border: 0; }
.asm-quote p { font-family: var(--wp--preset--font-family--dm-serif-display, inherit); font-size: var(--wp--preset--font-size--large, 1.6rem); line-height: 1.35; margin: 0; }
.asm-faq details { border-bottom: 1px solid var(--wp--preset--color--tertiary, #ddd); padding: 12px 0; }
.asm-faq summary { cursor: pointer; font-weight: 600; }
.asm-faq details > :not(summary) { margin: 8px 0 0; }
.asm-compare { margin-block: var(--wp--preset--spacing--40, 2rem); display: flex; flex-direction: column-reverse; }
.asm-compare table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.asm-compare th, .asm-compare td { text-align: left; padding: 8px 12px; border: 1px solid var(--wp--preset--color--tertiary, #ddd); vertical-align: top; }
.asm-compare thead th { border-bottom: 2px solid var(--wp--preset--color--contrast, #000); }
.asm-compare figcaption { margin: 0 0 8px; font-weight: 600; }

/* =====================================================================
 * Blog listing layout (2026-09-30)
 * Home, category, tag, author and search pages: a 1200px container with
 * a 2:1 main/sidebar grid, compact 40/60 cards with 3:2 thumbnails, and a
 * tighter header. 8px spacing grid; type scale 1.25 (18 22 28 35 44).
 * Markup: templates wrap the listing <main> + wp/sidebar in .asm-layout;
 * cards carry .asm-card / .asm-card-media / .asm-card-text (wp/post_list).
 * !important is used only where the theme's own rule or the WordPress
 * markup carries it (inline styles, pattern CSS).
 * ===================================================================== */

/* Body copy 17–18px everywhere. */
body { font-size: clamp(17px, 16px + 0.2vw, 18px); }

/* --- Header: ≈160px instead of ≈290px -------------------------------- */
header.wp-block-template-part > .wp-block-group {
  padding-top: 24px !important;   /* was 50px inline */
  padding-bottom: 16px !important;
}
header.wp-block-template-part .wp-block-site-title {
  font-size: 52px !important;      /* was a 35–64px clamp inline */
  line-height: 1.1;
  margin: 0;
}
header.wp-block-template-part .wp-block-spacer { height: 8px !important; }
/* The theme's 24px block gap between title, spacer and nav adds up. */
header.wp-block-template-part > .wp-block-group > * { margin-block-start: 0; }
header.wp-block-template-part > .wp-block-group > .wp-block-group { margin-block-start: 8px; }
header.wp-block-template-part .wp-block-group > .wp-block-group {
  padding-top: 12px !important;    /* the nav between the two rules */
  padding-bottom: 12px !important;
}
@media (max-width: 599px) {
  header.wp-block-template-part .wp-block-site-title { font-size: 36px !important; }
}

/* --- Container + grid ------------------------------------------------ */
.asm-layout {
  box-sizing: border-box;
  max-width: 1200px;
  margin: 40px auto 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 48px;
}
.asm-layout > main.wp-block-group {
  margin: 0;
  padding: 0;
  min-width: 0;
}
/* The theme constrains the listing to 800px and pads it; the grid sizes it now. */
.asm-layout > main.wp-block-group > *,
.asm-layout .wp-block-query > * { max-width: none; }
.asm-layout .wp-block-query,
.asm-layout > main.wp-block-group > main { padding-left: 0; padding-right: 0; }
.asm-layout > main > main { margin: 0 0 32px !important; }   /* archive heading block */
.asm-layout .wp-block-query-title { font-size: 44px; line-height: 1.15; margin: 0 !important; }
.asm-layout .wp-block-query > .wp-block-group:last-child { margin: 32px 0 0 !important; } /* pagination slot */
.asm-layout .wp-block-query > .wp-block-group:last-child:empty { display: none; }

@media (max-width: 899px) {
  .asm-layout { grid-template-columns: minmax(0, 1fr); gap: 56px; margin-top: 32px; }
}

/* --- Post cards ------------------------------------------------------- */
.asm-layout .wp-block-post-template { margin: 0; padding: 0; list-style: none; }
.asm-layout .wp-block-post + .wp-block-post {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid #ddd;
}
.asm-layout .has-post-thumbnail .asm-card,
.asm-layout .asm-card {
  flex-wrap: nowrap !important;    /* the theme wraps cards below 750px */
  align-items: flex-start;
  gap: 28px;
  margin: 0;
  padding: 0;
  border: 0;
}
.asm-layout .asm-card .asm-card-media {
  flex: 0 0 40%;
  min-width: 0 !important;         /* theme pattern: min-width 40%/100% !important */
  max-width: 40%;
  margin: 0;
}
.asm-layout .asm-card-media a { height: auto; }
.asm-layout .asm-card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center center;  /* crop the 3:2 frame from the middle of the photo */
}
.asm-layout .asm-card-text { flex: 1 1 60%; min-width: 0; }
.asm-layout .asm-card-text > * { margin-block: 0; }
.asm-layout .asm-card .wp-block-post-title {
  font-size: 28px !important;
  line-height: 1.2;
  margin: 0 0 8px !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.asm-layout .asm-card .wp-block-post-title a { display: inline; } /* core: inline-block, which defeats line-clamp */
.asm-layout .asm-card .wp-block-post-date {
  font-size: 14px;
  color: var(--wp--preset--color--secondary, #666);
}
.asm-layout .asm-card .wp-block-post-date a { color: inherit; text-decoration: none; }
.asm-layout .asm-card .wp-block-post-excerpt { margin-top: 16px !important; }
.asm-layout .asm-card .wp-block-post-excerpt__excerpt {
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
@media (max-width: 599px) {
  .asm-layout .has-post-thumbnail .asm-card,
  .asm-layout .asm-card { flex-wrap: wrap !important; gap: 16px; }
  .asm-layout .asm-card .asm-card-media { flex-basis: 100%; max-width: 100%; }
}

/* --- Sidebar ---------------------------------------------------------- */
.asm-sidebar {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}
.asm-widget__title {
  font-size: 14px !important;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--wp--preset--color--contrast, #000);
}
@media (min-width: 900px) {
  /* The map sticks while the post list scrolls (see wp/sidebar). */
  .asm-sidebar__sticky { position: sticky; top: 24px; }
}

/* Ad slots: reserve the space so nothing jumps when ad code is added. */
.ad-slot {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 100%;
  background: #fafafa;
  border: 1px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot:empty::before {
  content: "Advertisement";
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--secondary, #666);
}
.ad-slot--mrec { width: 300px; height: 250px; }
.asm-sidebar__sticky { display: flex; flex-direction: column; gap: 32px; }

/* Most popular: numbered titles. */
.asm-popular { margin: 0; padding: 0; list-style: none; counter-reset: pop; }
.asm-popular li {
  counter-increment: pop;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
  font-size: 17px;
  line-height: 1.35;
}
.asm-popular li:first-child { padding-top: 0; }
.asm-popular li::before {
  content: counter(pop);
  font-family: var(--wp--preset--font-family--dm-serif-display, serif);
  font-size: 22px;
  line-height: 1;
  color: var(--wp--preset--color--secondary, #666);
}
.asm-popular a { color: var(--wp--preset--color--contrast, #000); text-decoration: none; }
.asm-popular a:hover { text-decoration: underline; }

/* Africa map (app/Tags/AfricaMap). */
.asm-map { margin: 0; }
.asm-map svg { display: block; width: 100%; height: auto; }
.asm-map__country path {
  fill: #e6e6e6;
  stroke: #fff;
  stroke-width: .4;
  stroke-linejoin: round;
}
.asm-map__country.is-linked path { fill: #c8a165; cursor: pointer; transition: fill .15s; }
.asm-map__country.is-linked:hover path,
.asm-map__country.is-linked:focus path { fill: var(--wp--preset--color--contrast, #000); }
.asm-map__country.is-linked:focus { outline: none; }
.asm-map__list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.7;
}
/* A magazine index line: names separated by middle dots. */
.asm-map__list li { display: inline-block; }   /* each name + its dot is one unit; the line wraps between them */
.asm-map__list li + li::before {
  content: "\00B7";
  margin: 0 8px;
  color: var(--wp--preset--color--secondary, #666);
}
.asm-map__list a {
  color: var(--wp--preset--color--contrast, #000);
  text-decoration: none;
  white-space: nowrap;   /* keep "South Africa" on one line */
}
.asm-map__list a:hover,
.asm-map__list a:focus { text-decoration: underline; text-underline-offset: 3px; }
.asm-map__credit {
  margin-top: 8px;
  font-size: 12px;
  color: var(--wp--preset--color--secondary, #666);
}
.asm-map__credit a { color: inherit; }

/* Single post H1: top of the 1.25 scale (was 48px). */
body.single h1.wp-block-post-title { font-size: 44px; line-height: 1.15; }
@media (max-width: 599px) { body.single h1.wp-block-post-title { font-size: 35px; } }

/* Partner placements in the sidebar ad slots (wp/affiliate_mrec). */
.ad-slot:has(.asm-booking) { border: 0; background: none; }
.asm-booking {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 24px;
  border-radius: 5px;
  overflow: hidden;
  background: #000 center / cover no-repeat;
  color: #fff;
  text-decoration: none;
}
.asm-booking::before {           /* keeps white text readable on any photo */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.1) 100%);
}
.asm-booking > * { position: relative; }
.asm-booking__eyebrow {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}
.asm-booking__heading {
  font-family: var(--wp--preset--font-family--dm-serif-display, serif);
  font-size: 28px;
  line-height: 1.1;
}
.asm-booking__text { font-size: 14px; line-height: 1.4; opacity: .9; }
.asm-booking__button {
  align-self: flex-start;
  margin-top: 8px;
  padding: 8px 16px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  border-radius: 3px;
  transition: background .15s, color .15s;
}
.asm-booking:hover .asm-booking__button,
.asm-booking:focus .asm-booking__button { background: var(--wp--preset--color--contrast, #000); color: #fff; }
