/* ============================================================
   St Anthony's Church — Base Styles
   Variables, Reset, Typography, Utilities
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  /* Colour Palette */
  --gold:           #C9922A;
  --gold-light:     #E8B84B;
  --gold-pale:      #F5E6C8;
  --gold-glow:      rgba(201, 146, 42, 0.18);

  --navy:           #0D1B3E;
  --navy-mid:       #1A2E5A;
  --navy-light:     #243660;

  --cream:          #FAF7F0;
  --cream-dark:     #F0EBE0;
  --white:          #FFFFFF;

  --text:           #1E1E1E;
  --text-muted:     #6B6B6B;
  --text-light:     #9A9A9A;

  --border:         #E0D5BE;
  --border-light:   #EDE8DA;

  --success:        #1A6B3A;
  --success-bg:     #D1FAE5;
  --danger:         #B91C1C;
  --danger-bg:      #FEE2E2;
  --warning:        #92400E;
  --warning-bg:     #FEF3C7;

  /* Tag colours */
  --tag-feast:      #C9922A; --tag-feast-bg:    #FEF3E2;
  --tag-liturgy:    #3B48B7; --tag-liturgy-bg:  #EEF2FF;
  --tag-youth:      #166534; --tag-youth-bg:    #F0FDF4;
  --tag-charity:    #BE123C; --tag-charity-bg:  #FFF1F2;
  --tag-ministry:   #0369A1; --tag-ministry-bg: #F0F9FF;
  --tag-education:  #7E22CE; --tag-education-bg:#FDF4FF;
  --tag-general:    #555555; --tag-general-bg:  #F5F5F5;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   40px;
  --space-2xl:  64px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(13, 27, 62, 0.08);
  --shadow-md:  0 4px 24px rgba(13, 27, 62, 0.12);
  --shadow-lg:  0 12px 48px rgba(13, 27, 62, 0.18);
  --shadow-gold: 0 8px 32px rgba(201, 146, 42, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-med:  250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 68px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

/* ── Typography ───────────────────────────────────────────── */
.font-display  { font-family: 'Cinzel', serif; }
.font-serif    { font-family: 'Lora', serif; }
.font-sans     { font-family: 'DM Sans', sans-serif; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  line-height: 1.25;
  color: var(--navy);
}

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-2xl) var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section--full {
  padding: var(--space-2xl) var(--space-lg);
}

.section--dark {
  background: var(--navy);
}

.section--cream {
  background: var(--cream-dark);
}

/* ── Section Headers ──────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header__title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--navy);
  margin-bottom: var(--space-sm);
}

.section-header__title--light {
  color: var(--gold-light);
}

.section-header__line {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: var(--radius-full);
  margin: var(--space-sm) auto var(--space-md);
}

.section-header__subtitle {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.section-header__subtitle--light {
  color: rgba(255, 255, 255, 0.65);
}

/* ── Grids ────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card__icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  display: block;
}

.card__title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: var(--space-sm);
}

.card__body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.card__meta {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ── Tags / Badges ────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.tag--feast     { background: var(--tag-feast-bg);     color: var(--tag-feast); }
.tag--liturgy   { background: var(--tag-liturgy-bg);   color: var(--tag-liturgy); }
.tag--youth     { background: var(--tag-youth-bg);     color: var(--tag-youth); }
.tag--charity   { background: var(--tag-charity-bg);   color: var(--tag-charity); }
.tag--ministry  { background: var(--tag-ministry-bg);  color: var(--tag-ministry); }
.tag--education { background: var(--tag-education-bg); color: var(--tag-education); }
.tag--general   { background: var(--tag-general-bg);   color: var(--tag-general); }
.tag--active    { background: var(--success-bg);       color: var(--success); }
.tag--inactive  { background: var(--danger-bg);        color: var(--danger); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--transition-med);
  white-space: nowrap;
}

.btn--primary {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn--primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}

.btn--secondary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn--secondary:hover {
  background: var(--navy-mid);
}

.btn--outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn--outline:hover {
  background: var(--gold);
  color: var(--white);
}

.btn--danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn--danger:hover {
  opacity: 0.85;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--cream-dark);
  color: var(--text);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn--lg {
  padding: 14px 32px;
  font-size: 0.95rem;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ── Toast Notification ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-lg);
  transform: translateY(120px);
  opacity: 0;
  transition: all var(--transition-med);
  max-width: 360px;
}

.toast.toast--visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast--error {
  border-left-color: var(--danger);
}

/* ── Loading & Empty States ───────────────────────────────── */
.state-loading,
.state-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}

.state-empty__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
  opacity: 0.5;
}

.state-empty__title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: var(--space-sm);
}

.state-empty__body {
  font-size: 0.875rem;
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

/* ── Page Visibility ──────────────────────────────────────── */
.page {
  display: none;
  min-height: calc(100vh - var(--nav-height));
  animation: fadeIn 0.3s ease;
}

.page.page--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}
