/* ================================================================
   DESTINATIONS.CSS — Redesigned Destination Cards
   Elite Egypt Tours

   Grid layout (4 cards, editorial asymmetry):
   ┌────────────────────────┬───────────────┐
   │                        │    Luxor      │
   │     Cairo (featured)   ├───────────────┤
   │                        │    Red Sea    │
   ├────────────────────────┴───────────────┤
   │           Desert & Oasis (wide)        │
   └─────────────────────────────────────── ┘
   ================================================================ */

/* ================================================================
   1. SECTION SHELL
   ================================================================ */
.destinations {
  background: #0A2340;  /* brand navy */
  overflow: hidden;
}

.destinations .section-header {
  margin-bottom: 48px;
}

.destinations .section-header h2 {
  color: #ffffff;
}

.destinations .section-header p {
  color: rgba(255, 255, 255, 0.60);
}

.destinations .section-tag {
  background: rgba(15, 177, 162, 0.18);
  color: #3FC4B7;
  border: 1px solid rgba(15, 177, 162, 0.35);
}

/* ================================================================
   2. GRID
   ================================================================ */
.dest-grid {
  display: grid;
  /*  3 columns: featured left (1.55fr) + 2 equal right  */
  grid-template-columns: 1.55fr 1fr 1fr;
  /*  2 rows of equal height  */
  grid-template-rows: 300px 220px;
  gap: 14px;
}

/* Cairo — spans both rows on the left */
.dest-card:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / 3;
}

/* Luxor — top-right */
.dest-card:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

/* Red Sea — mid-right */
.dest-card:nth-child(3) {
  grid-column: 3;
  grid-row: 1;
}

/* Desert — spans both right columns, bottom row */
.dest-card:nth-child(4) {
  grid-column: 2 / 4;
  grid-row: 2;
}

/* ================================================================
   3. CARD BASE
   ================================================================ */
.dest-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  display: block;

  /* GPU layer for smooth transforms */
  transform: translateZ(0);
  will-change: transform;

  /* entrance animation */
  opacity: 0;
  animation: dest-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dest-card:nth-child(1) { animation-delay: 0.05s; }
.dest-card:nth-child(2) { animation-delay: 0.15s; }
.dest-card:nth-child(3) { animation-delay: 0.22s; }
.dest-card:nth-child(4) { animation-delay: 0.30s; }

@keyframes dest-card-in {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ================================================================
   4. BACKGROUND IMAGE
   ================================================================ */
.dest-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.70s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.70s ease;
  transform: scale(1.04);  /* slight over-scale so zoom-out on hover feels natural */
  filter: brightness(0.88);
  will-change: transform, filter;
}

.dest-card:hover img {
  transform: scale(1.10);
  filter: brightness(0.72);
}

/* ================================================================
   5. OVERLAY LAYERS
   ================================================================ */

/* Persistent dark gradient — always visible, heavier at bottom */
.dest-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6, 13, 31, 0.08)  0%,
    rgba(6, 13, 31, 0.22) 35%,
    rgba(6, 13, 31, 0.72) 68%,
    rgba(6, 13, 31, 0.92) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px 24px 24px;
  transition: background 0.50s ease;
}

/* On hover, deepen the overlay so text stays readable */
.dest-card:hover .dest-overlay {
  background: linear-gradient(
    to bottom,
    rgba(6, 13, 31, 0.15)  0%,
    rgba(6, 13, 31, 0.38) 30%,
    rgba(6, 13, 31, 0.82) 62%,
    rgba(6, 13, 31, 0.96) 100%
  );
}

/* Teal accent line at the bottom edge, revealed on hover */
.dest-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #0FB1A2 30%, #9FD6C7 70%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 4;
}

.dest-card:hover::after {
  transform: scaleX(1);
}

/* ================================================================
   6. TOUR COUNT PILL  (top-right corner)
   ================================================================ */
.dest-count-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(15, 177, 162, 0.22);
  border: 1px solid rgba(15, 177, 162, 0.55);
  color: #9FD6C7;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3;
  transition: background 0.30s ease, border-color 0.30s ease;
}

.dest-card:hover .dest-count-pill {
  background: rgba(15, 177, 162, 0.40);
  border-color: rgba(15, 177, 162, 0.80);
}

/* ================================================================
   7. TEXT CONTENT (inside overlay)
   ================================================================ */

