:root {
  --bg: #1b1c1f;
  /* softened dark charcoal */
  --card: #242528;
  /* slightly lighter card surface */
  --muted: #efe6d5;
  /* warm light text */
  --accent: #d2b67f;
  /* softened gold for headings & highlights */
  --gold: #c19a38;
  /* gold accent */
  --gap: 12px;
  --radius: 8px;
  --max-width: 1100px;
  --thumb-size: 100px;
  /* Increased slightly for better visibility */
}

/* --------------------------------------------------------------- */
/* Utility – hide something visually but keep it for AT */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px;
}

/* Header */
header {
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
}

h1 {
  margin: .2rem 0;
  font-size: 1.4rem;
  color: var(--accent);
}

#weekday {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------- */
/* Navigation Bar Styles */
/* --------------------------------------------------------------- */
.site-nav {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto 18px;
  text-align: center;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav li {
  display: inline-block;
}

.site-nav a {
  display: inline-block;
  padding: 10px 20px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.2s ease-in-out;
  background-color: transparent;
}

/* Hover Effect */
.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent);
  border-color: var(--accent);
  background-color: rgba(210, 182, 127, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.site-nav a:active {
  transform: translateY(0);
  background-color: rgba(210, 182, 127, 0.2);
}

/* Mobile adjustment */
@media (max-width: 600px) {
  .site-nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .site-nav a {
    width: 100%;
    text-align: center;
  }
}

/* --------------------------------------------------------------- */
/* Selector bar */
.set-selector {
  margin-bottom: 12px;
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
}

#mystery-select {
  font: inherit;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
}

/* --------------------------------------------------------------- */
/* Rotator Wrap */
.rotator-wrap {
  width: 100%;
  max-width: var(--max-width);
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.rotator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.rotator picture,
.rotator img {
  width: 100%;
  max-height: 60vh;
  border-radius: 6px;
  background: #121213;
  display: block;
}

#rotator-img {
  width: 100%;
  height: 60vh;
  object-fit: contain;
  border-radius: 6px;
  transition: opacity .6s ease;
}

.rotator .fade-out {
  opacity: 0;
}

.rotator figcaption {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  padding: 6px 2px;
}

.rotator figcaption .painter {
  color: var(--accent);
  font-weight: 600;
}

.rotator figcaption .fulltitle {
  color: var(--muted);
  font-weight: 500;
}

/* --------------------------------------------------------------- */
/* Stacked Mystery Groups (Dynamic Content) */
/* --------------------------------------------------------------- */
.thumb-columns {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 20px;
  width: 100%;
}

.mystery-group {
  width: 100%;
  text-align: left;
  background: transparent;
  /* Keep transparent to blend with rotator-wrap bg */
  padding: 0;
}

.mystery-group h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--gold);
  letter-spacing: .4px;
  font-weight: 600;
  border-bottom: 1px solid rgba(239, 230, 213, 0.1);
  padding-bottom: 8px;
}

.mystery-list {
  list-style: decimal;
  margin: 0 0 16px 20px;
  padding: 0;
  font-family: "Merriweather", "Gentium Basic", serif;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

.mystery-list li {
  margin-bottom: 4px;
}

/* Thumbnail Grid */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.thumb-grid button {
  background: transparent;
  border: 1px solid rgba(239, 230, 213, 0.08);
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 1 / 1;
  /* Keeps thumbnails square */
}

.thumb-grid button:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.thumb-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.thumb-grid button:hover img {
  transform: scale(1.05);
}

/* --------------------------------------------------------------- */
/* ---------- PRAYERS BLOCK ---------- */
.prayers {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.prayers h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--accent);
  font-family: "Merriweather", "Gentium Basic", serif;
}

.prayers h3 {
  margin: 12px 0 6px;
  font-size: 1rem;
  color: var(--gold);
  font-weight: 600;
  font-family: "Merriweather", "Gentium Basic", serif;
}

.prayers p {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-family: "Merriweather", "Gentium Basic", serif;
}

.prayers em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 600px) {
  .prayers {
    padding: 12px;
  }

  .prayers h2 {
    font-size: 1.1rem;
  }

  .prayers h3 {
    font-size: 0.95rem;
  }

  .prayers article+article {
    margin-top: 16px;
  }
}

/* --------------------------------------------------------------- */
/* Rosary Graphic Container Styles */
/* --------------------------------------------------------------- */
.rosary-graphic-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 24px auto;
  text-align: center;
  padding: 0 10px;
}

.rosary-graphic-container img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: block;
  margin: 0 auto;
  transition: transform 0.2s ease;
}

@media (hover: hover) {
  .rosary-graphic-container img:hover {
    transform: scale(1.02);
  }
}

.rosary-graphic-container p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 12px;
  font-style: italic;
  line-height: 1.4;
}

/* --------------------------------------------------------------- */
/* Footer */
/* --------------------------------------------------------------- */
footer {
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding-bottom: 8px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  #rotator-img {
    height: 45vh;
  }
}