/* =====================================================================
   St Stephen's / St Ignatius of Loyola — Design System
   Palette: candlelit parchment + liturgical wine & antique gold
   Type:    Fraunces (display serif) + Karla (humanist sans/body)
   Motif:   the arch — church windows, doors, and doorways of welcome
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Karla:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* --- Colour tokens --- */
  --parchment:      #F1EAD9;
  --parchment-deep: #E7DCC3;
  --card:           #FBF8F1;
  --ink:            #241F1C;
  --ink-soft:       #52493F;
  --wine:           #6E1423;
  --wine-deep:      #4E0E19;
  --gold:           #A9812F;
  --gold-light:     #C9A855;
  --slate-green:    #3F5347;
  --slate-green-lt: #E4EAE4;
  --line:           #D8CCAE;
  --danger:         #8A2A1E;

  /* --- Type --- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- Shape --- */
  --arch-radius: 999px 999px 8px 8px;
  --radius-sm: 6px;
  --radius-md: 10px;

  --shadow-sm: 0 1px 3px rgba(36, 31, 28, 0.08);
  --shadow-md: 0 8px 24px rgba(36, 31, 28, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--wine); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 4vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--wine);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

/* ---------------------------------------------------------------------
   Arch motif — the site's signature shape, echoed throughout
   --------------------------------------------------------------------- */
.arch {
  border-radius: var(--arch-radius);
}

.arch-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 40px;
  color: var(--gold);
}
.arch-divider::before,
.arch-divider::after {
  content: "";
  height: 1px;
  width: 72px;
  background: var(--line);
}
.arch-divider svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------------
   Header / Navigation
   --------------------------------------------------------------------- */
.site-header {
  background: var(--parchment);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  height: 44px;       /* controls the logo's on-screen size — adjust this one value */
  width: auto;        /* keeps the logo's natural aspect ratio, no squishing */
  max-width: 160px;   /* stops an unusually wide logo from crowding the nav */
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text {
  font-family: var(--font-display);
  line-height: 1.1;
}
.brand-text .line1 {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
}
.brand-text .line2 {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wine);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.main-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
  margin: 0 28px;
}
.main-nav ul {
  list-style: none;
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--wine);
  border-bottom-color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--wine);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--wine-deep); }
.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: #94701f; }
.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--wine); color: var(--wine); }
.btn-outline-light {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.btn-outline-light:hover { border-color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-deep) 100%);
  overflow: hidden;
  padding-top: 64px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 64px;
}
.hero-copy p.lead {
  font-size: 1.1rem;
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.hero-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--wine);
  border-radius: var(--arch-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}
.hero-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--arch-radius);
  pointer-events: none;
}
.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-stats .stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--wine);
  display: block;
}
.hero-stats .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------------
   Sections / cards
   --------------------------------------------------------------------- */
section { padding: 72px 0; }
.section-alt { background: var(--parchment-deep); }
.section-dark {
  background: var(--wine);
  color: #fff;
}
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: rgba(255,255,255,0.82); }
.section-dark .eyebrow { color: var(--gold-light); }
.section-dark .eyebrow::before { background: var(--gold-light); }

.section-head {
  max-width: 640px;
  margin: 0 auto 44px;
  text-align: center;
}
.section-head.left { margin-left: 0; text-align: left; }

.grid {
  display: grid;
  gap: 28px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-body { padding: 20px 22px; }
.card-media {
  aspect-ratio: 4/3;
  background: var(--parchment-deep);
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.priest-card {
  text-align: center;
  padding: 34px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.priest-photo {
  width: 140px;
  height: 168px;
  margin: 0 auto 18px;
  border-radius: var(--arch-radius);
  overflow: hidden;
  background: var(--parchment-deep);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
}
.priest-photo img { width: 100%; height: 100%; object-fit: cover; }
.priest-title {
  color: var(--wine);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

/* ---------------------------------------------------------------------
   Donation progress (the "stained glass" fill)
   --------------------------------------------------------------------- */
.progress-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.progress-figures {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.progress-figures .raised {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--wine);
}
.progress-figures .target {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.progress-track {
  height: 22px;
  background: var(--parchment-deep);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--wine) 100%);
  border-radius: 999px;
  transition: width 1s ease;
  position: relative;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    115deg, rgba(255,255,255,0.18) 0 8px, transparent 8px 16px
  );
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.stat-tile {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.stat-tile .num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  display: block;
}
.stat-tile .label {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1 / -1; }
label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 6px;
  color: var(--ink);
}
label .opt { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], input[type=date], input[type=time], input[type=file],
select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.96rem;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(110, 20, 35, 0.12);
}
.help-text { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 0 0 20px;
}
legend {
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0 8px;
  color: var(--wine);
}

/* ---------------------------------------------------------------------
   Alerts / badges
   --------------------------------------------------------------------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--slate-green-lt); color: var(--slate-green); border-color: #b9c9bd; }
.alert-error { background: #F6E3DF; color: var(--danger); border-color: #e6bdb2; }
.alert-info { background: #EFE7CF; color: var(--gold); border-color: var(--line); }

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-pending { background: #F3E6C8; color: #7A5B12; }
.badge-confirmed { background: var(--slate-green-lt); color: var(--slate-green); }
.badge-rejected { background: #F6E3DF; color: var(--danger); }

/* ---------------------------------------------------------------------
   Tables (admin)
   --------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
th {
  background: var(--parchment-deep);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}
tr:hover td { background: rgba(169, 129, 47, 0.06); }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.table-wrap table { border: none; }
.table-wrap tr:last-child td { border-bottom: none; }

/* ---------------------------------------------------------------------
   Admin shell
   --------------------------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--ink);
  color: #f1ead9;
  padding: 24px 0;
}
.admin-sidebar .brand-text .line1,
.admin-sidebar .brand-text .line2 { color: #f1ead9; }
.admin-sidebar .container { padding: 0 20px; }
.admin-nav { margin-top: 30px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: #cfc4ae;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-left-color: var(--gold);
}
.admin-nav .section-label {
  padding: 18px 20px 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b8072;
}
.admin-main { flex: 1; padding: 32px 40px; max-width: 1200px; }
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--wine);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.kpi .num { font-family: var(--font-display); font-size: 1.8rem; display: block; }
.kpi .label { font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: #cfc4ae;
  padding: 56px 0 28px;
}
.site-footer h4 { color: #f1ead9; font-size: 1rem; }
.site-footer a { color: #cfc4ae; text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 9px; font-size: 0.9rem; }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: #8b8072;
}

/* ---------------------------------------------------------------------
   Utilities
   --------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.gallery-empty, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-frame { max-width: 420px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-main { padding: 24px 20px; }
}
@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; }
  .main-nav { display: none; width: 100%; margin: 0; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; justify-content: flex-start; gap: 4px; padding: 14px 0; }
  .site-header .container { flex-wrap: wrap; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: 1fr; }
  h1 { font-size: 2.1rem; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .progress-fill { transition: none; }
}

/* Visible keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
