/* =============================================
   Stabat Mater — Custom Theme
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #2e6b4f;
  --green-dark: #1a4535;
  --green-light:#f0f7f3;
  --text:       #2d2d2d;
  --muted:      #666;
  --border:     #dde8e0;
  --bg:         #f9f9f7;
  --white:      #ffffff;
  --link:       #2e6b4f;
  --link-hover: #1a4535;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ── Top bar ── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 1.2rem;
  font-size: 0.82rem;
  font-family: sans-serif;
}
.topbar a { color: var(--muted); }

/* ── Site header ── */
.site-header {
  display: flex;
  align-items: center;
  padding: 0.8rem 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.site-logo-link {
  flex-shrink: 0;
  margin-right: 1.5rem;
  text-decoration: none;
}
.site-logo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.site-title-link {
  text-decoration: none;
  color: inherit;
}
.site-title {
  font-size: 2.2rem;
  font-weight: normal;
  color: var(--text);
  letter-spacing: 0.01em;
  margin: 0;
}
.site-subtitle {
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.2rem 0 0;
}

/* ── Hero banner ── */
.hero-banner {
  width: 100%;
  overflow: hidden;
  max-height: 220px;
  line-height: 0;
}
.hero-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ── Navigation ── */
nav.main-nav {
  background: var(--green);
  position: relative;
  z-index: 100;
}
nav.main-nav > ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}
nav.main-nav > ul > li {
  position: relative;
}
nav.main-nav li a {
  display: block;
  padding: 0.7rem 1.1rem;
  color: #fff;
  font-family: sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
nav.main-nav li a:hover,
nav.main-nav li a.active {
  border-bottom-color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.1);
  text-decoration: none;
}
/* Active parent */
nav.main-nav li.has-dropdown.active > a {
  border-bottom-color: rgba(255,255,255,0.6);
}
/* Dropdown */
nav.main-nav li.has-dropdown > a::after {
  content: " ▾";
  font-size: 0.75em;
}
nav.main-nav ul.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--green-dark);
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 200;
}
nav.main-nav li.has-dropdown:hover > ul.dropdown {
  display: block;
}
nav.main-nav ul.dropdown li a {
  padding: 0.6rem 1.2rem;
  text-transform: none;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  border-bottom: none;
  border-left: 3px solid transparent;
}
nav.main-nav ul.dropdown li a:hover,
nav.main-nav ul.dropdown li a.active {
  border-bottom: none;
  border-left-color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.15);
}

/* ── Layout ── */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
}
.page-wrapper.full-width {
  grid-template-columns: 1fr;
}
@media (max-width: 768px) {
  .page-wrapper { grid-template-columns: 1fr; }
  .site-title { font-size: 1.5rem; }
}

/* ── Main content ── */
main h1 { font-size: 1.8rem; font-weight: normal; margin-bottom: 1.2rem; color: var(--green-dark); }
main h2 { font-size: 1.3rem; font-weight: normal; margin: 1.8rem 0 0.7rem; color: var(--green-dark); border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
main h3 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; color: var(--green); }
main p  { margin-bottom: 0.9rem; }
main ul, main ol { padding-left: 1.5rem; margin-bottom: 0.9rem; }
main li { margin-bottom: 0.3rem; }

/* ── Sidebar ── */
.sidebar { font-family: sans-serif; font-size: 0.88rem; }
.sidebar-widget { margin-bottom: 2rem; }
.sidebar-widget h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.7rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.sidebar-donate {
  margin-bottom: 1.5rem;
  border-radius: 4px;
  overflow: hidden;
}
.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--green-dark); color: #fff; text-decoration: none; }

/* ── Search ── */
.search-box { display: flex; gap: 0.4rem; }
.search-box input {
  flex: 1;
  padding: 0.4rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
}
.search-box button {
  background: var(--green);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* ── Composer list ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  font-family: sans-serif;
}
.filter-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
  transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.composer-grid {
  columns: 2;
  column-gap: 2rem;
}
@media (max-width: 600px) { .composer-grid { columns: 1; } }

.composer-item {
  break-inside: avoid;
  margin-bottom: 0.3rem;
}
.composer-item a {
  font-size: 0.95rem;
  color: var(--link);
  display: block;
  padding: 0.15rem 0;
  border-bottom: 1px solid transparent;
}
.composer-item a:hover {
  text-decoration: none;
  color: var(--green-dark);
  border-bottom-color: var(--border);
}
.composer-item.hidden { display: none; }

