/* ═══════════════════════════════════════════════════════
   TRAVELGRAM — Design System
   Abordagem: Mobile First | Editoral/Magazine
   Paleta: Terra Cotta + Teal Oceano + Creme Quente
═══════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────── */
:root {
  /* Cores principais */
  --terra:       #C8512A;   /* Terra cotta — marca, aventura */
  --terra-light: #E8784F;   /* Hover / destaque */
  --ocean:       #1B5E7B;   /* Azul oceano — complementar */
  --cream:       #F8F4EF;   /* Fundo quente */
  --cream-deep:  #EDE8E2;   /* Surface cards */
  --sand:        #D8C8B4;   /* Bordas suaves */

  /* Texto */
  --ink:         #1A1812;
  --ink-mid:     #5A5550;
  --ink-light:   #9A948E;

  /* Tipografia */
  --display: 'Playfair Display', Georgia, serif;
  --body:    'DM Sans', system-ui, sans-serif;

  /* Espaçamento */
  --nav-h:   64px;

  /* Transições */
  --ease: cubic-bezier(.25,.8,.25,1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body);
  background-color: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  padding-bottom: 72px; /* espaço para bottom-nav mobile */
}

img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }
button { cursor: pointer; font-family: var(--body); }

/* ── Container ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  padding-inline: 16px;
  margin-inline: auto;
}

/* ═══════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 244, 239, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand);
  transition: box-shadow .25s var(--ease);
}

.navbar.scrolled {
  box-shadow: 0 4px 24px rgba(26,24,18,.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.nav-logo {
  flex-shrink: 0;
}

.logo-img {
  height: 32px;
  width: auto;
}

/* Desktop nav links */
.nav-links {
  display: none;   /* hidden on mobile — shown via media query */
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: .02em;
  transition: color .2s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--terra);
  transition: width .25s var(--ease);
}

.nav-link:hover {
  color: var(--terra);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-search {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 50%;
  transition: background .2s;
}

.nav-search:hover {
  background: var(--cream-deep);
}

.nav-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--terra);
  transition: transform .2s var(--ease);
}

.nav-avatar:hover img {
  transform: scale(1.08);
}

/* ── Hamburger ──────────────────────────────────────── */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 4px;
  border-radius: 8px;
  transition: background .2s;
}

.hamburger:hover {
  background: var(--cream-deep);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s, width .3s;
}

/* Animated X state */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Drawer ──────────────────────────────────── */
.mobile-drawer {
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s var(--ease);
  background: var(--cream);
  border-top: 1px solid var(--sand);
}

.mobile-drawer.open {
  max-height: 320px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 12px 0 20px;
}

.mobile-link {
  display: block;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-mid);
  transition: background .2s, color .2s;
}

.mobile-link:hover {
  background: var(--cream-deep);
  color: var(--terra);
}

.mobile-profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--sand);
  margin-top: 8px;
  color: var(--ink);
  font-weight: 500;
}

.mobile-profile-item img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--terra);
}

/* ── Overlay (mobile) ───────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,24,18,.4);
  z-index: 90;
  opacity: 0;
  transition: opacity .3s;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════
   PROFILE HEADER
═══════════════════════════════════════════════════════ */
.profile-header {
  position: relative;
  overflow: hidden;
  background: var(--cream-deep);
  padding-block: 40px 32px;
  border-bottom: 1px solid var(--sand);
}

/* Decorative backdrop */
.profile-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 90% 20%, rgba(200,81,42,.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(27,94,123,.07) 0%, transparent 70%);
  pointer-events: none;
}

.profile-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

/* Avatar */
.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 8px 32px rgba(26,24,18,.15);
}

.avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--terra), var(--terra-light), var(--ocean), var(--terra));
  z-index: -1;
  animation: spin 6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Profile info text */
.profile-name {
  font-family: var(--display);
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.2;
}

.profile-bio {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.7;
  max-width: 480px;
}

/* Stats row */
.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-mid);
}

.stat img {
  flex-shrink: 0;
  opacity: .7;
}

.stat strong {
  color: var(--ink);
  font-weight: 600;
}

/* CTA buttons */
.profile-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 2px solid transparent;
  transition: all .2s var(--ease);
}

.btn-primary {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}

.btn-primary:hover {
  background: var(--terra-light);
  border-color: var(--terra-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,81,42,.3);
}

.btn-ghost {
  background: transparent;
  color: var(--terra);
  border-color: var(--terra);
}

.btn-ghost:hover {
  background: rgba(200,81,42,.06);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   FEED TABS
═══════════════════════════════════════════════════════ */
.feed-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--sand);
  padding-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.feed-tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-light);
  letter-spacing: .04em;
  text-transform: uppercase;
  position: relative;
  transition: color .2s;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--terra);
  transform: scaleX(0);
  transition: transform .25s var(--ease);
}

