/* ============================================================
   Memorial da Escravatura de Cacheu — Design System
   ============================================================ */

:root {
  --terra:      #7C3421;
  --terra-dk:   #5A2518;
  --gold:       #C4924A;
  --gold-pale:  #E8CEAA;
  --sand:       #F5EEE4;
  --sand-dk:    #EDE0CA;
  --verde:      #2C4A35;
  --ink:        #1A110A;
  --ink-mid:    #4A3020;
  --ink-soft:   #7A6050;
  --white:      #FFFFFF;
  --rule:       #E0D0C0;
  --rule2:      #EDE0CA;
  --serif:      'Cormorant Garamond', Georgia, serif;
  --sans:       'DM Sans', system-ui, sans-serif;
  --radius:     6px;
  --radius-lg:  12px;
  --shadow:     0 2px 12px rgba(26,17,10,.08);
  --shadow-lg:  0 8px 32px rgba(26,17,10,.12);
  --topbar-h:   38px;
  --header-h:   68px;
  --offset:     calc(var(--topbar-h) + var(--header-h));
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--offset) + 1rem); }

body {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* -------- TOPBAR -------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-h);
  background: var(--ink);
  display: flex; align-items: center;
}
.topbar-inner {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar-status {
  display: flex; align-items: center; gap: .45rem;
  font-size: .72rem; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 500;
}
.topbar-open  { color: #6FCF97; }
.topbar-closed { color: rgba(255,255,255,.5); }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.topbar-open  .status-dot { background: #6FCF97; box-shadow: 0 0 0 3px rgba(111,207,151,.2); animation: blink 2s ease-in-out infinite; }
.topbar-closed .status-dot { background: rgba(255,255,255,.3); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }
.topbar-links {
  display: flex; align-items: center; gap: 1.25rem;
}
.topbar-links a {
  font-size: .72rem; color: rgba(255,255,255,.6);
  text-decoration: none; letter-spacing: .04em;
  transition: color .15s;
}
.topbar-links a:hover { color: var(--gold); }
.topbar-sep { font-size: .7rem; color: rgba(255,255,255,.35); }

/* -------- HEADER -------- */
.site-header {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0; z-index: 190;
  height: var(--header-h);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: var(--shadow-lg); }

.header-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; gap: 2rem;
}

/* Logo */
.site-logo {
  display: flex; align-items: center; text-decoration: none; flex-shrink: 0;
}
.site-logo-img {
  height: 40px;
  max-height: calc(var(--header-h) - 20px);
  width: auto;
  display: block;
  object-fit: contain;
}

/* Nav principal */
.main-nav { flex: 1; }
.nav-list {
  list-style: none; display: flex; align-items: center;
  height: var(--header-h);
}
.nav-item {
  position: relative; height: 100%; display: flex; align-items: center;
}
.nav-link {
  display: flex; align-items: center; height: 100%;
  padding: 0 1rem; font-size: .82rem; font-weight: 400;
  color: var(--ink-mid); text-decoration: none; letter-spacing: .02em;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.nav-item:hover .nav-link,
.nav-item.active .nav-link {
  color: var(--terra); border-bottom-color: var(--terra);
}

/* Megamenu */
.mega-panel {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--terra);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem 0;
  opacity: 0; visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 300;
  display: flex; gap: 0;
}
.nav-item.has-mega:hover .mega-panel {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

.mega-col { padding: 0 .5rem; min-width: 240px; }
.mega-heading {
  font-size: .65rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--terra); font-weight: 600; padding: .25rem 1rem .75rem;
}
.mega-link {
  display: block; padding: .5rem 1rem;
  text-decoration: none; border-radius: var(--radius);
  transition: background .12s;
}
.mega-link:hover { background: var(--sand); }
.mega-link strong { display: block; font-size: .85rem; color: var(--ink); font-weight: 500; }
.mega-link span   { display: block; font-size: .75rem; color: var(--ink-soft); margin-top: .1rem; }

.mega-cta {
  background: var(--sand); border-radius: 0 0 var(--radius-lg) 0;
  padding: 1rem; min-width: 200px;
  display: flex; flex-direction: column; justify-content: center;
}
.mega-cta-inner { display: flex; flex-direction: column; gap: .6rem; align-items: center; text-align: center; }
.mega-cta-icon  { font-size: 1.5rem; color: var(--terra); }
.mega-cta-title { font-size: .85rem; font-weight: 500; color: var(--ink); }
.mega-cta-sub   { font-size: .75rem; color: var(--ink-soft); }
.mega-cta-btn {
  display: inline-block; background: var(--terra); color: #fff;
  padding: .45rem 1.1rem; border-radius: var(--radius);
  font-size: .78rem; font-weight: 500; text-decoration: none;
  transition: background .15s;
}
.mega-cta-btn:hover { background: var(--terra-dk); }

/* Header CTA */
.header-cta {
  display: inline-flex; align-items: center;
  background: var(--terra); color: #fff;
  padding: .5rem 1.1rem; border-radius: var(--radius);
  font-size: .8rem; font-weight: 500; text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.header-cta:hover { background: var(--terra-dk); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile nav */
.mobile-nav {
  display: none; position: fixed;
  top: calc(var(--topbar-h) + var(--header-h));
  left: 0; right: 0; bottom: 0;
  background: var(--white);
  overflow-y: auto;
  z-index: 180;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--rule);
}
.mobile-nav.open { display: block; }
.mobile-group { border-bottom: 1px solid var(--rule2); }
.mobile-group-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 1.5rem; background: none; border: none; cursor: pointer;
  font-size: .88rem; font-weight: 500; color: var(--ink);
}
.mobile-group-toggle span { font-size: 1.1rem; color: var(--terra); }
.mobile-group-items { display: none; padding: 0 0 .75rem 2.5rem; }
.mobile-group-items.open { display: block; }
.mobile-group-items a {
  display: block; padding: .45rem 0;
  font-size: .85rem; color: var(--ink-mid); text-decoration: none;
}
.mobile-link {
  display: block; padding: .9rem 1.5rem;
  font-size: .88rem; font-weight: 500; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--rule2);
}
.mobile-cta {
  display: block; margin: 1.25rem 1.5rem 0;
  background: var(--terra); color: #fff;
  padding: .85rem 1.25rem; border-radius: var(--radius);
  font-size: .88rem; font-weight: 500; text-decoration: none; text-align: center;
}

/* -------- SITE MAIN -------- */
.site-main {
  margin-top: var(--offset);
}

/* -------- LAYOUT HELPERS -------- */
.container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1300px; margin: 0 auto; padding: 0 max(1.5rem, 4vw); }
.section { padding: 4.5rem max(1.5rem, 6vw); }