/* Region label — tiny uppercase above the name */
.dest-region {
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(159, 214, 199, 0.80);
  margin-bottom: 5px;
  transition: color 0.30s;
}

.dest-card:hover .dest-region {
  color: #9FD6C7;
}

/* Destination name */
.dest-name {
  font-size: 1.30rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 0;
  transition: transform 0.40s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Featured card gets a bigger name */
.dest-card:nth-child(1) .dest-name {
  font-size: 1.70rem;
}

/* Description — hidden at rest, slides up on hover */
.dest-desc {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.60;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: max-height 0.42s ease,
              opacity    0.35s ease 0.06s,
              transform  0.40s cubic-bezier(0.22, 1, 0.36, 1) 0.04s,
              margin-top 0.30s ease;
}

.dest-card:hover .dest-desc {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 8px;
}

/* Featured card description is slightly larger */
.dest-card:nth-child(1) .dest-desc {
  font-size: 0.90rem;
}

/* ================================================================
   8. CTA "EXPLORE" BUTTON
   ================================================================ */
.dest-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: max-height 0.42s ease 0.05s,
              opacity    0.32s ease 0.14s,
              transform  0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.10s,
              margin-top 0.30s ease 0.05s;
  pointer-events: none;
}

.dest-card:hover .dest-cta {
  max-height: 60px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 14px;
  pointer-events: auto;
}

.dest-cta-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0FB1A2, #3FC4B7);
  color: #0A2340;
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 9px 20px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(15, 177, 162, 0.45);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  white-space: nowrap;
}

.dest-cta-inner:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 28px rgba(15, 177, 162, 0.62);
}

.dest-cta-arrow {
  font-size: 0.9rem;
  transition: transform 0.22s ease;
}

.dest-cta-inner:hover .dest-cta-arrow {
  transform: translateX(3px);
}

/* ================================================================
   9. FOCUS / KEYBOARD ACCESSIBILITY
   ================================================================ */
.dest-card:focus-visible {
  outline: 3px solid #0FB1A2;
  outline-offset: 3px;
}

/* Show content on keyboard focus same as hover */
.dest-card:focus-visible .dest-desc,
.dest-card:focus-visible .dest-cta {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 8px;
  pointer-events: auto;
}

.dest-card:focus-visible .dest-cta {
  max-height: 60px;
  margin-top: 14px;
}

/* ================================================================
   10. RTL OVERRIDES
   ================================================================ */
[dir="rtl"] .dest-count-pill {
  right: auto;
  left: 16px;
}

[dir="rtl"] .dest-cta-inner {
  flex-direction: row-reverse;
}

[dir="rtl"] .dest-cta-inner:hover .dest-cta-arrow {
  transform: translateX(-3px);
}

[dir="rtl"] .dest-card::after {
  transform-origin: right center;
}

/* ================================================================
   11. RESPONSIVE
   ================================================================ */

/* Medium — 2×2 equal grid */
@media (max-width: 1050px) {
  .dest-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 280px 280px;
    gap: 12px;
  }

  /* Reset all placements back to auto-flow */
  .dest-card:nth-child(1),
  .dest-card:nth-child(2),
  .dest-card:nth-child(3),
  .dest-card:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Tablet portrait — 2 columns, shorter rows */
@media (max-width: 720px) {
  .dest-grid {
    grid-template-rows: 240px 240px;
    gap: 10px;
  }

  .dest-card:nth-child(1) .dest-name { font-size: 1.30rem; }

  /* Always show description on small screens (no hover) */
  .dest-desc {
    max-height: 80px;
    opacity: 1;
    transform: none;
    margin-top: 6px;
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .dest-cta {
    max-height: 60px;
    opacity: 1;
    transform: none;
    margin-top: 10px;
    pointer-events: auto;
  }
}

/* Tablet portrait — single row heights adjust */
@media (max-width: 600px) {
  .dest-grid {
    grid-template-rows: 220px 220px;
    gap: 10px;
  }
}

/* Mobile — single column */
@media (max-width: 520px) {
  .dest-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 10px;
  }

  .dest-card {
    height: 240px;
  }

  .dest-desc {
    -webkit-line-clamp: 3;
    max-height: 100px;
  }

  .dest-name { font-size: 1.15rem !important; }
  .dest-region { font-size: 0.72rem; }
}

@media (max-width: 360px) {
  .dest-card { height: 210px; }
  .dest-overlay { padding: 16px 14px; }
}
