/**
 * Charmers Group - Minimal CSS
 *
 * Only fonts and brand colors. Let DaisyUI handle everything else.
 */

/* ==========================================================================
   FONTS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap');

/* ==========================================================================
   DAISYUI 5 THEMES - Using --color-* format
   ========================================================================== */

/* Python Charmers (Green) */
[data-theme="python-charmers"] {
  color-scheme: light;

  /* Primary - Brand Green.
     Lightness is 50%, not the brand's original 65%: at 65% the green gave only
     3.08:1 as text on white and 2.90:1 for white button labels sitting on it,
     both below the WCAG AA 4.5:1 that CLAUDE.md commits to. 50% keeps the hue
     and chroma (so it still reads as the brand green) while reaching 5.06:1
     as text and 5.37:1 as a button fill. See
     scripts/check_colour_contrast.py. */
  --color-primary: oklch(50% 0.15 135);
  --color-primary-content: oklch(98% 0 0);

  /* Secondary - Navy (#2E343D) */
  --color-secondary: oklch(30% 0.02 260);
  --color-secondary-content: oklch(98% 0 0);

  /* Accent - Brighter green */
  --color-accent: oklch(70% 0.18 135);
  --color-accent-content: oklch(15% 0.05 135);

  /* Neutral - Dark gray */
  --color-neutral: oklch(25% 0.02 260);
  --color-neutral-content: oklch(95% 0 0);

  /* Base colors */
  --color-base-100: oklch(100% 0 0);
  --color-base-200: oklch(96% 0.005 260);
  --color-base-300: oklch(92% 0.01 260);
  --color-base-content: oklch(25% 0.02 260);

  /* Status colors */
  --color-info: oklch(55% 0.18 240);
  --color-info-content: oklch(98% 0 0);
  --color-success: oklch(55% 0.20 145);
  --color-success-content: oklch(98% 0 0);
  --color-warning: oklch(70% 0.18 70);
  --color-warning-content: oklch(20% 0.05 70);
  --color-error: oklch(50% 0.22 25);
  --color-error-content: oklch(98% 0 0);

  /* DaisyUI 5 design tokens */
  --radius-selector: 0.5rem;
  --radius-field: 0.25rem;
  --radius-box: 0.5rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 1;
  --noise: 0;
}

/* AI Charmers (Blue) */
[data-theme="ai-charmers"] {
  color-scheme: light;

  /* Primary - Brand Blue. Dropped from 55% to 50% lightness: at 55% white
     button labels on the blue reached only 4.28:1 and the blue as text on the
     tinted base-200 surface only 4.04:1, both short of WCAG AA. See
     scripts/check_colour_contrast.py. */
  --color-primary: oklch(50% 0.18 240);
  --color-primary-content: oklch(98% 0 0);
  --color-secondary: oklch(30% 0.02 260);
  --color-secondary-content: oklch(98% 0 0);
  --color-accent: oklch(65% 0.15 240);
  --color-accent-content: oklch(15% 0.05 240);
  --color-neutral: oklch(25% 0.02 260);
  --color-neutral-content: oklch(95% 0 0);
  --color-base-100: oklch(100% 0 0);
  --color-base-200: oklch(96% 0.005 260);
  --color-base-300: oklch(92% 0.01 260);
  --color-base-content: oklch(25% 0.02 260);
  --color-info: oklch(55% 0.18 240);
  --color-info-content: oklch(98% 0 0);
  --color-success: oklch(55% 0.20 145);
  --color-success-content: oklch(98% 0 0);
  --color-warning: oklch(70% 0.18 70);
  --color-warning-content: oklch(20% 0.05 70);
  --color-error: oklch(50% 0.22 25);
  --color-error-content: oklch(98% 0 0);

  /* DaisyUI 5 design tokens */
  --radius-selector: 0.5rem;
  --radius-field: 0.25rem;
  --radius-box: 0.5rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 1;
  --noise: 0;
}

/* Charmers Group (Slate) */
[data-theme="charmers-group"] {
  color-scheme: light;

  --color-primary: oklch(35% 0.04 250);
  --color-primary-content: oklch(98% 0 0);
  --color-secondary: oklch(25% 0.03 260);
  --color-secondary-content: oklch(98% 0 0);
  --color-accent: oklch(45% 0.05 250);
  --color-accent-content: oklch(98% 0 0);
  --color-neutral: oklch(25% 0.02 260);
  --color-neutral-content: oklch(95% 0 0);
  --color-base-100: oklch(100% 0 0);
  --color-base-200: oklch(96% 0.005 260);
  --color-base-300: oklch(92% 0.01 260);
  --color-base-content: oklch(25% 0.02 260);
  --color-info: oklch(55% 0.18 240);
  --color-info-content: oklch(98% 0 0);
  --color-success: oklch(55% 0.20 145);
  --color-success-content: oklch(98% 0 0);
  --color-warning: oklch(70% 0.18 70);
  --color-warning-content: oklch(20% 0.05 70);
  --color-error: oklch(50% 0.22 25);
  --color-error-content: oklch(98% 0 0);

  /* DaisyUI 5 design tokens */
  --radius-selector: 0.5rem;
  --radius-field: 0.25rem;
  --radius-box: 0.5rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 1;
  --noise: 0;
}

/* ==========================================================================
   TYPOGRAPHY - Just fonts, let DaisyUI handle sizes
   ========================================================================== */

body {
  font-family: 'Open Sans', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
}

