/* ========================================
   CATEGORIA PAGE - UX/UI IMPROVEMENTS
   Mobile-First Design System
   ======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
  --cat-primary: #B71C1C;
  --cat-primary-light: #ef5350;
  --cat-primary-dark: #7f0000;
  --cat-text-dark: #1a1a2e;
  --cat-text-medium: #4a4a68;
  --cat-text-light: #6b6b8a;
  --cat-bg-light: #f8f9fa;
  --cat-bg-white: #ffffff;
  --cat-border: #e8e8f0;
  --cat-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --cat-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --cat-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --cat-radius-sm: 8px;
  --cat-radius-md: 12px;
  --cat-radius-lg: 16px;
  --cat-radius-xl: 24px;
  --cat-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   CATEGORIA HERO SECTION
   ======================================== */
.cat-hero {
  background: linear-gradient(135deg, var(--cat-bg-light) 0%, var(--cat-bg-white) 100%);
  padding: 100px 0 32px;
  margin-bottom: 0;
}

.cat-hero .content-wrapper {
  max-width: 1200px;
  padding: 0 16px;
}

/* Category Header */
.cat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.cat-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--cat-primary) 0%, var(--cat-primary-light) 100%);
  border-radius: var(--cat-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(183, 28, 28, 0.3);
}

.cat-icon svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.cat-title-wrapper {
  flex: 1;
}

.cat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cat-primary);
  margin-bottom: 4px;
}

.cat-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--cat-text-dark);
  margin: 0;
  line-height: 1.2;
}

/* Article Count Badge */
.cat-article-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cat-bg-white);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cat-text-medium);
  box-shadow: var(--cat-shadow-sm);
}

.cat-article-count svg {
  width: 16px;
  height: 16px;
  fill: var(--cat-primary);
}

/* ========================================
   FEATURED ARTICLES (HERO CARDS)
   ======================================== */
.cat-featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.cat-featured-card {
  position: relative;
  border-radius: var(--cat-radius-lg);
  overflow: hidden;
  background: var(--cat-bg-white);
  box-shadow: var(--cat-shadow-md);
  transition: var(--cat-transition);
}

.cat-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cat-shadow-lg);
}

.cat-featured-card a {
  text-decoration: none;
}

.cat-featured-image {
  position: relative;
  width: 100%;
  padding-top: 60%;
  overflow: hidden;
}

.cat-featured-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cat-featured-card:hover .cat-featured-image img {
  transform: scale(1.05);
}

.cat-featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  padding: 60px 20px 20px;
}

.cat-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cat-primary);
  color: white;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.cat-featured-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.cat-featured-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  line-height: 1.4;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-featured-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}

.cat-featured-meta .author {
  font-weight: 500;
  color: white;
}

/* ========================================
   ULTIMISSIME SIDEBAR
   ======================================== */
.cat-sidebar {
  margin-top: 32px;
}

.cat-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--cat-border);
}

.cat-sidebar-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  border-radius: var(--cat-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-sidebar-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.cat-sidebar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cat-text-dark);
  margin: 0;
}

/* Sidebar Article List */
.cat-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-sidebar-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--cat-bg-white);
  border-radius: var(--cat-radius-md);
  box-shadow: var(--cat-shadow-sm);
  transition: var(--cat-transition);
  text-decoration: none;
}

.cat-sidebar-item:hover {
  box-shadow: var(--cat-shadow-md);
  transform: translateX(4px);
}

.cat-sidebar-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cat-primary) 0%, var(--cat-primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.cat-sidebar-content {
  flex: 1;
  min-width: 0;
}

.cat-sidebar-item-badge {
  display: inline-block;
  background: rgba(183, 28, 28, 0.1);
  color: var(--cat-primary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.cat-sidebar-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cat-text-dark);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-sidebar-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: var(--cat-radius-sm);
  overflow: hidden;
}

.cat-sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cat-sidebar-item:hover .cat-sidebar-thumb img {
  transform: scale(1.1);
}

/* ========================================
   MAIN ARTICLES LIST SECTION
   ======================================== */
.cat-articles-section {
  background: var(--cat-bg-light);
  padding: 40px 0 60px;
}

.cat-articles-section .content-wrapper {
  max-width: 1200px;
  padding: 0 16px;
}

.cat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.cat-section-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-section-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: var(--cat-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-section-icon svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.cat-section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--cat-text-dark);
  margin: 0;
}

