/* horairelunesoleil.fr - design system "celestial-serene"
   Palette : Ciel #F7F4EF (base neutre), Encre #1F2341 (texte/nuit), Indigo #2C2F5C,
   Pêche aube #FFA987, Corail #FF7E67, Or #C99A3C (accent unique), Twilight #3A3570
   Fonts : Fraunces (titres, serif élégant), Inter (corps, UI) */

:root {
  --papier: #FBF8F4;
  --encre: #1F2341;
  --indigo: #2C2F5C;
  --twilight: #3A3570;
  --peche: #FFA987;
  --corail: #FF6F59;
  --or: #C99A3C;
  --or-clair: #E4BA63;
  --ciel-clair: #EFEAE1;
  --white: #FFFFFF;
  --grey: #726E85;
  --radius: 16px;
  --max-w: 760px;
  --grad-dawn: linear-gradient(135deg, #FFD9B0 0%, #FF9D7A 32%, #BD6C8A 62%, #3A3570 100%);
  --grad-dawn-soft: linear-gradient(160deg, rgba(255,169,135,.16) 0%, rgba(44,47,92,.10) 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: 'Fraunces', Georgia, serif; font-weight: 600; color: var(--encre); margin: 0; }

a { color: var(--corail); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--ciel-clair); padding: 16px 0; background: var(--papier); position: relative; z-index: 30; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; font-family: 'Fraunces', serif; color: var(--encre); }
.logo:hover { text-decoration: none; }
.logo .mark { width: 32px; height: 32px; flex-shrink: 0; }

.nav-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-pills a { color: var(--grey); font-size: 13.5px; font-weight: 500; padding: 8px 13px; border-radius: 999px; min-height: 40px; display: flex; align-items: center; white-space: nowrap; }
.nav-pills a:hover { background: var(--ciel-clair); text-decoration: none; color: var(--encre); }

@media (max-width: 760px) {
  .site-header .container { flex-direction: column; align-items: stretch; gap: 10px; }
  .nav-pills { flex-wrap: nowrap; overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .nav-pills a { flex: 0 0 auto; }
}

.theme-toggle {
  width: 40px; height: 40px; min-height: 40px; border-radius: 999px;
  border: 1px solid var(--ciel-clair); background: var(--white); color: var(--encre);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0;
}
.theme-toggle:hover { background: var(--ciel-clair); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 13px; color: var(--grey); padding: 16px 0 0; }
.breadcrumb a { color: var(--grey); }
.breadcrumb a:hover { color: var(--corail); }

main { padding-bottom: 70px; }

/* ---------- Hero with gradient sky ---------- */
.hero { padding: 48px 0 10px; text-align: center; position: relative; }
.hero.with-sky { padding-top: 0; }
.sky-band {
  background: var(--grad-dawn);
  padding: 56px 0 72px;
  margin-bottom: -40px;
  position: relative;
  overflow: hidden;
}
.sky-band::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background: var(--papier);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: scale(1.4);
}
:root[data-theme="dark"] .sky-band::after { background: var(--papier); }
.sky-band .container { position: relative; z-index: 2; }
.sky-band h1 { color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.18); }
.sky-band .hero-sub { color: rgba(255,255,255,.92); font-size: 15px; max-width: 560px; margin: 10px auto 0; }
.sun-arc { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(560px, 90%); opacity: .55; }

.hero h1 { font-size: clamp(24px, 4.5vw, 36px); max-width: 740px; margin: 0 auto 10px; line-height: 1.25; }
.hero-sub { color: var(--grey); font-size: 14.5px; max-width: 600px; margin: 0 auto; }

/* ---------- Calculator card ---------- */
.calc-card {
  background: var(--white);
  border: 1px solid var(--ciel-clair);
  border-radius: var(--radius);
  padding: 28px 22px;
  max-width: var(--max-w);
  margin: 28px auto 0;
  text-align: left;
  box-shadow: 0 16px 40px -24px rgba(44,47,92,.35);
  position: relative;
  z-index: 3;
}

.calc-row, .field-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.calc-field, .field { flex: 1 1 200px; position: relative; }
.calc-field label, .field label { display: block; font-size: 13px; font-weight: 600; color: var(--encre); margin-bottom: 6px; }
.calc-field input, .field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--ciel-clair);
  border-radius: 10px; font-size: 16px; font-family: inherit; color: var(--encre); background: var(--papier);
}
.calc-field input:focus, .field input:focus, .field select:focus { outline: 2px solid var(--or); outline-offset: 1px; }

.city-field { position: relative; }
.city-suggestions {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--white);
  border: 1px solid var(--ciel-clair); border-radius: 10px; margin-top: 4px; max-height: 240px;
  overflow-y: auto; z-index: 40; display: none; box-shadow: 0 10px 28px rgba(31,35,65,.16);
}
.city-suggestions.open { display: block; }
.city-suggestion-item { padding: 10px 14px; cursor: pointer; font-size: 14px; }
.city-suggestion-item:hover, .city-suggestion-item.active { background: var(--ciel-clair); }