/* Prose styling for markdown content.
   This is a hand-rolled .prose, not the Tailwind typography plugin, so it has
   to restore the list and spacing styles that Tailwind's preflight resets.
   Without these, Markdown bullet lists render as unmarked run-on lines. */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: 'Raleway', sans-serif;
}

.prose p {
  margin-bottom: 1em;
}

/* The Tailwind browser build injects its preflight at runtime, after this
   stylesheet, and resets lists via `ol, ul { list-style: none; padding: 0 }`.
   Doubling the class raises specificity above that reset without !important. */
.prose.prose ul,
.prose.prose ol {
  margin: 1em 0;
  padding-left: 1.625em;
}

.prose.prose ul {
  list-style-type: disc;
}

.prose.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin: 0.375em 0;
  display: list-item;
}

.prose li::marker {
  color: var(--color-primary);
}

.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
  margin: 0.375em 0;
}

.prose ul ul {
  list-style-type: circle;
}

.prose strong {
  font-weight: 600;
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
}

.prose code {
  font-size: 0.9em;
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  background-color: oklch(95% 0.005 260);
}

/* ==========================================================================
   COMPONENT FIXES - Overrides for DaisyUI 5 CDN compatibility
   ========================================================================== */

/* Form inputs - visible borders */
.input,
.select,
.textarea {
  border: 1px solid oklch(70% 0.01 260);
  background-color: oklch(100% 0 0);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-primary);
  outline: 2px solid color-mix(in oklch, var(--color-primary) 25%, transparent);
  outline-offset: 0;
}

/* Validation states */
.input-success {
  border-color: var(--color-success);
}

.input-error {
  border-color: var(--color-error);
}

/* Checkbox and radio - smaller sizes */
.checkbox-sm,
.radio-sm {
  width: 1rem;
  height: 1rem;
}

.toggle-sm {
  width: 2rem;
  height: 1rem;
}

/* Checkbox and radio - better contrast when checked */
.checkbox:checked,
.radio:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Select dropdown - modern styling */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Buttons - ensure they look like buttons */
.btn {
  font-weight: 600;
  border-radius: var(--radius-selector, 0.5rem);
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-content);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background-color: transparent;
  border-width: 1px;
}

.btn-outline.btn-primary {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline.btn-primary:hover {
  background-color: var(--color-primary);
  color: var(--color-primary-content);
}

/* ==========================================================================
   HERO SECTION - Height defined in ONE place
   Matches pythoncharmers.com hero height (~661px)
   ========================================================================== */

/* Page hero - used for all internal page banners */
.hero.page-hero {
  min-height: 37rem; /* 592px - matches pythoncharmers.com/training/ hero height */
}

/* Home hero - larger for home page */
.hero.home-hero {
  min-height: 45rem; /* 720px - larger for home page */
}

/* ==========================================================================
   TYPOGRAPHY ACCESSIBILITY - Minimum readable font sizes
   WCAG recommends 16px body, 14px minimum for secondary text
   ========================================================================== */

/* Form labels - DaisyUI fieldset-legend defaults to 12px, increase to 14px */
.fieldset-legend {
  font-size: 0.875rem; /* 14px - accessible minimum */
}

/* ==========================================================================
   CONTRAST FIXES
   ========================================================================== */

/* The navbar sits on --color-secondary (navy). The active nav item is marked
   with .text-primary, but the brand green/blue against navy is only 2.38:1 —
   far below WCAG AA, and effectively unreadable. On the navbar the current page
   is instead indicated with the navbar's own high-contrast content colour plus
   an underline, so the cue does not depend on colour alone. */
.navbar .text-primary {
  color: var(--color-secondary-content);
  text-decoration: underline;
  text-underline-offset: 0.35em;
  font-weight: 700;
}

/* Muted headings and helper text use base-content at 60% opacity, which lands
   at 4.3:1 on white — just under the 4.5:1 AA threshold. 75% clears it while
   still reading as secondary text. */
.text-base-content\/60 {
  color: color-mix(in oklch, var(--color-base-content) 75%, transparent);
}

/* DaisyUI dims table headers to roughly 4.12:1 on the striped header row.
   Table headers carry the meaning of every cell beneath them, so they are
   restored to full base-content contrast. */
.table thead th,
.table tfoot th {
  color: var(--color-base-content);
}

/* ==========================================================================
   KEYBOARD ACCESSIBILITY
   ========================================================================== */

/* Skip link: off-screen until it takes focus, then it lands at the top-left of
   the viewport so the first Tab of a page offers a jump past the navigation.
   Positioned rather than display:none, because a hidden element cannot be
   focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background-color: var(--color-secondary);
  color: var(--color-secondary-content);
  font-weight: 600;
  border-radius: 0 0 var(--radius-box, 0.5rem) 0;
  text-decoration: underline;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* The skip link's target is programmatically focusable, so it must not draw a
   focus ring of its own when it receives focus from the link. */
main:focus,
main:focus-visible {
  outline: none;
}

/* Visible focus for every interactive element. The Tailwind preflight removes
   the browser's default focus ring, which left keyboard users with no visible
   indication of where they were. focus-visible is used so a pointer click does
   not leave a ring behind. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-field, 0.25rem);
}

/* On the navy navbar the primary colour is not distinct enough to serve as a
   focus ring, so the ring switches to the navbar's own content colour. */
.navbar a:focus-visible,
.navbar summary:focus-visible,
.navbar [role="button"]:focus-visible {
  outline-color: var(--color-secondary-content);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 1px;
}
