@font-face { font-family: "Lora"; src: url("fonts/Lora.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fonts/Lora-Italic.ttf") format("truetype"); font-style: italic; font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f6f3ee;
  --bg2: #eaf0eb;
  --card: #ffffff;
  --ink: #2f3a34;
  --muted: #7a857f;
  --green: #5f7f6e;
  --green-dark: #4a6657;
  --sand: #e9dcc7;
  --line: #e3ddd3;
  --danger: #b4534a;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(47, 58, 52, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c2320; --bg2: #222b27; --card: #27312c; --ink: #e8ece9; --muted: #9aa69f;
    --green: #8fb19d; --green-dark: #a7c5b3; --sand: #3a3a31; --line: #36413b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg2), var(--bg) 380px);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--green-dark); }
img { max-width: 100%; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  max-width: 1100px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: Lora, Georgia, serif; font-size: 1.25rem; font-weight: 600; }
.site-header nav { font-size: .9rem; }

.wrap { max-width: 620px; margin: 0 auto; padding: 8px 16px 48px; }
.wrap.narrow { max-width: 420px; }
.wrap.wide { max-width: 1100px; }

.today-label { text-align: center; color: var(--muted); letter-spacing: .04em; margin: 8px 0 18px; font-size: .95rem; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-image { display: block; width: 100%; max-height: 70vh; object-fit: cover; }
.card-body { padding: 24px 24px 26px; }
.card-title { font-family: Lora, Georgia, serif; font-weight: 600; font-size: 1.45rem; line-height: 1.3; margin: 0 0 12px; }
.card-text { font-family: Lora, Georgia, serif; font-size: 1.15rem; }
.card.text-only .card-body { padding: 48px 28px; text-align: center; background: radial-gradient(circle at 85% 10%, var(--bg2), transparent 55%), radial-gradient(circle at 10% 95%, var(--sand), transparent 45%); }
.card.text-only .card-text { font-style: italic; font-size: 1.4rem; line-height: 1.55; }
.card.text-only .card-text::before { content: "“"; display: block; font-size: 3.5rem; line-height: .6; color: var(--green); opacity: .6; margin-bottom: 14px; font-style: normal; }
.card-audio { width: 100%; margin: 4px 0 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--green); color: #fff; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--green-dark); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn-ghost:hover { background: var(--bg2); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.icon-btn { border: 0; background: var(--bg2); color: var(--green-dark); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }

.recent { margin-top: 36px; }
.recent h2 { font-family: Lora, Georgia, serif; font-size: 1.1rem; color: var(--muted); font-weight: 500; text-align: center; }
.recent ul { list-style: none; padding: 0; margin: 0; }
.recent a { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 12px 16px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.recent a:hover { background: var(--card); }
.recent-day { font-size: .8rem; color: var(--muted); grid-column: 1; }
.recent-title { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-kind { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: .75rem; color: var(--green-dark); background: var(--bg2); padding: 2px 10px; border-radius: 99px; }

.ios-hint { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 30px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* Partage */
.share-dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(92vw, 360px); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.share-dialog::backdrop { background: rgba(20, 28, 24, .45); }
.share-dialog h2 { margin: 0 0 16px; font-family: Lora, Georgia, serif; }
.share-dialog .close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 1.6rem; color: var(--muted); cursor: pointer; }
.share-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-links a, .share-links button { padding: 10px; border-radius: 12px; background: var(--bg2); color: var(--ink); text-decoration: none; text-align: center; border: 0; font: inherit; cursor: pointer; }
.share-links button { grid-column: 1 / -1; background: var(--green); color: #fff; font-weight: 600; }

/* Admin */
.admin-title { font-family: Lora, Georgia, serif; font-weight: 600; text-align: center; }
.admin h2 { font-family: Lora, Georgia, serif; font-weight: 600; font-size: 1.2rem; margin: 24px 0 12px; }
.admin-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .admin-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.alert { padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; }
.alert.ok { background: #e3f0e6; color: #2f5b3c; }
.alert.error { background: #f7e1de; color: #7d2f27; }

.form label, .form fieldset { display: block; margin: 0 0 18px; }
.form fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.form legend { font-weight: 600; padding: 0 6px; }
.form input[type=text], .form input[type=password], .form input[type=date], .form textarea, .form select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
}
.form select { display: inline-block; width: auto; margin: 4px 4px 0 0; }
.form textarea { font-family: Lora, Georgia, serif; }
.form input[type=file] { margin-top: 8px; max-width: 100%; }
.form .inline { display: flex; align-items: center; gap: 8px; }
.form .preview { max-height: 180px; border-radius: 10px; display: block; margin-bottom: 8px; }
.form audio { width: 100%; }
.modes .radio { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 6px; cursor: pointer; }
.modes .radio input { margin-top: 6px; }
.mode-opts { margin: 0 0 10px 26px; }
.mode-opts[hidden] { display: none; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.presets button { border: 0; border-radius: 99px; padding: 6px 12px; background: var(--bg2); color: var(--green-dark); font: inherit; font-size: .85rem; cursor: pointer; }
.delete-form { text-align: center; margin-top: 30px; }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.filters a { padding: 5px 12px; border-radius: 99px; text-decoration: none; background: var(--card); font-size: .88rem; color: var(--ink); }
.filters a.on { background: var(--green); color: #fff; }
.content-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.content-list li { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); }
.content-list li.draft { opacity: .6; }
.thumb { flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--bg2); display: grid; place-items: center; text-decoration: none; color: var(--green); font: 2rem Lora, Georgia, serif; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.info-title { font-weight: 600; text-decoration: none; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: .75rem; padding: 2px 10px; border-radius: 99px; background: var(--bg2); color: var(--green-dark); }
.badge.mode-date { background: #f2e6d3; color: #7a5a2a; }
.badge.mode-yearly { background: #e4e2f3; color: #4c4680; }
.badge.draft { background: #eee; color: #666; }
@media (prefers-color-scheme: dark) {
  .badge.mode-date { background: #4a3f2e; color: #f2dcb6; }
  .badge.mode-yearly { background: #393653; color: #d9d5ff; }
  .alert.ok { background: #2c4434; color: #cfe8d6; }
  .alert.error { background: #4d2b27; color: #f6d3ce; }
}
.upcoming { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.upcoming li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.upcoming li:last-child { border-bottom: 0; }
.up-day { width: 11em; color: var(--muted); }
.up-date .up-day, .up-yearly .up-day { color: var(--ink); font-weight: 600; }
.site-header .btn { padding: 8px 14px; font-size: .88rem; white-space: nowrap; }
.brand span { white-space: nowrap; }
.up-day { white-space: nowrap; }
