/*
 * KPT Production — Base / Reset
 * Mobile-first. Uses design tokens from style.css.
 */

/* ── BOX MODEL ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── RESET ────────────────────────────────────────────────── */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--kpt-bg-primary);
    color: var(--kpt-text-primary);
    font-family: var(--kpt-font-primary);
    font-size: var(--kpt-text-base);
    line-height: var(--kpt-leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100dvh;
    overflow-x: hidden;
}

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

a {
    color: var(--kpt-text-link);
    text-decoration: none;
    transition: color var(--kpt-transition-fast);
}
a:hover { color: var(--kpt-text-link-hover); }
a:focus-visible {
    outline: 2px solid var(--kpt-gold);
    outline-offset: 3px;
    border-radius: var(--kpt-radius-xs);
}

button, [role="button"] {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
}
button:focus-visible {
    outline: 2px solid var(--kpt-gold);
    outline-offset: 2px;
}

ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--kpt-weight-bold);
    line-height: var(--kpt-leading-tight);
    color: var(--kpt-text-primary);
    overflow-wrap: break-word;
    word-break: break-word;
}
p { margin: 0 0 var(--kpt-space-md); overflow-wrap: break-word; }
p:last-child { margin-bottom: 0; }

figure { margin: 0; }
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ── SKIP NAV ─────────────────────────────────────────────── */
.kpt-skip-nav {
    position: absolute;
    top: -100%;
    left: var(--kpt-space-md);
    background: var(--kpt-gold);
    color: var(--kpt-bg-primary);
    padding: var(--kpt-space-xs) var(--kpt-space-md);
    border-radius: var(--kpt-radius-sm);
    font-weight: var(--kpt-weight-semibold);
    z-index: var(--kpt-z-toast);
    transition: top var(--kpt-transition-fast);
}
.kpt-skip-nav:focus { top: var(--kpt-space-md); }

/* ── SCREEN READER ONLY ───────────────────────────────────── */
.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;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
.kpt-display {
    font-family: var(--kpt-font-display);
    font-size: var(--kpt-text-3xl);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.kpt-heading-lg { font-size: var(--kpt-text-2xl); }
.kpt-heading-md { font-size: var(--kpt-text-xl); }
.kpt-heading-sm { font-size: var(--kpt-text-lg); }
.kpt-body      { font-size: var(--kpt-text-base); line-height: var(--kpt-leading-relaxed); }
.kpt-caption   { font-size: var(--kpt-text-sm); color: var(--kpt-text-muted); }
.kpt-label     { font-size: var(--kpt-text-xs); font-weight: var(--kpt-weight-semibold); letter-spacing: 0.08em; text-transform: uppercase; }

/* ── GOLD ACCENT TEXT ─────────────────────────────────────── */
.kpt-text-gold { color: var(--kpt-gold); }
.kpt-text-muted { color: var(--kpt-text-muted); }

/* ── LIVE BADGE ───────────────────────────────────────────── */
.kpt-live-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--kpt-space-2xs);
    background: #e53e3e;
    color: #fff;
    font-size: var(--kpt-text-xs);
    font-weight: var(--kpt-weight-bold);
    padding: 2px 8px;
    border-radius: var(--kpt-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.kpt-live-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: kpt-pulse 1.2s ease infinite;
}
@keyframes kpt-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}

/* ── DURATION BADGE ───────────────────────────────────────── */
.kpt-duration {
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: var(--kpt-text-xs);
    font-weight: var(--kpt-weight-semibold);
    padding: 2px 6px;
    border-radius: var(--kpt-radius-xs);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--kpt-bg-secondary); }
::-webkit-scrollbar-thumb {
    background: var(--kpt-surface-elevated);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--kpt-gold-dim); }

/* ── SELECTION ────────────────────────────────────────────── */
::selection { background: var(--kpt-gold-dim); color: var(--kpt-text-primary); }

/* ============================================================
   ARTICLE TYPOGRAPHY (news, service, page body content)
   Justified body text, readable line length, comfortable size.
   Never applied to buttons, nav, labels, captions, headings.
   ============================================================ */
.kpt-body,
.kpt-article-content {
    max-width: 70ch;
}
.kpt-article-content p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    font-size: var(--kpt-text-md);
    line-height: var(--kpt-leading-relaxed);
    color: var(--kpt-text-secondary);
    margin-bottom: var(--kpt-space-md);
}
.kpt-article-content h2,
.kpt-article-content h3,
.kpt-article-content h4 {
    text-align: left;
    margin-top: var(--kpt-space-xl);
    margin-bottom: var(--kpt-space-sm);
}
.kpt-article-content ul,
.kpt-article-content ol {
    text-align: left;
    padding-left: var(--kpt-space-lg);
    margin-bottom: var(--kpt-space-md);
    list-style: revert;
}
.kpt-article-content a { text-decoration: underline; text-underline-offset: 2px; }
.kpt-article-content img {
    border-radius: var(--kpt-radius-md);
    margin-block: var(--kpt-space-md);
}
/* Never justify these — explicit override for safety */
.kpt-btn, .kpt-nav-menu, .kpt-caption, .kpt-label,
.kpt-video-card__meta, nav, button {
    text-align: left;
}

/* ============================================================
   ICON SYSTEM
   One consistent SVG style: 1.5–2px stroke, currentColor, no fills
   mixed with strokes inconsistently. Use .kpt-icon as the base.
   ============================================================ */
.kpt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: currentColor;
}
.kpt-icon svg { width: 100%; height: 100%; }
.kpt-icon--sm { width: 16px; height: 16px; }
.kpt-icon--lg { width: 24px; height: 24px; }

/* ============================================================
   TOUCH TARGETS
   Visible icon can stay small — the tappable hit area must not.
   Apply .kpt-tap-target to any small icon-only control.
   ============================================================ */
.kpt-tap-target {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--kpt-touch-min);
    min-height: var(--kpt-touch-min);
}

/* ============================================================
   SAFE AREA UTILITIES (notch / home indicator)
   ============================================================ */
.kpt-safe-top    { padding-top: max(var(--kpt-space-sm), var(--kpt-safe-top)); }
.kpt-safe-bottom { padding-bottom: max(var(--kpt-space-sm), var(--kpt-safe-bottom)); }

/* ============================================================
   GLASSMORPHISM — ACCENT UTILITY ONLY
   Apply sparingly: header overlay, search modal, floating panels.
   Never apply to large full-page surfaces on mobile (perf cost).
   ============================================================ */
.kpt-glass {
    background: var(--kpt-glass-bg);
    backdrop-filter: blur(var(--kpt-glass-blur));
    -webkit-backdrop-filter: blur(var(--kpt-glass-blur));
    border: 1px solid var(--kpt-glass-border);
}

/* ============================================================
   PREVENT HORIZONTAL OVERFLOW (global safety net)
   ============================================================ */
html, body { max-width: 100%; overflow-x: hidden; }
.kpt-no-scroll { overflow: hidden !important; height: 100dvh; }
