/**
 * Weekly Modal Styles
 * 
 * Minimal, light design matching the site with beautiful serif font.
 * Smooth animations and clean typography.
 */

/* Modal Container */
.weekly-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  font-family: 'Crimson Text', 'Georgia', serif;
}

/* Overlay - semi-transparent background */
.weekly-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* Modal Content Box */
.weekly-modal-content {
  position: relative;
  background: #fafaf8;
  border: 1px solid #e8e8e6;
  border-radius: 4px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 10001;
}

/* Close Button */
.weekly-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.weekly-modal-close:hover {
  color: #333;
}

/* Modal Header */
.weekly-modal-header {
  margin-bottom: 32px;
  text-align: center;
}

.weekly-modal-title {
  font-size: 24px;
  font-weight: 400;
  color: #333;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

.weekly-modal-subtitle {
  font-size: 13px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

/* Modal Body - The Poem */
.weekly-modal-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
}

/* Fixed-size container for poem content */
.weekly-modal-text-container {
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 24px 0;
}

#weekly-reveal {
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#weekly-reveal.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

#weekly-content {
  display: none;
  opacity: 0;
  font-size: 16px;
  line-height: 1.8;
  color: #444;
  white-space: pre-wrap;
}

#weekly-content p {
  margin: 0 0 12px 0;
  text-align: center;
}

#weekly-content p:last-child {
  margin-bottom: 0;
}

.reveal-text {
  font-size: 18px;
  font-style: italic;
  color: #666;
  margin: 0;
}

.cursor {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Modal Footer */
.weekly-modal-footer {
  border-top: 1px solid #e8e8e6;
  padding-top: 16px;
  text-align: center;
}

.weekly-modal-meta {
  font-size: 12px;
  color: #999;
  margin: 0;
}

.weekly-modal-link {
  color: #666;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
  transition: all 0.2s ease;
}

.weekly-modal-link:hover {
  color: #333;
  border-bottom-color: #999;
}

/* Animation Classes */
.weekly-modal-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Typewriter reveal styling */
#weekly-content {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#weekly-header {
  transition: opacity 0.4s ease;
}

#weekly-week {
  transition: opacity 0.4s ease;
}

.weekly-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.weekly-modal-hidden .weekly-modal-overlay,
.weekly-modal-hidden .weekly-modal-content {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.weekly-modal-hidden .weekly-modal-overlay {
  opacity: 0;
}

.weekly-modal-hidden .weekly-modal-content {
  opacity: 0;
  transform: scale(0.95);
}

.weekly-modal-visible .weekly-modal-overlay {
  opacity: 1;
}

.weekly-modal-visible .weekly-modal-content {
  opacity: 1;
  transform: scale(1);
}

/* Scrollbar Styling */
.weekly-modal-content::-webkit-scrollbar {
  width: 6px;
}

.weekly-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.weekly-modal-content::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.weekly-modal-content::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* Responsive Design */
@media (max-width: 600px) {
  .weekly-modal-content {
    padding: 24px;
    border-radius: 0;
  }

  .weekly-modal-title {
    font-size: 20px;
  }

  .weekly-modal-text {
    font-size: 15px;
    line-height: 1.7;
  }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
  .weekly-modal-content {
    background: #1a1a18;
    border-color: #333;
  }

  .weekly-modal-title {
    color: #f5f5f5;
  }

  .weekly-modal-text {
    color: #d0d0cc;
  }

  .weekly-modal-close {
    color: #666;
  }

  .weekly-modal-close:hover {
    color: #aaa;
  }

  .weekly-modal-link {
    color: #999;
    border-bottom-color: #444;
  }

  .weekly-modal-link:hover {
    color: #ccc;
    border-bottom-color: #666;
  }
}
