/* ============================================
   WRITINGS — Scattered Cards Layout
   ============================================ */

.writings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
}

/* Header */
.writings-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 1.5rem 0;
}

.writings-header h1 {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #222;
  margin: 0;
}

/* Scattered grid */
.writings-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Individual card */
.writing-entry {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.writing-entry:hover {
  transform: translateY(-4px) rotate(0deg) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  z-index: 10;
}

/* Subtle idle sway animation */
@keyframes subtleSway {
  0%, 100% { transform: rotate(var(--base-rotate)); }
  50% { transform: rotate(calc(var(--base-rotate) + var(--sway-amount))); }
}

/* Scattered rotation angles with rare subtle sway — "did it just move?" */
.writing-entry:nth-child(1) { --base-rotate: -1.5deg; --sway-amount: 0.8deg; animation: subtleSway 12s ease-in-out infinite; animation-delay: 0s; }
.writing-entry:nth-child(2) { --base-rotate: 1deg; --sway-amount: -0.6deg; animation: subtleSway 14s ease-in-out infinite; animation-delay: 2s; }
.writing-entry:nth-child(3) { --base-rotate: -0.5deg; --sway-amount: 0.5deg; animation: subtleSway 11s ease-in-out infinite; animation-delay: 4s; }
.writing-entry:nth-child(4) { --base-rotate: 2deg; --sway-amount: -0.7deg; animation: subtleSway 13s ease-in-out infinite; animation-delay: 1s; }
.writing-entry:nth-child(5) { --base-rotate: -1deg; --sway-amount: 0.6deg; animation: subtleSway 15s ease-in-out infinite; animation-delay: 3s; }
.writing-entry:nth-child(6) { --base-rotate: 0.5deg; --sway-amount: -0.5deg; animation: subtleSway 10s ease-in-out infinite; animation-delay: 5s; }
.writing-entry:nth-child(7) { --base-rotate: -2deg; --sway-amount: 0.7deg; animation: subtleSway 14s ease-in-out infinite; animation-delay: 2.5s; }
.writing-entry:nth-child(8) { --base-rotate: 1.5deg; --sway-amount: -0.6deg; animation: subtleSway 12s ease-in-out infinite; animation-delay: 1.5s; }
.writing-entry:nth-child(9) { --base-rotate: -0.5deg; --sway-amount: 0.5deg; animation: subtleSway 13s ease-in-out infinite; animation-delay: 3.5s; }
.writing-entry:nth-child(10) { --base-rotate: 1deg; --sway-amount: -0.8deg; animation: subtleSway 11s ease-in-out infinite; animation-delay: 0.5s; }
.writing-entry:nth-child(11) { --base-rotate: -1.5deg; --sway-amount: 0.6deg; animation: subtleSway 14s ease-in-out infinite; animation-delay: 4.5s; }
.writing-entry:nth-child(12) { --base-rotate: 0.5deg; --sway-amount: -0.5deg; animation: subtleSway 12s ease-in-out infinite; animation-delay: 2s; }
.writing-entry:nth-child(n+13) { --base-rotate: -1deg; --sway-amount: 0.6deg; animation: subtleSway 13s ease-in-out infinite; }

/* Pause animation on hover */
.writing-entry:hover {
  animation-play-state: paused;
}

/* Make some cards bigger */
.writing-entry:nth-child(1),
.writing-entry:nth-child(5),
.writing-entry:nth-child(9) {
  grid-column: span 2;
}

/* Paper texture hint */
.writing-entry::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ddd 0%, #eee 50%, #ddd 100%);
}

/* Title */
.writing-entry h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  font-weight: 400;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.writing-entry h2 a {
  color: #111;
  text-decoration: none;
}

.writing-entry h2 a:hover {
  text-decoration: underline;
}

/* Date */
.writing-entry .date {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.75rem;
}

/* Excerpt */
.writing-entry .excerpt {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* Read more button - matches Retroceder but smaller */
.writing-entry .read-more-btn {
  margin-top: 1rem;
  font-size: 0.7rem !important;
  padding: 0.5em 1em !important;
  letter-spacing: 0.1em;
}

/* Footer */
.writings-footer {
  text-align: center;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
}

.writings-footer p {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  color: #aaa;
  letter-spacing: 0.1em;
}

/* ============================================
   TABLET
   ============================================ */
@media (max-width: 900px) {
  .writings-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .writing-entry:nth-child(1),
  .writing-entry:nth-child(5),
  .writing-entry:nth-child(9) {
    grid-column: span 1;
  }
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 600px) {
  .writings-container {
    padding: 1.5rem 1rem;
  }
  
  .writings-header {
    margin-bottom: 2rem;
  }
  
  .writings-header h1 {
    font-size: 1.3rem;
  }
  
  .writings-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Keep subtle animation on mobile too */
  .writing-entry:hover {
    transform: translateY(-2px) rotate(0deg) !important;
  }
  
  .writing-entry {
    padding: 1.25rem;
  }
  
  .writing-entry h2 {
    font-size: 1.1rem;
  }
}
