/* ==========================================================================
   PORTAL TURÍSTICO OFICIAL DE CASTANHAL - PARÁ (PREFEITURA MUNICIPAL / SECTUR)
   Design System Institucional, Acessibilidade (e-MAG) & Componentes UX
   ========================================================================== */

:root {
  --color-primary: #003fb1;
  --color-primary-dark: #002b7a;
  --color-primary-container: #1a56db;
  --color-on-primary: #ffffff;
  --color-primary-fixed: #dbe1ff;
  --color-secondary: #006c4a;
  --color-secondary-container: #d1fae5;
  --color-on-secondary: #ffffff;
  --color-tertiary: #854200;
  --color-tertiary-container: #ffedd5;
  --color-tertiary-fixed: #ffdcc3;
  --color-surface: #f8fafc;
  --color-surface-low: #f1f5f9;
  --color-surface-container: #e2e8f0;
  --color-surface-high: #cbd5e1;
  --color-surface-lowest: #ffffff;
  --color-on-surface: #0f172a;
  --color-on-surface-variant: #475569;
  --color-outline: #64748b;
  --color-outline-variant: #cbd5e1;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================================
   ACESSIBILIDADE OFICIAL (e-MAG / ALTO CONTRASTE & FONTE)
   ======================================================== */
html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  font-size: 16px;
  transition: font-size 0.15s ease;
}

html.font-size-lg {
  font-size: 17.5px;
}

html.font-size-xl {
  font-size: 19px;
}

html.high-contrast {
  filter: contrast(1.25) saturate(1.1);
}

html.high-contrast body {
  background-color: #000000 !important;
  color: #ffffff !important;
}

html.high-contrast .bg-surface,
html.high-contrast .bg-surface-container-lowest,
html.high-contrast .bg-surface-container-low,
html.high-contrast .bg-surface-container,
html.high-contrast .bg-surface-container-high,
html.high-contrast header,
html.high-contrast footer,
html.high-contrast aside,
html.high-contrast article,
html.high-contrast section > div {
  background-color: #0a0f1d !important;
  color: #ffffff !important;
  border-color: #facc15 !important;
}

html.high-contrast .text-on-surface,
html.high-contrast .text-on-surface-variant,
html.high-contrast .text-outline,
html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast h4,
html.high-contrast p {
  color: #f8fafc !important;
}

html.high-contrast a,
html.high-contrast .text-primary,
html.high-contrast .text-secondary,
html.high-contrast .text-tertiary {
  color: #facc15 !important;
}

html.high-contrast .bg-primary,
html.high-contrast .bg-secondary,
html.high-contrast .bg-tertiary {
  background-color: #facc15 !important;
  color: #000000 !important;
}

/* ========================================================
   RESET & BASE
   ======================================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #003fb1;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  font-weight: 700;
  font-size: 13px;
  z-index: 9999;
  transition: top 0.2s ease;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.hero-banner-card {
  background-color: #091e42 !important;
  isolation: isolate;
  position: relative;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Custom Scrollbar */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: #f1f5f9;
  }
  ::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 9999px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #003fb1;
  }
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ========================================================
   ICONOGRAFIA MATERIAL SYMBOLS (REFINADA E CONSISTENTE)
   ======================================================== */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 20;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

/* Safe areas mobile */
.pt-safe {
  padding-top: env(safe-area-inset-top, 0px);
}
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========================================================
   IDENTIDADE VISUAL PREFEITURA DE CASTANHAL
   ======================================================== */
.prefeitura-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

@media (min-width: 768px) {
  .prefeitura-logo {
    height: 46px;
  }
}

.prefeitura-logo-footer {
  height: 56px;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .prefeitura-logo-footer {
    height: 66px;
  }
}

/* Institutional Gov Top Bar */
.gov-top-bar {
  background: linear-gradient(90deg, #091e42 0%, #003fb1 100%);
  color: #ffffff;
  font-size: 12px;
}

/* ========================================================
   INTERAÇÕES DE CARDS E MICROINTERAÇÕES UX
   ======================================================== */
.card-hover {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 32px -10px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(0, 63, 177, 0.06);
}

/* Favorite / Roteiro Bookmark Button */
.btn-fav-place {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-fav-place:hover {
  transform: scale(1.08);
}
.btn-fav-place.is-saved {
  background-color: #003fb1 !important;
  color: #ffffff !important;
  border-color: #003fb1 !important;
}
.btn-fav-place.is-saved .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

/* Filter Pill Active States */
.filter-chip {
  transition: all 0.2s ease;
  cursor: pointer;
}
.filter-chip.active {
  background-color: #003fb1 !important;
  color: #ffffff !important;
  border-color: #003fb1 !important;
  box-shadow: 0 4px 12px rgba(0, 63, 177, 0.22);
}

/* ========================================================
   CALENDÁRIO OFICIAL INTERATIVO
   ======================================================== */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
  color: #1e293b;
}

.cal-day-cell:hover:not(.other-month) {
  background-color: #dbe1ff;
  color: #003fb1;
  transform: scale(1.05);
}

.cal-day-cell.active {
  background-color: #003fb1 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 63, 177, 0.35);
}

.cal-day-cell.has-event {
  background-color: #fff7ed;
  border: 1px solid #fed7aa;
}

.cal-day-cell.has-event::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #ea580c;
}

.cal-day-cell.active.has-event::after {
  background-color: #ffffff;
}

.cal-day-cell.other-month {
  color: #94a3b8;
  opacity: 0.4;
  cursor: default;
}

/* ========================================================
   DRAWERS, MODAIS E TOASTS
   ======================================================== */
#mobile-menu-drawer,
#roteiro-drawer {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-closed {
  transform: translateX(100%);
}

.drawer-open {
  transform: translateX(0);
}

/* Modal Backdrop & Content Animation */
.portal-modal-overlay {
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease;
}

.portal-modal-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

/* Line Clamp Helpers */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.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;
}

/* ========================================================
   MAPA TURÍSTICO GEORREFERENCIADO (LEAFLET & PINS)
   ======================================================== */
.leaflet-container {
  font-family: var(--font-main) !important;
  z-index: 10;
}

.custom-map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35);
  border: 2.5px solid #ffffff;
  transition: transform 0.2s ease;
}

.custom-map-pin:hover {
  transform: scale(1.18) translateY(-3px);
}

.pin-passear { background-color: #003fb1; }
.pin-balneario { background-color: #006c4a; }
.pin-comer { background-color: #b45309; }
.pin-dormir { background-color: #4f46e5; }
.pin-cat { background-color: #0f172a; }

@keyframes pin-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.animate-pin {
  animation: pin-float 3s ease-in-out infinite;
}

/* Print Styles for "Meu Roteiro" & Guides */
@media print {
  header, footer, nav, .gov-top-bar, .no-print {
    display: none !important;
  }
  main {
    padding-top: 0 !important;
  }
}
