/* ========== Global Reset ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #000;
  color: #f4f4f4;
  font-family: 'Merriweather', serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* ========== Visually Hidden (for a11y) ========== */
.visually-hidden {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ========== Navigation ========== */
header.shard-nav {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.nav-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  margin-bottom: 3rem;
}

a.logo {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.8rem);
  text-decoration: none;
  color: #eee;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin: 1rem 0 2rem;
}

a.logo:hover {
  background: rgba(124, 198, 255, 0.1);
  color: #7cc6ff;
}

.back-arrow {
  font-size: 1.5rem;
  color: #7cc6ff;
  margin-right: 0.4rem;
  transition: transform 0.3s ease;
}

.logo:hover .back-arrow {
  animation: rewind 0.5s ease;
}

@keyframes rewind {
  0% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(-6px); opacity: 0.5; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ========== Layout ========== */
.main-wrapper {
  width: 90vw;
  max-width: 900px;
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.central-message {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  max-width: 700px;     /* ⬅️ this constrains the width */
  margin-left: auto;    /* ⬅️ these two center it horizontally */
  margin-right: auto;
  padding: 2rem 1rem;    /* optional: breathing room */
}

.central-message p {
  max-width: 60ch;      /* ideal line length for readability */
  text-align: left;     /* optional: better for blocks of text */
}

.main-text {
  font-size: 2.5rem;
}

/* ========== Buttons ========== */
.btn-reserve,
.btn-download,
.btn-submit {
  text-decoration: none;   /* remove underline */
  background-color: #7cc6ff;
  display: inline-block;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.25rem;
  color: #0b1a36;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

.btn-reserve:hover,
.btn-download:hover,
.btn-submit:hover {
  background-color: #54a2d9;
  outline: none;
}

/* ========== Notes and Forms ========== */
.download-intro,
.download-note,
.form-instruction {
  font-size: 1.5rem;
  color: #a0a8b9;
  text-align: left;
}

.form-instruction {
  max-width: 60ch;
  width: 100%;
}

/* ========== Blurbs ========== */
/* Base desktop: 3 columns */
.blurbs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.blurb {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  padding: 1rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  color: #a0a8b9;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.4);
}

.blurb:hover {
  background-color: rgba(124, 198, 255, 0.1);
  transform: scale(1.05);
}

.blurb-detail {
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  color: #7cc6ff;
}

.blurb:hover .blurb-detail {
  opacity: 1;
}

/* ========== Modals ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 26, 54, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 2vh 1rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: #152a5e;
  border-radius: 8px;
  color: #cdd9f4;
  box-shadow: 0 0 20px rgba(124, 198, 255, 0.5);
  position: relative;
  animation: fadeIn 0.3s ease;
}

/* Contact Modal */
#modal {
  align-items: center;
}

.modal-contact-content {
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  overflow-y: auto;
}

/* PDF Modal */
#pdfModal {
  align-items: center;
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #7cc6ff;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

body.modal-open {
  overflow: hidden;
}

/* ========== Form ========== */
.reserve-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reserve-form label {
  font-size: 0.9rem;
  color: #a0a8b9;
  text-align: left;
}

.reserve-form input,
.reserve-form textarea {
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
}

.reserve-form input:focus,
.reserve-form textarea:focus {
  outline: 2px solid #7cc6ff;
}

.form-message {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #a0ffa0;
}

/* ========== Footer ========== */
.universal-footer {
  text-align: center;
  padding: 1rem;
  color: #777;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.footer-link {
  color: #7cc6ff;
  text-decoration: none;
  font-weight: bold;
}

.footer-link:hover {
  text-decoration: underline;
  color: #54a2d9;
}

.footer-note {
  margin-top: 1rem;
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  .pdf-modal-content,
  .contact-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    padding: 1rem;
  }

  .btn-reserve,
  .btn-download,
  .btn-submit {
    width: 100%;
    font-size: 1.1rem;
  }

  .blurbs-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0 1rem;
  }
}

@media (max-width: 500px) {
  .blurb {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
}

/* Prevent scroll when modals are open */
body.modal-open {
  overflow: hidden;
}

/* Modal Base */
.pdf-modal-container,
.contact-modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 26, 54, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

/* Shared Modal Content */
.pdf-modal-content,
.contact-modal-content {
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  padding: 1rem;
  border-radius: 8px;
  position: relative;
  overflow: auto;
  background-color: #152a5e;
  color: #cdd9f4;
  box-shadow: 0 0 20px rgba(124, 198, 255, 0.4);
}

/* Unique to PDF modal */
.pdf-modal-content {
  display: flex;
  flex-direction: column;
  height: 90vh; /* Ensure this overrides max-height if needed */
}

/* PDF iframe inside modal */
.pdf-modal-content iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 6px;
  display: block;
}

/* Modal close button */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #7cc6ff;
  cursor: pointer;
}

/* Hide modals initially */
.hidden {
  display: none !important;
}

.toolbarButton.download {
  display: none !important;
}

.book-title {
  font-size: 3rem;
  font-weight: 400;
  color: #7cc6ff;
  text-align: center;
  margin: 0 auto 1rem;
  max-width: 90%;
  font-family: 'Merriweather', serif;
  letter-spacing: 0.03em;
}
