/*
 * LedCommerce base layer: document defaults, typography, layout primitives,
 * focus handling, motion preferences. Loaded after the legacy site.css so the
 * new foundation wins for document-level rules.
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--lc-header-h) + 1rem);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

/* `hidden` always hides. Without !important a component's own display (.lc-btn: inline-flex, a grid panel) wins
   and the element shows while marked hidden — an empty "Videoyu indir" button (owner report, 2026-10-15).
   An element that must stay laid out while hidden (a tray that slides away) says so with its own !important rule;
   HiddenAttributeTests lists those. */
[hidden] { display: none !important; }

body {
  font-family: var(--lc-font-sans);
  font-size: var(--lc-text-base);
  line-height: var(--lc-leading-normal);
  font-kerning: normal;
  color: var(--lc-text);
  background: var(--lc-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
  min-width: 0;
  width: 100%;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:where(h1, h2, h3, h4) {
  font-family: var(--lc-font-sans);
  font-weight: var(--lc-weight-semibold);
  letter-spacing: var(--lc-tracking-tight);
  line-height: var(--lc-leading-snug);
  margin: 0;
  text-wrap: balance;
}

:where(p) {
  text-wrap: pretty;
}

::selection {
  background: var(--lc-signal-500);
  color: var(--lc-on-accent);
}

:focus-visible {
  outline: none;
  box-shadow: var(--lc-focus-ring);
  border-radius: var(--lc-radius-xs);
}

/* Programmatic focus targets (e.g. <main tabindex="-1"> for the skip link) get no ring */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Skip link */
.lc-skip-link {
  position: absolute;
  left: var(--lc-space-4);
  top: -100px;
  z-index: var(--lc-z-skip);
  padding: var(--lc-space-3) var(--lc-space-5);
  border-radius: var(--lc-radius-sm);
  background: var(--lc-signal-500);
  color: var(--lc-on-accent);
  font-weight: var(--lc-weight-semibold);
  text-decoration: none;
}

.lc-skip-link:focus,
.lc-skip-link:focus-visible {
  top: var(--lc-space-3);
}

/* Layout primitives */
.lc-container {
  width: 100%;
  max-width: calc(var(--lc-container) + 2 * var(--lc-gutter));
  margin-inline: auto;
  padding-inline: var(--lc-gutter);
}

.lc-container--narrow {
  max-width: calc(var(--lc-container-narrow) + 2 * var(--lc-gutter));
}

.lc-section {
  position: relative;
  overflow-x: clip;
  padding-block: var(--lc-section-y);
  background: var(--lc-surface);
  color: var(--lc-text);
}

.lc-section--compact {
  padding-block: var(--lc-section-y-compact);
}

.lc-section--flush-top {
  padding-top: 0;
}

.lc-section + .lc-section.lc-section--continue {
  padding-top: 0;
}

.lc-stack {
  display: grid;
  align-content: start;
  gap: var(--lc-stack-gap, var(--lc-space-4));
}

.lc-stack > * { margin-block: 0; }

.lc-stack--loose { --lc-stack-gap: var(--lc-space-6); }

.lc-grid {
  display: grid;
  gap: var(--lc-grid-gap, var(--lc-space-6));
}

.lc-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.lc-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.lc-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

.lc-surface {
  background: var(--lc-surface);
  color: var(--lc-text);
}

.lc-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--lc-space-2);
}

/* Typography primitives */
.lc-display {
  font-size: var(--lc-text-display);
  line-height: var(--lc-leading-tight);
  letter-spacing: var(--lc-tracking-display);
  font-weight: var(--lc-weight-semibold);
}

.lc-h1 { font-size: var(--lc-text-4xl); line-height: var(--lc-leading-tight); letter-spacing: var(--lc-tracking-display); }
.lc-h2 { font-size: var(--lc-text-3xl); line-height: 1.12; }
.lc-h3 { font-size: var(--lc-text-xl); }
.lc-h4 { font-size: var(--lc-text-lg); }

.lc-lead {
  font-size: var(--lc-text-lg);
  line-height: 1.5;
  color: var(--lc-text-muted);
  max-width: 40rem;
  margin: 0;
}

.lc-body-sm { font-size: var(--lc-text-sm); }
.lc-muted { color: var(--lc-text-muted); }
.lc-subtle { color: var(--lc-text-subtle); }
.lc-mono { font-family: var(--lc-font-mono); font-feature-settings: normal; letter-spacing: 0; }
.lc-accent-text { color: var(--lc-accent-text); }

.lc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--lc-space-2);
  margin: 0;
  font-family: var(--lc-font-mono);
  font-size: var(--lc-text-xs);
  font-weight: var(--lc-weight-medium);
  letter-spacing: var(--lc-tracking-caps);
  text-transform: uppercase;
  color: var(--lc-text-muted);
}

.lc-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--lc-accent);
  flex: none;
}

.lc-eyebrow--plain::before { display: none; }

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

/* Decorative LED pixel grid (dot matrix). Use on a positioned container. */
.lc-pixel-field {
  background-image: radial-gradient(circle at center, var(--lc-pixel-dot) 1.1px, transparent 1.6px);
  background-size: 14px 14px;
  background-position: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