.calc-btn, .btn-primary {
  width: 100%; min-height: 48px; background: var(--or); color: #2A1E03; border: none;
  border-radius: 10px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; margin-top: 4px;
}
.calc-btn:hover, .btn-primary:hover { background: var(--or-clair); }
.calc-btn:focus-visible, .btn-primary:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

.result-card {
  margin-top: 20px; background: var(--ciel-clair); border-radius: 12px; padding: 22px; text-align: center;
}
.result-number { font-family: 'Fraunces', serif; font-size: clamp(38px, 10vw, 60px); line-height: 1; color: var(--or); font-variant-numeric: tabular-nums; }
.result-label { font-size: 15px; color: var(--encre); margin-top: 4px; font-weight: 600; }
.result-sub { font-size: 13px; color: var(--grey); margin-top: 8px; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.result-mini { background: var(--white); border-radius: 10px; padding: 14px; text-align: center; }
.result-mini .label { font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
.result-mini .value { font-family: 'Fraunces', serif; font-size: 22px; color: var(--encre); margin-top: 4px; }
@media (max-width: 560px) { .result-grid { grid-template-columns: repeat(2, 1fr); } }

.result-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(31,35,65,.08); }
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--grey); font-size: 14px; }
.result-row .value { font-weight: 700; color: var(--encre); font-family: 'Fraunces', serif; font-size: 17px; }
.form-note { font-size: 13px; color: var(--grey); margin-top: 6px; }
.result-error { color: var(--corail); font-size: 14px; }

/* ---------- Layout content+aside ---------- */
.layout { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 48px; }
.content { flex: 999 1 560px; min-width: 0; }
.aside { flex: 1 1 300px; min-width: 0; }
.aside-box { background: var(--white); border: 1px solid var(--ciel-clair); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.aside-box a { display: block; font-size: 14px; padding: 6px 0; color: var(--encre); }
.aside-box a:hover { color: var(--corail); }

/* ---------- Ad slot ---------- */
.ad-slot { background: var(--ciel-clair); border: 1px dashed #D8CFC0; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--grey); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ad-slot[data-size="300x250"] { width: 300px; height: 250px; max-width: 100%; }
.ad-slot[data-size="320x100"] { width: 320px; height: 100px; max-width: 100%; }

.section-title { font-size: 19px; margin-bottom: 14px; }

/* ---------- FAQ ---------- */
details { border-bottom: 1px solid var(--ciel-clair); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; list-style: none; min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; color: var(--or); font-size: 20px; flex-shrink: 0; }
details[open] summary::after { content: '−'; }
details p { color: var(--grey); margin: 10px 0 0; }

/* ---------- Trivia / explainer box ---------- */
.trivia-box { background: var(--ciel-clair); border-radius: 12px; padding: 18px 20px; margin: 24px 0; font-size: 14.5px; color: var(--encre); border-left: 3px solid var(--or); }
.trivia-box strong { color: var(--corail); }

.error-list { margin: 14px 0 0; padding-left: 20px; color: var(--encre); font-size: 14.5px; line-height: 1.6; }
.error-list li { margin-bottom: 10px; }
.error-list strong { color: var(--corail); }

/* ---------- Home ---------- */
.home-feature { background: var(--white); border: 1px solid var(--ciel-clair); border-radius: 16px; padding: 24px; text-align: center; margin: 0 auto 28px; max-width: 900px; }
.home-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.home-feature-item { text-align: center; }
.home-feature-value { font-family: 'Fraunces', serif; font-size: clamp(26px, 5vw, 38px); color: var(--or); }
.home-feature-label { font-size: 12.5px; color: var(--grey); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; margin-top: 4px; }

.search-box { max-width: var(--max-w); margin: 28px auto 0; }
.search-box input {
  width: 100%; box-sizing: border-box; padding: 14px 18px; border: 1px solid var(--ciel-clair);
  border-radius: 999px; font-size: 15px; font-family: inherit; background: var(--white); color: var(--encre);
  box-shadow: 0 10px 28px -18px rgba(44,47,92,.4);
}
.search-box input:focus { outline: 2px solid var(--or); outline-offset: 1px; }
.no-results { color: var(--grey); margin-top: 16px; text-align: center; }

.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.tool-card {
  background: var(--white); border: 1px solid var(--ciel-clair); border-radius: 14px; padding: 20px;
  min-height: 48px; display: block; transition: transform .15s ease, box-shadow .15s ease;
}
.tool-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(44,47,92,.4); }
.tool-card .tc-icon { font-size: 22px; margin-bottom: 6px; }
.tool-card .tc-name { font-size: 15.5px; font-weight: 700; color: var(--encre); font-family: 'Fraunces', serif; }
.tool-card .tc-desc { font-size: 13px; color: var(--grey); margin-top: 6px; line-height: 1.5; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pill-row a.pill { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--ciel-clair); color: var(--encre); font-size: 13px; font-weight: 600; text-decoration: none; }
.pill-row a.pill:hover { background: var(--or); color: #2A1E03; }

/* ---------- Moon phase visuals (real functional UI elements) ---------- */
.moon-icon { width: 46px; height: 46px; border-radius: 50%; position: relative; background: #DCD6C6; overflow: hidden; flex-shrink: 0; box-shadow: inset -3px -3px 8px rgba(0,0,0,.12); }
.moon-icon .shadow { position: absolute; top: 0; bottom: 0; background: var(--indigo); }
.moon-icon.lg { width: 96px; height: 96px; }
:root[data-theme="dark"] .moon-icon { background: #E8E2D0; }

/* ---------- Monthly moon calendar grid ---------- */
.moon-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; }
.moon-cal-grid .dow { font-size: 11px; color: var(--grey); font-weight: 700; text-transform: uppercase; text-align: center; padding-bottom: 4px; }
.moon-cal-cell {
  min-height: 72px; border-radius: 10px; background: var(--white); border: 1px solid var(--ciel-clair);
  padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--grey);
}
.moon-cal-cell.empty { background: transparent; border: none; }
.moon-cal-cell .daynum { font-size: 12px; font-weight: 700; color: var(--encre); align-self: flex-start; }
.moon-cal-cell .moon-icon { width: 26px; height: 26px; }
.moon-cal-cell.today { border-color: var(--or); border-width: 2px; }
.moon-cal-cell .pct { font-size: 10px; }
@media (max-width: 640px) {
  .moon-cal-grid { gap: 4px; }
  .moon-cal-cell { min-height: 58px; font-size: 9.5px; padding: 4px; }
  .moon-cal-cell .moon-icon { width: 20px; height: 20px; }
  .moon-cal-cell .daynum { font-size: 11px; }
}

/* ---------- Sun path arc (motif) ---------- */
.sun-path-svg { width: 100%; max-width: 420px; margin: 18px auto 0; display: block; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ciel-clair); }
.data-table th { color: var(--grey); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.data-table-wrap { overflow-x: auto; }

/* ---------- City grid ---------- */
.city-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.city-chip { display: block; text-align: center; padding: 10px 8px; border-radius: 10px; background: var(--white); border: 1px solid var(--ciel-clair); font-size: 13.5px; font-weight: 600; color: var(--encre); }
.city-chip:hover { background: var(--ciel-clair); text-decoration: none; }

/* ---------- Action row (share) ---------- */
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; justify-content: center; }
.action-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--ciel-clair); background: var(--white); color: var(--encre);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.action-btn:hover { background: var(--ciel-clair); text-decoration: none; }
.action-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--ciel-clair); padding: 32px 0; color: var(--grey); font-size: 13px; text-align: center; }
.site-footer .source { margin-top: 4px; }
.site-footer a { color: var(--grey); text-decoration: underline; }

