/* ═══════════════════════════════════════════
   FOPL shared styles — nav, footer, auth pill
   Single source of truth for site-wide chrome
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cabin:wght@400;600;700&family=Lato:wght@300;400;700&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Lato', sans-serif;
  background: #0f1a12 !important;
}

/* ── Nav bar ── */
.fopl-nav {
  background: #0f1a12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 48px;
  border-bottom: 1px solid rgba(212,168,83,0.2);
}

.fopl-nav-left,
.fopl-nav-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.fopl-logo-wrap img {
  height: 32px;
  width: auto;
  display: block;
}

.fopl-nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.fopl-nav-links--right {
  gap: 2px;
}

.fopl-nav-links li a {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-family: 'Cabin', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 16px;
  height: 48px;
  transition: background 0.2s, color 0.2s;
}

.fopl-nav-links li a:hover,
.fopl-nav-links li.active a {
  background: rgba(255,255,255,0.1);
}

.fopl-nav-cal-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 12px !important;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: color 0.2s;
}
.fopl-nav-cal-icon:hover { color: #d4a853; }
.fopl-nav-cal-icon svg { display: block; }

/* Ensure icon li items are vertically centered */
.fopl-nav-links li {
  display: flex;
  align-items: center;
  height: 100%;
}

/* ── Calendar popup ── */
.fopl-cal-popup {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: -60px;
  z-index: 500;
  background: #fff;
  border: 1px solid rgba(2,59,15,0.2);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  width: 380px;
  padding: 18px;
}
.fopl-cal-popup.open { display: block; }

.fopl-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fopl-pop-month {
  font-family: 'Cabin', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #023b0f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fopl-pop-nav {
  background: none;
  border: 1px solid rgba(2,59,15,0.3);
  color: #023b0f;
  border-radius: 3px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.fopl-pop-nav:hover { background: #e8f5eb; }

.fopl-pop-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.fopl-pop-dow {
  text-align: center;
  font-family: 'Cabin', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #023b0f;
  text-transform: uppercase;
  padding: 4px 0 6px;
}
.fopl-pop-cell {
  min-height: 40px;
  padding: 4px 2px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: background 0.12s;
}
.fopl-pop-cell:not(.other):hover { background: #e8f5eb; }
.fopl-pop-cell.selected { background: #c8e6c9; }
.fopl-pop-cell.other { opacity: 0.3; cursor: default; }
.fopl-pop-cell.today .fopl-pop-day {
  background: #023b0f;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fopl-pop-day {
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
  line-height: 1;
}
.fopl-pop-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

/* ── Day detail panel ── */
.fopl-pop-detail {
  display: none;
  margin-top: 14px;
  border-top: 1px solid rgba(2,59,15,0.15);
  padding-top: 12px;
}
.fopl-pop-detail.open { display: block; }
.fopl-pop-detail-date {
  font-family: 'Cabin', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #023b0f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.fopl-pop-event-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(2,59,15,0.08);
  font-size: 0.82rem;
  color: #1a1a1a;
}
.fopl-pop-event-row:last-child { border-bottom: none; }
.fopl-pop-event-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.fopl-pop-event-name { font-weight: 600; }
.fopl-pop-event-desc { font-size: 0.76rem; color: #555; margin-top: 1px; }
.fopl-pop-no-events {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
}

/* ── Nav dropdown ── */
.fopl-nav-has-dropdown { position: relative; }

.fopl-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  min-width: 140px;
  z-index: 1000;
}

.fopl-nav-dropdown.open { display: block; }

.fopl-nav-dropdown li a {
  display: block;
  padding: 10px 18px;
  color: #023b0f;
  font-family: 'Cabin', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  background: none;
}

.fopl-nav-dropdown li a:hover { background: #f4f8f4 !important; }

/* ── Auth nav pill ── */
#nav-auth-item {
  position: relative;
}
#nav-auth-item a#nav-auth-link {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 6px 16px;
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  height: auto;
}

#nav-auth-item a#nav-auth-link:hover {
  background: rgba(255,255,255,0.25);
}

/* ── Footer ── */
.fopl-footer {
  background: #0f1a12;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px 20px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.fopl-footer a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.fopl-footer a:hover { text-decoration: underline; }

/* ── Fun decorative scene strip above footer ── */
@keyframes palm-sway {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%       { transform: rotate(3deg) translateY(-6px); }
}
@keyframes palm-sway-r {
  0%, 100% { transform: scaleX(-1) rotate(-3deg) translateY(0); }
  50%       { transform: scaleX(-1) rotate(3deg) translateY(-6px); }
}
@keyframes palm-shake {
  0%   { transform: rotate(-3deg) translateY(0); }
  10%  { transform: rotate(-14deg) translateY(-4px); }
  25%  { transform: rotate(12deg) translateY(-8px); }
  40%  { transform: rotate(-10deg) translateY(-4px); }
  55%  { transform: rotate(8deg) translateY(-3px); }
  70%  { transform: rotate(-5deg) translateY(-1px); }
  85%  { transform: rotate(3deg) translateY(0); }
  100% { transform: rotate(-3deg) translateY(0); }
}
@keyframes palm-shake-r {
  0%   { transform: scaleX(-1) rotate(-3deg) translateY(0); }
  10%  { transform: scaleX(-1) rotate(-14deg) translateY(-4px); }
  25%  { transform: scaleX(-1) rotate(12deg) translateY(-8px); }
  40%  { transform: scaleX(-1) rotate(-10deg) translateY(-4px); }
  55%  { transform: scaleX(-1) rotate(8deg) translateY(-3px); }
  70%  { transform: scaleX(-1) rotate(-5deg) translateY(-1px); }
  85%  { transform: scaleX(-1) rotate(3deg) translateY(0); }
  100% { transform: scaleX(-1) rotate(-3deg) translateY(0); }
}
.deco-palm.palm-shaking {
  animation: palm-shake 0.6s ease-in-out !important;
}
.deco-palm--right.palm-shaking {
  animation: palm-shake-r 0.6s ease-in-out !important;
}
/* Falling book particles */
.deco-falling-book {
  position: absolute;
  font-size: 18px;
  pointer-events: none;
  z-index: 10;
  user-select: none;
  will-change: transform, opacity;
  animation: book-fall var(--fall-dur, 1.1s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  transform-origin: center center;
}
@keyframes book-fall {
  0%   { transform: translateY(0) rotate(var(--rot-start, -20deg));  opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translateY(var(--fall-dist, 120px)) rotate(var(--rot-end, 40deg)); opacity: 0; }
}
@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-14px) rotate(4deg); }
}
@keyframes nav-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.fopl-deco-scene {
  position: relative;
  width: 100%;
  background: #a8d5b5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 160px;
  overflow: hidden;
  padding: 0 40px;
}

/* wavy ground line */
.fopl-deco-scene::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: #0f1a12;
  border-radius: 60% 60% 0 0 / 100% 100% 0 0;
}

.fopl-deco-scene::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(2,59,15,0.18);
}

