/**
 * Main CSS - Styles additionnels et améliorations
 * 
 * Ce fichier contient des styles supplémentaires qui ne sont pas
 * dans style.css (le fichier de base du thème)
 * 
 * @package Portfolio_Minimal
 */

/* ==========================================================================
   MENU MOBILE (HAMBURGER)
   ========================================================================== */

.menu-toggle {
    display: none;
    /* Caché par défaut sur desktop */
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    cursor: pointer;
    background: transparent;
    border: none;
}

.menu-toggle-bar {
    width: 28px;
    height: 2px;
    background-color: var(--color-primary);
    transition: all var(--transition-base);
    border-radius: 2px;
}

/* Animation du menu hamburger quand ouvert */
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Afficher le bouton hamburger sur mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        padding: var(--spacing-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        border-bottom: 1px solid var(--color-border);
        z-index: 999;
    }

    .main-navigation.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }

    .main-navigation a {
        font-size: var(--font-size-base);
        padding: var(--spacing-xs) 0;
        display: block;
    }
}

/* ==========================================================================
   ANIMATIONS ET TRANSITIONS
   ========================================================================== */

/* Animation d'apparition au scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Animation de rotation légère au hover (pour les images) */
@keyframes rotateSubtle {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(1deg);
    }
}

/* ==========================================================================
   FOCUS ET ACCESSIBILITÉ
   ========================================================================== */

/* Skip to main content (pour lecteurs d'écran) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

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

/* ==========================================================================
   SMOOTH SCROLL BEHAVIOR
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* Désactiver le smooth scroll si l'utilisateur préfère reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   PRINT STYLES (pour impression)
   ========================================================================== */

@media print {

    .site-header,
    .site-footer,
    .menu-toggle,
    .form-submit,
    .home-cta {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
}

/* ==========================================================================
   LOADING SPINNER (pour AJAX)
   ========================================================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   SÉLECTION DE TEXTE
   ========================================================================== */

::selection {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

/* ==========================================================================
   SCROLLBAR PERSONNALISÉE (Webkit uniquement)
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ==========================================================================
   CLASSES UTILITAIRES SUPPLÉMENTAIRES
   ========================================================================== */

/* Visibilité responsive */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: block;
    }
}

/* Espacement responsive */
.spacing-responsive {
    padding: var(--spacing-2xl) var(--spacing-md);
}

@media (max-width: 768px) {
    .spacing-responsive {
        padding: var(--spacing-xl) var(--spacing-sm);
    }
}

/* Text truncate avec ellipsis */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Aspect ratio containers (pour images/vidéos) */
.aspect-ratio-16-9 {
    position: relative;
    padding-bottom: 56.25%;
    /* 9/16 = 56.25% */
    height: 0;
    overflow: hidden;
}

.aspect-ratio-16-9>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aspect-ratio-1-1 {
    position: relative;
    padding-bottom: 100%;
    height: 0;
    overflow: hidden;
}

.aspect-ratio-1-1>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   AMÉLIORATIONS TYPOGRAPHIQUES
   ========================================================================== */

/* Optimisation des lignes orphelines et veuves */
p {
    orphans: 3;
    widows: 3;
}

/* Amélioration de la lisibilité */
article,
.entry-content {
    hyphens: auto;
}

/* Lettrine (première lettre grande) - optionnel */
.drop-cap::first-letter {
    font-size: 3em;
    line-height: 0.9;
    float: left;
    margin: 0.1em 0.1em 0 0;
    font-weight: 400;
}

/* ==========================================================================
   DARK MODE (préparation pour futur développement)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Ces règles peuvent être activées pour supporter le dark mode */
    /*
    :root {
        --color-primary: #ffffff;
        --color-secondary: #000000;
        --color-text: #e5e5e5;
        --color-text-light: #a0a0a0;
        --color-border: #333333;
        --color-bg: #0a0a0a;
        --color-bg-alt: #1a1a1a;
    }
    */
}