.section-eyebrow {
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--terra); font-weight: 600; margin-bottom: .6rem;
}
.section-title {
  font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 300; color: var(--ink); line-height: 1.1;
  margin-bottom: 1.25rem;
}
.section-lead {
  font-size: 1rem; color: var(--ink-mid); line-height: 1.8;
  max-width: 640px; margin-bottom: 2.5rem;
}

/* -------- BUTTONS -------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.4rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 500; text-decoration: none;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  min-height: 44px;
}
.btn-primary { background: var(--terra); color: #fff; border-color: var(--terra); }
.btn-primary:hover { background: var(--terra-dk); border-color: var(--terra-dk); }
.btn-outline { background: transparent; color: var(--terra); border-color: var(--terra); }
.btn-outline:hover { background: var(--terra); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-mid); border-color: var(--rule); }
.btn-ghost:hover { background: var(--sand); }

/* -------- CARDS -------- */
.card {
  background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-img { aspect-ratio: 16/9; object-fit: cover; width: 100%; background: var(--sand-dk); }
.card-body { padding: 1.25rem; }
.card-cat {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--terra); font-weight: 600; margin-bottom: .5rem;
}
.card-title {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 400;
  color: var(--ink); line-height: 1.25; margin-bottom: .5rem;
}
.card-excerpt { font-size: .83rem; color: var(--ink-mid); line-height: 1.6; }
.card-meta { font-size: .75rem; color: var(--ink-soft); margin-top: .75rem; }

/* -------- FORMS -------- */
.form-group { margin-bottom: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label { display: block; font-size: .8rem; font-weight: 500; color: var(--ink-mid); margin-bottom: .4rem; }
.form-control {
  width: 100%; padding: .65rem .9rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--sans); font-size: .88rem; color: var(--ink);
  background: var(--white); transition: border-color .15s, box-shadow .15s;
  min-height: 44px;
}
.form-control:focus {
  outline: none; border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(124,52,33,.1);
}
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A6050' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.2rem; }

.notice {
  padding: .9rem 1.1rem; border-radius: var(--radius);
  font-size: .88rem; margin-bottom: 1.25rem; line-height: 1.5;
}
.notice-success { background: #EBF7F0; color: #1A5C38; border: 1px solid #A8DBC0; }
.notice-error   { background: #FDF0F0; color: #7C2020; border: 1px solid #E8A8A8; }

/* -------- BADGE -------- */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 100px;
  font-size: .7rem; font-weight: 500; letter-spacing: .04em;
}
.badge-terra  { background: rgba(124,52,33,.12); color: var(--terra); }
.badge-green  { background: rgba(44,74,53,.12); color: var(--verde); }
.badge-gold   { background: rgba(196,146,74,.15); color: #8B6020; }
.badge-urgent { background: #FDECEA; color: #C0392B; }

/* -------- PAGINATION -------- */
.pagination { display: flex; align-items: center; gap: .4rem; justify-content: center; padding: 2rem 0; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius);
  font-size: .83rem; text-decoration: none; color: var(--ink-mid);
  border: 1px solid var(--rule); transition: background .15s;
}
.pagination a:hover      { background: var(--sand); }
.pagination .active      { background: var(--terra); color: #fff; border-color: var(--terra); }
.pagination .disabled    { opacity: .35; pointer-events: none; }

/* -------- ARTICLE BODY -------- */
.article-body { font-size: .97rem; line-height: 1.85; color: var(--ink-mid); }
.article-body h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; color: var(--ink); margin: 2rem 0 .75rem; }
.article-body h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 400; color: var(--terra); margin: 1.5rem 0 .5rem; }
.article-body p  { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.5rem; }
.article-body li { margin-bottom: .35rem; }
.article-body blockquote { border-left: 3px solid var(--gold); padding: .75rem 1.25rem; margin: 1.5rem 0; font-style: italic; color: var(--ink-mid); background: var(--sand); border-radius: 0 var(--radius) var(--radius) 0; }
.article-body img { border-radius: var(--radius-lg); margin: 1.5rem 0; }

/* -------- HERO PATTERNS -------- */
.hero-dark {
  background: var(--ink); padding: 5rem max(1.5rem,8vw) 4rem;
  position: relative; overflow: hidden;
}
.hero-dark::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,52,33,.35) 0%, rgba(26,17,10,.9) 100%);
}
.hero-dark > * { position: relative; z-index: 2; }