/* ---------- Legal pages ---------- */
.legal-content h2 { font-size: 18px; margin-top: 28px; margin-bottom: 10px; }
.legal-content p, .legal-content li { color: var(--grey); font-size: 15px; line-height: 1.7; }
.legal-content ul { padding-left: 20px; }

/* ---------- Cookie consent banner ---------- */
#cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
  background: var(--encre); color: var(--papier); padding: 16px 20px; box-shadow: 0 -2px 16px rgba(0,0,0,.25);
}
.cookie-banner-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cookie-banner-inner p { margin: 0; font-size: 14px; line-height: 1.5; max-width: 640px; }
.cookie-banner-inner a { color: var(--papier); text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn { min-height: 44px; padding: 0 20px; border-radius: 999px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; border: 1px solid var(--papier); }
.cookie-btn-reject { background: transparent; color: var(--papier); }
.cookie-btn-accept { background: var(--or); color: #2A1E03; border-color: var(--or); }
.cookie-btn:hover { opacity: .88; }
@media (max-width: 640px) { .cookie-banner-inner { flex-direction: column; align-items: stretch; } .cookie-banner-actions { width: 100%; } .cookie-btn { flex: 1; } }

a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Dark mode ---------- */
:root[data-theme="dark"] {
  --papier: #14152A;
  --encre: #EDEBF5;
  --indigo: #9AA0E8;
  --corail: #FF9178;
  --or: #E4BA63;
  --or-clair: #F0D08C;
  --ciel-clair: #212340;
  --white: #1B1D38;
  --grey: #9793B0;
  --grad-dawn: linear-gradient(135deg, #4A3350 0%, #3A2C55 32%, #28285A 62%, #15173A 100%);
}
:root[data-theme="dark"] .ad-slot { border-color: #30325A; }
:root[data-theme="dark"] .calc-card,
:root[data-theme="dark"] .data-table td,
:root[data-theme="dark"] .data-table th,
:root[data-theme="dark"] details,
:root[data-theme="dark"] .site-header,
:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .aside-box,
:root[data-theme="dark"] .tool-card,
:root[data-theme="dark"] .city-chip,
:root[data-theme="dark"] .moon-cal-cell { border-color: #30325A; }
:root[data-theme="dark"] .result-number { color: var(--or-clair); }
:root[data-theme="dark"] .sky-band { opacity: .9; }
