/* ============================================================
   Public site layout
   ============================================================ */

/* ---- Reset & base ---- */
.public-page {
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* ============================================================
   Header
   ============================================================ */
.public-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

body.public-page {
    padding-top: 96px;
}

.public-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 70px;
}

/* Logo */
.public-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.public-logo-img {
    max-height: 48px;
    width: auto;
}
.public-logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

/* Top nav */
.public-nav-menu {
    display: flex;
    align-items: center;
}
.public-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}
.public-nav-item {
    position: relative;
}
.public-nav-link {
    display: block;
    padding: 8px 14px;
    font-size: .93rem;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    border-radius: 4px;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.public-nav-link:hover,
.public-nav-link.active {
    color: var(--primary, #007bff);
    background: rgba(0,123,255,.07);
    text-decoration: none;
}

/* Login button */
.public-nav-login .public-nav-link.btn-login {
    background: var(--primary, #007bff);
    color: #fff;
    margin-left: 8px;
}
.public-nav-login .public-nav-link.btn-login:hover {
    background: var(--primary-dark, #0056b3);
    color: #fff;
}

/* Dropdown */
.public-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    list-style: none;
    padding: 6px 0;
    margin: 0;
    z-index: 999;
}
.public-nav-item.has-dropdown:hover .public-dropdown {
    display: block;
}
.public-dropdown li a {
    display: block;
    padding: 9px 18px;
    color: #444;
    font-size: .9rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.public-dropdown li a:hover,
.public-dropdown li a.active {
    background: #f4f7ff;
    color: var(--primary, #007bff);
    text-decoration: none;
}

/* Mobile toggle */
.public-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.public-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #444;
    border-radius: 2px;
    transition: transform .3s;
}

/* ============================================================
   Main content
   ============================================================ */
.public-main {
    min-height: calc(100vh - 70px - 180px);
}

.public-content-wrap {
    padding: 32px 24px;
    min-height: calc(100vh - 70px - 180px);
}

/* Breadcrumb */
.public-breadcrumb {
    margin-bottom: 20px;
}

/* ============================================================
   Hero
   ============================================================ */
.public-hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    text-align: center;
}
.public-hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 16px;
}
.public-hero-subtitle {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 28px;
}
.public-btn-primary {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary, #007bff);
    color: #fff;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}
.public-btn-primary:hover {
    background: var(--primary-dark, #0056b3);
    color: #fff;
    text-decoration: none;
}

.public-sections {
    padding: 48px 24px;
}

/* ============================================================
   Footer
   ============================================================ */
.public-footer {
    background: #1e2a3a;
    color: #ccc;
    padding-top: 48px;
}

.public-footer-top {
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

/* Footer brand */
.public-footer-brand {
    margin-bottom: 24px;
}
.public-footer-logo {
    display: inline-block;
    margin-bottom: 12px;
    text-decoration: none;
}
.public-footer-logo-img {
    max-height: 48px;
    filter: brightness(0) invert(1);
}
.public-footer-desc {
    font-size: .88rem;
    color: #aaa;
    line-height: 1.6;
}

/* Footer nav */
.public-footer-nav {
    padding-top: 8px;
}
.public-footer-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.public-footer-nav-link {
    color: #bbb;
    font-size: .9rem;
    text-decoration: none;
    transition: color .2s;
}
.public-footer-nav-link:hover,
.public-footer-nav-link.active {
    color: #fff;
    text-decoration: none;
}

/* Footer bottom bar */
.public-footer-bottom {
    padding: 16px 0;
    font-size: .82rem;
    color: #888;
}
.public-footer-bottom a {
    color: #aaa;
    text-decoration: none;
}
.public-footer-bottom a:hover {
    color: #fff;
}
.public-footer-credit {
    text-align: right;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991px) {
    /* Show burger */
    .public-nav-toggle {
        display: flex;
        order: 10;
    }

    /* Right group: keep inline, horizontal */
    .public-header-lang-login {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Hide desktop nav, show as overlay when open */
    .public-nav-menu {
        display: none;
        position: fixed;
        top: 96px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,.1);
        padding: 16px 20px;
        overflow-y: auto;
        z-index: 199;
        flex-direction: column;
        align-items: flex-start;
    }
    .public-nav-menu.is-open {
        display: flex;
    }
    .public-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        height: auto;
    }
    .public-nav-item {
        height: auto;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    .public-nav-link {
        height: auto;
        padding: 12px 8px;
        width: 100%;
        font-size: 15px;
    }
    .public-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 2px solid #37B3A3;
        border-radius: 0;
        padding: 4px 0 4px 12px;
        margin-left: 8px;
    }
    .public-nav-item.has-dropdown:hover .public-dropdown {
        display: none;
    }

    /* Login/user button — compact, not full width */
    .public-nav-login {
        height: auto;
        margin-left: 0;
        width: auto;
    }
    .public-user-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        min-width: 200px;
    }

    .public-footer-credit {
        text-align: left;
        margin-top: 8px;
    }
    .public-hero-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    /* Hide login text, show only icon */
    .btn-login span,
    .public-user-name {
        display: none;
    }
}

/* ============================================================
   Publication card — stack on mobile
   ============================================================ */
@media (max-width: 767px) {
    .ph-pub-card > .row {
        display: flex;
        flex-direction: column;
    }
    .ph-pub-card > .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    .ph-pub-card__cover {
        margin: 16px 16px 0;
        height: 200px;
        padding: 0;
    }
    .ph-pub-card__body {
        padding: 16px;
    }
}

/* ============================================================
   Language switcher
   ============================================================ */
.public-lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    color: #444;
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s, color .2s;
}
.public-lang-btn:hover,
.public-nav-lang:has(#publicLangDropdown.is-open) .public-lang-btn {
    background: rgba(0,123,255,.07);
    color: var(--primary, #007bff);
}
.lang-globe {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.lang-current {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
}
.lang-caret {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    transition: transform .2s;
}
#publicLangDropdown.is-open ~ * .lang-caret,
.public-lang-btn[aria-expanded="true"] .lang-caret {
    transform: rotate(180deg);
}
.public-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 130px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    list-style: none;
    padding: 6px 0;
    margin: 0;
    z-index: 1010;
}
.public-lang-dropdown.is-open {
    display: block;
}
.public-lang-dropdown li a {
    display: block;
    padding: 9px 16px;
    color: #444;
    font-size: .9rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.public-lang-dropdown li a:hover {
    background: #f4f7ff;
    color: var(--primary, #007bff);
    text-decoration: none;
}
.public-lang-dropdown li a.active {
    color: var(--primary, #007bff);
    font-weight: 600;
}

/* Bootstrap 4 utility manquante en Bootstrap 3 */
.d-none { display: none !important; }
