/* ============================================================
   ExploringLanka — Layout System
   Grid, container, spacing utilities
   ============================================================ */

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  /* Mobile bottom nav offset */
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
}

/* Desktop: no bottom padding */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

ul, ol { list-style: none; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ─── Container ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (min-width: 640px) {
  .container { padding-inline: var(--space-8); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--space-12); }
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ─── Section Spacing ────────────────────────────────────── */
.section {
  padding-block: var(--space-16);
}

@media (min-width: 768px) {
  .section { padding-block: var(--space-24); }
}

@media (min-width: 1024px) {
  .section { padding-block: var(--space-32); }
}

.section--sm {
  padding-block: var(--space-10);
}

@media (min-width: 768px) {
  .section--sm { padding-block: var(--space-16); }
}

/* ─── Grid Systems ───────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Destination Masonry Grid */
.grid-masonry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 180px;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .grid-masonry {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 220px;
  }
}

@media (min-width: 1024px) {
  .grid-masonry {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 260px;
    gap: var(--space-4);
  }
}

.grid-masonry .card--tall {
  grid-row: span 2;
}

.grid-masonry .card--wide {
  grid-column: span 2;
}

/* ─── Flex Utilities ─────────────────────────────────────── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ─── Overflow Scroll Row (mobile swipe shelf) ───────────── */
.scroll-row {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-block: var(--space-2);
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-row::-webkit-scrollbar { display: none; }

.scroll-row > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ─── Visibility ─────────────────────────────────────────── */
.show-mobile { display: block; }
.show-desktop { display: none; }

@media (min-width: 768px) {
  .show-mobile  { display: none; }
  .show-desktop { display: block; }
}

.hide-mobile { display: none; }
@media (min-width: 768px) {
  .hide-mobile { display: block; }
}

/* ─── Text Utilities ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Position ───────────────────────────────────────────── */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

.inset-0 { inset: 0; }

/* ─── Full Width/Height ──────────────────────────────────── */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.min-h-screen { min-height: 100dvh; }

/* ─── Overflow ───────────────────────────────────────────── */
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }

/* ─── Section Header ─────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--cream);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .section-title { font-size: var(--text-4xl); }
}

@media (min-width: 1024px) {
  .section-title { font-size: var(--text-5xl); }
}

.section-subtitle {
  font-size: var(--text-md);
  line-height: var(--leading-loose);
  color: var(--color-text-muted);
  max-width: 56ch;
}

.section-header {
  margin-bottom: var(--space-10);
}

@media (min-width: 768px) {
  .section-header { margin-bottom: var(--space-16); }
}

/* ─── Divider ────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-divider);
  margin-block: var(--space-8);
}

.divider--gold {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ─── Aspect Ratios ──────────────────────────────────────── */
.aspect-square    { aspect-ratio: 1/1; }
.aspect-video     { aspect-ratio: 16/9; }
.aspect-portrait  { aspect-ratio: 3/4; }
.aspect-landscape { aspect-ratio: 4/3; }
.aspect-wide      { aspect-ratio: 21/9; }

/* ─── Object Fit ─────────────────────────────────────────── */
.object-cover  { object-fit: cover; }
.object-contain{ object-fit: contain; }
.object-center { object-position: center; }

/* ─── Overlay Gradient ───────────────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay--dark {
  background: linear-gradient(
    to top,
    rgba(13, 27, 42, 0.92) 0%,
    rgba(13, 27, 42, 0.5) 50%,
    rgba(13, 27, 42, 0.15) 100%
  );
}

.overlay--darker {
  background: rgba(13, 27, 42, 0.75);
}

.overlay--hero {
  background: linear-gradient(
    180deg,
    rgba(13, 27, 42, 0.2) 0%,
    rgba(13, 27, 42, 0.1) 30%,
    rgba(13, 27, 42, 0.6) 70%,
    rgba(13, 27, 42, 0.92) 100%
  );
}

/* ─── Card Spacing ───────────────────────────────────────── */
.card-padding {
  padding: var(--space-5);
}

@media (min-width: 768px) {
  .card-padding { padding: var(--space-6); }
}
