/* ================================================================
 * DESTINATIONS PAGES — archive + single
 * Scoped: .em-destinations-page  (archive)
 *         .em-single-dest-page   (single destination)
 * Enqueued in functions.php on destination CPT pages.
 * ================================================================ */

/* ---------------------------------------------------------------
 * SHARED BASE
 * ------------------------------------------------------------- */
.em-destinations-page,
.em-single-dest-page {
  background: var(--em-bg);
  color: var(--em-ink);
}

/* ---------------------------------------------------------------
 * MAP SECTION
 * ------------------------------------------------------------- */
.em-map-section {
  padding: clamp(4rem, 9vw, 7rem) 0;
  background: var(--em-bg);
}

.em-map-section__head {
  margin-bottom: 2.5rem;
}

.em-map-section__sub {
  color: var(--em-muted);
  font-size: 1rem;
  margin-top: .6rem;
  max-width: 480px;
  line-height: 1.6;
}

#em-egypt-map {
  height: 540px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 50px rgba(28,24,19,.13);
  background: var(--em-bg2);
}

/* Leaflet overrides — match papyrus palette */
.em-destinations-page .leaflet-container,
.em-single-dest-page .leaflet-container {
  font-family: var(--em-font-body);
}

.em-destinations-page .leaflet-control-attribution,
.em-single-dest-page .leaflet-control-attribution {
  background: rgba(22,19,13,.72) !important;
  color: rgba(244,236,224,.55) !important;
  font-size: .65rem !important;
  padding: .2rem .5rem;
  border-radius: 4px 0 0 0;
}

.em-destinations-page .leaflet-control-attribution a,
.em-single-dest-page .leaflet-control-attribution a {
  color: var(--em-gold) !important;
}

.em-destinations-page .leaflet-control-zoom a,
.em-single-dest-page .leaflet-control-zoom a {
  background: #fff;
  color: var(--em-ink);
  border-color: rgba(28,24,19,.15);
  font-family: var(--em-font-head);
}

.em-destinations-page .leaflet-control-zoom a:hover,
.em-single-dest-page .leaflet-control-zoom a:hover {
  background: var(--em-gold);
  color: #fff;
  border-color: var(--em-gold);
}

/* Custom map markers */
.em-map-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.em-map-marker__dot {
  width: 14px;
  height: 14px;
  background: var(--em-gold);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(192,136,58,.55);
  transition: transform .25s, box-shadow .25s;
}

.em-map-marker:hover .em-map-marker__dot,
.em-map-marker.is-open .em-map-marker__dot {
  transform: scale(1.45);
  box-shadow: 0 4px 18px rgba(192,136,58,.7);
}

.em-map-marker__label {
  margin-top: 3px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--em-ink);
  background: #fff;
  padding: .16rem .55rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(28,24,19,.14);
  white-space: nowrap;
  pointer-events: none;
}

/* Leaflet popup skin */
.em-leaflet-popup .leaflet-popup-content-wrapper {
  border-radius: 14px !important;
  box-shadow: 0 10px 44px rgba(28,24,19,.18) !important;
  padding: 0 !important;
  overflow: hidden;
  border: none !important;
}

.em-leaflet-popup .leaflet-popup-content {
  margin: 0 !important;
  width: 220px !important;
}

.em-leaflet-popup .leaflet-popup-tip-container {
  margin-top: -1px;
}

.em-leaflet-popup .leaflet-popup-close-button {
  color: rgba(255,255,255,.8) !important;
  font-size: 18px !important;
  top: 6px !important;
  right: 8px !important;
  padding: 0 !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* Popup content */
.em-map-popup {
  font-family: 'Barlow Semi Condensed', sans-serif;
}

.em-map-popup__img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.em-map-popup__body {
  padding: .9rem 1rem 1rem;
}

.em-map-popup h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #1c1813;
  margin-bottom: .18rem;
  line-height: 1;
}

.em-map-popup__region {
  font-size: .72rem;
  color: #7a6f5f;
  letter-spacing: .08em;
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.em-map-popup__link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  color: #c0883a;
  transition: gap .2s;
}

.em-map-popup__link:hover {
  gap: .6rem;
}

