/* ── Lunar Garden Calendar — Public Styles ── */

.lgc-root {
  position: relative;
  margin: 0 auto;
}
.lgc-root *, .lgc-root *::before, .lgc-root *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
}

/* ── Étoiles ───────────────────────────────────────────────────── */
.lgc-stars {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  border-radius: inherit; overflow: hidden;
  background-image:
    radial-gradient(1px 1px at 8%  12%, rgba(255,255,255,.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 23% 38%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 44%  9%, rgba(255,255,255,.50) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 24%, rgba(255,255,255,.30) 0%, transparent 100%),
    radial-gradient(1px 1px at 84% 58%, rgba(255,255,255,.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 14% 73%, rgba(255,255,255,.40) 0%, transparent 100%),
    radial-gradient(1px 1px at 54% 84%, rgba(255,255,255,.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 91%  4%, rgba(255,255,255,.65) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 4% 48%, rgba(255,255,255,.75) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 61% 41%, rgba(255,255,255,.55) 0%, transparent 100%);
}

/* ── Widget wrapper ─────────────────────────────────────────────── */
.lgc-widget {
  position: relative; z-index: 1;
  background: var(--bg);
  padding: clamp(.8rem, 4vw, 2rem) clamp(.6rem, 4vw, 1.4rem);
  border-radius: 16px;
  font-family: var(--fb), 'Josefin Sans', sans-serif;
  color: var(--txt);
}

/* ── Header ─────────────────────────────────────────────────────── */
.lgc-hdr {
  text-align: center;
  margin-bottom: clamp(1rem, 4vw, 1.8rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bord);
}
.lgc-moon-big {
  font-size: clamp(2rem, 8vw, 3.2rem);
  display: block; margin-bottom: .3rem;
  animation: lgcGlow 4s ease-in-out infinite;
}
@keyframes lgcGlow {
  0%,100% { filter: drop-shadow(0 0 10px rgba(240,232,208,.4)); }
  50%      { filter: drop-shadow(0 0 24px rgba(240,232,208,.75)); }
}
.lgc-title {
  font-family: var(--fh), 'Cormorant Garamond', serif;
  font-size: var(--fs-title, 2rem);
  font-weight: 300; color: var(--goldl);
  letter-spacing: .03em; line-height: 1.2;
  border: none !important; padding: 0 !important; margin: 0 !important;
}
.lgc-subtitle {
  font-size: var(--fs-subtitle, 0.70rem);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim); margin-top: .3rem;
}

/* ── Month nav ──────────────────────────────────────────────────── */
.lgc-mnav {
  display: flex; align-items: center; justify-content: center;
  gap: .9rem; margin-bottom: .9rem;
}
.lgc-nbtn {
  background: none; border: 1px solid var(--bord); color: var(--gold);
  width: clamp(34px, 9vw, 40px); height: clamp(34px, 9vw, 40px);
  border-radius: 50%; cursor: pointer;
  font-size: clamp(.95rem, 4vw, 1.2rem);
  display: flex; align-items: center; justify-content: center;
  transition: all .22s; touch-action: manipulation;
}
.lgc-nbtn:hover, .lgc-nbtn:active {
  background: rgba(201,169,110,.15); border-color: var(--gold);
}
.lgc-mtitle {
  font-family: var(--fh), 'Cormorant Garamond', serif;
  font-size: var(--fs-month, 1.45rem);
  font-weight: 400; color: var(--goldl);
  flex: 1; text-align: center; letter-spacing: .04em;
}

/* ── Phase card ─────────────────────────────────────────────────── */
.lgc-pcard {
  background: var(--surf); border: 1px solid var(--bord); border-radius: 12px;
  padding: clamp(.8rem, 3vw, 1.2rem) clamp(.9rem, 3vw, 1.4rem);
  margin-bottom: .9rem;
  display: flex; align-items: center; gap: clamp(.7rem, 3vw, 1.4rem);
  position: relative; overflow: hidden;
}
.lgc-pcard::before {
  content: ''; position: absolute; top: -50%; left: -5%;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(201,169,110,.07) 0%, transparent 70%);
  pointer-events: none;
}
.lgc-pmoon {
  font-size: clamp(1.9rem, 7.5vw, 2.8rem); flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(240,232,208,.3));
}
.lgc-pinfo { min-width: 0; flex: 1; }
.lgc-pname {
  font-family: var(--fh), 'Cormorant Garamond', serif;
  font-size: var(--fs-phase-name, 1.25rem);
  color: var(--goldl); margin-bottom: .1rem;
  border: none !important; padding: 0 !important;
}
.lgc-psub {
  font-size: clamp(.6rem, 2.1vw, .7rem);
  color: var(--dim); letter-spacing: .1em; text-transform: uppercase;
}
.lgc-padv {
  margin-top: .35rem;
  font-family: var(--fh), 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: var(--fs-phase-advice, 0.97rem);
  color: var(--grnl); line-height: 1.4;
}

