/* Geburtstagskalender v2 – eigenständiges, festliches Design (kein Framework/CDN) */

:root {
  --color-bg: #fbf7f4;
  --color-surface: #ffffff;
  --color-surface-alt: #fff3ee;
  --color-border: #ecdfd8;
  --color-text: #2c2320;
  --color-text-muted: #7a6a63;
  --color-primary: #e8557a;
  --color-primary-dark: #c93f63;
  --color-primary-contrast: #ffffff;
  --color-accent: #f6a821;
  --color-danger: #d3455b;
  --color-danger-bg: #fdecee;
  --color-today-bg: #fff0d6;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(60, 30, 20, 0.08);
  --shadow-sm: 0 2px 8px rgba(60, 30, 20, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #221a17;
    --color-surface: #2c2320;
    --color-surface-alt: #3a2c26;
    --color-border: #47372f;
    --color-text: #f4ece7;
    --color-text-muted: #c3b2a9;
    --color-primary: #f2779a;
    --color-primary-dark: #f6a2b8;
    --color-primary-contrast: #241118;
    --color-accent: #f7b84a;
    --color-danger: #f28b9a;
    --color-danger-bg: #402126;
    --color-today-bg: #4a3418;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, var(--color-surface-alt) 0%, transparent 45%),
    var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--color-primary-dark);
}

h1, h2 {
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.muted {
  color: var(--color-text-muted);
}

.center {
  text-align: center;
}

/* Header / Nav */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__bar {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
}

.site-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }
  .site-nav {
    display: none;
    flex-direction: column;
    padding-top: 0.25rem;
  }
  .site-nav.is-open {
    display: flex;
  }
}

/* Layout */

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page-head {
  margin-bottom: 1.5rem;
}

.site-footer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: 2rem 1.25rem 3rem;
}

/* Cards */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.card--narrow {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2rem;
}

/* Forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.input {
  font: inherit;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-text);
}

.input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.input--compact {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.3;
}

/* Browser rendern <select> mit eigener Mindesthöhe, die Padding allein
   nicht überschreibt (macht Tabellenzeilen unnötig hoch) - natives
   Erscheinungsbild abschalten und Pfeil selbst zeichnen. */
select.input--compact {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 1.6rem;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    right 0.65rem top 55%,
    right 0.45rem top 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}

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

.btn--ghost:hover {
  border-color: var(--color-primary);
}

.btn--small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.link-btn {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary-dark);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}

.link-btn--danger {
  color: var(--color-danger);
}

.alert {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.alert--error {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

/* Lists */

.birthday-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.birthday-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.birthday-list__item--today {
  background: var(--color-today-bg);
  border-color: var(--color-accent);
}

.birthday-list__item--memorial {
  background: var(--color-surface-alt);
}

.birthday-list__item--memorial.birthday-list__item--today {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
}

.birthday-list__icon {
  font-size: 1.3rem;
}

.birthday-list__text {
  flex: 1;
}

.birthday-list__date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.simple-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.simple-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.table {
  /* Kein width:100% - Tabelle soll sich an ihrem tatsächlichen Inhalt
     orientieren statt immer mindestens den ganzen Container zu füllen. */
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table__actions {
  display: inline-flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.table__row--deceased {
  opacity: 0.85;
}

.death-marker {
  font-size: 0.8rem;
  white-space: nowrap;
}
