/*
Theme Name:  Pyduc 2026
Theme URI:   https://www.pyduc.com
Author:      Pyduc
Author URI:  https://www.pyduc.com
Description: Thème minimaliste pour blog photo, responsive, sans commentaires.
Version:     1.0.0
License:     GNU General Public License v2 or later
Text Domain: photo-blog
*/

/* =========================================================
   RESET & BASE
   ========================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg:           #ffffff;
    --color-text:         #1a1a1a;
    --color-muted:        #666666;
    --color-border:       #e0e0e0;
    --color-accent:       #336666;
    --color-accent-hover: #254d4d;
    --color-accent-light: #669999;
    --font-sans:      system-ui, -apple-system, sans-serif;
    --font-size-base: 1rem;
    --line-height:    1.6;
    --radius:         4px;
    --gap:            1.5rem;
    --container:      1280px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family:      var(--font-sans);
    font-size:        var(--font-size-base);
    line-height:      var(--line-height);
    color:            var(--color-text);
    background-color: var(--color-bg);
}

img {
    max-width:  100%;
    height:     auto;
    display:    block;
}

a {
    color:           inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.container {
    width:         min(92%, var(--container));
    margin-inline: auto;
}

.site-header {padding-block:1rem; border-bottom: 1px solid var(--color-border);}

.site-header .container {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    flex-wrap:       wrap;
    gap:             1rem;
}

.site-title {color:var(--color-accent); font-size:1.4rem; font-weight:700;}

.site-title a:hover {text-decoration:none; color:var(--color-accent-light); opacity:1;}

.site-description {
    font-size: 0.85rem;
    color:     var(--color-muted);
    margin-top: 0.2rem;
}

/* -------------------------
   Navigation — structure commune
   ------------------------- */

.main-navigation {
    display:     flex;
    align-items: center;
    position:    relative;
}

/* Bouton hamburger — caché sur desktop */
.nav-toggle {
    display:    none;
    flex-direction: column;
    justify-content: center;
    gap:        5px;
    background: none;
    border:     none;
    cursor:     pointer;
    padding:    0.4rem;
    z-index:    100;
}

.nav-toggle__bar {display:block; width:22px; height:2px; background-color:var(--color-text); transition:transform 0.25s ease, opacity 0.2s ease; transform-origin:center;}

/* Croix quand menu ouvert */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* -------------------------
   Menu desktop (≥ 768px)
   ------------------------- */

.nav-menu {
    list-style: none;
    display:    flex;
    gap:        0.25rem;
    align-items: center;
}

