/*
Theme Name: Bibletude
Theme URI: https://bibletude.fr
Author: Copilot
Author URI: https://bibletude.fr
Description: Theme WordPress oriente conferences, seminaires, reunions, bibliotheque d'articles et enregistrements d'exposes. Menu vertical lateral gauche et contenu pleine largeur.
Version: 1.11.3
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: event-library-hub
*/

:root {
    --elh-bg: #f3f9fb;
    --elh-bg-soft: #fafafa;
    --elh-text: #1f2430;
    --elh-muted: #59627a;
    --elh-accent: #1a6c7a;
    --elh-accent-2: #1a6c7a;
    --elh-highlight: #dff5e8;
    --elh-card: #fafafa;
    --elh-border: rgba(26, 108, 122, 0.2);
    --elh-shadow: 0 12px 24px rgba(31, 36, 48, 0.08);
    --elh-radius: 14px;
    --elh-max: 1200px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--elh-text);
    background:
        radial-gradient(circle at 10% 10%, rgba(223, 245, 232, 0.7), transparent 45%),
        radial-gradient(circle at 90% 20%, rgba(26, 108, 122, 0.14), transparent 50%),
        var(--elh-bg);
    line-height: 1.6;
}

a {
    color: var(--elh-accent-2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

.site-layout {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.site-sidebar {
    flex: 0 0 250px;
    width: 250px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(180deg, #1a6c7a 0%, #12545f 100%);
    border-right: none;
    box-shadow: 2px 0 12px rgba(26, 108, 122, 0.15);
}

.admin-bar .site-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}

.branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-family: "Merriweather", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.branding:hover {
    text-decoration: none;
}

.branding-logo {
    height: 64px;
    width: auto;
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.main-nav ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
}

.main-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.main-nav li:last-child {
    border-bottom: none;
}

.main-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.92);
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.main-nav a.menu-library::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: -3px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding-left: 18px;
    text-decoration: none;
}

.main-nav .sub-menu {
    display: none;
    margin: 0;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.1);
}

.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu,
.main-nav .current-menu-item > .sub-menu,
.main-nav .current-menu-ancestor > .sub-menu {
    display: flex;
}

.main-nav .sub-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-nav .sub-menu a {
    padding: 8px 12px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.main-nav .menu-item-has-children > a::after {
    content: "\25B8"; /* Fleche droite pour indiquer un sous-menu */
    margin-left: 6px;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease;
}

.library-nav-list .menu-item-has-children:hover > a::after,
.library-nav-list .menu-item-has-children:focus-within > a::after {
    transform: rotate(90deg); /* Fleche vers le bas au survol */
    color: #ffffff;
}

.library-nav-list .sub-menu .menu-item-has-children > a::after {
    content: "\25B9"; /* Fleche plus petite pour les sous-sous-menus */
    margin-left: auto;
    float: right;
    color: rgba(255, 255, 255, 0.6);
}

.library-nav-list .sub-menu .menu-item-has-children:hover > a::after,
.library-nav-list .sub-menu .menu-item-has-children:focus-within > a::after {
    transform: rotate(90deg);
    color: #ffffff;
}

.site-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #1a6c7a 0%, #12545f 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 28px;
    box-shadow: 0 2px 8px rgba(26, 108, 122, 0.12);
}

.library-nav-inline {
    flex-shrink: 0;
}

.library-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.library-nav-list a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.library-nav-list a.menu-library::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -2px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.library-nav-list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0; /* Aligne a droite pour eviter le debordement */
    min-width: 200px;
    max-width: 280px;
    margin-top: 4px;
    padding: 8px;
    background: linear-gradient(180deg, #12545f 0%, #0d3f47 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--elh-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 100;
    list-style: none;
}

.library-nav-list li {
    position: relative;
}

.library-nav-list li:hover > .sub-menu,
.library-nav-list li:focus-within > .sub-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.library-nav-list .sub-menu a {
    display: block;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.88rem;
    position: relative;
}

.library-nav-list .sub-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.library-nav-list .sub-menu .sub-menu {
    right: 100%; /* Ouvre a gauche pour les sous-sous-menus */
    left: auto;
    top: 0;
    margin-top: 0;
    margin-right: 4px;
    margin-left: 0;
}