.cat-section-subtitle {
  font-size: 13px;
  color: var(--cat-text-light);
  font-weight: 400;
}

/* Articles Grid */
.cat-articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Article Card */
.cat-article-card {
  display: flex;
  flex-direction: column;
  background: var(--cat-bg-white);
  border-radius: var(--cat-radius-lg);
  overflow: hidden;
  box-shadow: var(--cat-shadow-sm);
  transition: var(--cat-transition);
}

.cat-article-card:hover {
  box-shadow: var(--cat-shadow-lg);
  transform: translateY(-4px);
}

.cat-article-card a {
  text-decoration: none;
}

.cat-article-image {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
}

.cat-article-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cat-article-card:hover .cat-article-image img {
  transform: scale(1.05);
}

.cat-article-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cat-article-badge {
  display: inline-flex;
  align-self: flex-start;
  background: var(--cat-primary);
  color: white;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.cat-article-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--cat-text-dark);
  line-height: 1.4;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-article-card:hover .cat-article-title {
  color: var(--cat-primary);
}

.cat-article-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--cat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--cat-text-light);
}

.cat-article-author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-article-author svg {
  width: 14px;
  height: 14px;
  fill: var(--cat-text-light);
}

.cat-article-author a {
  color: var(--cat-text-medium);
  font-weight: 500;
}

.cat-article-author a:hover {
  color: var(--cat-primary);
}

.cat-article-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cat-article-date svg {
  width: 12px;
  height: 12px;
  fill: var(--cat-text-light);
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */
.cat-load-more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.cat-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--cat-primary) 0%, var(--cat-primary-light) 100%);
  color: white;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 16px rgba(183, 28, 28, 0.3);
  transition: var(--cat-transition);
}

.cat-load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(183, 28, 28, 0.4);
}

.cat-load-more-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  animation: bounce 1.5s infinite;
}

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

.cat-load-more-btn.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========================================
   SIDEBAR ADS
   ======================================== */
.cat-sidebar-ads {
  margin-top: 32px;
  padding: 20px;
  background: var(--cat-bg-white);
  border-radius: var(--cat-radius-lg);
  box-shadow: var(--cat-shadow-sm);
}

.cat-sidebar-ads-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cat-text-light);
  margin-bottom: 16px;
  text-align: center;
}

/* ========================================
   TABLET STYLES (768px+)
   ======================================== */
@media (min-width: 768px) {
  .cat-hero {
    padding: 120px 0 48px;
  }

  .cat-hero .content-wrapper {
    padding: 0 24px;
  }

  .cat-icon {
    width: 64px;
    height: 64px;
  }

  .cat-icon svg {
    width: 32px;
    height: 32px;
  }

  .cat-title {
    font-size: 40px;
  }

  /* Featured Grid - 2 columns */
  .cat-featured-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .cat-featured-title {
    font-size: 20px;
  }

  /* Sidebar inline with featured */
  .cat-hero-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
  }

  .cat-sidebar {
    margin-top: 0;
    position: sticky;
    top: 100px;
  }

  /* Articles Section */
  .cat-articles-section {
    padding: 48px 0 80px;
  }

  .cat-articles-section .content-wrapper {
    padding: 0 24px;
  }

  .cat-articles-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
  }

  .cat-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cat-article-title {
    font-size: 16px;
  }
}

/* ========================================
   DESKTOP STYLES (1024px+)
   ======================================== */
