/*
Theme Name: Portal de Transparència BComú
Theme URI: https://transparencia.barcelonaencomu.cat
Template: astra
Author: qtica.studio
Author URI: qtica.studio
Description: Tema personalizado para BCNEnComú - Portal de Transparència
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bcomu-transparencia
*/

/*LENIS*/
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/*END LENIS*/

html {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  overscroll-behavior: none;
  scroll-behavior: smooth;
}

.ast-builder-grid-row-container-inner {
  font-family: "Raveo Display";
}

/*MENU DE IDIOMAS HEADER*/

.wpml-ls-legacy-list-horizontal a {
  display: block;
  text-decoration: none;
  padding: 0;
  line-height: 1;
}
.wpml-ls-statics-shortcode_actions.wpml-ls.wpml-ls-legacy-list-horizontal {
  font-family: "Raveo Display", serif;
  font-weight: 700;
  padding-bottom: 3px;
  font-size: 18px;
}

.wpml-ls-legacy-list-horizontal {
  border: 0px;
  padding: 0px;
  clear: both;
}

/*CABECERA*/

.ast-logo-title-inline .ast-site-identity {
  padding: 0px !important;
}

.site-header-primary-section-right.site-header-section.ast-flex.ast-grid-right-section {
  max-height: 80px;
}

/*BUSCADOR PÁGINA PRINCIPAL*/

.search-filter-description {
  text-align: right;
}

