/**
 * Top Pneus - Styles de base
 *
 * Reset CSS et styles de base globaux appliqués à tout le site.
 * Inclut les styles de liens, typographie de base, et box-model.
 *
 * @package TopPneus
 * @since 2.0.0
 */

/* ==========================================================================
   GLOBAL RESETS & BASE
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--tp-font-sans);
    color: var(--tp-gray-900);
    line-height: 1.6;
}

/* Gap between fixed header and page content (all pages except home).
   Home has its own hero layout. Shop hero-section is display:none,
   so this margin is the only vertical space on product archives. */
body:not(.home) main {
    margin-top: 28px;
}

/* -------------------------------------------------------------------------
   LIENS GLOBAUX
   ------------------------------------------------------------------------- */

a {
    color: var(--tp-gray-700);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--tp-red);
}

a:visited {
    color: var(--tp-gray-600);
}

/* Liens dans le contenu éditorial + WooCommerce inline */
.entry-content a,
.tp-content a,
.woocommerce-info a,
.woocommerce-message a,
.tp-no-products a,
.woocommerce-notices-wrapper a {
    color: var(--tp-primary);
    text-decoration: underline;
    text-decoration-color: var(--tp-gray-300);
    text-underline-offset: 2px;
}

.entry-content a:hover,
.tp-content a:hover,
.woocommerce-info a:hover,
.woocommerce-message a:hover,
.tp-no-products a:hover,
.woocommerce-notices-wrapper a:hover {
    color: var(--tp-red);
    text-decoration-color: var(--tp-red);
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Skip to content link - visible on focus for keyboard users */
.tp-skip-link {
    position: absolute;
    top: -100%;
    left: var(--tp-space-md);
    z-index: 100000;
    padding: var(--tp-space-sm) var(--tp-space-md);
    background: var(--tp-primary);
    color: var(--tp-white);
    font-size: var(--tp-text-sm, 0.875rem);
    font-weight: 600;
    border-radius: 0 0 var(--tp-radius-md) var(--tp-radius-md);
    text-decoration: none;
    transition: top var(--tp-transition-fast);
}
.tp-skip-link:focus {
    top: 0;
    color: var(--tp-white);
    outline: 2px solid var(--tp-red);
    outline-offset: 2px;
}

/* Screen reader only - accessible but visually hidden */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus visible enhancement */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--tp-primary);
    outline-offset: 2px;
}

/* =========================================================================
   LEGAL PAGES
   ========================================================================= */

.tp-legal-page {
    max-width: 800px;
    line-height: 1.7;
}

.tp-legal-title {
    font-size: var(--tp-text-3xl, 1.875rem);
    font-weight: 700;
    margin-bottom: var(--tp-space-lg, 1.5rem);
    color: var(--tp-gray-900, #1a1a1a);
}

.tp-legal-page h2 {
    margin-top: var(--tp-space-xl, 2rem);
    margin-bottom: var(--tp-space-sm, 0.5rem);
}

.tp-legal-page h3 {
    margin-top: var(--tp-space-lg, 1.5rem);
    margin-bottom: var(--tp-space-xs, 0.25rem);
}

.tp-legal-notice {
    background: var(--tp-gray-50, #f9fafb);
    border-left: 3px solid var(--tp-gray-300, #d1d5db);
    padding: var(--tp-space-sm, 0.5rem) var(--tp-space-md, 1rem);
    color: var(--tp-gray-600, #4b5563);
    font-size: var(--tp-text-sm, 0.875rem);
    margin-bottom: var(--tp-space-md, 1rem);
}

.tp-legal-updated {
    color: var(--tp-gray-500, #6b7280);
    font-size: var(--tp-text-sm, 0.875rem);
    margin-bottom: var(--tp-space-xs, 0.25rem);
}

.tp-legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--tp-space-md, 1rem) 0;
    font-size: var(--tp-text-sm, 0.875rem);
}

.tp-legal-table th,
.tp-legal-table td {
    border: 1px solid var(--tp-gray-200, #e5e7eb);
    padding: var(--tp-space-xs, 0.25rem) var(--tp-space-sm, 0.5rem);
    text-align: left;
}

.tp-legal-table th {
    background: var(--tp-gray-50, #f9fafb);
    font-weight: 600;
}

.tp-legal-download {
    margin-bottom: var(--tp-space-lg, 1.5rem);
}

.tp-btn-print {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: var(--tp-text-sm, 0.875rem);
    font-weight: 500;
    color: var(--tp-gray-700, #374151);
    background: var(--tp-white, #ffffff);
    border: 1px solid var(--tp-gray-300, #d1d5db);
    border-radius: var(--tp-radius-sm, 4px);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tp-btn-print:hover {
    background: var(--tp-gray-50, #f9fafb);
    border-color: var(--tp-gray-400, #9ca3af);
}

/* Print fallback (Ctrl+P) — hide chrome only.
   The "Download PDF" button uses a clean window (tpPrintLegal in legal.php),
   so these rules are just a minimal fallback for direct browser print. */
@media print {
    .ct-header,
    .ct-footer,
    .ct-breadcrumbs,
    .ct-sidebar,
    #wpadminbar,
    .ct-drawer-canvas,
    .tp-btn-print,
    .tp-legal-download,
    .tp-mobile-toolbar,
    .ct-back-to-top,
    .tp-lang-switcher {
        display: none !important;
    }
}
