/**
 * Unamos - Unified Timeline Component
 * Brand Colors:
 *   - Primary Orange: #F88D11 / #FF8C00
 *   - Corporate Blue: #003399 / #0D3357
 *   - Dark Slate:     #0F172A / #1E293B
 *   - Slate Muted:    #475569 / #64748B
 *   - Light Surface:  #F8FAFC / #FFFFFF
 */

/* ==========================================================================
   1. Section Wrapper & Header
   ========================================================================== */
.utl-section {
  position: relative;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 8%, #F8FAFC 92%, #FFFFFF 100%);
  padding: 60px 0 80px;
  overflow: hidden;
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1E293B;
}

.utl-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Header Area */
.utl-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 36px;
}

.utl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(248, 141, 17, 0.1);
  color: #D97706;
  border: 1px solid rgba(248, 141, 17, 0.3);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.utl-eyebrow-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F88D11;
  box-shadow: 0 0 0 0 rgba(248, 141, 17, 0.7);
  animation: utlPulse 2s infinite;
}

@keyframes utlPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(248, 141, 17, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(248, 141, 17, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(248, 141, 17, 0); }
}

.utl-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  color: #0D3357;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}

.utl-title span {
  color: #F88D11;
}

.utl-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: #475569;
  margin: 0 auto;
  max-width: 680px;
}

/* ==========================================================================
   2. Interactive Toolbar & Filters
   ========================================================================== */
.utl-toolbar {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
  margin-bottom: 45px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.utl-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Category Filter Tabs */
.utl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.utl-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.utl-filter-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.utl-filter-btn.active {
  background: #0D3357;
  color: #FFFFFF;
  border-color: #0D3357;
  box-shadow: 0 4px 10px rgba(13, 51, 87, 0.25);
}

.utl-filter-btn.active.utl-filter-zona {
  background: #F88D11;
  border-color: #F88D11;
  box-shadow: 0 4px 10px rgba(248, 141, 17, 0.3);
}

.utl-filter-count {
  display: inline-block;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.utl-filter-btn.active .utl-filter-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Year Filter Quick Select */
.utl-years-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.utl-years-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.utl-year-chip {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.utl-year-chip:hover {
  border-color: #F88D11;
  color: #F88D11;
}

.utl-year-chip.active {
  background: #F88D11;
  border-color: #F88D11;
  color: #FFFFFF;
  font-weight: 700;
}

/* Search Box */
.utl-search-wrap {
  position: relative;
  min-width: 240px;
  flex: 1;
  max-width: 320px;
}

.utl-search-input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 13.5px;
  color: #0F172A;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.utl-search-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #003399;
  box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.12);
}

.utl-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94A3B8;
  pointer-events: none;
}

.utl-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  display: none;
  font-size: 16px;
  line-height: 1;
}

.utl-search-clear.visible {
  display: block;
}

/* Status row: Results info */
.utl-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #64748B;
  padding-top: 6px;
  border-top: 1px solid #F1F5F9;
}

.utl-info-strong {
  font-weight: 700;
  color: #0D3357;
}

/* ==========================================================================
   3. Timeline Track & Grid Layout
   ========================================================================== */
.utl-timeline {
  position: relative;
  margin: 0 auto;
  padding: 10px 0 20px;
}

/* Central vertical spine (Desktop) */
.utl-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #F88D11 0%, #003399 45%, #0D3357 100%);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(248, 141, 17, 0.15);
  z-index: 1;
}

/* Desktop 2-Column Grid */
.utl-items-group {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 64px;
  row-gap: 32px;
  align-items: start;
}

/* ==========================================================================
   4. Markers: Year & Month
   ========================================================================== */
.utl-year-marker {
  grid-column: 1 / -1;
  position: relative;
  z-index: 5;
  text-align: center;
  margin: 20px 0 10px;
}

.utl-year-marker:first-child {
  margin-top: 0;
}

.utl-year-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0D3357;
  color: #FFFFFF;
  border: 2px solid #F88D11;
  padding: 8px 24px;
  border-radius: 9999px;
  box-shadow: 0 8px 20px -4px rgba(13, 51, 87, 0.35);
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.utl-year-pill svg {
  width: 18px;
  height: 18px;
  color: #F88D11;
}

.utl-year-count-badge {
  background: rgba(248, 141, 17, 0.25);
  color: #FFC078;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0;
}

/* Month Divider */
.utl-month-divider {
  grid-column: 1 / -1;
  position: relative;
  z-index: 4;
  text-align: center;
  margin: 10px 0 6px;
}

.utl-month-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  color: #0D3357;
  border: 1px solid #CBD5E1;
  padding: 4px 16px;
  border-radius: 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.utl-month-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F88D11;
}

/* ==========================================================================
   5. Timeline Cards & Alternating Grid
   ========================================================================== */
.utl-item {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  z-index: 2;
}

.utl-item--left {
  grid-column: 1;
  justify-self: end;
}

.utl-item--right {
  grid-column: 2;
  justify-self: start;
}

