/* ─────────────────────────────────────────
   Kanpai Ø — Charte graphique
   mobile-first, tous formats
───────────────────────────────────────── */

:root {
  --bg:     #F7F4EE;
  --ink:    #1A1A18;
  --muted:  #6B6860;
  --sage:   #3D5A3E;
  --accent: #C9865B;
  --white:  #FFFFFF;
  --border: #E8E3D8;

  /* Recipe accent colors */
  --color-green:  #0A9A4A;
  --color-pink:   #D01860;
  --color-gold:   #CF7C00;
  --color-orange: #E04810;

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;

  --header-h: 60px;
  --max-w: 1440px;
  --inset: max(0px, calc((100vw - var(--max-w)) / 2));
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body { height: 100%; }

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 2px;
}
body {
  background: linear-gradient(160deg, #FDFBF7 0%, var(--bg) 40%, var(--border) 100%) fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body.home,
body.recipe-page {
  overflow: auto;
}

body.green  { --accent: var(--color-green); }
body.pink   { --accent: var(--color-pink); }
body.gold   { --accent: var(--color-gold); }
body.orange { --accent: var(--color-orange); }

/* ── Header ── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding-inline: calc(var(--inset) + 24px);
  z-index: 100;
}

.site-logo {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

/* Recipe page: logo centered, back button on the left */
.recipe-page .site-header {
  justify-content: center;
}

.site-back {
  position: absolute;
  left: calc(var(--inset) + 16px);
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.15s;
}

.site-back:hover { background: var(--border); }

.site-github {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.fridge-btn + .site-github { margin-left: 8px; }

.site-github:hover,
.site-github:focus-visible { background: var(--border); color: var(--ink); }

.site-github svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.recipe-page .site-github {
  position: absolute;
  right: calc(var(--inset) + 16px);
  margin-left: 0;
}

/* ── Recipe page ── */
.recipe {
  padding-top: var(--header-h);
}

/* Photo: full image visible, centered, max 600px */
.recipe__photo {
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
  display: block;
}

.recipe__photo img {
  width: 100%;
  height: auto;
  display: block;
}

/* Scrollable content */
.recipe__body {
  max-width: 640px;
  margin-inline: auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Title block */
.recipe__head {
  padding-bottom: 28px;
}

.recipe__subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px;
}

.recipe__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 8vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

/* Sections */
.recipe__section {
  padding-block: 24px;
}

.recipe__section-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.recipe__rule {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 20px;
}

/* Ingredients — 2-column: name left, qty right */
.recipe__ingredients {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.recipe__ingredients li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
}

.recipe__ing-name {
  font-size: 14px;
  color: var(--ink);
}

.recipe__ing-qty {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Glass / tools */
.recipe__glass {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  padding: 4px 0;
}

.glass-icon {
  color: var(--muted);
  flex-shrink: 0;
}

/* Steps */
.recipe__steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.recipe__step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.recipe__step-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  color: var(--accent);
  line-height: 1.2;
  flex-shrink: 0;
  min-width: 32px;
}

.recipe__step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
}

.recipe__step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.recipe__step-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

/* Tips */
.recipe__section--tips .recipe__tips {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
}

.filter-cb { display: none; }

/* ── pill bar height token ── */
:root { --pills-h: 44px; }

/* ── Flavor pill bar ── */
.flavor-pills {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  gap: 8px;
  padding: 6px calc(var(--inset) + 16px);
  height: var(--pills-h);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.flavor-pills::-webkit-scrollbar { display: none; }

.flavor-cb { display: none; }

.flavor-pill {
  flex-shrink: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  transition: background .15s, color .15s, border-color .15s;
}

.flavor-pill:has(.flavor-cb:checked) {
  background: var(--sage);
  color: var(--white);
  border-color: var(--sage);
}

.flavor-pill:not(:has(.flavor-cb:checked)):hover {
  border-color: var(--sage);
  color: var(--ink);
}

/* ── Grille d'accueil ── */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(180px, 20% - 6px, 275px), 1fr));
  gap: 8px;
  padding: calc(var(--header-h) + 36px) 16px 48px;
  max-width: var(--max-w);
  margin-inline: auto;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  padding: 16px 8px 12px;
  border-radius: 4px;
  transition: background 0.15s;
}

