/* Makini — safari archive (pages/safaris.html). Loads after makini-v3-8.css and uses its tokens.
   WP: enqueue on archive-safari.php only. */
@layer components {
  /* ---------- Hero (header floats over it, as on the homepage) ---------- */
  .ahero { position: relative; color: var(--white); background: var(--night); overflow: hidden; }
  .ahero__media { position: absolute; inset: 0; }
  .ahero__media picture, .ahero__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .ahero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(26 25 23 / .8) 0%, rgb(26 25 23 / .45) 55%, rgb(26 25 23 / .15) 100%), linear-gradient(0deg, rgb(26 25 23 / .45), transparent 45%); }
  .ahero__in { position: relative; display: grid; gap: 1rem; padding-top: 170px; padding-bottom: 3.25rem; }
  .crumbs-v3 ol { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; font-size: .8125rem; color: rgb(255 255 255 / .75); }
  .crumbs-v3 li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }
  .crumbs-v3 a { color: var(--white); text-decoration: none; }
  .crumbs-v3 a:hover { color: var(--orange-soft); }
  .ahero h1 { max-width: 16ch; margin: 0; color: var(--white); font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); line-height: 1.08; }
  .ahero h1 em { font-style: italic; color: var(--orange); }
  .ahero__lede { max-width: 60ch; margin: 0; font-size: 1.0625rem; color: rgb(255 255 255 / .88); }
  .ahero__facts { display: flex; flex-wrap: wrap; gap: .78rem; margin: .8rem 0 0; padding: 0; list-style: none; }
  .ahero__facts li { display: grid; padding: .75rem 1.1rem; border: 1px solid rgb(255 255 255 / .2); border-radius: var(--r); background: rgb(255 255 255 / .06); backdrop-filter: blur(4px); }
  .ahero__facts b { font-family: var(--head); font-size: 1.25rem; font-weight: 400; color: var(--white); }
  .ahero__facts span { font-size: .8125rem; color: rgb(255 255 255 / .75); }

  /* ---------- Theme strip ---------- */
  .athemes { position: relative; z-index: 2; background: var(--white); border-bottom: 1px solid var(--line); }
  .athemes ul { display: flex; gap: .4rem; margin: 0; padding: .8rem 0; overflow-x: auto; list-style: none; scrollbar-width: none; }
  .athemes ul::-webkit-scrollbar { display: none; }
  .atheme { display: inline-flex; flex: none; align-items: center; gap: .55rem; min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: var(--pill); background: var(--white); font-size: .875rem; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background-color .2s var(--ease), border-color .2s var(--ease); }
  .atheme span { min-width: 22px; padding: .1rem .4rem; border-radius: var(--pill); background: var(--sand); font-size: .72rem; font-weight: 600; text-align: center; color: var(--muted); }
  .atheme:hover { border-color: var(--orange-soft); }
  .atheme[aria-pressed="true"] { border-color: var(--night); background: var(--night); color: var(--white); }
  .atheme[aria-pressed="true"] span { background: #9b4d08; color: #fcfaf6; }

  /* ---------- Layout ---------- */
  .archive { padding-top: 2.5rem; }
  .archive__in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
  @media (min-width: 1100px) { .archive__in { grid-template-columns: 290px minmax(0, 1fr); gap: 2.25rem; } }

  /* ---------- Filters ---------- */
  .af { display: grid; gap: 1rem; }
  .af__top { display: flex; justify-content: space-between; align-items: center; }
  .af__top h2 { margin: 0; font-family: var(--sans); font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
  .af__close { display: none; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--sand); color: var(--ink); cursor: pointer; }
  .af__close .icon { width: 18px; height: 18px; }
  .af__form { display: grid; gap: .2rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
  .af__search { position: relative; margin-bottom: .6rem; }
  .af__search .icon { position: absolute; left: .85rem; top: 50%; width: 17px; height: 17px; color: var(--muted); transform: translateY(-50%); }
  .af__search input { width: 100%; min-height: 46px; padding: .6rem .9rem .6rem 2.5rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--cream); font: inherit; font-size: .9375rem; color: var(--ink); }
  .af__search input:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
  .af__group { margin: 0; padding: .9rem 0 .7rem; border: 0; border-top: 1px solid var(--line); }
  .af__group legend { float: left; width: 100%; margin-bottom: .5rem; padding: 0; font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
  .af__opt { clear: both; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .38rem 0; font-size: .9375rem; color: var(--ink); cursor: pointer; }
  .af__opt input { width: 17px; height: 17px; margin: 0; accent-color: var(--umber); }
  .af__l small { color: var(--muted); font-size: .8rem; }
  .af__n { min-width: 26px; padding: .05rem .4rem; border-radius: var(--pill); background: var(--sand); font-size: .72rem; font-weight: 600; text-align: center; color: var(--muted); }
  .af__opt.is-empty { color: #a59a8e; }
  .af__opt.is-empty .af__n { opacity: .6; }
  .af__range { clear: both; display: grid; gap: .4rem; }
  .af__range input { width: 100%; accent-color: var(--umber); }
  .af__range output { font-size: .875rem; font-weight: 600; color: var(--umber); }
  .af__actions { display: flex; gap: .6rem; padding-top: .9rem; border-top: 1px solid var(--line); }
  .af__actions .btn { flex: 1; }
  .af__apply { display: none; }
  .ahelp { display: grid; gap: .55rem; justify-items: start; padding: 1.3rem; border-radius: var(--r); background: var(--night); color: #e3d4c3; }
  .ahelp__avs { display: flex; }
  .ahelp__av { display: block; width: 46px; height: 46px; margin-left: -10px; overflow: hidden; border: 2px solid var(--night); border-radius: 50%; }
  .ahelp__av:first-child { margin-left: 0; }
  .ahelp__av img { width: 100%; height: 100%; object-fit: cover; }
  .ahelp__t { margin: .2rem 0 0; font-family: var(--head); font-size: 1.3rem; color: var(--white); }
  .ahelp p { margin: 0; font-size: .875rem; line-height: 1.55; }
  .ahelp .btn { margin-top: .3rem; }
  .ahelp__wa { display: inline-flex; align-items: center; gap: .4rem; font-size: .875rem; color: var(--orange-soft); }
  .ahelp__wa .icon { width: 16px; height: 16px; }
  @media (min-width: 1100px) { .af { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; } }
  @media (max-width: 1099px) {
    .af { position: fixed; inset: 0; z-index: 80; display: block; padding: 0; overflow: hidden; background: rgb(26 25 23 / .55); opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s; }
    .af.is-open { opacity: 1; visibility: visible; }
    .af > * { width: min(400px, 92vw); margin: 0; background: var(--white); }
    .af__top { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
    .af__close { display: grid; }
    .af__form { height: calc(100dvh - 73px); overflow-y: auto; border: 0; border-radius: 0; padding-bottom: 6rem; }
    .af__actions { position: fixed; bottom: 0; left: 0; width: min(400px, 92vw); padding: .9rem 1.1rem; background: var(--white); box-shadow: 0 -6px 18px rgb(26 25 23 / .08); }
    .af__apply { display: inline-flex; }
    .ahelp { display: none; }
    .af > .af__top, .af > .af__form { transform: translateX(-100%); transition: transform .3s var(--ease); }
    .af.is-open > .af__top, .af.is-open > .af__form { transform: none; }
    html.af-open { overflow: hidden; }
  }

  /* ---------- Toolbar + chips ---------- */
  .abar { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; margin-bottom: .9rem; }
  .abar__filters { display: inline-flex; }
  @media (min-width: 1100px) { .abar__filters { display: none; } }
  .abar__count { margin: 0 auto 0 0; font-size: .9375rem; color: var(--muted); }
  .abar__count b { color: var(--ink); }
  .abar__sort { display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--muted); }
  .abar__sort select { min-height: 42px; padding: .4rem 2rem .4rem .8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); font: inherit; font-size: .875rem; color: var(--ink); }
  .abar__view { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
  .abar__view button { min-height: 34px; padding: .3rem .8rem; border: 0; border-radius: var(--pill); background: none; font-size: .8125rem; font-weight: 500; color: var(--muted); cursor: pointer; }
  .abar__view button[aria-pressed="true"] { background: var(--night); color: var(--white); }
  @media (max-width: 699px) { .abar__view { display: none; } }
  .achips { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; padding: 0; list-style: none; }
  .achips:empty { display: none; }
  .achips button { display: inline-flex; align-items: center; gap: .4rem; min-height: 34px; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: var(--pill); background: var(--peach); font-size: .8125rem; font-weight: 500; color: var(--umber); cursor: pointer; }
  .achips .achips__clear { background: none; color: var(--orange-ink); text-decoration: underline; border-color: transparent; }

  /* ---------- Cards ---------- */
  .aresults { display: grid; gap: .78rem; margin: 0; padding: 0; list-style: none; }
  .acard { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); transition: box-shadow .25s var(--ease), border-color .25s var(--ease); }
  .acard:hover { border-color: #ddd3c5; box-shadow: var(--shadow); }
  .acard[hidden] { display: none; }
  .acard__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sand); }
  .acard__media picture, .acard__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .acard__media img { transition: transform .6s var(--ease); }
  .acard:hover .acard__media img { transform: scale(1.04); }
  .acard__noimg { display: grid; place-items: center; height: 100%; background: linear-gradient(135deg, var(--night-2), var(--umber)); }
  .acard__noimg .icon { width: 38px; height: 38px; color: var(--orange-soft); }
  .acard__tier, .acard__days { position: absolute; top: .8rem; padding: .4em .8em; border-radius: var(--pill); font-size: .6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; line-height: 1; }
  .acard__tier { left: .8rem; background: var(--white); color: var(--ink); }
  .acard__tier--budget { background: var(--peach); color: var(--umber); }
  .acard__tier--luxury { background: var(--night); color: var(--orange-soft); }
  .acard__days { right: .8rem; background: #9b4d08; color: #fcfaf6; }
  .acard__body { display: grid; align-content: start; gap: .5rem; padding: 1.15rem 1.25rem; }
  .acard__route { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-ink); }
  .acard__route .icon { flex: none; width: 14px; height: 14px; }
  .acard__route span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acard h3 { margin: 0; font-size: 1.35rem; line-height: 1.25; }
  .acard h3 a { color: var(--ink); text-decoration: none; }
  .acard h3 a:hover { color: var(--umber); }
  .acard__blurb { margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--body); }
  .acard__facts { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .2rem 0 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--muted); }
  .acard__facts li { display: inline-flex; align-items: center; gap: .35rem; }
  .acard__facts .icon { width: 15px; height: 15px; color: var(--orange-ink); }
  .acard__alt { margin: 0; font-size: .8125rem; color: var(--umber); }
  .acard__price { display: grid; align-content: center; gap: .6rem; padding: 1.15rem 1.25rem; border-top: 1px solid var(--line); background: var(--cream); }
  .acard__from { display: grid; margin: 0; line-height: 1.15; }
  .acard__from small { font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .acard__from small:last-child { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
  .acard__from strong { font-family: var(--head); font-size: 1.9rem; font-weight: 500; color: var(--umber); }
  .acard__ladder { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .8125rem; color: var(--body); }
  .acard__ladder .icon { width: 15px; height: 15px; color: var(--orange-ink); }
  .acard__ladder b { color: var(--ink); }
  .acard__acts { display: flex; flex-wrap: wrap; gap: .5rem; }
  .acard__acts .btn { flex: 1 1 auto; min-height: 42px; }
  @media (max-width: 479px) { .acard__acts { flex-direction: column; } .acard__acts .btn { width: 100%; } }
  /* list view: photo | details | price */
  @media (min-width: 700px) {
    .aresults:not(.aresults--grid) .acard { grid-template-columns: 260px minmax(0, 1fr); }
    .aresults:not(.aresults--grid) .acard__media { grid-row: span 2; aspect-ratio: auto; min-height: 100%; }
    .aresults:not(.aresults--grid) .acard__price { grid-template-columns: auto auto 1fr; align-items: center; column-gap: 1.25rem; }
    .aresults:not(.aresults--grid) .acard__acts { justify-content: flex-end; }
    .aresults:not(.aresults--grid) .acard__acts .btn { flex: 0 0 auto; }
  }
  @media (min-width: 1300px) {
    .aresults:not(.aresults--grid) .acard { grid-template-columns: 300px minmax(0, 1fr) 240px; }
    .aresults:not(.aresults--grid) .acard__media { grid-row: auto; }
    .aresults:not(.aresults--grid) .acard__price { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 1px solid var(--line); }
    .aresults:not(.aresults--grid) .acard__acts { flex-direction: column; }
    .aresults:not(.aresults--grid) .acard__acts .btn { width: 100%; }
  }
  /* grid view */
  @media (min-width: 700px) { .aresults--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1300px) { .aresults--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .aresults--grid .acard { grid-template-rows: auto 1fr auto; }
  .aresults--grid .acard__blurb { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

  .amore { display: flex; justify-content: center; margin-top: 1.5rem; }
  .aempty { display: grid; justify-items: center; gap: .6rem; padding: 3rem 1.5rem; border: 1px dashed #d9cfc1; border-radius: var(--r); text-align: center; }
  .aempty > .icon { width: 40px; height: 40px; color: var(--orange-ink); }
  .aempty h3 { margin: 0; font-size: 1.5rem; }
  .aempty p { max-width: 46ch; margin: 0; color: var(--muted); }
  .aempty__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .6rem; }
  .anote { margin: 1.5rem 0 0; font-size: .9rem; color: var(--muted); }
  .anote a { color: var(--orange-ink); }

  /* ---------- How prices work ---------- */
  .aprices h2 { margin: 0 0 1.5rem; font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.4rem); }
  .aprices__list { display: grid; gap: .78rem; margin: 0; padding: 0; list-style: none; }
  @media (min-width: 900px) { .aprices__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .aprices__list li { display: flex; gap: 1rem; padding: 1.3rem; border-radius: var(--r); background: var(--white); }
  .aprices__ic { display: grid; flex: none; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--peach); }
  .aprices__ic .icon { width: 20px; height: 20px; color: var(--umber); }
  .aprices h3 { margin: 0 0 .3rem; font-family: var(--sans); font-size: 1rem; font-weight: 600; }
  .aprices p { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--body); }
  .aprices a { color: var(--orange-ink); }
}

/* Fix (2026-10-21): every card photo fills the same frame; a tall photo never stretches its card */
@layer components {
  .acard__media picture, .acard__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .acard__media { aspect-ratio: 16 / 10; }
  @media (min-width: 700px) {
    .aresults:not(.aresults--grid) .acard { grid-template-rows: auto auto; }
    .aresults:not(.aresults--grid) .acard__media { aspect-ratio: auto; height: 100%; min-height: 230px; }
  }
  @media (min-width: 1300px) {
    .aresults:not(.aresults--grid) .acard { grid-template-rows: auto; min-height: 250px; }
    .aresults:not(.aresults--grid) .acard__media { height: auto; min-height: 250px; }
  }
}

/* ===== Phone fix (2026-10-22): the results list gets one flexible column, so cards fit the screen ===== */
@layer components {
  :where(.aresults) { grid-template-columns: minmax(0, 1fr); }  /* zero specificity: the grid view keeps its 2 or 3 columns */
  .acard > * { min-width: 0; }
}
@layer components {
  .acard__body { grid-template-columns: minmax(0, 1fr); }
  .acard__route span { min-width: 0; }  /* the route wraps onto two lines on small phones */
}
