:root {
  --primary: #2B2B2B;
  --secondary: #6E6E6E;
  --accent: #E8E8E8;
  --background: #FAFAFA;
  --candle-gold: #D4A857;
  --max-width: 1100px;
  --radius: 6px;
  --spacing: 1.5rem;
}

/* Reset */

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--background);
  color: var(--primary);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

/* Header & Footer */

header,
footer {
  background: #ffffff;
  border-bottom: 1px solid var(--accent);
}

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

.brand-icon {
  width: 10px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--candle-gold);
  position: relative;
}

.brand-icon::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: var(--candle-gold);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--secondary);
}

.nav-links a.primary-link {
  color: var(--primary);
  font-weight: 500;
}

/* Main Layout */

.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* Section Rhythm */

.section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--accent);
}

.section:last-child {
  border-bottom: none;
}

.section-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* Hero */

.hero {
  padding: 2.5rem 2rem;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.hero-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.hero-subtitle {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: #1f1f1f;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--secondary);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--secondary);
  padding-left: 0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Memorial Wall */

.memorial-wall {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.memorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.memorial-card {
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  padding: 1rem;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: transform 0.15s ease;
}

.memorial-card:hover {
  transform: translateY(-2px);
}

.memorial-photo {
  width: 100%;
  height: 140px;
  background: var(--accent);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.memorial-name {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.memorial-dates {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

/* Candle Counter */

.candle-counter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--secondary);
}

.candle-counter .icon {
  color: var(--candle-gold);
  font-size: 1rem;
}

/* CTA Strip */

.cta-strip {
  padding: 1.75rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.cta-strip-text {
  font-size: 1rem;
}

/* Footer */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2rem;
  font-size: 0.85rem;
  color: var(--secondary);
  border-top: 1px solid var(--accent);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0 0.75rem;
}

.footer-meta {
  color: var(--secondary);
}

/* Forms */

.form-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  padding: 1.75rem 1.75rem 2rem;
  max-width: 640px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row-inline {
  display: flex;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--secondary);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  font-family: inherit;
  font-size: 0.9rem;
  background: #fafafa;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.helper-text {
  font-size: 0.8rem;
  color: var(--secondary);
  margin-top: 0.25rem;
}

/* Tribute Page */

.tribute-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 2rem;
}

.tribute-photo {
  width: 100%;
  max-height: 360px;
  background: var(--accent);
  border-radius: var(--radius);
}

.tribute-name {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.8rem;
  margin: 1rem 0 0.25rem;
}

.tribute-dates {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.tribute-message {
  font-size: 0.95rem;
}

.candle-panel {
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  padding: 1.25rem;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.candle-count {
  font-size: 1.4rem;
  font-family: "Playfair Display", "Times New Roman", serif;
}

.candle-label {
  font-size: 0.85rem;
  color: var(--secondary);
}

/* Tables (Admin) */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--accent);
}

.table th {
  text-align: left;
  color: var(--secondary);
  font-weight: 500;
}

/* Utility */

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  font-size: 0.75rem;
  color: var(--secondary);
}

.notice {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 0.75rem;
}

/* Error / Maintenance */

.centered {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.centered-inner {
  max-width: 480px;
  text-align: center;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #bbb;
  transition: 0.3s;
  border-radius: 32px;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

/* When checked */
.toggle-switch input:checked + .slider {
  background-color: #4caf50; /* green ON */
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(28px);
}

/* Optional: focus outline */
.toggle-switch input:focus + .slider {
  box-shadow: 0 0 2px #4caf50;
}

.homepage-banner img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

@media (max-width: 600px) {
  .homepage-banner img {
    max-height: 260px;
  }
}

/* Responsive */

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .cta-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .tribute-layout {
    grid-template-columns: 1fr;
  }

  .form-row-inline {
    flex-direction: column;
  }
}