.recipe-card__photo {
  width: 100%;
  aspect-ratio: 1;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.recipe-card__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(15px, 3.5vw, 20px);
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1.2;
}

/* ── Fridge ── */
.fridge-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 0;
  letter-spacing: 0.04em;
  user-select: none;
}

.fridge-btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  opacity: 0;
  transition: opacity 0.2s;
}

.home:has(.fridge-cb:not(:checked)) .fridge-btn__dot {
  opacity: 1;
}

.fridge-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(26,26,24,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.home:has(#fridge-open:checked) .fridge-overlay {
  opacity: 1;
  pointer-events: auto;
}

.fridge-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--max-w);
  margin-inline: auto;
  z-index: 200;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 0 20px 48px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  max-height: 82vh;
  overflow-y: auto;
}

.home:has(#fridge-open:checked) .fridge-panel {
  transform: translateY(0);
}

.fridge-panel__header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 16px 0 12px;
}

.fridge-panel__title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
}

.fridge-panel__close {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 8px;
  border-radius: 50%;
  transition: background 0.15s;
  line-height: 1;
}

.fridge-panel__close:hover { background: var(--border); }

.fridge-section__title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 8px;
}

.fridge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.fridge-cb { display: none; }

.fridge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
  user-select: none;
  gap: 3px;
}

.fridge-item__icon {
  width: 20px;
  height: 20px;
  stroke: var(--muted);
  transition: stroke 0.15s;
}

.fridge-item__name {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  transition: color 0.15s;
}

.fridge-item:has(.fridge-cb:checked) {
  border-color: var(--sage);
}

.fridge-item:has(.fridge-cb:checked) .fridge-item__icon {
  stroke: var(--sage);
}

.fridge-item:has(.fridge-cb:checked) .fridge-item__name {
  color: var(--ink);
}

/* Fridge-filtered recipe cards */
.recipe-card.fridge-hidden {
  display: none !important;
}

/* Filter summary banner */
.filter-summary {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 12px 16px 32px;
}

/* Footer */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  font-size: 12px;
  color: var(--muted);
}

.site-footer__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-footer a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--sage);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-links a {
  display: flex;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.social-links a:hover {
  color: var(--sage);
}

.social-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Prose page (mentions légales, etc.) */
.page .prose {
  max-width: 640px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.page .prose h1 {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 2rem;
}

.page .prose p,
.page .prose li {
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 1rem;
}

.page .prose strong {
  font-weight: 600;
  display: block;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}

.page .prose a {
  color: var(--sage);
  text-underline-offset: 2px;
}

/* ── About ── */
body.about-page { overflow: auto; }

.about-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 48px) 24px 80px;
}

.about-icon {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 22%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  margin: 0 auto 32px;
}

.about-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2rem, 6vw, 3rem);
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.about-kana {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 56px;
}

.about-section {
  margin-bottom: 48px;
}

.about-section h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--ink);
}

.about-section > p {
  line-height: 1.7;
  color: var(--ink);
}

.about-duo {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.about-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-card p {
  line-height: 1.6;
  font-size: 0.9rem;
  color: var(--muted);
}

.about-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sage);
}

.about-card-heading {
  font-weight: 600;
  color: var(--ink);
}

.about-tech-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.about-tech-list li {
  padding-left: 16px;
  border-left: 2px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.about-tech-list strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 2px;
}

.about-tech-list code {
  font-size: 0.85em;
  background: var(--border);
  padding: 1px 4px;
  border-radius: 3px;
}

.about-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.about-links a {
  color: var(--sage);
  font-size: 0.9rem;
  text-underline-offset: 2px;
}

.about-links a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .about-duo { grid-template-columns: 1fr; }
}