/* Connector Dot on Spine */
.utl-item-node {
  position: absolute;
  top: 32px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3.5px solid #F88D11;
  box-shadow: 0 0 0 3px rgba(248, 141, 17, 0.25);
  z-index: 3;
  transition: all 0.25s ease;
}

.utl-item--left .utl-item-node {
  right: -40px;
}

.utl-item--right .utl-item-node {
  left: -40px;
}

/* Connector Line from Card to Spine */
.utl-item::after {
  content: '';
  position: absolute;
  top: 39px;
  height: 2px;
  background: #CBD5E1;
  z-index: 1;
  transition: background-color 0.25s ease;
}

.utl-item--left::after {
  right: -32px;
  width: 32px;
}

.utl-item--right::after {
  left: -32px;
  width: 32px;
}

.utl-item:hover .utl-item-node {
  transform: scale(1.3);
  background: #F88D11;
  box-shadow: 0 0 0 6px rgba(248, 141, 17, 0.35);
}

.utl-item:hover::after {
  background: #F88D11;
}

/* Card Outer & Article */
.utl-card-wrapper {
  display: block;
  height: 100%;
}

.utl-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  color: inherit;
}

.utl-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(248, 141, 17, 0.12), 0 8px 10px -6px rgba(13, 51, 87, 0.08);
  border-color: rgba(248, 141, 17, 0.5);
}

/* Card Media / Image */
.utl-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0F172A;
  overflow: hidden;
}

.utl-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.utl-card:hover .utl-card-img {
  transform: scale(1.05);
}

/* Floating Badges */
.utl-badge-category {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.utl-badge-category--noticias {
  background: linear-gradient(135deg, #003399 0%, #0D3357 100%);
}

.utl-badge-category--zona {
  background: linear-gradient(135deg, #F88D11 0%, #D97706 100%);
}

.utl-badge-type {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.utl-badge-type svg {
  width: 12px;
  height: 12px;
}

.utl-badge-type--video svg {
  color: #EF4444;
}

.utl-badge-type--nota svg {
  color: #38BDF8;
}

/* Card Body */
.utl-card-body {
  padding: 20px 22px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.utl-card-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 8px;
}

.utl-card-date svg {
  width: 14px;
  height: 14px;
  color: #F88D11;
}

.utl-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #0F172A;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.utl-card:hover .utl-card-title {
  color: #F88D11;
}

.utl-card-excerpt {
  font-size: 13.5px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer */
.utl-card-footer {
  padding: 12px 22px 14px;
  border-top: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FCFDFF;
  margin-top: auto;
}

.utl-readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #003399;
  transition: all 0.2s ease;
}

.utl-readmore svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.utl-card:hover .utl-readmore {
  color: #F88D11;
}

.utl-card:hover .utl-readmore svg {
  transform: translateX(4px);
}

/* ==========================================================================
   6. Pagination Controls
   ========================================================================== */
.utl-pagination-wrap {
  margin-top: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.utl-pagination {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 9999px;
  padding: 6px 10px;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

.utl-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.utl-page-btn:hover:not(:disabled) {
  background: #F1F5F9;
  color: #0F172A;
}

.utl-page-btn.active {
  background: #F88D11;
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(248, 141, 17, 0.35);
}

.utl-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.utl-page-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}

.utl-pagination-info {
  font-size: 13px;
  color: #64748B;
}

/* Empty State */
.utl-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #FFFFFF;
  border: 1px dashed #CBD5E1;
  border-radius: 16px;
  max-width: 500px;
  margin: 30px auto;
}

.utl-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.utl-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
}

.utl-empty-desc {
  font-size: 14px;
  color: #64748B;
  margin-bottom: 16px;
}

.utl-empty-btn {
  padding: 8px 18px;
  background: #F88D11;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   7. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 991px) {
  .utl-section {
    padding: 40px 0 60px;
  }

  .utl-title {
    font-size: 30px;
  }

  /* Move timeline spine to left */
  .utl-timeline::before {
    left: 24px;
    transform: none;
  }

  .utl-items-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .utl-year-marker,
  .utl-month-divider {
    text-align: left;
    padding-left: 54px;
    margin: 12px 0 0;
  }

  .utl-year-pill {
    padding: 6px 18px;
    font-size: 15px;
  }

  /* Items stack full width on right of spine */
  .utl-item,
  .utl-item--left,
  .utl-item--right {
    width: 100%;
    margin-left: 0;
    padding-left: 54px;
  }

  /* Left item node & line adjustments */
  .utl-item--left .utl-item-node,
  .utl-item--right .utl-item-node {
    left: 16px;
    right: auto;
  }

  .utl-item--left::after,
  .utl-item--right::after {
    left: 24px;
    right: auto;
    width: 30px;
  }
}

@media (max-width: 640px) {
  .utl-title {
    font-size: 26px;
  }

  .utl-toolbar {
    padding: 14px;
  }

  .utl-search-wrap {
    max-width: 100%;
    width: 100%;
  }

  .utl-card-body {
    padding: 16px;
  }

  .utl-card-title {
    font-size: 16px;
  }

  .utl-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }
}