/* ── Calendar grid ──────────────────────────────────────────────── */
.lgc-cgrid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: clamp(2px, .8vw, 4px); margin-bottom: .8rem;
}
.lgc-dhdr {
  text-align: center;
  font-size: clamp(.52rem, 1.8vw, .62rem);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); padding: .3rem 0;
}
.lgc-dcell {
  background: var(--surf); border: 1px solid var(--bord);
  border-radius: clamp(5px, 1.5vw, 8px);
  padding: clamp(3px, 1vw, 6px) clamp(2px, .7vw, 4px);
  text-align: center; cursor: pointer; transition: all .18s;
  min-height: clamp(50px, 13vw, 70px);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: clamp(1px, .4vw, 2px);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.lgc-dcell:active { transform: scale(.94); background: var(--surf2); }
@media(hover:hover) {
  .lgc-dcell:hover { background: var(--surf2); border-color: var(--gold); transform: translateY(-1px); }
}
.lgc-dcell.lgc-today  { border-color: var(--gold); background: rgba(201,169,110,.08); }
.lgc-dcell.lgc-today .lgc-dnum { color: var(--gold); }
.lgc-dcell.lgc-sel    { border-color: var(--grn); background: rgba(107,158,107,.12); box-shadow: 0 0 9px rgba(107,158,107,.22); }
.lgc-dcell.lgc-other  { opacity: .25; cursor: default; pointer-events: none; }
.lgc-dnum  { font-size: var(--fs-day-num, 0.80rem); font-weight: 300; color: var(--txt); line-height: 1; }
.lgc-dmoon { font-size: clamp(.68rem, 2.4vw, .95rem); line-height: 1; }
.lgc-dact  {
  font-size: var(--fs-day-label, 0.62rem);
  letter-spacing: .03em; padding: 1px 3px; border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
@media(max-width:370px) { .lgc-dact { display: none; } }
.lgc-af  { background: rgba(220,120,60,.2);  color: #e8956a; }
.lgc-afl { background: rgba(180,120,200,.2); color: #d4a0e8; }
.lgc-ar  { background: rgba(160,100,60,.2);  color: #c49070; }
.lgc-afo { background: rgba(80,150,100,.2);  color: #70c490; }

/* ── Légende ────────────────────────────────────────────────────── */
.lgc-leg {
  display: flex; gap: clamp(.35rem, 2vw, .85rem);
  flex-wrap: wrap; margin-bottom: .85rem; justify-content: center;
}
.lgc-li  {
  display: flex; align-items: center; gap: .28rem;
  font-size: var(--fs-legend, 0.65rem);
  letter-spacing: .07em; color: var(--dim); text-transform: uppercase;
}
.lgc-ld  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Day detail ─────────────────────────────────────────────────── */
.lgc-ddet {
  background: var(--surf); border: 1px solid var(--bord); border-radius: 12px;
  padding: clamp(.9rem, 3.5vw, 1.4rem); margin-bottom: .85rem;
  animation: lgcFu .28s ease;
}
@keyframes lgcFu {
  from { opacity:0; transform:translateY(5px); }
  to   { opacity:1; transform:translateY(0); }
}
.lgc-dtitle {
  font-family: var(--fh), 'Cormorant Garamond', serif;
  font-size: var(--fs-detail-title, 1.30rem);
  color: var(--goldl);
  margin-bottom: .9rem; padding-bottom: .55rem;
  border-bottom: 1px solid var(--bord);
  border-top: none !important; border-left: none !important; border-right: none !important;
}
.lgc-dgrid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(.45rem, 2vw, .85rem);
}
@media(max-width:340px) { .lgc-dgrid { grid-template-columns: 1fr; } }
.lgc-dc   { background: var(--surf2); border-radius: 8px; padding: clamp(.7rem, 2.5vw, .95rem); border-left: 3px solid var(--gold); }
.lgc-dc.g { border-left-color: var(--grn); }
.lgc-dc.p { border-left-color: #9b72cf; }
.lgc-dc.o { border-left-color: #c9783e; }
.lgc-dc .lgc-ic { font-size: clamp(1.1rem, 3.8vw, 1.4rem); margin-bottom: .25rem; display: block; }
.lgc-dc h4 {
  font-size: var(--fs-detail-label, 0.66rem);
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--dim); margin-bottom: .2rem;
  font-family: var(--fb), sans-serif;
}
.lgc-dc p { font-size: var(--fs-detail-text, 0.85rem); color: var(--txt); line-height: 1.5; }

/* ── Tips section ───────────────────────────────────────────────── */
.lgc-tips {
  background: var(--surf); border: 1px solid var(--bord); border-radius: 12px;
  padding: clamp(.9rem, 3.5vw, 1.4rem); margin-bottom: 1.4rem;
}
.lgc-tips-title {
  font-family: var(--fh), 'Cormorant Garamond', serif;
  font-size: var(--fs-guide-title, 1.20rem);
  color: var(--goldl); margin-bottom: .8rem;
  border: none !important; padding: 0 !important;
}
.lgc-tabs {
  display: flex; gap: clamp(.28rem, 1.4vw, .45rem); margin-bottom: .9rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
}
.lgc-tabs::-webkit-scrollbar { display: none; }
.lgc-tbtn {
  background: none; border: 1px solid var(--bord); color: var(--dim);
  padding: clamp(.32rem, 1.1vw, .42rem) clamp(.6rem, 2.4vw, .85rem);
  border-radius: 20px; cursor: pointer;
  font-family: var(--fb), 'Josefin Sans', sans-serif;
  font-size: var(--fs-guide-tab, 0.70rem);
  letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; transition: all .2s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; flex-shrink: 0;
}
.lgc-tbtn.on { border-color: var(--grn); color: var(--grnl); background: rgba(107,158,107,.1); }
@media(hover:hover) { .lgc-tbtn:hover { border-color: var(--grn); color: var(--grnl); } }
.lgc-tc { display: none; }
.lgc-tc.on { display: block; animation: lgcFu .25s ease; }
.lgc-tl { list-style: none; }
.lgc-tl li {
  padding: clamp(.42rem, 1.4vw, .55rem) 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: var(--fs-guide-text, 0.84rem);
  color: var(--txt);
  display: flex; gap: .55rem; align-items: flex-start; line-height: 1.55;
}
.lgc-tl li:last-child { border-bottom: none; }
.lgc-tic { font-size: clamp(.85rem, 2.8vw, .98rem); flex-shrink: 0; margin-top: .05em; }

/* ── Footer ─────────────────────────────────────────────────────── */
.lgc-foot {
  text-align: center;
  font-size: var(--fs-footer, 0.70rem);
  color: var(--dim); letter-spacing: .08em;
  font-family: var(--fh), 'Cormorant Garamond', serif;
  font-style: italic; padding-bottom: .8rem;
}