.deco-palm {
  height: 140px;
  width: auto;
  position: relative;
  z-index: 2;
  transform-origin: bottom center;
  animation: palm-sway 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(2,59,15,0.25));
}

.deco-palm--right {
  animation: palm-sway-r 4.5s ease-in-out infinite;
  transform: scaleX(-1);
}

.deco-book-mascot {
  height: 110px;
  width: auto;
  mix-blend-mode: multiply;
  position: relative;
  z-index: 2;
  transform-origin: bottom center;
  animation: mascot-bounce 2.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(2,59,15,0.3));
  margin-bottom: 24px;
}

/* ── Nav active state ── */
.fopl-nav-links li.active a {
  background: rgba(255,255,255,0.1);
  border-bottom: 2px solid #d4a853;
}

/* ── Responsive nav ── */
@media (max-width: 640px) {
  .fopl-nav {
    height: auto;
    padding: 8px 16px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .fopl-nav-left,
  .fopl-nav-right {
    height: auto;
  }
  .fopl-nav-links { flex-wrap: wrap; }
  .fopl-nav-links li a {
    padding: 0 12px;
    height: 36px;
    font-size: 0.82rem;
  }
  .fopl-nav-cal-icon { height: 36px; }
}

/* ── Dark mode toggle button ── */
.fopl-nav-dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: color 0.2s;
}
.fopl-nav-dark-toggle:hover { color: #d4a853; }
.fopl-nav-dark-toggle svg { display: block; }

/* ── Dark mode overrides (site-wide shared) ── */
body.fopl-dark {
  background: #121212 !important;
}
body.fopl-dark .fopl-nav {
  background: #111;
  border-bottom-color: rgba(212,168,83,0.3);
}
body.fopl-dark .fopl-footer {
  background: #111;
}
body.fopl-dark .fopl-deco-scene {
  background: #1a2e1f;
}
body.fopl-dark .fopl-deco-scene::before {
  background: #111;
}
body.fopl-dark .fopl-cal-popup {
  background: #1e1e1e;
  border-color: rgba(88,232,122,0.2);
}
body.fopl-dark .fopl-pop-month,
body.fopl-dark .fopl-pop-dow,
body.fopl-dark .fopl-pop-detail-date { color: #d4a853; }
body.fopl-dark .fopl-pop-nav {
  color: #e8f5e9;
  border-color: rgba(255,255,255,0.2);
}
body.fopl-dark .fopl-pop-nav:hover { background: #2a3d2e; }
body.fopl-dark .fopl-pop-day { color: #ddd; }
body.fopl-dark .fopl-pop-cell:not(.other):hover { background: #2a3d2e; }
body.fopl-dark .fopl-pop-cell.selected { background: #1a3d1f; }
body.fopl-dark .fopl-pop-event-row { color: #ddd; border-bottom-color: rgba(255,255,255,0.08); }
body.fopl-dark .fopl-pop-event-desc { color: #aaa; }
body.fopl-dark .fopl-nav-dropdown {
  background: #1e1e1e;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
body.fopl-dark .fopl-nav-dropdown li a { color: #e8f5e9; }
body.fopl-dark .fopl-nav-dropdown li a:hover { background: #2a3d2e !important; }

/* Dark mode icon swap */
body.fopl-dark .fopl-dark-icon-moon { display: none !important; }
body.fopl-dark .fopl-dark-icon-sun { display: block !important; }
