/* Memorial Musolino — site stylesheet
   Warm, elegant tone for a memorial/charity site. */

:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-alt: #f3ece1;
  --text: #2b2420;
  --text-muted: #6b5f55;
  --border: #e6dcca;
  --accent: #7a2e2e;
  --accent-dark: #5e2222;
  --accent-soft: #f1e2df;
  --gold: #b08d3f;
  --shadow: 0 2px 10px rgba(43, 36, 32, 0.08);
  --radius: 10px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #1c1815;
  --surface: #262019;
  --surface-alt: #2e2721;
  --text: #ece5da;
  --text-muted: #b9ada0;
  --border: #423a30;
  --accent: #d98a8a;
  --accent-dark: #e8a5a5;
  --accent-soft: #362320;
  --gold: #d3ac5f;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1815;
    --surface: #262019;
    --surface-alt: #2e2721;
    --text: #ece5da;
    --text-muted: #b9ada0;
    --border: #423a30;
    --accent: #d98a8a;
    --accent-dark: #e8a5a5;
    --accent-soft: #362320;
    --gold: #d3ac5f;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: normal;
  color: var(--text);
  line-height: 1.25;
}

h1 { font-size: 2.1rem; margin: 0 0 0.4em; }
h2 { font-size: 1.5rem; margin: 1.6em 0 0.6em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 0.5em; color: var(--accent); }

p { margin: 0 0 1em; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--accent);
}

.site-header .brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px 14px;
  max-width: 1080px;
  margin: 0 auto;
}

.brand-row .crest {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.brand-row .brand-text h1 {
  font-size: 1.5rem;
  margin: 0;
}

.brand-row .brand-text .tagline {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 2px 0 0;
}

nav.main-nav {
  background: var(--accent);
}

nav.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 24px;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
}

nav.main-nav a {
  display: block;
  color: #fff;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

nav.main-nav a:hover,
nav.main-nav a.active {
  background: var(--accent-dark);
  text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--surface-alt), var(--bg));
  padding: 48px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 { font-size: 2.3rem; }
.hero .lede {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-image {
  max-width: 620px;
  margin: 28px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ---------- Layout blocks ---------- */

main { padding: 40px 0 60px; }

.lead-in {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.two-col { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(43,36,32,0.12); }

.tile h3 { margin-top: 0; }

.tile a.tile-link {
  display: block;
  color: inherit;
}
.tile a.tile-link:hover { text-decoration: none; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }

.btn.secondary {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.btn.secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumbs a { color: var(--text-muted); text-decoration: underline; }

/* ---------- Tables ---------- */

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0 1.6em;
  font-size: 0.95rem;
}
table.data th, table.data td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
table.data th {
  background: var(--surface-alt);
  font-family: var(--serif);
}
table.data tr:nth-child(even) td { background: rgba(0,0,0,0.015); }

.table-scroll { overflow-x: auto; }

/* ---------- Lists ---------- */

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li {
  padding: 8px 0;
  border-bottom: 1px dotted var(--border);
}
ul.two-col-list {
  columns: 2;
  column-gap: 32px;
  padding-left: 1.1em;
}
@media (max-width: 640px) {
  ul.two-col-list { columns: 1; }
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.gallery-grid figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.gallery-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.gallery-grid figcaption {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Docs / archive lists ---------- */

.doc-list a::before { content: "📄 "; }
.doc-list a[href$=".pdf"]::before { content: "📕 "; }
.doc-list a[href$=".doc"]::before, .doc-list a[href$=".docx"]::before { content: "📝 "; }
.doc-list a[href$=".zip"]::before, .doc-list a[href$=".rar"]::before { content: "🗜 "; }
.doc-list a[href$=".jpg"]::before, .doc-list a[href$=".jpeg"]::before, .doc-list a[href$=".png"]::before, .doc-list a[href$=".gif"]::before { content: "🖼 "; }

/* ---------- Notice ---------- */

.notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 1.2em 0;
  font-size: 0.95rem;
}

.notice.muted {
  background: var(--surface-alt);
  border-left-color: var(--gold);
  color: var(--text-muted);
}

/* ---------- Donation box ---------- */

.donate-box {
  background: var(--surface-alt);
  border: 1px dashed var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.donate-box code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */

footer.site-footer {
  background: var(--accent-dark);
  color: #f2e6e6;
  padding: 32px 0;
  margin-top: 20px;
  font-size: 0.88rem;
}
footer.site-footer a { color: #fff; text-decoration: underline; }
footer.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
footer.site-footer h4 {
  color: #fff;
  font-size: 0.95rem;
  margin: 0 0 8px;
}
footer.site-footer .bottom-line {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 20px;
  padding-top: 14px;
  text-align: center;
  color: #ecd9d9;
  font-size: 0.8rem;
}

/* ---------- Converted legacy table markup ---------- */

.legacy-table {
  display: block;
  margin: 0.8em 0;
}
.legacy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
}
.legacy-cell {
  flex: 1 1 220px;
  min-width: 0;
}
.legacy-cell img { margin: 0 auto; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .brand-row { flex-direction: column; text-align: center; }
  nav.main-nav ul { justify-content: center; }
  nav.main-nav a { padding: 10px 12px; font-size: 0.85rem; }
  .hero h1 { font-size: 1.7rem; }
}
