/*
 * Estilos Modernos - Tema FFLCH
 *
 * 1. Base e design tokens universais
 * 2. Garantia visual imediata: Troca dos logos por paleta via CSS
 * 3. Layout moderno institucional, alinhado ao visual original
 */

/* ==========================================================================
   1. Base & Tipografia Geral
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fflch-font-sans);
  color: var(--fflch-text-secondary);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: rgba(var(--fflch-primary-rgb), 0.2);
  color: var(--fflch-primary-dark);
}

/* ==========================================================================
   2. Garantia Visual Imediata: Troca dos Logos via CSS por Paleta
   ========================================================================== */

body.fflch-palette-verde .fflch-logo-img { content: url("../images/logo-verde.png") !important; }
body.fflch-palette-verde .fflch-logo-usp-img,
body.fflch-palette-verde .fflch-header-center-logo-usp-img { content: url("../images/usp-verde.png") !important; }

body.fflch-palette-vinho .fflch-logo-img { content: url("../images/logo-vinho.png") !important; }
body.fflch-palette-vinho .fflch-logo-usp-img,
body.fflch-palette-vinho .fflch-header-center-logo-usp-img { content: url("../images/usp-vinho.png") !important; }

body.fflch-palette-terracota .fflch-logo-img { content: url("../images/logo-terracota.png") !important; }
body.fflch-palette-terracota .fflch-logo-usp-img,
body.fflch-palette-terracota .fflch-header-center-logo-usp-img { content: url("../images/usp-terracota.png") !important; }

body.fflch-palette-grafite .fflch-logo-img { content: url("../images/logo-grafite.png") !important; }
body.fflch-palette-grafite .fflch-logo-usp-img,
body.fflch-palette-grafite .fflch-header-center-logo-usp-img { content: url("../images/usp-grafite.png") !important; }

body.fflch-palette-marinho .fflch-logo-img { content: url("../images/logo-marinho.png") !important; }
body.fflch-palette-marinho .fflch-logo-usp-img,
body.fflch-palette-marinho .fflch-header-center-logo-usp-img { content: url("../images/usp-marinho.png") !important; }

body.fflch-palette-roxo .fflch-logo-img { content: url("../images/logo-roxo.png") !important; }
body.fflch-palette-roxo .fflch-logo-usp-img,
body.fflch-palette-roxo .fflch-header-center-logo-usp-img { content: url("../images/usp-roxo.png") !important; }

body.fflch-palette-petroleo .fflch-logo-img { content: url("../images/logo-petroleo.png") !important; }
body.fflch-palette-petroleo .fflch-logo-usp-img,
body.fflch-palette-petroleo .fflch-header-center-logo-usp-img { content: url("../images/usp-petroleo.png") !important; }

body.fflch-palette-ocre .fflch-logo-img { content: url("../images/logo-ocre.png") !important; }
body.fflch-palette-ocre .fflch-logo-usp-img,
body.fflch-palette-ocre .fflch-header-center-logo-usp-img { content: url("../images/usp-ocre.png") !important; }

body.fflch-palette-cafe .fflch-logo-img { content: url("../images/logo-cafe.png") !important; }
body.fflch-palette-cafe .fflch-logo-usp-img,
body.fflch-palette-cafe .fflch-header-center-logo-usp-img { content: url("../images/usp-cafe.png") !important; }

body.fflch-palette-esmeralda .fflch-logo-img { content: url("../images/logo-esmeralda.png") !important; }
body.fflch-palette-esmeralda .fflch-logo-usp-img,
body.fflch-palette-esmeralda .fflch-header-center-logo-usp-img { content: url("../images/usp-esmeralda.png") !important; }

body.fflch-palette-coral .fflch-logo-img { content: url("../images/logo-coral.png") !important; }
body.fflch-palette-coral .fflch-logo-usp-img,
body.fflch-palette-coral .fflch-header-center-logo-usp-img { content: url("../images/usp-coral.png") !important; }

/* ==========================================================================
   Regras de Menu Comuns a Ambos os Modos (Visibilidade Absoluta e Contraste)
   ========================================================================== */

.navbar,
.region-primary-menu,
.fflch-menu-bar-wrapper {
  background-color: var(--fflch-primary) !important;
  color: #ffffff !important;
  border: none !important;
  min-height: 48px !important;
}

.navbar-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.navbar-nav li a,
.navbar-nav > li > a,
.navbar a.text-white {
  display: block !important;
  color: #ffffff !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (min-width: 768px) {
  .navbar .navbar-collapse,
  .navbar-expand-lg .navbar-collapse,
  #mainNavigation {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
  }
  .navbar-toggler {
    display: none !important;
  }
}