.nav-menu a {
    display:      block;
    font-size:    0.875rem;
    color:        var(--color-muted);
    padding:      0.35rem 0.65rem;
    border-radius: var(--radius);
    transition:   color 0.15s, background 0.15s;
    white-space:  nowrap;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current-menu-ancestor > a {
    color:           var(--color-accent);
    text-decoration: none;
}

/* Éléments avec sous-menu */
.nav-menu .menu-item-has-children {
    position: relative;
    display:  flex;
    align-items: center;
}

/* Bouton chevron sous-menu */
.submenu-toggle {
    background:  none;
    border:      none;
    cursor:      pointer;
    padding:     0 0.2rem;
    font-size:   1rem;
    color:       var(--color-muted);
    line-height: 1;
    transition:  transform 0.2s ease, color 0.15s;
}

.submenu-toggle:hover {
    color: var(--color-text);
}

.menu-item-has-children.is-open > .submenu-toggle {
    transform: rotate(90deg);
    color:     var(--color-accent);
}

/* Sous-menu desktop — dropdown */
.nav-menu .sub-menu {
    display:       none;
    position:      absolute;
    top:           calc(100% + 0.4rem);
    left:          0;
    min-width:     180px;
    list-style:    none;
    background:    var(--color-bg);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow:    0 4px 16px rgba(0,0,0,0.08);
    z-index:       50;
    padding:       0.4rem 0;
}

.menu-item-has-children.is-open > .sub-menu {
    display: block;
}

.nav-menu .sub-menu a {
    font-size: 0.85rem;
    padding:   0.4rem 1rem;
    color:     var(--color-text);
}

.nav-menu .sub-menu a:hover {
    background: #f5f5f5;
}

/* -------------------------
   Menu mobile (< 768px)
   ------------------------- */

@media (max-width: 767px) {

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display:        none; /* caché par défaut */
        flex-direction: column;
        align-items:    stretch;
        gap:            0;
        position:       absolute;
        top:            calc(100% + 0.75rem);
        right:          0;
        width:          220px;
        background:     var(--color-bg);
        border:         1px solid var(--color-border);
        border-radius:  var(--radius);
        box-shadow:     0 4px 16px rgba(0,0,0,0.08);
        z-index:        99;
        padding:        0.5rem 0;
    }

    .nav-menu.is-open {
        display: flex;
    }

    .nav-menu > li {
        display:       flex;
        flex-wrap:     wrap;
        align-items:   center;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu > li:last-child {
        border-bottom: none;
    }

    .nav-menu > li > a {
        flex:    1;
        padding: 0.65rem 1rem;
        color:   var(--color-text);
    }

    .submenu-toggle {
        padding: 0.65rem 0.85rem;
    }

    /* Sous-menu mobile — indenté */
    .nav-menu .sub-menu {
        display:  none;
        position: static;
        width:    100%;
        border:   none;
        border-top: 1px solid var(--color-border);
        box-shadow: none;
        border-radius: 0;
        background: #fafafa;
        padding:   0.25rem 0;
    }

    .menu-item-has-children.is-open > .sub-menu {
        display: block;
    }

    .nav-menu .sub-menu a {
        padding-left: 1.75rem;
        color:        var(--color-text);
    }
}

/* Contenu principal */
.site-main {
    padding-block: 2.5rem;
}

.site-footer {
    padding-block: 2rem;
    border-top:    1px solid var(--color-border);
    font-size:     0.85rem;
    color:         var(--color-muted);
}

.site-footer .container {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    flex-wrap:       wrap;
    gap:             1rem;
}

.footer-menu {
    list-style: none;
    display:    flex;
    flex-wrap:  wrap;
    gap:        0.25rem;
}

.footer-menu a {
    font-size:    0.85rem;
    color:        var(--color-muted);
    padding:      0.2rem 0.5rem;
    border-radius: var(--radius);
    transition:   color 0.15s;
}

.footer-menu a:hover {
    color:           var(--color-accent);
    text-decoration: none;
}

.footer-copy {
    white-space: nowrap;
}

/* =========================================================
   PAGE CATÉGORIES & MOTS-CLÉS
   ========================================================= */

.taxonomy-page__title {
    font-size:      2rem;
    font-weight:    700;
    margin-bottom:  2rem;
}

.taxonomy-page {
    max-width: 760px;
}

.taxonomy-section {
    margin-bottom: 0;
}

.taxonomy-section__heading {
    font-size:      1.1rem;
    font-weight:    700;
    text-transform: uppercase;
    color:          var(--color-muted);
    margin-bottom:  1.25rem;
}

/* ── Arbre des catégories ── */

.cat-tree__list {
    list-style: none;
    margin:     0;
    padding:    0;
}

/* Chaque niveau enfant est indenté */
.cat-tree__list--depth-0 > .cat-tree__item {
    border-top: 1px solid var(--color-border);
}
.cat-tree__list--depth-0 > .cat-tree__item:last-child {
    border-bottom: 1px solid var(--color-border);
}

.cat-tree__list--depth-1 {
    padding-left: 1.25rem;
    border-top:   1px solid var(--color-border);
    margin-top:   0.1rem;
}

.cat-tree__list--depth-2 {
    padding-left: 1.25rem;
    border-top:   1px solid var(--color-border);
    margin-top:   0.1rem;
}

.cat-tree__link {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         0.55rem 0.25rem;
    font-size:       0.95rem;
    color:           var(--color-text);
    transition:      color 0.15s;
    gap:             1rem;
}

.cat-tree__list--depth-1 .cat-tree__link {
    font-size: 0.875rem;
    color:     var(--color-muted);
}

.cat-tree__list--depth-2 .cat-tree__link {
    font-size: 0.825rem;
    color:     var(--color-muted);
}

.cat-tree__link:hover {
    color:           var(--color-accent);
    text-decoration: none;
}

.cat-tree__count {
    font-size:  0.75rem;
    color:      var(--color-muted);
    flex-shrink: 0;
}

/* ── Index alphabétique des tags ── */

.tag-index {
    display:        flex;
    flex-direction: column;
    gap:            1.25rem;
}

.tag-index__group {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    gap:     0 1rem;
    align-items: start;
}

.tag-index__letter {
    font-size:   1.1rem;
    font-weight: 700;
    color:       var(--color-muted);
    padding-top: 0.15rem;
    line-height: 1;
}

.tag-index__items {
    display:   flex;
    flex-wrap: wrap;
    gap:       0.35rem;
}

.tag-index__link {
    display:      inline-flex;
    align-items:  center;
    gap:          0.3rem;
    font-size:    0.825rem;
    padding:      0.2rem 0.6rem;
    border:       1px solid var(--color-border);
    border-radius: 999px;
    color:        var(--color-muted);
    transition:   background 0.15s, color 0.15s, border-color 0.15s;
}

.tag-index__link:hover {
    background:      var(--color-accent);
    color:           var(--color-bg);
    border-color:    var(--color-accent);
    text-decoration: none;
}

.tag-index__count {
    font-size: 0.7rem;
    opacity:   0.6;
}

/* =========================================================
   POST MIS EN AVANT (home.php)
   ========================================================= */

.featured-section {
    margin-bottom: 0;
}

.post-featured {
    max-width: 960px;
    margin:    0 auto;
}

.post-featured__link {
    display: block;
}

.post-featured__figure {
    margin: 0;
}

.post-featured__image {
    width:         100%;
    height:        auto;
    border-radius: var(--radius);
    display:       block;
}

.post-featured__body {
    padding-top: 1rem;
}

.post-featured__title {
    font-size:      1.5rem;
    font-weight:    700;
    line-height:    1.2;
    margin-bottom:  0.3rem;
}

.post-featured__title a:hover {
    text-decoration: underline;
}

.post-featured__meta {
    font-size: 0.85rem;
    color:     var(--color-muted);
    margin-bottom: 0.5rem;
}

.section-divider {
    border:     none;
    border-top: 1px solid var(--color-border);
    margin:     2.5rem 0;
}

/* =========================================================
   GRILLE PHOTOS (home.php / archive.php / tag.php)
   ========================================================= */

.photo-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap:                   var(--gap);
}

