/* ==========================================================================
   SUMARIO
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

.sumario-hero {
  background: var(--light);
  padding: 60px 0 10px;
}

.sumario-hero-card {
  background: linear-gradient(135deg, #012a40 0%, #023f5f 70%);
  border-radius: 20px;
  padding: 30px 36px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.sumario-hero-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.sumario-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sumario-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.sumario-back:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sumario-back svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sumario-hero-tag {
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
}

.sumario-hero-title {
  font-family: 'Inter', sans-serif;
  font-size: 2.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.sumario-hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 10px;
  text-align: center;
}

.sumario-section {
  background: var(--light);
  padding: 20px 0 80px;
}

.sumario-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 40px;
}

.sumario-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  text-align: center;
}

.sumario-header-text {
  flex: 1;
  min-width: 240px;
  text-align: center;
}

.sumario-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.sumario-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a2b3c;
  margin-bottom: 6px;
}

.sumario-description {
  color: #5a6a7a;
  font-size: 0.95rem;
}

.sumario-meta {
  background: #eef4f9;
  color: #1a2b3c;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.sumario-search {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 14px;
  border-radius: 999px;
  background: #f8fbff;
  border: 1px solid #e1e8f0;
  min-width: 420px;
  max-width: 560px;
  margin: 0 auto;
}

.sumario-search-input {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: #1a2b3c;
  outline: none;
  padding: 6px 0;
  text-align: center;
}

.sumario-search-input::placeholder {
  color: #7a8a99;
}

.sumario-search:focus-within {
  border-color: #7daed1;
  box-shadow: 0 0 0 2px rgba(125, 174, 209, 0.18);
  background: #ffffff;
}

.sumario-search-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #3d7a9e 0%, #2d6a8e 100%);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease;
}

.sumario-search-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sumario-search-button:hover {
  box-shadow: none;
}

.sumario-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  max-height: 260px;
  overflow-y: auto;
}

.sumario-suggestion {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sumario-suggestion:hover,
.sumario-suggestion.active {
  background: #f3f7fb;
}

.sumario-suggestion-title {
  font-size: 0.92rem;
  color: #1a2b3c;
  font-weight: 600;
}

.sumario-suggestion-path {
  font-size: 0.78rem;
  color: #6a7a88;
}

.sumario-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sumario-folder {
  border: 1px solid #e6ebf0;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin-left: calc(var(--depth, 0) * 8px);
}

.sumario-folder-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  padding-left: calc(18px + (var(--depth, 0) * 16px));
  background: #f3f7fb;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--primary);
}

.sumario-folder-header:hover {
  background: #eaf1f7;
}

.folder-toggle {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(2, 63, 95, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.sumario-folder.open .folder-toggle {
  transform: rotate(90deg);
}

.folder-label {
  flex: 1;
}

.folder-count {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
}

.sumario-folder-content {
  display: none;
  flex-direction: column;
  background: #ffffff;
}

.sumario-folder.open .sumario-folder-content {
  display: flex;
}

.sumario-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  padding-left: calc(44px + (var(--depth, 0) * 16px));
  color: var(--gray);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border-left: 3px solid transparent;
}

.sumario-item:hover {
  background: #f5f8fb;
  color: var(--primary);
  border-left-color: var(--primary);
}

.item-icon {
  font-size: 0.9rem;
}

.item-title {
  font-size: 0.95rem;
}

.sumario-empty {
  text-align: center;
  color: #5a6a7a;
  padding: 20px;
  background: #f5f8fb;
  border-radius: 12px;
}

.sumario-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.blog-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 360px;
}

.blog-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.blog-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-content {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.blog-card-content h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2b3c;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-content p {
  font-size: 0.92rem;
  color: #5a6a7a;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.sumario-load-more {
  display: block;
  margin: 20px auto 0;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #3d7a9e 0%, #2d6a8e 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease;
}

.sumario-load-more:hover {
  box-shadow: none;
}

.sumario-load-more:disabled {
  background: #e2e6ec;
  color: #8a93a3;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.sumario-books {
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
}

.sumario-books-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.sumario-books-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--secondary);
  background: rgba(67, 129, 164, 0.12);
  padding: 6px 12px;
  margin-top: 8px;
  border-radius: 999px;
}

.sumario-books-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  color: #1a2b3c;
  margin-bottom: 6px;
}

.sumario-books-subtitle {
  font-size: 0.98rem;
  color: #5a6a7a;
  line-height: 1.6;
  max-width: 760px;
  text-align: justify;
}

.sumario-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.book-card {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 18px;
  align-items: center;
  background: #f8fbff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(67, 129, 164, 0.12);
}

.book-cover {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.book-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.book-role {
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 700;
}

.book-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a2b3c;
}

.book-chapter {
  font-size: 0.95rem;
  color: #3d5368;
}

.book-reference {
  font-size: 0.85rem;
  color: #6a7a88;
  line-height: 1.5;
}

@media (max-width: 1200px) {
  .sumario-posts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sumario-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sumario-posts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sumario-hero {
    padding: 36px 0 24px;
  }

  .sumario-hero-card {
    padding: 26px 22px;
  }

  .sumario-hero-title {
    font-size: 1.8rem;
  }

  .sumario-panel {
    padding: 20px;
  }

  .sumario-header-actions {
    width: 100%;
    justify-content: center;
  }

  .sumario-search {
    width: 100%;
    min-width: auto;
  }

  .sumario-books {
    padding: 22px;
  }

  .book-card {
    grid-template-columns: 1fr;
  }

  .book-cover {
    max-width: 220px;
    justify-self: center;
  }

  .blog-card {
    grid-template-columns: 1fr;
  }

  .sumario-folder-header {
    padding: 12px 16px;
    padding-left: calc(16px + (var(--depth, 0) * 14px));
  }

  .sumario-item {
    padding: 12px 16px;
    padding-left: calc(38px + (var(--depth, 0) * 14px));
  }
}

@media (max-width: 560px) {
  .sumario-search {
    grid-template-columns: 1fr;
    border-radius: 16px;
    padding: 0;
    background: transparent;
    border: none;
    gap: 10px;
  }

  .sumario-search:focus-within {
    box-shadow: none;
    background: transparent;
    border: none;
  }

  .sumario-search-input {
    background: #f8fbff;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    padding: 12px 14px;
  }

  .sumario-search-input:focus {
    border-color: #7daed1;
    box-shadow: 0 0 0 2px rgba(125, 174, 209, 0.18);
  }

  .sumario-search-button {
    justify-content: center;
    max-width: 120px;
    justify-self: center;
    margin: 0 auto;
  }
}

