/**
 * PKKT Global CSS Overrides — Round 4.8.7+++++++.6
 * ═══════════════════════════════════════════════
 *
 * Project-wide rules · MUST be loaded LAST in <head>
 *
 * Mandates per PROJECT-INSTRUCTIONS-COMPLIANCE.md Rule #9a:
 *   - NO underline on any <a> elements (brand consistency)
 *   - NO underline on .underline Tailwind utility class
 *   - NO underline on <u> tag
 *   - Hover indication via opacity/color, not text-decoration
 *
 * Reference: ISO 25010 (usability) + brand consistency
 */

/* ─── Universal no-underline (mandatory · highest priority) ──────── */
a,
a:link,
a:visited,
a:hover,
a:active,
a:focus,
a:focus-visible,
a *,
a:hover *,
.underline,         /* Tailwind utility · neutralized */
.no-underline,      /* Tailwind reverse · already correct but explicit */
u,                  /* HTML <u> tag */
ins,                /* HTML <ins> tag */
.cite-link,
.legal-ref a,
.btn,
.btn:hover,
button,
button:hover,
[role="link"],
[role="button"] {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-color: transparent !important;
}

/* Hover indication via opacity (not underline) */
a:hover,
.btn:hover,
button:hover,
[role="link"]:hover,
[role="button"]:hover {
    opacity: 0.85;
}

/* Keyboard accessibility: ring outline on focus (ISO 25010 a11y) */
a:focus-visible,
button:focus-visible,
[role="link"]:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--accent, #5B6CFF) !important;
    outline-offset: 2px !important;
    border-radius: 3px;
    text-decoration: none !important;
}

/* Print styles can re-enable underline for accessibility */
@media print {
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 90%;
        color: #555;
    }
    /* Allow visible link distinction in print */
    a {
        text-decoration: underline !important;
        color: #000 !important;
    }
}

/* ─── Project-wide accessibility (ISO 25010) ──── */
:root {
    --accent: #5B6CFF;
    --accent-hover: #4338ca;
    --success: #06D6A0;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text: #1e293b;
    --text-muted: #64748b;
}

/* Reset for inputs · keep readable */
input, select, textarea, button {
    font-family: inherit;
}

/* Form elements should respect Thai text rendering */
body {
    font-family: -apple-system, BlinkMacSystemFont,
                 "Segoe UI", "IBM Plex Sans Thai",
                 "Noto Sans Thai", Tahoma, sans-serif;
}

/* ─── Compliance flag · highlight legal references ─── */
.legal-ref,
.cite-ref {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
}
.legal-ref::before,
.cite-ref::before {
    content: "📖 ";
}