@media (min-width: 901px) {
    .top-bar {
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .admin-bar .top-bar {
        top: 32px;
    }
}

.breadcrumb {
    padding: 0;
    font-size: 0.92rem;
    flex: 1;
    min-width: 0;
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb li + li::before {
    content: "\203A";
    color: rgba(255, 255, 255, 0.6);
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    font-weight: 600;
    color: #ffffff;
}

@media (min-width: 901px) {
    .breadcrumb {
        position: static;
    }

    .admin-bar .breadcrumb {
        top: auto;
    }
}

.container {
    flex: 1;
    width: 100%;
    padding: 22px 28px 40px;
}

.hero {
    border-radius: 22px;
    padding: 26px;
    background: linear-gradient(135deg, #f3f9fb 0%, #dff5e8 100%);
    box-shadow: var(--elh-shadow);
    margin-bottom: 30px;
}

.hero h1 {
    margin-top: 0;
    font-family: "Merriweather", Georgia, serif;
    line-height: 1.2;
}

.section-title {
    margin: 0 0 14px;
    font-family: "Merriweather", Georgia, serif;
    font-size: 1.45rem;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card {
    background: var(--elh-card);
    border: 1px solid var(--elh-border);
    border-radius: var(--elh-radius);
    box-shadow: var(--elh-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-media {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #dff5e8, #f3f9fb);
}

.card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 14px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    line-height: 1.3;
}

.meta {
    color: var(--elh-muted);
    font-size: 0.92rem;
}

.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--elh-border);
    background: var(--elh-card);
    box-shadow: var(--elh-shadow);
}

.carousel-track {
    display: flex;
    transition: transform 0.45s ease;
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
}

.carousel-slide .card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.carousel-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    pointer-events: none;
}

.carousel-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(31, 36, 48, 0.45);
    color: #fff;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(2px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-btn:hover {
    background: rgba(31, 36, 48, 0.75);
    transform: scale(1.05);
}

@media (min-width: 901px) {
    .carousel-slide .card {
        flex-direction: row;
    }

    .carousel-slide .card-media {
        flex: 0 0 42%;
        aspect-ratio: auto;
        min-height: 240px;
    }

    .carousel-slide .card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px 26px;
    }
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 18px;
    background: var(--elh-bg-soft);
    border: 1px solid var(--elh-border);
    border-radius: var(--elh-radius);
    padding: 12px;
}

.filter-bar input,
.filter-bar select,
.filter-bar button {
    width: 100%;
    border: 1px solid var(--elh-border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}

.filter-bar button {
    background: var(--elh-accent);
    color: #fff;
    border-color: var(--elh-accent);
    cursor: pointer;
}

.site-footer {
    border-top: 1px solid var(--elh-border);
    padding: 22px 20px 28px;
    color: var(--elh-muted);
}

.footer-wrap {
    width: 100%;
}

.site-signature {
    margin: 4px 0 0;
    font-family: "Merriweather", Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--elh-accent-2);
}

.notice-empty {
    padding: 18px;
    border-radius: var(--elh-radius);
    background: var(--elh-highlight);
    border: 1px dashed var(--elh-border);
}

.recording-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.recording-flag,
.recording-script {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--elh-border);
    background: var(--elh-card);
    color: var(--elh-accent-2);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recording-flag:hover,
.recording-script:hover {
    transform: translateY(-1px);
    box-shadow: var(--elh-shadow);
}

.recording-script svg {
    width: 19px;
    height: 19px;
}

@media (max-width: 900px) {
    .site-layout {
        flex-direction: column;
    }

    .site-sidebar {
        width: 100%;
        flex: none;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 30;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--elh-border);
    }

    .branding {
        flex-direction: row;
        text-align: left;
    }

    .branding-logo {
        height: 36px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        flex-basis: 100%;
    }

    .main-nav.is-open {
        display: block;
    }

    .container {
        padding: 18px 16px 32px;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 8px 16px;
    }

    .library-nav-list {
        justify-content: center;
    }

    .library-nav-list .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--elh-border);
        margin-top: 4px;
        margin-left: 12px;
        padding: 0 0 0 12px;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    .admin-bar .site-sidebar {
        top: 46px;
        height: auto;
    }
}