/* ==========================================================================
   3. MODO CAIXA CENTRALIZADA (Clássico - 1140px)
   Padrão seguro e intocado para compatibilidade estrita com 500+ sites
   ========================================================================== */

body.fflch-layout-boxed {
  background-color: #ffffff;
}

#page-wrapper.fflch-layout-boxed,
#page-wrapper.container {
  background-color: #ffffff;
  padding: 0 15px;
}

.fflch-layout-boxed #header-region,
.fflch-layout-boxed #main,
.fflch-layout-boxed #footer {
  padding: 20px 0;
}

.fflch-layout-boxed .navbar-nav > li > a {
  padding: 12px 16px !important;
}

/* ==========================================================================
   4. MODO LARGURA AMPLA (Modernização Radical de Ponta a Ponta)
   Transformação impactante: preenchimento total, menu 100%, cartões amplos
   ========================================================================== */

body.fflch-layout-fluid {
  background-color: #f4f7fb !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

#page-wrapper.fflch-layout-fluid {
  width: 100vw !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Topo / Header 100% Ponta a Ponta */
.fflch-layout-fluid #header-region.fflch-header-region {
  background-color: #ffffff !important;
  width: 100% !important;
  padding: 12px clamp(1.2rem, 3.5vw, 4rem) !important;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.fflch-layout-fluid #header-region .fflch-row {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* Busca Moderna Estilo Pílula */
.fflch-layout-fluid .region-header-right .search-block-form {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.fflch-layout-fluid .region-header-right .search-block-form .form-item .form-search {
  border: 1.5px solid #cbd5e1;
  border-radius: 28px !important;
  padding: 10px 48px 10px 20px !important;
  font-size: 0.94rem;
  background-color: #f8fafc;
  width: 100%;
  transition: all 0.2s ease;
}

.fflch-layout-fluid .region-header-right .search-block-form .form-item .form-search:focus {
  border-color: var(--fflch-primary);
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--fflch-primary-rgb), 0.2);
}

.fflch-layout-fluid .search-block-form .form-submit {
  background-color: var(--fflch-primary) !important;
  border-radius: 0 28px 28px 0 !important;
  width: 44px !important;
  cursor: pointer;
  transition: background-color 0.2s;
}

/* Branding Bar 100% Ponta a Ponta */
.fflch-layout-fluid #branding-region,
.fflch-layout-fluid .fflch-branding-region,
.fflch-layout-fluid .fflch-logodefault {
  background-color: #ffffff !important;
  width: 100% !important;
  border-bottom: 1px solid #e2e8f0;
  padding: 22px clamp(1.2rem, 3.5vw, 4rem) !important;
}

.fflch-layout-fluid .fflch-firstsecondthird {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.fflch-layout-fluid .fflch-first .fflch-logo-img {
  max-height: 58px;
  width: auto;
  transition: transform 0.2s ease;
}

.fflch-layout-fluid .fflch-first .fflch-logo-link:hover .fflch-logo-img {
  transform: scale(1.03);
}

.fflch-layout-fluid .fflch-second a {
  font-family: var(--fflch-font-brand);
  color: var(--fflch-primary) !important;
}

.fflch-layout-fluid .fflch-second {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  flex: 1 1 auto !important;
}

.fflch-layout-fluid .fflch-second .fflch-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 0.15rem !important;
  text-align: left !important;
}

.fflch-layout-fluid .fflch-slogan {
  margin: 0 !important;
  line-height: 1.2 !important;
  text-align: left !important;
}

.fflch-layout-fluid .fflch-slogan a,
.fflch-layout-fluid .fflch-site-name a {
  text-align: left !important;
  display: inline-block !important;
}

