.hespedim-page {
  max-width: 1200px;
  margin: auto;
  padding: 2rem 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Arial", sans-serif;
  color: #1a1a1a;
}

.uniform-gallery-img {
  width: 100%;
  height: 400px;
  object-fit: contain;
  object-position: center top; 
}


.hespedim-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  border-bottom: 2px solid #e0e0e0;
}

.hespedim-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.hespedim-header p {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
}

.hespedim-section {
  margin-bottom: 4rem;
}

.hespedim-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #333;
  border-right: 4px solid #2c3e50;
  padding-right: 1rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

.note-card {
  perspective: 1000px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.note-card:hover {
  transform: translateY(-8px) rotateZ(-1deg);
}

.note-content {
  background: linear-gradient(135deg, #fff8e1 0%, #fffacd 100%);
  padding: 1.5rem;
  border-radius: 0px 12px 15px 8px;
  box-shadow:
    -2px 4px 8px rgba(0, 0, 0, 0.1),
    -8px 12px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.note-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 4px
    );
  pointer-events: none;
}

.note-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: #333;
  position: relative;
  z-index: 1;
}

.note-preview {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  position: relative;
  z-index: 1;
  font-style: italic;
}

.note-content {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.note-card:nth-child(1) .note-content {
  transform: rotateZ(-2deg);
  margin-top: -1rem;
}

.note-card:nth-child(2) .note-content {
  transform: rotateZ(1.5deg);
  margin-top: 0.5rem;
}

.note-card:nth-child(3) .note-content {
  transform: rotateZ(-1deg);
  margin-top: -0.5rem;
}

.note-card:nth-child(4) .note-content {
  transform: rotateZ(2deg);
  margin-top: 0.8rem;
}

.note-card:nth-child(n+5) .note-content {
  transform: rotateZ(calc(sin(var(--index)) * 2deg));
}

.author-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
  margin: 30px 0;
}

.hespedim-page .author-link,
.hespedim-page a.author-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 140px;
  color: #333;
  text-decoration: none !important;
  transition: transform 0.2s ease, color 0.2s ease;
}

.author-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: linear-gradient(135deg, #7c93c3 0%, #4a617d 100%);
  box-shadow: 0 10px 20px rgba(74, 97, 125, 0.2);
  border: 4px solid #fff;
  user-select: none;
}

.author-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.4rem;
  font-weight: 700;
}

.author-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: #333;
}

.hespedim-page .author-link:hover,
.hespedim-page a.author-link:hover {
  color: #000;
  text-decoration: none !important;
  transform: translateY(-4px);
}

.hespedim-page .author-link.active,
.hespedim-page a.author-link.active {
  color: #000;
  text-decoration: none !important;
  transform: translateY(-4px);
}

.hespedim-page .author-link:hover .author-avatar,
.hespedim-page a.author-link:hover .author-avatar,
.hespedim-page .author-link.active .author-avatar,
.hespedim-page a.author-link.active .author-avatar {
  box-shadow: 0 12px 22px rgba(74, 97, 125, 0.28);
}

.author-panel {
  display: none;
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.author-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.close-panel {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.hesped-entry {
  margin-bottom: 25px;
  padding: 18px 20px;
  border-radius: 12px;
}

/* Rotating background colors so consecutive hespedim on the same page stand apart */
.hesped-color-0 { background-color: #fdf3e7; }
.hesped-color-1 { background-color: #e9f2fb; }
.hesped-color-2 { background-color: #eef7ec; }
.hesped-color-3 { background-color: #f7ecf5; }
.hesped-color-4 { background-color: #fdeeee; }
.hesped-color-5 { background-color: #eef1fb; }

.hesped-content {
  direction: rtl;
  text-align: start;
  unicode-bidi: plaintext;
}

.hesped-video {
  width: 400px;
  max-width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  border: 0;
  display: block;
}

.hesped-content [lang="en"],
.hesped-content [lang="en"] *,
.hesped-content :lang(en),
.hesped-content :lang(en) * {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

.hesped-entry h3 {
  margin-bottom: 8px;
  color: #555;
}

.empty-state {
  text-align: center;
  color: #888;
  margin-top: 40px;
}

@media (max-width: 720px) {
  .hespedim-header h1 {
    font-size: 1.8rem;
  }

  .hespedim-section h2 {
    font-size: 1.5rem;
  }

  .notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }

  .note-content {
    padding: 1.2rem;
    min-height: 140px;
  }

}
