/* ================================
   LAYOUT TRÁMITES - ESTILOS CSS
   ================================ */

/* BANNER TRÁMITES */
.tramites-section-banner .container {  
  display: flex;
  align-items: center;
  justify-content: center;
}

.tramites-section-banner .row {
  width: 100%;
  justify-content: center;
}

.tramites-section-banner .col-12 {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.tramites-section-banner h1 {
  max-width: 780px;
  margin: 0 auto;
}

/* SECCIÓN BUSCADOR */
.tramites-section-buscador {
    background-color: #1a362a;
  }
  
  .tramites-section-buscador h2 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 400;
  }
  
  .tramites-section-buscador p {
    color: #1D1D1B;
    font-size: 14px;
  }

  /* Alinear el input del buscador con la grilla de categorías de abajo.
     El texto ocupa la 1ª columna de la grilla y el formulario arranca en el
     borde de la 2ª card. Tablet: grilla de 2 cols (50%). Desktop: 3 cols (33,3%). */
  @media (min-width: 768px) {
    .tramites-section-buscador .row > .col-md-5 {
      width: 50%;
    }
    .tramites-section-buscador .search-form-wrapper-dark {
      width: 50%;
    }
  }

  @media (min-width: 992px) {
    .tramites-section-buscador .row > .col-md-5 {
      width: 33.333333%;
    }
    .tramites-section-buscador .search-form-wrapper-dark {
      width: 66.666667%;
    }
  }

  /* SECCIÓN FLEXIBLE SUPERIOR */
  .tramites-section-flexible-top {
    padding: 30px 0;
  }
  
  /* SECCIÓN GRILLA DE CATEGORÍAS */
  .tramites-section-grilla {
    padding: 50px 0;
  }
  
  /* TEXTO DESCRIPTIVO CERCA DEL TÍTULO */
  .tramites-section-grilla > p,
  .tramites-section-grilla .tramites-descripcion-intro {
    font-size: 16px;
    color: #1D1D1B;
    margin: 4px -100px 40px 0;
    line-height: 1.5;
    max-width: 100%;
  }
  
  /* GRILLA PRINCIPAL */
  .tramites-section-grilla .views-view-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    grid-auto-flow: row;
    grid-auto-rows: auto;
  }
  
  /* COLUMNA DE VISTA */
  .tramites-section-grilla .views-row {
    display: flex;
    flex-direction: column;
  }
  
  /* TARJETA DE CATEGORÍA */
  .tramites-section-grilla .views-field,
  .tramites-section-grilla .views-row {
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    color: #1D1D1B;
  }
  
  /* Asegurar que TODO el texto dentro de la tarjeta sea negro */
  .tramites-section-grilla .views-field *,
  .tramites-section-grilla .views-row * {
    color: #1D1D1B !important;
  }
  
  .tramites-section-grilla .views-field:hover,
  .tramites-section-grilla .views-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #205C40;
  }
  
  /* ICONO DE CATEGORÍA (Material Symbols) */
  .tramites-section-grilla .material-symbols-outlined {
    font-size: 30px !important;
    margin-bottom: 24px;
    display: block;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
  }
  
  /* Campos internos de la tarjeta */
  .tramites-section-grilla .views-field-body,
  .tramites-section-grilla .views-field-field-descripcion {
    flex-grow: 1;
    margin-top: 0;
  }
  
  /* Asegurar espaciado entre elementos internos */
  .tramites-section-grilla .views-field > * {
    margin-bottom: 0;
  }
  
  /* TÍTULO DE CATEGORÍA */
  .tramites-section-grilla h3,
  .tramites-section-grilla .views-field-title h3,
  .tramites-section-grilla .field-content h3 {
    font-size: 28px !important;
    font-weight: 600 !important;
    color: #205C40 !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.3;
    padding: 0;
  }
  
  .tramites-section-grilla .views-field-title,
  .tramites-section-grilla .node__title {
    margin: 0 0 12px 0;
  }
  
  .tramites-section-grilla .views-field-title h2 {
    font-size: 28px;
    font-weight: 600;
    color: #205C40;
    margin: 0;
  }
  
  /* DESCRIPCIÓN DE CATEGORÍA - NEGRO #1D1D1B */
  .tramites-section-grilla p,
  .tramites-section-grilla .views-field-body,
  .tramites-section-grilla .field-content p,
  .tramites-section-grilla .views-field-body p,
  .tramites-section-grilla .views-row p,
  .tramites-section-grilla .views-row .field-content,
  .tramites-section-grilla .node__content p,
  .tramites-section-grilla span {
    font-size: 16px !important;
    color: #1D1D1B !important;
    margin: 0 !important;
    line-height: 1.5;
  }
  
  .tramites-section-grilla .views-field-body,
  .tramites-section-grilla .field-content p,
  .tramites-section-grilla .views-field-body p {
    flex-grow: 1;
  }
  
  /* BAJADA DESCRIPTIVA - forzar negro sobre el gris de .text-muted */
  .tramites-section-grilla .card-text,
  .tramites-section-grilla .card-text * {
    color: #1D1D1B !important;
  }
  
  /* ENLACE DE CATEGORÍA */
  .tramites-section-grilla a {
    color: #205C40;
    text-decoration: none;
    transition: color 0.3s ease;
  }
  
  .tramites-section-grilla a:hover {
    color: #164a30;
    text-decoration: underline;
  }
  
  /* SECCIÓN FLEXIBLE INFERIOR */
  .tramites-section-flexible-bottom {
    padding: 50px 0;
    border-top: 1px solid #e0e0e0;
  }
  
  /* ================================
     RESPONSIVE DESIGN
     ================================ */
  
  /* TABLET - 2 COLUMNAS */
  @media (max-width: 992px) {
    .tramites-section-grilla .views-view-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
    }
  }
  
  @media (max-width: 768px) {
    .tramites-section-grilla .views-view-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
    }
  
    .tramites-section-grilla .views-field,
    .tramites-section-grilla .views-row {
      padding: 20px;
      min-height: 200px;
    }
  
    .tramites-section-grilla h3,
    .tramites-section-grilla .views-field-title h2 {
      font-size: 24px;
    }
  
    .tramites-section-grilla p {
      font-size: 15px;
    }
  
    .tramites-section-grilla {
      padding: 40px 0;
    }
  }
  
  /* MOBILE - 1 COLUMNA */
  @media (max-width: 480px) {
    .tramites-section-grilla .views-view-grid {
      grid-template-columns: 1fr;
      gap: 16px;
    }
  
    .tramites-section-grilla .views-field,
    .tramites-section-grilla .views-row {
      padding: 16px;
      min-height: auto;
    }
  
    .tramites-section-grilla h3,
    .tramites-section-grilla .card-title,
    .tramites-section-grilla .views-field-title h2 {
      font-size: 27px !important;
    }
  
    .tramites-section-grilla p {
      font-size: 14px;
    }

    /* OCULTAR PÁRRAFOS (DESCRIPCIÓN/BODY) DENTRO DE LA CARD EN MOBILE */
    .tramites-section-grilla p,
    .tramites-section-grilla .views-field-body,
    .tramites-section-grilla .views-field-field-descripcion,
    .tramites-section-grilla .field--name-body,
    .tramites-section-grilla .card-text {
      display: none !important;
    }

    /* MÁS ESPACIO ENTRE EL ÍCONO Y EL TÍTULO EN MOBILE */
    .tramites-section-grilla .material-symbols-outlined {
      margin-bottom: 34px !important;
    }
  
    .tramites-section-grilla {
      padding: 30px 0;
    }
  
    .tramites-section-buscador h2 {
      font-size: 24px;
    }
  }
  
  /* BOTÓN BUSCAR - FORMULARIO BUSCADOR TRÁMITES */
  .tramites-section-buscador #button-addon2 {
    background-color: #205C40;
    color: #ffffff;
    border: 1px solid #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .tramites-section-buscador #button-addon2:hover,
  .tramites-section-buscador #button-addon2:focus {
    background-color: #164a30;
    color: #ffffff;
    border-color: #ffffff;
  }

  .tramites-section-buscador #button-addon2 .material-symbols-outlined {
    color: #ffffff;
  }

  /* ================================
     UTILIDADES EXTRAS
     ================================ */
  
  /* Color verde principal */
  .tramites-color-primary {
    color: #205C40;
  }
  
  /* Fondo verde ligero */
  .tramites-bg-light {
    background-color: #f5f5f5;
  }
  
  /* Bordes */
  .tramites-border-top {
    border-top: 1px solid #e0e0e0;
  }
  
  .tramites-border-bottom {
    border-bottom: 1px solid #e0e0e0;
  }