/* CSS Minimal - Gabriel's Blog */

/* ============================================================================
   HEADER - LANG & THEME SWITCHERS
   ============================================================================ */

.header__container {
    position: relative;
}

.lang-switcher {
    position: absolute;
    top: 30px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.lang-switcher a {
    display: inline-block;
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0.3;
    transition: all 0.2s;
    filter: grayscale(100%);
}

.lang-switcher a:hover {
    opacity: 0.6;
    filter: grayscale(50%);
    transform: scale(1.1);
}

.lang-switcher a.active {
    opacity: 1;
    filter: grayscale(0%);
}

.theme-switcher {
    position: absolute;
    top: 30px;
    right: 100px;
    cursor: pointer;
    font-size: 1.5rem;
    opacity: 0.7;
    transition: all 0.2s;
}

.theme-switcher:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ============================================================================
   LAYOUT - SIDEBAR À GAUCHE
   ============================================================================ */

/* Sidebar à gauche */
.sidebar {
    -webkit-order: 0 !important;
    order: 0 !important;
    margin: 0 2.5% 0 0 !important;
}

.primary {
    -webkit-order: 1 !important;
    order: 1 !important;
}

/* Variables */
:root {
    --color-primary: #e74c3c;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #e9ecef;
    --color-bg-light: #f8f9fa;
}

[data-theme="dark"] {
    --color-text: #e2e8f0;
    --color-text-light: #a0aec0;
    --color-border: #4a5568;
    --color-bg-light: #2d3748;
}

/* Titres plus grands */
h2 { font-size: 1.375rem !important; }
h3 { font-size: 1.2rem !important; }
h4 { font-size: 1.1rem !important; }

.page__title, .post__title {
    font-size: 1.5rem;
}

/* Menu actif - style subtil */
.menu__item--active .menu__link {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%) !important;
    border-left: 3px solid var(--color-primary) !important;
    color: var(--color-primary) !important;
    font-weight: 600 !important;
    padding: 8px 12px 8px 9px !important;
    border-radius: 4px !important;
}

/* Tags de la sidebar - style harmonisé avec les tags du contenu */
.tag-filter, .tag {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 4px 12px;
    background: rgba(212, 181, 212, 0.3);
    color: #555;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 20px;
    border: 1px solid rgba(212, 181, 212, 0.5);
    transition: all 0.2s ease;
}

.tag-filter:hover, .tag:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #555;
    border-color: rgba(231, 76, 60, 0.3);
}

/* Tags filter bar */
.tags-filter {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--color-bg-light);
    border-radius: 8px;
}

.tags-filter__label {
    font-weight: 600;
    margin-right: 1rem;
}

/* Content list */
.content-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.content-item:last-child {
    border-bottom: none;
}

.content-item__title a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
}

.content-item__title a:hover {
    color: var(--color-primary);
}

.content-item__meta {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0.5rem 0;
}

.content-item__meta span {
    margin-right: 1rem;
}

/* Post tags */
.post__tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.tags-label {
    font-weight: 600;
    margin-right: 1rem;
}

/* ============================================================================
   LAYOUT - ALIGNEMENT ET ESPACEMENT
   ============================================================================ */

/* Alignement vertical : sidebar et contenu démarrent au même niveau */
.wrapper.flex {
    align-items: flex-start;
}

/* S'assurer que le premier widget et le contenu principal commencent au même niveau */
.sidebar .widget:first-child {
    margin-top: 0;
}

.primary > .main {
    margin-top: 0;
}

.primary > .main > .post,
.primary > .main > .content,
.primary > .main > .main__header {
    margin-top: 0;
    padding-top: 0;
}

/* Aligner les titres de page de liste avec la sidebar */
.main__header {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.main__title {
    margin-top: 0 !important;
}

/* Supprimer l'espace des titres vides (comme sur la page expérience) */
.page__title:empty {
    display: none;
}

/* Widget Contact - espacement harmonieux */
.widget-contact .widget__content {
    margin-top: -0.6rem;
}

.widget-contact .contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget-contact .contact-item {
    line-height: 1.4;
    margin: 0;
    padding: 0;
}

.widget-contact .contact-name {
    font-size: 1rem;
}

.widget-contact .contact-cv {
    margin-top: 0.8rem;
}

/* Bouton de téléchargement CV - style sombre */
.cv-download-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #333;
    color: white !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 4px;
    border: 1px solid #333;
    transition: all 0.2s ease;
}

