/* =============================================================================
   Chief's Den — Base Styles
   File: public/assets/css/base.css
   Reset, typography, global element defaults.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Reset
--------------------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------------------------
   Typography
--------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hi);
}

strong, b {
  font-weight: var(--weight-semi);
  color: var(--color-text);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

code {
  background: var(--color-surface-2);
  color: var(--color-accent-hi);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

ul, ol {
  padding-left: var(--space-6);
  color: var(--color-text-muted);
}

li {
  margin-bottom: var(--space-1);
  line-height: var(--leading-relaxed);
}

/* ---------------------------------------------------------------------------
   Forms — global defaults
--------------------------------------------------------------------------- */

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-dim);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--color-accent);
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: var(--leading-relaxed);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238A7D6A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Buttons — global defaults (component variants in components.css)
--------------------------------------------------------------------------- */

button {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  transition: background var(--transition-fast), color var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  min-height: 44px; /* iOS tap target minimum */
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Images & Media
--------------------------------------------------------------------------- */

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

img {
  object-fit: cover;
}

/* ---------------------------------------------------------------------------
   Tables
--------------------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--color-surface-2);
}

/* ---------------------------------------------------------------------------
   Scrollbars
--------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dim);
}

/* ---------------------------------------------------------------------------
   Focus visible — keyboard navigation
--------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Selection
--------------------------------------------------------------------------- */

::selection {
  background: var(--color-accent-bg);
  color: var(--color-accent-hi);
}

/* ---------------------------------------------------------------------------
   Utilities
--------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-font {
  font-family: var(--font-display);
}

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

.text-accent { color: var(--color-accent); }
.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-success{ color: var(--color-success-text); }
.text-danger { color: var(--color-danger-text); }
.text-warning{ color: var(--color-warning-text); }