.tab.active {
  color: var(--terra);
}

.tab.active::after {
  transform: scaleX(1);
}

.tab:hover {
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════
   PHOTO FEED — CSS Grid
═══════════════════════════════════════════════════════ */
.feed {
  padding-block: 24px 48px;
}

.feed-grid {
  display: grid;
  /* Mobile: 2 colunas */
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

/* Feed item */
.feed-item {
  position: relative;
  overflow: hidden;
  background: var(--cream-deep);
  aspect-ratio: 1 / 1;
}

.feed-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s var(--ease);
}

.feed-item:hover img {
  transform: scale(1.06);
}

/* Overlay on hover */
.feed-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,24,18,.65) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.feed-item:hover .feed-overlay {
  opacity: 1;
  transform: translateY(0);
}

.feed-overlay img {
  display: inline-block;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.site-footer {
  background: var(--cream-deep);
  border-top: 1px solid var(--sand);
  padding-block: 24px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-brand {
  font-size: 13px;
  color: var(--ink-light);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 12px;
  color: var(--ink-light);
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--terra);
}

/* ═══════════════════════════════════════════════════════
   BOTTOM NAV (Mobile Only)
═══════════════════════════════════════════════════════ */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248,244,239,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--sand);
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  transition: color .2s;
}

.bottom-nav-item.active {
  color: var(--terra);
}

.bottom-nav-item img {
  width: 22px;
  height: 22px;
  object-fit: cover;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-avatar {
  border-radius: 50% !important;
  border: 2px solid var(--terra);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≥ 640px)
═══════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .container {
    padding-inline: 24px;
  }

  /* Profile */
  .profile-header {
    padding-block: 48px 40px;
  }

  .profile-avatar {
    width: 120px;
    height: 120px;
  }

  /* Stats horizontal */
  .profile-stats {
    flex-direction: row;
    gap: 24px;
  }

  /* Feed: 3 colunas no tablet */
  .feed-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  /* Footer horizontal */
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Desktop (≥ 1024px)
═══════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  body {
    padding-bottom: 0; /* sem bottom-nav no desktop */
  }

  .container {
    padding-inline: 32px;
  }

  /* Navbar: mostrar links, esconder hamburger */
  .nav-links {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .mobile-drawer {
    display: none;
  }

  /* Bottom nav: esconder no desktop */
  .bottom-nav {
    display: none;
  }

  /* Profile: horizontal */
  .profile-inner {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 40px;
  }

  .profile-avatar {
    width: 160px;
    height: 160px;
  }

  .profile-bio {
    font-size: 15px;
  }

  .profile-stats {
    flex-direction: row;
    gap: 28px;
    justify-content: flex-start;
  }

  .profile-actions {
    justify-content: flex-start;
  }

  /* Feed: 4 colunas no desktop */
  .feed-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  /* Overlay sempre visível no hover (já funciona) */
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Wide Desktop (≥ 1280px)
═══════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
  .feed-grid {
    gap: 10px;
  }
}

/* ═══════════════════════════════════════════════════════
   ANIMAÇÕES DE ENTRADA (stagger reveal)
═══════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-avatar-wrap {
  animation: fadeUp .5s var(--ease) both;
}
.profile-name {
  animation: fadeUp .5s .1s var(--ease) both;
}
.profile-bio {
  animation: fadeUp .5s .2s var(--ease) both;
}
.profile-stats {
  animation: fadeUp .5s .3s var(--ease) both;
}
.profile-actions {
  animation: fadeUp .5s .4s var(--ease) both;
}

.feed-item {
  animation: fadeUp .4s var(--ease) both;
}

/* Stagger nos itens do feed */
.feed-item:nth-child(1)  { animation-delay: .05s; }
.feed-item:nth-child(2)  { animation-delay: .10s; }
.feed-item:nth-child(3)  { animation-delay: .15s; }
.feed-item:nth-child(4)  { animation-delay: .20s; }
.feed-item:nth-child(5)  { animation-delay: .25s; }
.feed-item:nth-child(6)  { animation-delay: .30s; }
.feed-item:nth-child(7)  { animation-delay: .35s; }
.feed-item:nth-child(8)  { animation-delay: .40s; }
.feed-item:nth-child(9)  { animation-delay: .45s; }
.feed-item:nth-child(10) { animation-delay: .50s; }
.feed-item:nth-child(11) { animation-delay: .55s; }
.feed-item:nth-child(12) { animation-delay: .60s; }