/* -------- MAP PINS -------- */
@keyframes pulse-pin {
  0% { transform: translate(-50%,-50%) scale(1); opacity: .4; }
  70% { transform: translate(-50%,-50%) scale(3.5); opacity: 0; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}
.map-pin-pulse {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  opacity: .4; animation: pulse-pin 2.5s ease-out infinite;
  transform: translate(-50%,-50%);
}

/* -------- ITINERARY CARDS -------- */
.itinerary-card {
  background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.itinerary-card-num {
  font-family: var(--serif); font-size: 3rem; font-weight: 300;
  color: var(--terra); opacity: .15; line-height: 1;
}
.itinerary-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.itinerary-card-title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); margin-bottom: .5rem; }
.itinerary-card-desc  { font-size: .85rem; color: var(--ink-mid); line-height: 1.65; flex: 1; }
.itinerary-card-foot  { padding: 1rem 1.5rem; border-top: 1px solid var(--rule2); display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.itinerary-card-meta  { font-size: .78rem; color: var(--ink-soft); }

/* -------- CALENDAR -------- */
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .8rem; border-radius: 4px; cursor: default; }
.cal-day.has-slot { background: rgba(124,52,33,.08); cursor: pointer; }
.cal-day.has-slot:hover { background: rgba(124,52,33,.18); }
.cal-day.today { font-weight: 600; }
.cal-day.selected { background: var(--terra); color: #fff; }
.cal-day.empty, .cal-day.past { opacity: .3; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--terra); margin-top: 2px; }

/* -------- FOOTER -------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.7); }
.footer-top {
  max-width: 1300px; margin: 0 auto; padding: 3.5rem max(1.5rem,4vw);
  display: grid; grid-template-columns: 280px 1fr; gap: 4rem;
}
.footer-brand {}
.footer-logo { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.footer-name { font-family: var(--serif); font-size: 1rem; color: #fff; }
.footer-sub  { font-size: .72rem; color: rgba(255,255,255,.5); }
.footer-about { font-size: .83rem; line-height: 1.7; color: rgba(255,255,255,.55); margin-bottom: 1.25rem; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.6);
  text-decoration: none; transition: background .15s, color .15s;
}
.footer-social a:hover { background: var(--terra); color: #fff; }
.footer-links { display: grid; grid-template-columns: repeat(4,1fr); gap: 2rem; }
.footer-col-title { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-bottom: .85rem; }
.footer-col a { display: block; font-size: .83rem; color: rgba(255,255,255,.6); text-decoration: none; margin-bottom: .4rem; transition: color .15s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 1.25rem max(1.5rem,4vw); }
.footer-bottom-inner {
  max-width: 1300px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; color: rgba(255,255,255,.35);
}
.footer-bottom-inner a { color: rgba(255,255,255,.5); text-decoration: none; }
.footer-bottom-inner a:hover { color: var(--gold); }

/* -------- BREADCRUMB -------- */
.breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  font-size: .78rem; color: var(--ink-soft); padding: .85rem 0;
}
.breadcrumb a { color: var(--terra); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { opacity: .4; }

/* -------- STATS ROW -------- */
.stats-row { display: flex; gap: 2rem; flex-wrap: wrap; }
.stat-item {}
.stat-num { font-family: var(--serif); font-size: 2.5rem; font-weight: 300; color: var(--terra); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--ink-soft); margin-top: .25rem; }

/* -------- INFO BOX -------- */
.info-box {
  background: var(--sand); border-radius: var(--radius-lg); padding: 1.5rem 1.75rem;
}
.info-box-title { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--terra); font-weight: 600; margin-bottom: 1rem; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--rule2); font-size: .85rem; }
.info-row:last-child { border-bottom: none; }
.info-row-label { color: var(--ink-mid); }
.info-row-val   { color: var(--ink); font-weight: 500; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
  .hamburger { display: flex; }
  .main-nav, .header-cta { display: none; }
  .topbar-links { display: none; }
}

@media (max-width: 768px) {
  :root { --topbar-h: 36px; --header-h: 60px; }
  .section { padding: 2.75rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-links { grid-template-columns: repeat(2,1fr); }
  .stats-row { gap: 1.25rem; }
}

@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-bottom-inner { flex-direction: column; gap: .4rem; text-align: center; }
  .logo-sub { display: none; }
}