:root {
  /* Eclipse base palette */
  --color-obsidian: #2c2c2e;
  --color-bone: #e8e8e8;
  --color-sage: #8b9a87;
  --color-forest: #4d622a;
  --color-clay: #763e2f;
  --color-clay-light: #9d734b;
  --color-slate-blue: #4d657f;
  --color-slate-blue-light: #85989f;

  /* Semantic colors — light mode */
  --color-primary: var(--color-forest);
  --color-primary-foreground: var(--color-bone);
  --color-primary-hover: #3d4e22;
  --color-secondary: var(--color-sage);
  --color-secondary-foreground: var(--color-obsidian);
  --color-accent: var(--color-clay);
  --color-accent-foreground: var(--color-bone);
  --color-background: var(--color-bone);
  --color-foreground: var(--color-obsidian);
  --color-muted: #d8dcd4;
  --color-muted-foreground: #5e6258;
  --color-border: #c4cabd;
  --color-destructive: var(--color-clay);
  --color-destructive-foreground: var(--color-bone);
  --color-success: var(--color-forest);
  --color-success-foreground: var(--color-bone);
  --color-warning: var(--color-clay-light);
  --color-warning-foreground: var(--color-obsidian);
  --color-card: #ffffff;
  --color-card-foreground: var(--color-obsidian);
  --color-sidebar: #ffffff;
  --color-sidebar-foreground: var(--color-obsidian);
  --color-footer: var(--color-obsidian);
  --color-footer-foreground: var(--color-bone);

  /* Typography — Courier Prime everywhere (brand mono) */
  --font-mono: "Courier Prime", "Courier New", ui-monospace, monospace;
  --font-serif: var(--font-mono);
  --font-sans: var(--font-mono);
  --font-heading: var(--font-mono);
  --font-script: var(--font-mono);

  /* Spacing & Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Dark mode — applied when <html> has the `dark` class */
.dark {
  --color-primary: var(--color-sage);
  --color-primary-foreground: var(--color-obsidian);
  --color-primary-hover: #9eaa9a;
  --color-secondary: #3a4a36;
  --color-secondary-foreground: var(--color-bone);
  --color-accent: var(--color-clay-light);
  --color-accent-foreground: var(--color-obsidian);
  --color-background: var(--color-obsidian);
  --color-foreground: var(--color-bone);
  --color-muted: #3a3a3c;
  --color-muted-foreground: #9c9c9e;
  --color-border: #45454a;
  --color-destructive: #c4604f;
  --color-destructive-foreground: var(--color-obsidian);
  --color-success: var(--color-sage);
  --color-success-foreground: var(--color-obsidian);
  --color-warning: var(--color-clay-light);
  --color-warning-foreground: var(--color-obsidian);
  --color-card: #38383b;
  --color-card-foreground: var(--color-bone);
  --color-sidebar: var(--color-obsidian);
  --color-sidebar-foreground: var(--color-bone);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.55), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------------------------------------------
   Editorial typography helpers & base
   (Hand-written classes — not generated by Tailwind, so always available.)
---------------------------------------------------------------------------- */
/* Everything uses the mono brand font (Courier Prime). .font-brand / .font-display
   / .font-meta are kept as aliases so existing markup keeps working. */
.font-brand {
  font-family: var(--font-mono);
}

/* Secondary headings, product names and subtitles use the mono brand font
   (Courier Prime). .font-display is kept as an alias so existing heading markup
   that ISN'T a brand-moment title renders in mono, matching the brand look. */
.font-display {
  font-family: var(--font-mono);
}

.font-meta {
  font-family: var(--font-mono);
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ----------------------------------------------------------------------------
   Scroll-reveal — progressive enhancement.
   Items only start hidden once the `reveal` Stimulus controller marks its
   container with [data-reveal-ready]; without JS (or with reduced motion)
   everything stays visible.
---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal-ready] [data-reveal-target="item"] {
    opacity: 0;
    transform: translateY(14px);
    transition:
      opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
  }

  [data-reveal-ready] [data-reveal-target="item"].is-visible {
    opacity: 1;
    transform: none;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Smooth color transitions when toggling dark mode */
html {
  color-scheme: light;
}
html.dark {
  color-scheme: dark;
}

/*
 * Dark-mode compatibility layer for Tailwind utility classes that don't yet
 * use theme variables. Always-dark surfaces (e.g. the site footer) are scoped
 * out via :not([data-theme-static]).
 */
.dark .bg-white:not([data-theme-static]) { background-color: var(--color-card); }
.dark .bg-white\/80:not([data-theme-static]) { background-color: color-mix(in srgb, var(--color-card) 80%, transparent); }
.dark .bg-gray-50:not([data-theme-static]),
.dark .bg-slate-50:not([data-theme-static]) { background-color: var(--color-muted); }
.dark .bg-gray-100:not([data-theme-static]),
.dark .bg-slate-100:not([data-theme-static]) { background-color: var(--color-muted); }

.dark .text-gray-900:not([data-theme-static]),
.dark .text-slate-900:not([data-theme-static]) { color: var(--color-foreground); }
.dark .text-gray-800:not([data-theme-static]),
.dark .text-slate-800:not([data-theme-static]) { color: var(--color-foreground); }
.dark .text-gray-700:not([data-theme-static]),
.dark .text-slate-700:not([data-theme-static]) { color: var(--color-foreground); }
.dark .text-gray-600:not([data-theme-static]),
.dark .text-slate-600:not([data-theme-static]) { color: var(--color-muted-foreground); }
.dark .text-gray-500:not([data-theme-static]),
.dark .text-slate-500:not([data-theme-static]) { color: var(--color-muted-foreground); }
.dark .text-gray-400:not([data-theme-static]),
.dark .text-slate-400:not([data-theme-static]) { color: var(--color-muted-foreground); }

.dark .border-gray-200:not([data-theme-static]),
.dark .border-slate-200:not([data-theme-static]) { border-color: var(--color-border); }
.dark .border-gray-300:not([data-theme-static]),
.dark .border-slate-300:not([data-theme-static]) { border-color: var(--color-border); }

/*
 * Admin sidebar — fixed full-viewport column.
 * Off-canvas on mobile, permanently visible on desktop (≥1024px).
 * Toggled on mobile via the `open` state class from the mobile-menu controller.
 * On desktop we force `display: flex` so the controller's `hidden` toggling
 * (used for the public navbar mobile menu) can't take the sidebar down.
 */
.admin-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 200ms ease-out;
}

.admin-sidebar.open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .admin-sidebar {
    display: flex !important;
    width: 16rem;
    max-width: none;
    transform: translateX(0);
    transition: none;
  }
}