/* ---------------------------------------------------------------
 * DESTINATIONS CARD GRID  (archive)
 * ------------------------------------------------------------- */
.em-dests-section {
  background: var(--em-bg2);
  padding: clamp(4rem, 9vw, 7rem) 0;
}

.em-dests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

/* First card is featured — spans 2 columns */
.em-dests-grid > .em-dcard:first-child {
  grid-column: span 2;
}

/* ---------------------------------------------------------------
 * DESTINATION CARD  (.em-dcard)
 * ------------------------------------------------------------- */
.em-dcard {
  background: var(--em-bg);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .4s var(--em-ease), box-shadow .4s;
}

.em-dcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 60px rgba(28,24,19,.14);
}

/* Image */
.em-dcard__img {
  display: block;
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--em-dark);
}

.em-dests-grid > .em-dcard:first-child .em-dcard__img {
  aspect-ratio: 16/9;
}

.em-dcard__img .ph {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .6s var(--em-ease);
}

.em-dcard:hover .em-dcard__img .ph {
  transform: scale(1.06);
}

/* Badges */
.em-dcard__region {
  position: absolute;
  top: .9rem;
  left: .9rem;
  background: rgba(22,19,13,.72);
  color: #fff;
  font-family: var(--em-font-head);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  padding: .28rem .75rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.em-dcard__travel {
  position: absolute;
  top: .9rem;
  right: .9rem;
  background: var(--em-gold);
  color: #fff;
  font-family: var(--em-font-head);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  padding: .28rem .75rem;
  border-radius: 999px;
}

/* Card body */
.em-dcard__body {
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.em-dcard__title {
  font-family: var(--em-font-head);
  font-weight: 600;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1;
  color: var(--em-ink);
  margin-bottom: .6rem;
  transition: color .3s;
}

.em-dcard__title a { color: inherit; }

.em-dcard:hover .em-dcard__title {
  color: var(--em-gold);
}

.em-dcard__intro {
  font-size: .88rem;
  color: var(--em-muted);
  line-height: 1.57;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.em-dcard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(28,24,19,.09);
  padding-top: 1rem;
  gap: 1rem;
}

.em-dcard__tour-count {
  font-family: var(--em-font-head);
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--em-muted);
}

.em-dcard__cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--em-font-head);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  font-size: .78rem;
  padding: .6rem 1.15rem;
  border-radius: 999px;
  background: var(--em-ink);
  color: var(--em-bg);
  white-space: nowrap;
  transition: background .3s, transform .3s var(--em-ease);
}

.em-dcard__cta:hover {
  background: var(--em-gold);
  transform: translateY(-2px);
}

/* No results */
.em-no-results {
  grid-column: 1 / -1;
  padding: 5rem 0;
  text-align: center;
  color: var(--em-muted);
  font-family: var(--em-font-head);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}

/* ================================================================
 * SINGLE DESTINATION
 * ================================================================ */

/* ---------------------------------------------------------------
 * SINGLE HERO
 * ------------------------------------------------------------- */
.em-sdest-hero {
  position: relative;
  height: 72vh;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.em-sdest-hero__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: transform 1.6s var(--em-ease);
}

.em-sdest-hero.is-loaded .em-sdest-hero__img {
  transform: scale(1);
}

.em-sdest-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(22,19,13,.9) 0%,
    rgba(22,19,13,.35) 55%,
    rgba(22,19,13,.12) 100%
  );
}

.em-sdest-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: 3.5rem;
}

.em-sdest-hero h1 {
  font-family: var(--em-font-head);
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -.03em;
  line-height: .9;
  color: #fff;
  margin: .8rem 0 1.4rem;
}

.em-sdest-hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--em-gold);
  font-family: Georgia, serif;
  text-transform: none;
  letter-spacing: 0;
}

.em-sdest-hero__meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.em-sdest-tag {
  font-family: var(--em-font-head);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 600;
  padding: .3rem .85rem;
  border-radius: 999px;
}

.em-sdest-tag--region {
  background: rgba(255,255,255,.14);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
}

.em-sdest-tag--travel {
  background: var(--em-gold);
  color: #fff;
}