/* ── Composer detail ── */
.composer-meta {
  background: var(--green-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-family: sans-serif;
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}
.composer-meta span { color: var(--muted); }
.composer-meta strong { color: var(--text); }

.cd-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  background: var(--white);
}
.cd-card h3 { margin-top: 0; font-size: 0.95rem; font-family: sans-serif; color: var(--green-dark); }
.cd-moreinfo { font-size: 0.88rem; margin-bottom: 0.6rem; font-family: sans-serif; color: var(--text); }
.cd-table { width: 100%; border-collapse: collapse; font-family: sans-serif; font-size: 0.88rem; margin-top: 0.3rem; }
.cd-table th { text-align: left; vertical-align: top; padding: 0.15rem 1rem 0.15rem 0; color: var(--muted); font-weight: bold; width: 110px; white-space: nowrap; }
.cd-table td { vertical-align: top; padding: 0.15rem 0; color: var(--text); }

/* ── Blog ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  transition: box-shadow 0.15s;
}
.blog-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.blog-card h2 { font-size: 1.05rem; margin-bottom: 0.4rem; border: none; }
.blog-card h2 a { color: var(--text); }
.blog-card .date { font-size: 0.78rem; color: var(--muted); font-family: sans-serif; margin-bottom: 0.6rem; }
.blog-card p { font-size: 0.88rem; color: #555; margin: 0; }

/* ── Translations ── */
.translation-list {
  columns: 2;
  column-gap: 2rem;
  list-style: none;
  padding: 0;
}
.translation-list li { margin-bottom: 0.4rem; break-inside: avoid; }

/* ── Homepage ── */
.home-intro {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.home-video {
  margin-bottom: 1.5rem;
}
.home-video iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 6px;
}

/* ── Footer ── */
footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem;
  font-family: sans-serif;
  font-size: 0.82rem;
  margin-top: 3rem;
}
footer a { color: rgba(255,255,255,0.85); }

/* ── Test banner ── */
.test-banner {
  background: #d94f4f;
  color: white;
  text-align: center;
  padding: 0.5rem;
  font-family: sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Composer portrait ── */
.composer-portrait { float: right; margin: 0 0 1rem 1.5rem; max-width: 200px; }
.composer-portrait img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.composer-portrait figcaption { font-size: 0.75rem; color: var(--muted); text-align: center; margin-top: 0.3rem; }
@media (max-width: 600px) { .composer-portrait { float: none; margin: 0 auto 1rem; display: block; } }

/* ── Stabat Mater info table (on composer pages) ── */
.stabat-table { width: 100%; border-collapse: collapse; font-family: sans-serif; font-size: 0.92rem; margin-bottom: 1.2rem; }
.stabat-table th { text-align: left; vertical-align: top; padding: 0.25rem 1.2rem 0.25rem 0; font-weight: bold; color: var(--text); width: 150px; white-space: nowrap; }
.stabat-table td { vertical-align: top; padding: 0.25rem 0; color: var(--text); }

/* ── Listen / YouTube embeds ── */
.listen-video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin-bottom: 1.2rem; border-radius: 6px; }
.listen-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* ── Pre-footer widgets ── */
.pre-footer {
  background: #b03a1a;
  color: rgba(255,255,255,0.9);
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
}
.pre-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .pre-footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .pre-footer-grid { grid-template-columns: 1fr; }
}
.pre-footer-widget h3 {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.7rem;
}
.pre-footer-widget a { color: rgba(255,255,255,0.9); text-decoration: none; }
.pre-footer-widget a:hover { color: white; text-decoration: underline; }
.pre-footer-widget img {
  width: 100%;
  max-width: 140px;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 0.5rem;
}
.pre-footer-widget p { font-size: 0.85rem; margin: 0; }

/* ── Translation pages ── */
.translation-page h2 { font-size: 1.1rem; color: var(--green-dark); margin: 1.5rem 0 0.5rem; }
.translation-stanza-table {
  width: 100%;
  border-collapse: collapse;
  font-family: serif;
  font-size: 0.93rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.translation-stanza-table th {
  background: var(--green-dark);
  color: white;
  padding: 0.4rem 0.8rem;
  font-weight: normal;
  font-size: 0.82rem;
  text-align: left;
}
.translation-stanza-table td {
  padding: 0.3rem 0.8rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  white-space: pre-line;
}
.translation-stanza-table tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
.stanza-num { font-size: 0.78rem; color: var(--muted); font-family: sans-serif; padding-right: 0.5rem; width: 1.5rem; }
.translation-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.translation-block h3 {
  font-size: 1rem;
  color: var(--green-dark);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.translation-block .stanza { font-family: serif; margin-bottom: 0.8rem; line-height: 1.7; }
.translation-block .stanza-nr { font-size: 0.78rem; color: var(--muted); font-family: sans-serif; }
