/* ============================================================
   Placeholder Poetry — Unified styles.css (Restored Version)
   ============================================================ */

/* -------------------- Base layout -------------------- */
:root {
  --paper: #f9f5ef;
  --ink: #2b2b2b;
  --muted: #555;
  --button-bg: #f2e8dc;
  --button-hover: #d8cbb3;
}

html, body { height: 100%; }

body {
  font-family: Georgia, serif;
  background-color: var(--paper);
  color: var(--ink);
  text-align: center;
  margin: 0;
  padding: 2rem 1rem;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
a, p, figcaption, button {
  font-family: Georgia, serif;
}

/* -------------------- Headings -------------------- */
h1 {
  font-size: 2.2rem;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #d8cbb3;
  padding-bottom: 0.5rem;
  display: inline-block;
}

.subtitle {
  font-size: 1.3rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.5rem auto 1rem auto;
  letter-spacing: 0.5px;
  text-align: center;
}

/* -------------------- Paragraphs -------------------- */
.intro-text {
  max-width: 500px;
  margin: 1.5rem auto;
  font-size: 1.1rem;
  color: #3c3c3c;
}

/* -------------------- Links & nav -------------------- */
a {
  color: #3b3b3b;
  text-decoration: none;
  font-weight: bold;
}
a:hover { text-decoration: underline; color: #5a4634; }

.nav-links {
  margin: 2.5rem auto 3.5rem auto;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  background-color: var(--button-bg);
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.08);
  transition: background-color .25s ease, transform .18s ease;
}
.nav-links a:hover { background-color: var(--button-hover); transform: translateY(-2px); }

/* -------------------- Galleries (shared) -------------------- */
.gallery,
.book-gallery {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: nowrap;
  margin: 2rem auto 3rem auto;
  max-width: 95%;
}

.gallery {
  max-width: 1000px;
  align-items: center;
  text-align: center;
  gap: 50px;
}

.gallery figure {
  margin: 0;
  flex-shrink: 0;
  transition: transform .3s ease, opacity .3s ease;
  text-align: center;
}

.gallery figcaption {
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  margin-top: .5rem;
  line-height: 1.4;
}

.gallery img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  transition: transform .25s ease, opacity .25s ease;
  margin: 0 auto;
}
.gallery img:hover { transform: scale(1.03); }

/* Book gallery */
.book-gallery { align-items: flex-end; }
.book-gallery img {
  height: 420px;
  width: auto;
  object-fit: contain;
  transition: transform .25s ease;
  cursor: pointer;
}
.book-gallery img:hover { transform: scale(1.03); }

/* -------------------- Readings page tweaks -------------------- */
body.readings-page .gallery { align-items: center; justify-content: center; }
body.readings-page .gallery figure { margin: 0 20px; }

body.readings-page .gallery figure:nth-child(2) img,
body.readings-page .gallery figure:nth-child(3) img {
  height: 320px;
  opacity: 0.6;
}

/* -------------------- Press page image -------------------- */
body.press-page .press-image {
  display: block;
  margin: 2rem auto;
  width: 300px;
  height: auto;
  opacity: .5;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border: 1px solid #e0d6c8;
  transition: transform .3s ease, opacity .25s ease;
}
body.press-page .press-image:hover { opacity: .7; transform: scale(1.05); }
body.press-page .press-image.flipped { transform: rotate(180deg); }

/* -------------------- Modal (image zoom) -------------------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  padding: 1rem;
  overflow: hidden;
  background-color: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity .3s ease;
}
.modal.show { display: flex; opacity: 1; }

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  transition: transform .25s ease;
  cursor: grab;
  user-select: none;
  will-change: transform;
  box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

.close {
  position: absolute;
  top: 20px; right: 30px;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
}
.close:hover { color: #ccc; }

/* -------------------- Homepage -------------------- */
body.index-page .subtitle {
  text-align: center;
  margin: 0 auto 1rem auto;
  font-size: 1.3rem;
  color: var(--muted);
  font-style: italic;
  letter-spacing: .5px;
}

body.index-page .homepage-image {
  display: block;
  margin: 2rem auto;
  width: 100%;
  max-width: 700px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border: 1px solid #e0d6c8;
  z-index: 1;
}

/* -------------------- Page-wrapper & corner logos -------------------- */
.page-wrapper { position: relative; padding-bottom: 3rem; }