/* ---------------------------------------------------------------
 * SINGLE BODY  (2-col: main + sidebar)
 * ------------------------------------------------------------- */
.em-sdest-body {
  background: var(--em-bg);
}

.em-sdest-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 4.5rem;
  padding: 5rem 0 7rem;
  align-items: start;
}

/* Main content */
.em-sdest-content h2 {
  font-family: var(--em-font-head);
  font-size: 1.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--em-ink);
  margin: 2.6rem 0 1rem;
}

.em-sdest-content h2:first-child {
  margin-top: 0;
}

.em-sdest-intro {
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--em-ink);
  max-width: 60ch;
}

.em-sdest-desc {
  font-size: .98rem;
  line-height: 1.75;
  color: var(--em-ink);
}

.em-sdest-desc p + p {
  margin-top: .9rem;
}

/* Highlights strip */
.em-dest-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .8rem;
  margin-top: .5rem;
}

.em-dest-highlight {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-family: var(--em-font-head);
  font-size: .92rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  color: var(--em-ink);
}

.em-dest-highlight svg {
  color: var(--em-gold);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------
 * DESTINATION INFO SIDEBAR
 * ------------------------------------------------------------- */
.em-dest-info-box {
  background: #fff;
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: 0 2px 30px rgba(28,24,19,.08);
  position: sticky;
  top: 100px;
}

.em-dest-info-box__label {
  font-family: var(--em-font-head);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--em-muted);
  margin-bottom: 1.3rem;
}

.em-dest-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  margin-bottom: 1.8rem;
}

.em-dest-info-list li {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  font-size: .88rem;
  color: var(--em-ink);
  line-height: 1.42;
}

.em-dest-info-list li svg {
  color: var(--em-gold);
  flex-shrink: 0;
  margin-top: .1em;
}

.em-dest-info-list__key {
  font-family: var(--em-font-head);
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--em-muted);
  display: block;
  margin-bottom: .1rem;
}

.em-dest-info-box__divider {
  height: 1px;
  background: rgba(28,24,19,.09);
  margin-bottom: 1.5rem;
}

.em-dest-info-box__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .9rem 1.4rem;
  border-radius: 999px;
  background: var(--em-ink);
  color: var(--em-bg);
  font-family: var(--em-font-head);
  font-weight: 600;
  font-size: .92rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: background .3s, transform .3s var(--em-ease);
  margin-bottom: .7rem;
}

.em-dest-info-box__cta:hover {
  background: var(--em-gold);
  transform: translateY(-2px);
}

.em-dest-info-box__secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .78rem 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(28,24,19,.16);
  color: var(--em-ink);
  font-family: var(--em-font-head);
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: border-color .3s, color .3s;
}

.em-dest-info-box__secondary:hover {
  border-color: var(--em-gold);
  color: var(--em-gold);
}

/* ---------------------------------------------------------------
 * RELATED TOURS ON SINGLE DESTINATION
 * ------------------------------------------------------------- */
.em-dest-related {
  background: var(--em-bg2);
  padding: clamp(4rem, 9vw, 7rem) 0;
}

.em-dest-related .em-title {
  margin-bottom: 3rem;
}

/* ================================================================
 * RESPONSIVE
 * ================================================================ */
@media (max-width: 1024px) {
  .em-sdest-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .em-dest-info-box {
    position: static;
    order: -1;
  }
}

@media (max-width: 860px) {
  .em-dests-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .em-dests-grid > .em-dcard:first-child {
    grid-column: span 2;
  }

  #em-egypt-map {
    height: 400px;
  }
}

@media (max-width: 600px) {
  .em-dests-grid {
    grid-template-columns: 1fr;
  }

  .em-dests-grid > .em-dcard:first-child {
    grid-column: span 1;
  }

  #em-egypt-map {
    height: 320px;
    border-radius: 14px;
  }

  .em-dest-highlights {
    grid-template-columns: 1fr;
  }

  .em-sdest-hero h1 {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .em-dcard,
  .em-dcard__img .ph,
  .em-sdest-hero__img,
  .em-dcard__cta,
  .em-dest-info-box__cta {
    transition: none !important;
    transform: none !important;
  }
}
