/*
 * CahFelix Tech WP - Utilities CSS
 * Classes utilitárias para acessibilidade, layout e componentes
 */

/* ==========================================================================
   ACESSIBILIDADE
   ========================================================================== */

/* Skip Link para navegação por teclado */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    padding: 8px 12px;
    z-index: 1000;
    border-radius: 0 0 var(--radius) var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* Screen Reader Only - Oculta visualmente mas mantém para leitores de tela */
.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 - Indicadores de foco melhorados */
.engineer-mobile-toggle:focus-visible,
.engineer-nav a:focus-visible,
.engineer-nav-menu a:focus-visible,
.engineer-btn:focus-visible,
.mobile-nav-link:focus-visible,
.medium-post-card:focus-visible,
.medium-tag:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid hsl(var(--accent));
    outline-offset: 2px;
    border-radius: 6px;
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

/* Container padrão */
.container {
    max-width: 56rem; /* 896px - Padrão Engineer Trails */
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Flexbox utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Combinações comuns de flexbox */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

/* Grid utilities */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ==========================================================================
   SPACING UTILITIES
   ========================================================================== */

/* Margin utilities */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }
.mr-0 { margin-right: 0; }

.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Padding utilities */
.p-0 { padding: 0; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }
.pl-0 { padding-left: 0; }
.pr-0 { padding-right: 0; }

/* ==========================================================================
   TEXT UTILITIES
   ========================================================================== */

/* Text colors - mantendo apenas as utilizadas */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-accent { color: hsl(var(--accent)); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text sizes - mantendo apenas as utilizadas */
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }

/* Font weights - mantendo apenas as utilizadas */
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ==========================================================================
   BACKGROUND UTILITIES
   ========================================================================== */

.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-accent { background-color: hsl(var(--accent)); }

/* ==========================================================================
   BORDER UTILITIES
   ========================================================================== */

.border { border: 1px solid hsl(var(--border)); }
.border-t { border-top: 1px solid hsl(var(--border)); }
.border-b { border-bottom: 1px solid hsl(var(--border)); }
.border-l { border-left: 1px solid hsl(var(--border)); }
.border-r { border-right: 1px solid hsl(var(--border)); }

.border-accent { border-color: hsl(var(--accent)); }
.border-muted { border-color: hsl(var(--muted)); }
.border-border { border-color: hsl(var(--border)); }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

/* ==========================================================================
   DISPLAY UTILITIES
   ========================================================================== */

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* ==========================================================================
   POSITION UTILITIES
   ========================================================================== */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ==========================================================================
   SHADOW UTILITIES
   ========================================================================== */

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   TRANSITION UTILITIES
   ========================================================================== */

.transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* ==========================================================================
   HOVER UTILITIES
   ========================================================================== */

.hover\:text-accent:hover {
    color: hsl(var(--accent));
}

.hover\:text-accent:hover {
    color: hsl(var(--accent));
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

/* Mobile First - Base styles são para mobile */

/* Tablet (768px e acima) */
@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
    .md\:flex { display: flex; }
    .md\:grid { display: grid; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:text-left { text-align: left; }
    .md\:text-center { text-align: center; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
}

/* Desktop (1024px e acima) */
@media (min-width: 1024px) {
    .lg\:block { display: block; }
    .lg\:hidden { display: none; }
    .lg\:flex { display: flex; }
    .lg\:grid { display: grid; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .lg\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
}

/* ==========================================================================
   COMPONENT UTILITIES
   ========================================================================== */

/* Button base styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-primary:hover {
    background-color: hsl(var(--accent) / 0.9);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.8);
}

.btn-outline {
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    background-color: hsl(var(--secondary));
}

/* Card component */
.card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: hsl(var(--accent) / 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px hsl(var(--background) / 0.3);
}

/* Badge component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-accent {
    background-color: hsl(var(--accent) / 0.1);
    color: hsl(var(--accent));
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* ==========================================================================
   PRINT UTILITIES
   ========================================================================== */

@media print {
    .print\:hidden {
        display: none !important;
    }

    .print\:block {
        display: block !important;
    }
}