/*INFORMACIO*/
/* Optimized animation styles with blur support */
.estructura-organitzativa,
.eo-1-descripciones,
.eo-2-descripciones,
.eo-3-descripciones,
.eo-4-descripciones,
.organigrama,
.seus,
.entitats-vinculades {
  transform-origin: center center; /* Changed from center top */
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

/* Improved sticky handling */
.elementor-sticky--active {
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, filter;
}

/*PAGINA PRINCIPAL*/
.page-id-53 {
  a.elementor-element.e-con-full.e-flex.e-con.e-child {
    text-decoration: none !important;
  }
  a:hover.elementor-element.e-con-full.e-flex.e-con.e-child {
    text-decoration: none !important;
  }
}

/*NORMATIVA*/
.estatuts,
.codi-etic,
.normativa-interna,
.ins-contractacio,
.altres-documents {
  transform-origin: center center;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

/*FINANCES*/

/*CARPETAS DOCS -------------------------- */
/* Estilos para el contenedor de la carpeta */
.folder-container {
  display: block;
  padding: 0;
  transition: all 0.3s ease;
  text-decoration: none;
}

/* Carpeta */
.folder-wrapper {
  padding: 0;
  overflow: hidden;
}

.folder-block {
  position: relative;
  perspective: 1000px;
  padding-top: 5.625rem;
}

.folder-back {
  width: 100%;
  padding-bottom: 0.875rem;
}

.folder-paper {
  position: absolute;
  width: 80%;
  z-index: 1;
  left: 10%;
  bottom: -15%;
  transform: translate(0, 0) rotate(0);
  opacity: 0.9;
  transition: transform 0.525s cubic-bezier(0.51, 0, 0.08, 1);
}

.folder-front {
  position: absolute;
  z-index: 2;
  width: 100%;
  bottom: -1px;
  left: 0;
  right: 0;
  transform-origin: 50% 100%;
  transform: perspective(1000px);
  transition: transform 0.525s cubic-bezier(0.51, 0, 0.08, 1);
}

/* Animaciones al hover */
.folder-container:hover .folder-front {
  transform: rotateX(-25deg);
}

.folder-container:hover .folder-paper {
  transform: translate(0, -60%) rotate(-5deg);
  opacity: 1;
}

.folder-container:hover .folder-title {
  color: #000;
  text-decoration: underline;
}

/*CAROUSEL REGIDORS */

.regidor-container {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 350px;
  transition: all 0.3s ease;
}

/* Capa de color que cubre la imagen */
.regidor-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ce0037;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 1;
}

/* Ocultar elementos internos por defecto */
.regidor-container .elementor-widget-heading,
.regidor-container .elementor-widget-text-editor,
.regidor-container .elementor-widget-social-icons {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* Mostrar elementos al hacer hover */
.regidor-container:hover::before {
  opacity: 0.95; /* Más opaco al hacer hover */
}

.regidor-container:hover .elementor-widget-heading,
.regidor-container:hover .elementor-widget-text-editor,
.regidor-container:hover .elementor-widget-social-icons {
  opacity: 1;
}

/* Old regidor popup styles removed - replaced with modern shortcode-based system */

/* Estilos mínimos para el efecto de transición */
.efecte_transicio01 {
  letter-spacing: -0.03em;
  overflow: hidden;
}
.efecte_transicio01 .pin-height-trans01 {
  height: 400vh;
}
.efecte_transicio01 .container_transicio01 {
  height: 100vh;
  align-items: center;
  padding: 0 3vw;
  column-gap: 15px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
}
.efecte_transicio01 .container_transicio01 .name {
  position: absolute;
  top: 15vh;
  left: calc(2 * 15px);
}

.efecte_transicio01 .paragraf_transicio01:not(:first-child) {
  position: absolute;
  top: 0;
}
.efecte_transicio01 .word {
  position: relative;
  overflow: hidden;
  display: inline-block;
  margin: -0.14em 0; /* depends on the font */
}
.efecte_transicio01 .word span {
  display: block;
  padding: 0.14em 0; /* depends on the font */
}
.efecte_transicio01 .paragraf_transicio01:not(:first-child) .word span {
  transform: translate(0, -100%);
}

@media (max-width: 767px) {
  .efecte_transicio01 .pin-height-trans01 {
    height: 800vh;
  }

  .efecte_transicio01 .container_transicio01 .name {
    top: 5vh;
    left: 20px;
  }

  .efecte_transicio01 .word {
    margin: -0.12em 0;
  }

  .efecte_transicio01 .word span {
    padding: 0.1em 0;
    font-size: 0.85em;
  }
}

.wpml-elementor-ls .wpml-ls-legacy-list-horizontal li {
  margin: 0 3px; /* 5px a cada lado = 10px entre elementos */
}

/* Para eliminar el margen del primer elemento por la izquierda */
.wpml-elementor-ls .wpml-ls-legacy-list-horizontal li:first-child {
  margin-left: 0;
}

/* Para eliminar el margen del último elemento por la derecha */
.wpml-elementor-ls .wpml-ls-legacy-list-horizontal li:last-child {
  margin-right: 0;
}

/* Estilos mejorados para el indicador de scroll */
.scroll-indicator {
  position: fixed !important; /* Forzar position fixed */
  bottom: 30px !important; /* Posición desde abajo */
  left: 50px !important; /* Posición desde la izquierda */
  z-index: 1000 !important; /* Asegurar que está por encima de otros elementos */
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  pointer-events: none; /* Evitar interferencias con clicks */
}

.scroll-indicator span {
  font-family: "Raveo Display", sans-serif !important;
  font-weight: 400 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  margin-bottom: 8px !important;
  color: #000 !important;
}

.scroll-indicator.visible {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Animación para la flecha */
.scroll-indicator svg {
  animation: scroll-bounce 1.5s infinite;
}

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

/* FORMULARIO DE CONTACTO PORTAL TRANSPARENCIA */
:root {
  --transparency-primary: #6348cc;
  --transparency-text: #2d3748;
  --transparency-text-light: #718096;
  --transparency-border: #e2e8f0;
  --transparency-border-focused: #6348cc;
  --transparency-error: #e53e3e;
  --transparency-success: #38a169;
  --transparency-transition: all 0.3s ease;
}

/* Wrapper principal del formulario */
.transparency-form {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  font-family: "Raveo Display", sans-serif;
}

/* Layout de filas */
.transparency-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 0px;
}

/* Contenedor de cada campo */
.transparency-form .field-wrapper {
  position: relative;
  margin-bottom: 0px;
}

/* Estilos base para todos los campos */
.transparency-form .form-field {
  width: 100%;
  padding: 10px 0 6px 0;
  border: none;
  border-bottom: 2px solid var(--transparency-border);
  background: transparent;
  font-size: 15px;
  color: var(--transparency-text);
  outline: none;
  transition: var(--transparency-transition);
  font-family: inherit;
}

.transparency-form .form-field:focus {
  border-bottom-color: var(--transparency-border-focused);
}

/* Labels flotantes */
.transparency-form .field-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 13px;
  letter-spacing: -0.5px;
  color: var(--transparency-text-light);
  transition: var(--transparency-transition);
  pointer-events: none;
  font-weight: 400;
}

/* Estados de los labels */
.transparency-form .field-wrapper.field-focused .field-label,
.transparency-form .field-wrapper.field-has-content .field-label,
.transparency-form .form-field:focus + .field-label,
.transparency-form .form-field:not(:placeholder-shown) + .field-label {
  top: -6px;
  font-size: 11px;
  color: var(--transparency-border-focused);
  font-weight: 500;
}

/* Select específico */
.transparency-form select.form-field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 35px;
  cursor: pointer;
  height: auto;
}

/* Fix para el label del select */
.transparency-form select.form-field:invalid + .field-label,
.transparency-form select.form-field[value=""] + .field-label {
  top: 10px;
  font-size: 15px;
  color: var(--transparency-text-light);
}

.transparency-form select.form-field:valid:not([value=""]) + .field-label,
.transparency-form select.form-field:focus + .field-label {
  top: -6px;
  font-size: 11px;
  color: var(--transparency-border-focused);
}

.transparency-form select.form-field:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b2c91' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Textarea */
.transparency-form textarea.form-field {
  min-height: 60px;
  max-height: 100px;
  resize: vertical;
  padding-top: 10px;
  line-height: 1.4;
}