@media (min-width: 1024px) {
  .cat-hero {
    padding: 130px 0 56px;
  }

  .cat-hero .content-wrapper,
  .cat-articles-section .content-wrapper {
    padding: 0 32px;
  }

  .cat-title {
    font-size: 48px;
  }

  .cat-hero-layout {
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
  }

  .cat-featured-grid {
    gap: 24px;
  }

  .cat-featured-title {
    font-size: 22px;
  }

  .cat-featured-overlay {
    padding: 80px 24px 24px;
  }

  /* Sidebar */
  .cat-sidebar-item {
    padding: 14px;
  }

  .cat-sidebar-item-title {
    font-size: 15px;
  }

  .cat-sidebar-thumb {
    width: 90px;
    height: 68px;
  }

  /* Articles Grid - 3 columns with sidebar */
  .cat-articles-layout {
    grid-template-columns: 1fr 320px;
    gap: 40px;
  }

  .cat-articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .cat-article-title {
    font-size: 17px;
  }

  .cat-section-title {
    font-size: 28px;
  }
}

/* ========================================
   LARGE DESKTOP STYLES (1280px+)
   ======================================== */
@media (min-width: 1280px) {
  .cat-hero .content-wrapper,
  .cat-articles-section .content-wrapper {
    max-width: 1280px;
    padding: 0 40px;
  }

  .cat-featured-grid {
    gap: 28px;
  }

  .cat-featured-title {
    font-size: 24px;
  }

  .cat-articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   ANIMATIONS & TRANSITIONS
   ======================================== */
.cat-fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: catFadeIn 0.6s ease forwards;
}

.cat-fade-in-delay-1 { animation-delay: 0.1s; }
.cat-fade-in-delay-2 { animation-delay: 0.2s; }
.cat-fade-in-delay-3 { animation-delay: 0.3s; }
.cat-fade-in-delay-4 { animation-delay: 0.4s; }

@keyframes catFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for article cards */
.cat-article-card {
  opacity: 0;
  animation: catCardFadeIn 0.5s ease forwards;
}

.cat-article-card:nth-child(1) { animation-delay: 0.1s; }
.cat-article-card:nth-child(2) { animation-delay: 0.15s; }
.cat-article-card:nth-child(3) { animation-delay: 0.2s; }
.cat-article-card:nth-child(4) { animation-delay: 0.25s; }
.cat-article-card:nth-child(5) { animation-delay: 0.3s; }
.cat-article-card:nth-child(6) { animation-delay: 0.35s; }

@keyframes catCardFadeIn {
  to {
    opacity: 1;
  }
}

/* ========================================
   HIDE OLD WEBFLOW STYLES
   ======================================== */
body.cat-page .hero-section.visible.wf-section,
body.cat-page .content-section.double-visible.wf-section {
  display: none !important;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.cat-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.cat-breadcrumb a {
  color: var(--cat-text-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cat-breadcrumb a:hover {
  color: var(--cat-primary);
}

.cat-breadcrumb svg {
  width: 12px;
  height: 12px;
  fill: var(--cat-text-light);
}

.cat-breadcrumb span {
  color: var(--cat-text-dark);
  font-weight: 500;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.cat-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--cat-bg-white);
  border-radius: var(--cat-radius-lg);
}

.cat-empty-state svg {
  width: 80px;
  height: 80px;
  fill: var(--cat-border);
  margin-bottom: 20px;
}

.cat-empty-state h3 {
  font-size: 20px;
  color: var(--cat-text-dark);
  margin-bottom: 8px;
}

.cat-empty-state p {
  color: var(--cat-text-light);
  font-size: 14px;
}

/* ========================================
   SCROLL TO TOP BUTTON (ENHANCED)
   ======================================== */
.cat-scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--cat-primary) 0%, var(--cat-primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(183, 28, 28, 0.3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--cat-transition);
  z-index: 100;
  border: none;
}

.cat-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cat-scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(183, 28, 28, 0.4);
}

.cat-scroll-top svg {
  width: 24px;
  height: 24px;
  fill: white;
}