.photo-card {
    display:        flex;
    flex-direction: column;
}

.photo-card__thumb {
    position:      relative;
    overflow:      hidden;
    aspect-ratio:  4 / 3;
    background:    var(--color-border);
    border-radius: var(--radius);
}

.photo-card__thumb img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.photo-card:hover .photo-card__thumb img {
    transform: scale(1.04);
}

.photo-card__body {
    padding-top: 0.75rem;
}

.photo-card__title {
    font-size:   1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.photo-card__title a:hover {
    text-decoration: underline;
}

.photo-card__meta {
    font-size: 0.8rem;
    color:     var(--color-muted);
}

/* =========================================================
   TAXONOMIES : CATÉGORIES + TAGS
   ========================================================= */

.post-taxonomy {
    display:        flex;
    flex-direction: column;
    gap:            0.5rem;
    margin-top:     0.75rem;
}

.home .post-taxonomy {display:none;}

.category-list {
    display:   flex;
    flex-wrap: wrap;
    gap:       0.4rem;
}

.category-list a {
    font-size:     0.75rem;
    font-weight:   600;
    padding:       0.2rem 0.6rem;
    border-radius: var(--radius);
    background:    var(--color-accent);
    color:         var(--color-bg);
    text-transform: uppercase;
    transition:    opacity 0.15s;
}

.category-list a:hover {background:var(--color-accent-light); text-decoration:none;}

/* Lieux et Personnes sur les posts — même style pill que les tags
   mais avec une couleur de bordure distincte */

.tax-list {
    display:   flex;
    flex-wrap: wrap;
    gap:       0.4rem;
    margin-top: 0.1rem;
}

.tax-list a {
    font-size:    0.75rem;
    padding:      0.2rem 0.6rem;
    border-radius: 999px;
    transition:   background 0.2s, color 0.2s;
    text-decoration: none;
}

.tax-list--lieu a {
    border: 1px solid var(--color-accent);
    color:  var(--color-accent);
}

.tax-list--lieu a:hover {
    background:   var(--color-accent);
    color:        #fff;
    border-color: var(--color-accent);
}

.tax-list--personne a {
    border: 1px solid var(--color-accent);
    color:  var(--color-accent);
}

.tax-list--personne a:hover {
    background:   var(--color-accent);
    color:        #fff;
    border-color: var(--color-accent);
}

/* =========================================================
   TAGS
   ========================================================= */

.tag-list {
    display:    flex;
    flex-wrap:  wrap;
    gap:        0.4rem;
    margin-top: 0.6rem;
}

.tag-list a {
    font-size:        0.75rem;
    padding:          0.2rem 0.6rem;
    border:           1px solid var(--color-border);
    border-radius:    999px;
    color:            var(--color-muted);
    transition:       background 0.2s, color 0.2s;
}

.tag-list a:hover {
    background:      var(--color-accent);
    color:           var(--color-bg);
    text-decoration: none;
    border-color:    var(--color-accent);
}

/* En-tête de page archive/tag */
.archive-header {
    margin-bottom: 2rem;
}

.archive-title {
    font-size:      1.6rem;
    font-weight:    700;
}

.archive-description {
    margin-top: 0.4rem;
    color:      var(--color-muted);
    font-size:  0.9rem;
}

/* =========================================================
   POST SINGLE
   ========================================================= */

.single-photo {
    max-width: 960px;
    margin:    0 auto;
}

.single-photo__image {
    width:         100%;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.single-photo__header {
    margin-bottom: 1rem;
}

.single-photo__title {
    font-size:      2rem;
    font-weight:    700;
    line-height:    1.2;
}

.single-photo__meta {
    margin-top: 0.5rem;
    font-size:  0.85rem;
    color:      var(--color-muted);
    display:    flex;
    gap:        1rem;
    flex-wrap:  wrap;
}

.single-photo__content {font-size:1rem; line-height:1.75;  margin-block:1.5rem;}

.single-photo__content .size-full {margin-bottom:2em;}

.single-photo__nav {
    display:         flex;
    justify-content: space-between;
    margin-top:      2.5rem;
    padding-top:     1.5rem;
    border-top:      1px solid var(--color-border);
    font-size:       0.9rem;
    gap:             1rem;
}

.single-photo__nav a {
    color: var(--color-muted);
}

.single-photo__nav a:hover {
    color: var(--color-accent);
}

/* Pagination interne d'un post (<!--nextpage-->) */

.post-pages {display:flex; flex-wrap:wrap; gap:0.5rem; margin-bottom:1.5rem; padding-bottom:1.5rem; border-bottom:1px solid var(--color-border);}

.post-page-numbers {display: inline-block; padding:0.4rem 1rem; border: 1px solid var(--color-border); border-radius:var(--radius); color:   var(--color-muted); transition: background 0.2s;}

.post-pages a:hover {
    background:      var(--color-accent);
    color:           var(--color-bg);
    border-color:    var(--color-accent);
    text-decoration: none;
}

/* Page courante — span sans lien */
.post-pages > span:not(:has(a)) {
    background:   var(--color-accent);
    color:        var(--color-bg);
    border-color: var(--color-accent);
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display:         flex;
    justify-content: center;
    gap:             0.5rem;
    margin-top:      3rem;
    flex-wrap:       wrap;
}

.pagination a,
.pagination span {
    padding:       0.4rem 0.8rem;
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    font-size:     0.875rem;
    color:         var(--color-muted);
    transition:    background 0.2s;
}

.pagination a:hover {
    background:      var(--color-accent);
    color:           var(--color-bg);
    border-color:    var(--color-accent);
    text-decoration: none;
}

.pagination .current {
    background:   var(--color-accent);
    color:        var(--color-bg);
    border-color: var(--color-accent);
}

/* =========================================================
   UTILITAIRES
   ========================================================= */

.screen-reader-text {
    position:   absolute;
    width:      1px;
    height:     1px;
    overflow:   hidden;
    clip:       rect(0, 0, 0, 0);
    white-space: nowrap;
}