.corner-logo {
  position: absolute;
  width: 180px;
  height: auto;
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.corner-logo.top-left { top: 20px; left: 20px; }
.corner-logo.bottom-right { bottom: 20px; right: 20px; }
.corner-logo:hover { opacity: 0.7; transform: scale(1.03); }

/* ============================================================
   Unified Mobile Rules — for screens ≤ 600px
   ============================================================ */
@media (max-width: 600px) {

  /* General layout */
  body { padding: 1rem; }
  h1 { font-size: 1.8rem; }
  .subtitle { font-size: 1.1rem; }
  .intro-text { font-size: 1rem; max-width: 90%; }

  /* Navigation */
  .nav-links a {
    padding: 8px 14px;
    font-size: .95rem;
    margin: 4px 6px;
  }

  /* Galleries */
  .gallery,
  .book-gallery {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .gallery img,
  .book-gallery img,
  .reading-image {
    width: 90%;
    height: auto;
    margin: 0 auto;
  }

  /* Dimmed readings (same size on mobile) */
  body.readings-page .gallery figure:nth-child(2) img,
  body.readings-page .gallery figure:nth-child(3) img {
    width: 90%;
    opacity: 0.6;
  }

  /* Books: reduce height */
  .book-gallery img { height: auto; }

  /* Hide both logos */
  .corner-logo.top-left,
  .corner-logo.bottom-right {
    opacity: 0 !important;
    pointer-events: none;
  }

  /* Homepage image */
  .feature-image,
  .homepage-image {
    display: block;
    width: 90%;
    height: auto;
    margin: 1rem auto;
  }

  /* Modal fit on mobile */
  .modal-content {
    max-width: 100%;
    max-height: 85%;
  }

  /* Corner logo sizing (if visible in other contexts) */
  .corner-logo { width: 110px; opacity: .45; }
  .corner-logo.top-left { top: 12px; left: 12px; }
  .corner-logo.bottom-right { bottom: 12px; right: 12px; }
}

/* ============================================================
   Readings Page – Consistent Layout Fixes
   ============================================================ */

/* Desktop: all posters in one row */
@media (min-width: 769px) {
  .gallery {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 40px !important;
    max-width: 1000px;
    margin: 2rem auto 3rem auto;
  }

  .gallery figure {
    flex: 0 0 auto !important;
    text-align: center;
  }

  .gallery img {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
  }
}

/* Tablet / narrow screens */
@media (max-width: 768px) {
  .gallery {
    flex-direction: column;
    align-items: center;
    gap: 25px;
    max-width: 90%;
    margin: 1.5rem auto 2.5rem auto;
  }

  .gallery figure {
    max-width: 400px;
    width: 90%;
  }

  .gallery img {
    width: 90%;
    max-width: 350px;
  }

  .gallery figure:nth-child(2) img,
  .gallery figure:nth-child(3) img {
    width: 85%;
    opacity: 0.6;
  }
}

/* Extra-small screens (narrow phones) */
@media (max-width: 480px) {
  .gallery {
    gap: 20px;
  }

  .gallery figure {
    max-width: 100%;
  }

  .gallery img {
    width: 100%;
    max-width: 300px;
  }

  .gallery figure:nth-child(2) img,
  .gallery figure:nth-child(3) img {
    width: 100%;
    max-width: 280px;
    opacity: 0.65;
  }

  /* Ensure logos hidden */
  .corner-logo.top-left,
  .corner-logo.bottom-right {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Safety override */
.gallery[style] {
  align-items: center !important;
  justify-content: center !important;
}
/* ============================================================
   FINAL RESPONSIVE FIXES — 9 Nov
   ============================================================ */

/* Force corner logos to hide on mobile */
@media (max-width: 768px) {
  .corner-logo,
  .corner-logo.top-left,
  .corner-logo.bottom-right {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
  }
}

/* Homepage image scaling */
body.index-page .feature-image,
body.index-page .homepage-image {
  display: block;
  margin: 2rem auto;
  width: 100%;
  max-width: 700px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border: 1px solid #e0d6c8;
}

@media (max-width: 900px) {
  body.index-page .feature-image,
  body.index-page .homepage-image {
    max-width: 500px;
  }
}
@media (max-width: 600px) {
  body.index-page .feature-image,
  body.index-page .homepage-image {
    max-width: 90%;
  }
}

/* Book gallery responsive stacking */
@media (max-width: 768px) {
  .book-gallery {
    flex-direction: column !important;
    align-items: center !important;
    gap: 25px !important;
  }

  .book-gallery img {
    width: 90% !important;
    height: auto !important;
  }
}