/* Checkbox de aceptación */
.transparency-form .acceptance-cf7 {
  margin: 5px 0;
}

.transparency-form .checkbox-field {
  margin-right: 10px;
  transform: scale(1.2);
}

.transparency-form .acceptance-cf7 label {
  font-size: 14px;
  color: var(--transparency-text);
  line-height: 1.5;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.transparency-form .acceptance-cf7 a {
  color: var(--transparency-primary);
  text-decoration: underline;
}

/* Sección de protección de datos */
.transparency-form .data-protection-info {
  margin: 15px 0;
  border: 1px solid var(--transparency-border);
  border-radius: 8px;
  overflow: hidden;
}

.transparency-form .data-protection-toggle {
  width: 100%;
  padding: 10px 10px;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--transparency-text);
  transition: var(--transparency-transition);
  font-size: 13px;
}

.transparency-form .data-protection-toggle:hover {
  background: #e9ecef;
}

.transparency-form .toggle-icon {
  width: 20px;
  height: 20px;
  background: var(--transparency-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.transparency-form .toggle-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.transparency-form .data-protection-toggle[aria-expanded="true"] .toggle-arrow {
  transform: rotate(180deg);
}

.transparency-form .data-protection-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.transparency-form .data-protection-content.expanded {
  max-height: 500px;
  padding: 20px;
}

.transparency-form .data-protection-grid {
  display: grid;
  gap: 15px;
}

.transparency-form .data-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: start;
}

.transparency-form .data-item-label {
  font-weight: 600;
  color: var(--transparency-text);
  font-size: 14px;
}

.transparency-form .data-item-value {
  font-size: 14px;
  color: var(--transparency-text-light);
  line-height: 1.4;
}

.transparency-form .data-item-value a {
  color: var(--transparency-primary);
  text-decoration: underline;
}

/* Botón de envío */
.transparency-form .form-actions {
  text-align: right !important;
  margin-top: 5px !important;
}

.transparency-form .btn-primary {
  background: var(--transparency-primary);
  color: white;
  border: none;
  padding: 10px 10px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transparency-transition);
  min-width: 180px;
}

.transparency-form .btn-primary:hover {
  background: #5639a3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 72, 204, 0.3);
}

/* Estados de error */
.transparency-form .wpcf7-not-valid {
  border-bottom-color: var(--transparency-error) !important;
}

.transparency-form .wpcf7-not-valid + .field-label {
  color: var(--transparency-error) !important;
}

.transparency-form .wpcf7-validation-errors,
.transparency-form .wpcf7-acceptance-missing {
  background: #fff5f5;
  border: 1px solid var(--transparency-error);
  border-radius: 6px;
  padding: 15px;
  margin: 20px 0;
  color: var(--transparency-error);
  font-size: 14px;
}

/* Mensaje de éxito */
.transparency-form .wpcf7-mail-sent-ok {
  background: #f0fff4;
  border: 1px solid var(--transparency-success);
  border-radius: 6px;
  padding: 15px;
  margin: 20px 0;
  color: var(--transparency-success);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .transparency-form .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .transparency-form .data-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .transparency-form .btn-primary {
    width: 100%;
    padding: 16px;
  }
}

.bcn-contact-form.transparency-form p {
  margin-bottom: 0px !important;
}

/* Botón de envío - reducir margen */
.transparency-form .form-actions {
  text-align: center;
  margin-top: 15px;
}

/* Mejorar comportamiento del select */
.transparency-form select.form-field {
  padding-top: 12px;
}

/* JavaScript fallback para el select label */
.transparency-form .field-wrapper.has-value .field-label {
  top: -6px !important;
  font-size: 11px !important;
  color: var(--transparency-border-focused) !important;
}

/* Fix específico para select - forzar label arriba siempre */
.transparency-form select.form-field + .field-label {
  top: -10px !important;
  font-size: 11px !important;
  color: var(--transparency-border-focused) !important;
  font-weight: 500 !important;
}

/* Asegurar que el label nunca se superponga al select */
.transparency-form .field-wrapper:has(select) .field-label {
  top: -10px !important;
  font-size: 11px !important;
  color: var(--transparency-border-focused) !important;
  transform: translateY(0) !important;
  z-index: 10;
}

/* Fallback para navegadores que no soportan :has() */
.transparency-form .field-wrapper .field-label.select-label,
.transparency-form .field-wrapper.has-select .field-label {
  top: -6px !important;
  font-size: 11px !important;
  color: var(--transparency-border-focused) !important;
  font-weight: 500 !important;
}

.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
  height: 0.7em;
  margin: 4px 0 4px 0;
}

.wpcf7-spinner {
  position: absolute !important;
  left: 0;
  bottom: 20;
}

.wpcf7 form > div,
.wpcf7 form > p {
  margin-bottom: 0px !important;
}
