/* ==========================================================================
   Lao Ethnic Garden — Timeline + Card Components
   ========================================================================== */

/* ==========================================================================
   TIMELINE
   ========================================================================== */
.leg-timeline {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.leg-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: var(--leg-gradient);
  transform: translateX(-50%);
  border-radius: 4px;
}

.leg-timeline__item {
  position: relative;
  width: 50%;
  padding: 24px 44px;
  box-sizing: border-box;
}

.leg-timeline__item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.leg-timeline__item:nth-child(even) {
  left: 50%;
  text-align: left;
}

/* Node (circle marker) */
.leg-timeline__node {
  position: absolute;
  top: 40px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--leg-surface);
  border: 4px solid var(--leg-primary);
  box-shadow: var(--leg-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 2;
}

.leg-timeline__item:nth-child(odd) .leg-timeline__node {
  right: -27px;
}
.leg-timeline__item:nth-child(even) .leg-timeline__node {
  left: -27px;
}

/* Card inside timeline */
.leg-timeline__card {
  background: var(--leg-surface);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--leg-shadow);
  overflow: hidden;
  transition: transform var(--leg-transition), box-shadow var(--leg-transition);
  opacity: 0;
  transform: translateY(30px);
}
.leg-timeline__card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.leg-timeline__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--leg-shadow-lg);
}

.leg-timeline__image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, #e0f2e9, #c7ebd5);
  display: block;
}

.leg-timeline__body {
  padding: 22px 24px 24px;
}

.leg-timeline__title {
  font-family: var(--leg-font-heading);
  font-size: var(--leg-font-size-xl);
  font-weight: var(--leg-font-weight-extrabold);
  color: var(--leg-primary-dark);
  margin: 0 0 10px 0;
  letter-spacing: var(--leg-tracking-tight);
  line-height: var(--leg-line-height-tight);
}
:root[data-theme="dark"] .leg-timeline__title {
  color: #7dd499;
}

.leg-timeline__desc {
  font-size: var(--leg-font-size-base);
  color: var(--leg-text-muted);
  line-height: var(--leg-line-height-relaxed);
  margin: 0 0 18px 0;
  text-align: left;
}

.leg-timeline__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--leg-gradient);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all var(--leg-transition);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}
.leg-timeline__btn:hover {
  color: #fff;
  transform: translateX(3px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}
.leg-timeline__btn::after { content: "→"; font-weight: 700; }

/* Tag pill on card */
.leg-timeline__tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(22, 163, 74, 0.1);
  color: var(--leg-primary-dark);
  border-radius: 14px;
  font-size: var(--leg-font-size-xs);
  font-weight: var(--leg-font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--leg-tracking-wide);
  margin-bottom: 12px;
}
:root[data-theme="dark"] .leg-timeline__tag {
  background: rgba(108, 178, 82, 0.22);
  color: #a7d88e;
}
:root[data-theme="dark"] .leg-card__tag {
  background: rgba(18, 26, 42, 0.92);
  color: #a7d88e;
}

/* ==========================================================================
   TIMELINE RESPONSIVE
   ========================================================================== */
@media (max-width: 767px) {
  .leg-timeline {
    padding: 12px 0 24px 12px;
  }
  .leg-timeline::before {
    left: 24px;
    transform: none;
  }
  .leg-timeline__item,
  .leg-timeline__item:nth-child(even),
  .leg-timeline__item:nth-child(odd) {
    width: 100%;
    left: 0;
    text-align: left;
    padding: 16px 16px 16px 56px;
  }
  .leg-timeline__node,
  .leg-timeline__item:nth-child(odd) .leg-timeline__node,
  .leg-timeline__item:nth-child(even) .leg-timeline__node {
    left: -3px;
    right: auto;
    top: 28px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  .leg-timeline__image { height: 180px; }
  .leg-timeline__body { padding: 18px 20px 20px; }
  .leg-timeline__title { font-size: 1.15rem; }
}

/* ==========================================================================
   CARD GRID (for other pages)
   ========================================================================== */
.leg-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 1399px) { .leg-card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991px)  { .leg-card-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (max-width: 575px)  { .leg-card-grid { grid-template-columns: 1fr; gap: 16px; } }

/* ==========================================================================
   CARD
   ========================================================================== */
.leg-card {
  background: var(--leg-surface);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--leg-shadow-sm);
  border: 1px solid var(--leg-border);
  transition: all var(--leg-transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.leg-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--leg-shadow-lg);
  border-color: var(--leg-primary-light);
  color: inherit;
}

.leg-card__media {
  position: relative;
  width: 100%;
  padding-top: 66%; /* 3:2 aspect ratio */
  overflow: hidden;
  background: linear-gradient(135deg, #e0f2e9, #c7ebd5);
}
.leg-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}
.leg-card:hover .leg-card__media img {
  transform: scale(1.08);
}

.leg-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--leg-primary-dark);
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
  z-index: 1;
}

.leg-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.leg-card__title {
  font-family: var(--leg-font-heading);
  font-size: var(--leg-font-size-lg);
  font-weight: var(--leg-font-weight-extrabold);
  color: var(--leg-primary-dark);
  margin: 0 0 8px 0;
  line-height: var(--leg-line-height-snug);
  letter-spacing: var(--leg-tracking-tight);
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
:root[data-theme="dark"] .leg-card__title {
  color: #7dd499;
}

.leg-card__desc {
  font-size: var(--leg-font-size-sm);
  color: var(--leg-text-muted);
  line-height: var(--leg-line-height-normal);
  margin: 0 0 14px 0;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.leg-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--leg-border);
}

.leg-card__price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--leg-primary);
}

.leg-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(22, 163, 74, 0.1);
  color: var(--leg-primary-dark);
  font-size: var(--leg-font-size-sm);
  font-weight: var(--leg-font-weight-bold);
  text-decoration: none;
  transition: all var(--leg-transition);
}
.leg-card__btn:hover {
  background: var(--leg-gradient);
  color: #fff;
}
:root[data-theme="dark"] .leg-card__btn {
  background: rgba(108, 178, 82, 0.2);
  color: #a7d88e;
}
:root[data-theme="dark"] .leg-card__btn:hover {
  background: var(--leg-gradient);
  color: #fff;
}

/* Card skeleton dark mode adjustments */
:root[data-theme="dark"] .leg-card--skeleton .leg-card__media {
  background: linear-gradient(90deg, #1f2937, #2d3748, #1f2937);
  background-size: 200% 100%;
}
:root[data-theme="dark"] .leg-card--skeleton .leg-card__title,
:root[data-theme="dark"] .leg-card--skeleton .leg-card__desc {
  background: #2d3748;
}

/* Skeleton loader when waiting for AJAX */
.leg-card--skeleton .leg-card__media { background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6); background-size: 200% 100%; animation: leg-shimmer 1.4s infinite; }
.leg-card--skeleton .leg-card__title,
.leg-card--skeleton .leg-card__desc { background: #e5e7eb; color: transparent; border-radius: 6px; }
@keyframes leg-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.leg-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--leg-text-muted);
}
.leg-empty__icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.4; }
.leg-empty__text { font-size: 1rem; }
