/* RESPIRE Website — Styles */

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

/* Design Tokens */
:root {
    /* Brand Colors — Respire Charte graphique */
    /* principale */
    --respire-forest:     #355d4e;
    --respire-sage:       #a5c3bf;
    /* neutre */
    --respire-espresso:   #311b0f;
    --respire-cream:      #fcf5dd;
    /* secondaire */
    --respire-lavender:   #d8cfe8;
    --respire-terracotta: #cf6c2b;
    /* accent */
    --respire-lime:       #caff12;
    --white:             #ffffff;
    --black:             #000000;

    /* Typography */
    --font-title:      "roca", Georgia, serif;
    --font-body:       "dm-sans", sans-serif;
    --font-body-large: "dm-sans-18pt", sans-serif;

    /* Shape */
    --border-radius:    0.5rem;
    --border-radius-sm: 4px;

    /* Motion */
    --transition: all 0.3s ease;

    /* Shadows */
    --shadow:       0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);

    /* Semantic surfaces */
    --header-bg:      rgba(165, 195, 191, 0.95);
    --footer-bg:      rgba(0, 0, 0, 0.1);
    --nav-hover-bg:   rgba(255, 255, 255, 0.4);
    --nav-active-bg:  rgba(255, 255, 255, 0.3);

    /* Z-index scale */
    --z-sticky:  1020;
    --z-overlay: 9999;
}

/* ─── Base ──────────────────────────────────────────────── */

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
    height: -webkit-fill-available;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--black);
    background-color: var(--respire-sage);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
}

*:focus {
    outline: 2px solid var(--respire-forest);
    outline-offset: 2px;
}

/* ─── Accessibility ─────────────────────────────────────── */

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--respire-forest);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    z-index: var(--z-overlay);
    border-radius: var(--border-radius-sm);
}

.skip-link:focus {
    top: 6px;
    padding: 8px 16px;
    font-weight: 600;
}

/* ─── Layout ─────────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── Header ─────────────────────────────────────────────── */

header {
    background-color: var(--header-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* ─── Navigation ─────────────────────────────────────────── */

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--black);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    z-index: 1;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover,
.nav-link:focus {
    background-color: var(--nav-hover-bg);
    color: var(--respire-forest);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-link.active,
.nav-link[aria-current="page"] {
    background-color: var(--nav-active-bg);
    color: var(--respire-forest);
    font-weight: 700;
}

/* ─── Logo ───────────────────────────────────────────────── */

.logo-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
}

.site-logo {
    height: 160px;
    width: auto;
    display: block;
    transition: var(--transition);
}

.site-logo:hover {
    transform: scale(1.03);
}

/* ─── Main Content ───────────────────────────────────────── */

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    width: 100%;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    max-width: 1000px;
    width: 100%;
    font-family: var(--font-body);
}

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

#home-title {
    font-size: 34px;
    font-weight: 400;
    margin: 2rem 0 3rem;
    color: var(--black);
    line-height: 1.2;
    text-align: center;
}

.construction-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--black);
}

.construction-text p {
    margin-bottom: 0.5rem;
}

.construction-text strong {
    font-weight: 600;
}

/* ─── Inline Navigation Links ────────────────────────────── */

.contact-link,
.adoe-link,
.pub-link {
    color: var(--black);
    text-decoration: underline;
    font-weight: 600;
    transition: var(--transition);
}

.contact-link:hover,
.contact-link:focus,
.adoe-link:hover,
.adoe-link:focus,
.pub-link:hover,
.pub-link:focus {
    color: var(--respire-forest);
    text-decoration-thickness: 2px;
}

/* ─── Right Column ───────────────────────────────────────── */

.right-column {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--black);
    text-align: left;
}

.right-column p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* ─── Section Management ─────────────────────────────────── */

.section {
    display: none;
    width: 100%;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* ─── ADOES / Publications Sections ─────────────────────── */

.adoe-section {
    background-color: var(--respire-sage);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding: 2rem 0;
    width: 100%;
}

.adoe-content {
    background-color: var(--white);
    opacity: 0.9;
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.adoe-content h2 {
    font-size: 2.5rem;
    color: var(--black);
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.2;
}

.adoe-content h3 {
    font-size: 1.2rem;
    color: var(--respire-forest);
    margin: 2rem 0 1rem;
    font-weight: 600;
}

.adoe-content p {
    font-size: 1rem;
    color: var(--black);
    margin-bottom: 1rem;
    text-align: left;
    line-height: 1.4;
}

.adoe-content a {
    color: var(--respire-espresso);
    text-decoration: underline;
    font-weight: 600;
}

.adoe-content ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.adoe-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.adoe-content ul li::before {
    content: "•";
    color: var(--respire-forest);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* ─── Photo Gallery ──────────────────────────────────────── */

.photo-gallery {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    margin: 20px 0;
}

.photo-gallery-item {
    flex: 1 1 0;
    min-width: 0;
    height: 320px;
}

.photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: var(--border-radius);
    display: block;
}

/* ─── Back Button ────────────────────────────────────────── */

.button-container {
    text-align: center;
    margin-top: 2rem;
}

.back-button {
    display: inline-block;
    background-color: var(--respire-forest);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
    min-width: 120px;
    position: relative;
    z-index: 1;
}

.back-button:hover,
.back-button:focus {
    background-color: var(--respire-espresso);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.back-button:active {
    transform: translateY(0);
}

/* ─── Footer ─────────────────────────────────────────────── */

footer {
    background-color: var(--footer-bg);
    color: var(--black);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.9rem;
}

footer a {
    color: var(--black);
    text-decoration: underline;
    font-weight: 400;
}


/* ─── Social Media Icons ─────────────────────────────────── */

.social-links {
    display: grid;
    grid-template-columns: repeat(4, 44px);
    gap: 0.625rem;
    margin-top: 1.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.social-link svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: var(--black);
}

.social-link:hover,
.social-link:focus {
    opacity: 1;
}

/* ─── Animations ─────────────────────────────────────────── */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Focus Indicators ───────────────────────────────────── */

.nav-link:focus-visible,
.adoe-link:focus-visible,
.pub-link:focus-visible,
.contact-link:focus-visible,
.back-button:focus-visible {
    outline: 2px solid var(--respire-forest);
    outline-offset: 2px;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 575.98px) {
    .container               { padding: 0 15px; }
    .site-logo               { height: 100px; }
    #home-title              { font-size: 1.3rem; margin-bottom: 1.5rem; }
    .construction-text       { font-size: 1rem; }
    .adoe-content            { padding: 1.5rem; }
    .adoe-content h2         { font-size: 1.8rem; }
    .nav-list                { gap: 1rem; }
    .nav-link                { font-size: 1rem; padding: 0.5rem 1rem; }
    .photo-gallery-item      { min-width: 100%; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .site-logo       { height: 120px; }
    #home-title      { font-size: 1.5rem; }
    .adoe-content    { padding: 2rem; }
    .adoe-content h2 { font-size: 2rem; }
}

@media (max-width: 991.98px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .nav-list { flex-wrap: wrap; gap: 1rem; }
    main      { padding: 1.5rem 0; }
}

@media (min-width: 1200px) {
    .container       { max-width: 1140px; }
    .content-wrapper { max-width: 1100px; gap: 5rem; }
    .site-logo       { height: 200px; }
    #home-title      { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    header, footer, .nav-list { display: none; }
    body {
        background: white !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    .site-logo { height: 80px; }
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
    h1, h2, h3 { page-break-after: avoid; }
}