.cv-download-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* Normaliser .page__intro : séparateur visuel entre intro et contenu */
.page__intro {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* Retirer la double bordure de .post__meta (border-top + border-bottom) */
.post__meta {
    border-top: none !important;
}

/* Alignement de la page de recherche avec les autres pages */
.main__content {
    padding-left: 0 !important;
    margin-left: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.main__content .page__title {
    margin-top: 0;
}

.main__content .page__intro {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* Styles pour listes de contenu - cohérent avec le thème */
.content-list .content-item {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.content-list .content-item:last-child {
    border-bottom: none;
}

.content-title {
    margin-bottom: 0.5rem;
}

.content-title h2 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 600;
}

.content-link {
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.content-item .content-link:hover {
    color: var(--color-primary);
}

.content-meta {
    margin: 0.5rem 0 1rem 0;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.content-summary {
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* Tags en couleurs pastelles douces - pour toutes les pages */
.content-tags,
.post__tags,
.single__tags,
.article__tags {
    margin-top: 1rem;
}

.content-tags .widget-taglist__link,
.post__tags .widget-taglist__link,
.single__tags .widget-taglist__link,
.article__tags .widget-taglist__link,
.post-tags .widget-taglist__link,
.widget-taglist__link {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 4px 10px;
    background-color: rgba(212, 181, 212, 0.3) !important; /* Couleur par défaut - lavande très douce */
    color: #555 !important;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 20px !important;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
}

.widget-taglist__link:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Tags dans les listes filtrées (content-tags) - non cliquables */
.content-tags .widget-taglist__link {
    cursor: default !important;
    pointer-events: none !important;
}

/* Tags en bas d'article/expérience - non cliquables, pas en gras */
.post__tags .tags__link,
.tags__link.btn {
    cursor: default !important;
    pointer-events: none !important;
    font-weight: 400 !important;
}

/* Les tags du widget contextuel sont cliquables */
.tag-filter {
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: all 0.2s ease;
}

.tag-filter:hover {
    background-color: rgba(231, 76, 60, 0.2) !important;
}

/* Tags sélectionnés en rouge vif */
.tag-filter.tag-selected,
a.widget-taglist__link.tag-filter.tag-selected {
    background-color: #e74c3c !important;
    color: white !important;
    border-color: #e74c3c !important;
    font-weight: 700 !important;
}

/* ============================================================================
   COULEURS DES TAGS - PAR CATÉGORIE UNIQUEMENT
   Couleurs basées sur data-taxonomy (platforms, tools, methodologies, services, languages, skills)
   ============================================================================ */

/* Style de base pour tous les tags (pill arrondi) */
.tags__link.btn,
.post__tags .tags__link {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 4px 12px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 20px;
    transition: all 0.2s ease;
}

/* Plateformes - Bleu cloud */
[data-taxonomy="platform"],
.tags__link[data-taxonomy="platform"],
.widget-taglist__link[data-taxonomy="platform"] {
    background-color: rgba(179, 217, 255, 0.3) !important;
    color: #2980b9 !important;
}

/* Outils - Vert */
[data-taxonomy="tool"],
.tags__link[data-taxonomy="tool"],
.widget-taglist__link[data-taxonomy="tool"] {
    background-color: rgba(200, 230, 201, 0.3) !important;
    color: #27ae60 !important;
}

/* Méthodologies - Violet */
[data-taxonomy="methodology"],
.tags__link[data-taxonomy="methodology"],
.widget-taglist__link[data-taxonomy="methodology"] {
    background-color: rgba(225, 190, 231, 0.3) !important;
    color: #8e44ad !important;
}

/* Services - Orange */
[data-taxonomy="service"],
.tags__link[data-taxonomy="service"],
.widget-taglist__link[data-taxonomy="service"] {
    background-color: rgba(255, 224, 179, 0.3) !important;
    color: #e67e22 !important;
}

/* Langages - Jaune/Or */
[data-taxonomy="language"],
.tags__link[data-taxonomy="language"],
.widget-taglist__link[data-taxonomy="language"] {
    background-color: rgba(255, 243, 196, 0.3) !important;
    color: #d68910 !important;
}

/* Compétences - Rose/Rouge */
[data-taxonomy="skill"],
.tags__link[data-taxonomy="skill"],
.widget-taglist__link[data-taxonomy="skill"] {
    background-color: rgba(255, 205, 210, 0.3) !important;
    color: #c0392b !important;
}

/* Tags génériques sans catégorie - Lavande (défaut) */
.tags__link:not([data-taxonomy]),
.widget-taglist__link:not([data-taxonomy]) {
    background-color: rgba(212, 181, 212, 0.3) !important;
    color: #555 !important;
}

/* Widget de recherche interne - réutilise les classes du thème */
.search-results {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    border-bottom: 1px solid var(--color-border);
    padding: 8px 0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-link {
    text-decoration: none;
    color: var(--color-text);
}

.search-result-link:hover {
    color: var(--color-primary);
}

.search-result-meta {
    color: var(--color-text-light);
    font-size: 0.8rem;
}

.search-no-results {
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* Styles pour la page de recherche */
.search-results-page {
    margin-top: 2rem;
}

.search-result-article {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.search-result-article:last-child {
    border-bottom: none;
}

.search-result-title {
    color: var(--color-text);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.search-result-title:hover {
    color: var(--color-primary);
}

.search-result-company {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.search-result-excerpt {
    line-height: 1.6;
    margin: 1rem 0;
}

.search-result-tags {
    margin-top: 1rem;
}

.search-result-tags .tag {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 4px 10px;
    background-color: #333;
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 0;
}

.search-result-type {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Styles pour les tags contextuels sélectionnés - fond rouge visible */
.tag-selected,
.widget-taglist .tag-selected,
.widget-taglist__link.tag-selected,
.widget__content .tag-selected,
a.widget-taglist__link.widget__link.btn.tag-selected,
.tag-filter.tag-selected,
a.widget-taglist__link.tag-filter.tag-selected {
    background-color: #e74c3c !important;
    color: white !important;
    border-color: #e74c3c !important;
    font-weight: 700 !important;
}

/* Désactiver l'uppercase automatique du titre du site */
.header__title,
.logo__title,
h1.header__title,
h1.logo__title {
    text-transform: none !important;
}

/* Hover effect pour le menu actif */
.menu__item--active .menu__link:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15) 0%, rgba(231, 76, 60, 0.08) 100%) !important;
}

/* Styles pour le widget de recherche d'expériences */
.experience-search-widget {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--color-bg-light);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.search-container {
    margin-bottom: 1rem;
}

#experience-search:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Styles pour les widgets de projet */

/* Widget Project Overview */
.widget-project-overview .project-overview {
    font-size: 0.9rem;
}

.widget-project-overview .overview-item {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.widget-project-overview .overview-item strong {
    display: inline-block;
    min-width: 120px;
    color: var(--color-text);
}

.widget-project-overview .overview-item span,
.widget-project-overview .overview-item a {
    color: var(--color-text-light);
}

.widget-project-overview .overview-item a {
    color: var(--color-primary);
    text-decoration: none;
}

.widget-project-overview .overview-item a:hover {
    text-decoration: underline;
}

/* Widget Project Metrics */
.widget-project-metrics .project-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.widget-project-metrics .metric-item {
    text-align: center;
    padding: 1rem;
    background: var(--color-bg-light);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.widget-project-metrics .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.widget-project-metrics .metric-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    line-height: 1.3;
}

/* Widget Project Key Points */
.widget-project-key-points .project-key-points {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-project-key-points .key-point-item {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
    font-size: 0.9rem;
}

.widget-project-key-points .key-point-item::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.widget-project-key-points .key-point-icon {
    margin-right: 0.5rem;
}

.widget-project-key-points .key-point-text {
    color: var(--color-text-light);
}

/* Responsive pour les métriques */
@media (max-width: 768px) {
    .widget-project-metrics .project-metrics {
        grid-template-columns: 1fr;
    }
}

/* Espacement amélioré pour les articles et projets */
.post__content h2,
.page__content h2,
.single__content h2 {
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
}

.post__content h3,
.page__content h3,
.single__content h3 {
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
}

.post__content h4,
.page__content h4,
.single__content h4 {
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
}

/* Premier titre après intro : moins d'espace en haut */
.post__content > h2:first-of-type,
.page__content > h2:first-of-type,
.single__content > h2:first-of-type {
    margin-top: 1.5rem !important;
}

/* Pager : 3 colonnes avec sommaire toujours au centre */
.pager.flex {
    display: grid;
    grid-template-columns: 1fr minmax(120px, auto) 1fr;
    align-items: start;
    gap: 1rem;
}

.pager__item--prev {
    grid-column: 1;
    text-align: left;
}

.pager__item--summary {
    grid-column: 2;
    text-align: center;
    white-space: nowrap;
}

.pager__item--next {
    grid-column: 3;
    text-align: right;
}

.pager__item--summary .pager__link {
    display: block;
}

.pager__item--summary .pager__subtitle {
    color: var(--color-primary);
    font-weight: 600;
}

.pager__item--summary .pager__title {
    font-size: 0.9rem;
}

/* Corriger le débordement de texte dans les contenus */
.post__content,
.page__content,
.single__content,
.content,
.list__excerpt,
.post__lead,
.list__lead {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Pour les liens et éléments inline */
.post__content a,
.page__content a,
.single__content a,
.content a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Pour les titres longs */
.post__title,
.page__title,
.list__title,
.single__title {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* ============================================================================
   DARK THEME
   ============================================================================ */

/* Transition douce pour changement de thème */
body, .header, .menu, .content, .sidebar, .widget {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Menu actif en rouge */
.menu__item--active {
    background: #e74c3c !important;
}

.menu__item--active .menu__link {
    color: white !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .menu__item--active {
    background: #e74c3c !important;
}

[data-theme="dark"] .menu__item--active .menu__link {
    color: white !important;
}

/* Thème sombre */
[data-theme="dark"] body {
    background: #2d2d30;
    color: #e8e8e8;
}

[data-theme="dark"] .header {
    background: transparent;
}

[data-theme="dark"] .logo__link,
[data-theme="dark"] .logo__title {
    color: #ffffff;
}

[data-theme="dark"] .logo__tagline {
    color: #e74c3c;
}

[data-theme="dark"] .menu {
    background: transparent;
}

[data-theme="dark"] .menu__link {
    color: #e8e8e8;
}

[data-theme="dark"] .menu__link:hover,
[data-theme="dark"] .menu__link--active {
    color: #ffffff;
}

[data-theme="dark"] .wrapper,
[data-theme="dark"] .main {
    background: #2d2d30;
}

[data-theme="dark"] .content {
    background: transparent;
    color: #e8e8e8;
}

[data-theme="dark"] .sidebar {
    background: #2d2d30;
}

[data-theme="dark"] .widget {
    background: transparent;
    border: none;
}

[data-theme="dark"] .widget__title {
    color: #ffffff;
    background: transparent;
    border-bottom: 2px solid #e74c3c;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: #ffffff;
}

[data-theme="dark"] .post__title a {
    color: #ffffff;
}

[data-theme="dark"] .post__meta {
    color: #999;
}

[data-theme="dark"] .list__item {
    border-bottom-color: #4e4e52;
}

[data-theme="dark"] code {
    background: #2d2d30;
    color: #e74c3c;
}

[data-theme="dark"] pre {
    background: #2d2d30;
    border-color: #4e4e52;
}

[data-theme="dark"] .authorbox,
[data-theme="dark"] .toc {
    background: #3e3e42;
    border-color: #4e4e52;
}

[data-theme="dark"] .toc__title {
    background: #2d2d30;
}

/* Tags en mode sombre */
[data-theme="dark"] .tags__item .tags__link.btn {
    opacity: 1;
    color: #ffffff !important;
}

[data-theme="dark"] .widget-taglist__link {
    color: #ffffff !important;
}

/* Titres en blanc */
[data-theme="dark"] .main .post__title a,
[data-theme="dark"] .main .list__title a,
[data-theme="dark"] .main h2 a,
[data-theme="dark"] .list__lead {
    color: #ffffff !important;
}

[data-theme="dark"] a {
    color: #e74c3c;
}

[data-theme="dark"] .widget__item a {
    color: #ccc;
}

[data-theme="dark"] .widget__item a:hover {
    color: #ffffff;
}