.fflch-layout-fluid .fflch-site-name {
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.fflch-layout-fluid .fflch-slogan {
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #64748b;
}

.fflch-layout-fluid .fflch-logo-usp-img,
.fflch-layout-fluid .fflch-header-center-logo-usp-img {
  max-height: 52px;
  width: auto;
}

/* Barra de Menu Principal Radicalmente Moderna (100% de Lado a Lado) */
.fflch-layout-fluid .fflch-menu-bar-wrapper,
.fflch-layout-fluid .region-primary-menu,
.fflch-layout-fluid .navbar {
  width: 100% !important;
  background: linear-gradient(135deg, var(--fflch-primary) 0%, var(--fflch-primary-dark) 100%) !important;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.25) !important;
  min-height: 54px !important;
  position: relative !important;
  top: auto !important;
  z-index: 1000 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.fflch-layout-fluid .navbar .navbar-header {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 clamp(1.2rem, 3.5vw, 4rem) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.fflch-layout-fluid .navbar-collapse {
  width: 100% !important;
  padding: 0 !important;
}

.fflch-layout-fluid .navbar-nav {
  width: 100% !important;
  gap: 0.15rem !important;
}

.fflch-layout-fluid .navbar-nav > li {
  margin: 0 !important;
}

.fflch-layout-fluid .navbar-nav > li > a {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  padding: 15px 20px !important;
  border-radius: 0 !important;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
}

.fflch-layout-fluid .navbar-nav > li > a:hover,
.fflch-layout-fluid .navbar-nav > li > a:focus {
  background-color: rgba(255, 255, 255, 0.12) !important;
  transform: translateY(-1px);
}

.fflch-layout-fluid .navbar-nav > li.active > a,
.fflch-layout-fluid .navbar-nav > li > a.is-active {
  background-color: rgba(0, 0, 0, 0.18) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Dropdowns com Efeito de Vidro Fosco (Glassmorphism) */
.fflch-layout-fluid .dropdown-menu {
  background-color: var(--fflch-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 35px -10px rgba(0, 0, 0, 0.22) !important;
  padding: 10px !important;
  min-width: 240px !important;
}

.fflch-layout-fluid .dropdown-menu > li > a {
  border-radius: 8px !important;
  padding: 11px 18px !important;
  font-size: 0.92rem !important;
  transition: all 0.15s ease !important;
}

.fflch-layout-fluid .dropdown-menu > li > a:hover {
  background-color: var(--fflch-primary-dark) !important;
  padding-left: 24px !important;
}

/* Área Principal de Conteúdo (#main) Radical e Arejada */
.fflch-layout-fluid #main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 32px clamp(1.2rem, 3.5vw, 4rem) 70px clamp(1.2rem, 3.5vw, 4rem) !important;
}

/* Cartão de Conteúdo Principal */
.fflch-layout-fluid div[role="main"] {
  background-color: #ffffff !important;
  border-radius: 16px !important;
  padding: clamp(28px, 4vw, 54px) !important;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.06), 0 2px 8px -2px rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  min-height: 600px;
}

.fflch-layout-fluid div[role="main"] p {
  font-size: 1.04rem;
  line-height: 1.8;
  color: #334155;
  margin-bottom: 1.5rem;
}

.fflch-layout-fluid div[role="main"] h1:first-child {
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-top: 0;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--fflch-primary-subtle, #edf2f9);
  margin-bottom: 26px;
}

.fflch-layout-fluid div[role="main"] h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

/* Cartões da Barra Lateral */
.fflch-layout-fluid .sidebar .block {
  background-color: #ffffff !important;
  border-radius: 14px !important;
  padding: 22px !important;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid #e2e8f0 !important;
  margin-bottom: 24px !important;
  overflow: hidden;
}

.fflch-layout-fluid .sidebar .headline {
  margin: -22px -22px 18px -22px !important;
  padding: 14px 22px !important;
  border-radius: 14px 14px 0 0 !important;
  background: linear-gradient(135deg, var(--fflch-primary) 0%, var(--fflch-primary-dark) 100%) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fflch-layout-fluid .sidebar .headline .block-title,
.fflch-layout-fluid .sidebar .block-title {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
}

.fflch-layout-fluid .sidebar ul li {
  padding: 9px 0;
  border-bottom: 1px solid #f8fafc;
}

.fflch-layout-fluid .sidebar ul li a {
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.fflch-layout-fluid .sidebar ul li a:hover {
  color: var(--fflch-primary);
  padding-left: 8px;
  font-weight: 600;
}

/* Slideshow Modernizado */
.fflch-layout-fluid #slideshow_top,
.fflch-layout-fluid .carousel {
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.12) !important;
  margin-bottom: 28px;
}

/* Rodapé Amplo 100% Ponta a Ponta */
.fflch-layout-fluid #footer-column.gray-bg {
  width: 100% !important;
  background-color: #eef2f7 !important;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 48px clamp(1.2rem, 3.5vw, 4rem) !important;
}

.fflch-layout-fluid #footer.dark-blue-bg {
  width: 100% !important;
  background: linear-gradient(135deg, var(--fflch-primary-dark) 0%, var(--fflch-primary) 100%) !important;
  padding: 36px clamp(1.2rem, 3.5vw, 4rem) 30px clamp(1.2rem, 3.5vw, 4rem) !important;
}