/* Admin sidebar — stays white in light mode, uses themed surface in dark mode. */
.dark aside[data-mobile-menu-target="menu"][data-theme-static] {
  background-color: var(--color-sidebar);
  color: var(--color-sidebar-foreground);
}

/* Calendar view toggle buttons */
.active-view {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}

.active-view:hover {
  opacity: 0.9;
}

.inactive-view {
  border: 1px solid var(--color-border);
  background-color: transparent;
  color: var(--color-foreground);
}

.inactive-view:hover {
  background-color: var(--color-secondary);
}

/* Pagy pagination */
.pagy.series-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagy.series-nav > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md, 0.5rem);
  color: var(--color-foreground);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.pagy.series-nav > a:hover:not([aria-disabled="true"]) {
  background-color: var(--color-muted);
}

.pagy.series-nav > a[aria-current="page"] {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}

.pagy.series-nav > a[aria-disabled="true"]:not([aria-current="page"]) {
  color: var(--color-muted-foreground);
  cursor: default;
  opacity: 0.5;
}

.pagy.series-nav > a[role="separator"] {
  opacity: 1;
  letter-spacing: 0.1em;
}

.pagy.series-nav > a[aria-label="Previous"],
.pagy.series-nav > a[aria-label="Next"] {
  font-size: 0;
  overflow: hidden;
}

.pagy.series-nav > a[aria-label="Previous"]::before,
.pagy.series-nav > a[aria-label="Next"]::before {
  content: "";
  display: block;
  width: 1rem;
  height: 1rem;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.pagy.series-nav > a[aria-label="Previous"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 19l-7-7 7-7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 19l-7-7 7-7'/%3E%3C/svg%3E");
}

.pagy.series-nav > a[aria-label="Next"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
}
