/*
 * ISP Base Theme — Design tokens & typographic foundation
 * App-specific layout lives in isp_app/css/app.css
 * Public layout lives in isp_public/css/public.css
 */

:root {
  /* Color Palette */
  --primary-color: #1d62d4;
  --primary-hover: #1751b8;
  --accent-color: #f59e0b;

  --text-main: #111827;
  --text-muted: #4b5563;
  --text-light: #9ca3af;
  --text-on-dark: #f3f4f6;

  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-sidebar: #1e3a8a;
  --border-color: #e5e7eb;

  /* Depth backgrounds */
  --bg-card: #ffffff;
  --bg-section: #f0f4ff;
  --bg-hero: linear-gradient(135deg, #1e3a8a 0%, #1d62d4 100%);

  /* Display typography */
  --font-display: 'DM Sans', system-ui, sans-serif;
  --text-display: 2.5rem;
  --text-hero: 1.15rem;

  /* Lesson type accent colors */
  --color-ai:      #7c3aed;
  --color-video:   #0891b2;
  --color-private: #059669;
  --color-podcast: #2563eb;

  /* Card styling */
  --radius-card: 14px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-card-hover: 0 8px 28px rgba(37,99,235,0.12);

  /* Typography */
  --font-family-base: system-ui, -apple-system, sans-serif;
  --font-size-base: 17px;
  --line-height-base: 1.6;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Layout */
  --sidebar-width: 280px;

  /* Responsive content padding — grows with viewport, no dead whitespace */
  --content-px: clamp(1.5rem, 4vw, 4rem);
  --content-py: 1.5rem;

  /* Transitions — overridden at runtime by isp_preprocess_html */
  --transition-duration: 300ms;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-main);
  background-color: var(--bg-page);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- GLOBAL MENU RESET --- */
nav ul,
ul.menu,
ul.menu ul,
.menu-wrapper ul,
.region ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav ul {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem;
  font-size: 1rem;
}

/* --- DRUPAL ADMIN OVERLAYS --- */
body.toolbar-horizontal {
  padding-top: 39px !important;
}
body.toolbar-tray-open.toolbar-horizontal {
  padding-top: 79px !important;
}

body.navigation-is-open {
  padding-left: var(--navigation-width, 260px) !important;
}
body.navigation-is-open.navigation-is-collapsed {
  padding-left: var(--navigation-collapsed-width, 64px) !important;
}

/* --- MODERN INPUT STYLING --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
  padding: 0.75rem 1rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  background-color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}


label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 500;
  margin-top: 0;
  letter-spacing: normal;
}

h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; }
h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.025em; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: var(--primary-color);
}

/* Forms & Buttons */
button, .button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  display: inline-block;
}

button:hover, .button:hover {
  background-color: var(--primary-hover);
}

.btn-primary, .button--primary, input[type="submit"] {
  background: var(--primary-color);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.20);
}
.btn-primary:hover, .button--primary:hover, input[type="submit"]:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* HTMX indicator visibility */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
form.htmx-request button { opacity: 0.5; pointer-events: none; }
