/* ============================
   Fichier : pages.css
   Description : pages secondaires (contact, blog, article).
   Les composants viennent du kit Roar Cosmos ; ce fichier ne gère que la mise en page.
   ============================ */

/* ============================================ */
/* HERO DES PAGES                               */
/* ============================================ */

.page-hero {
    padding-block: calc(72px + var(--header-h)) 104px;
}

.page-hero .rc-title--hero {
    margin-bottom: var(--space-5);
}

.page-hero__dino {
    display: block;
    width: 100%;
    height: auto;
    animation: pageDinoFloat 6s ease-in-out infinite;
}

@keyframes pageDinoFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-14px) rotate(2deg); }
}

/* ============================================ */
/* CONTACT                                      */
/* ============================================ */

.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: var(--space-7);
    align-items: start;
}

.contact__card {
    padding: var(--space-6);
}

.contact__submit {
    justify-self: start;
}

.contact__submit:disabled {
    opacity: 0.7;
    cursor: progress;
}

/* Piège à robots : hors écran, jamais visible */
.contact__honey {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.contact__error {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    background: #FBEAE8;
    color: #8C1D18;
    font-size: 14px;
}

.contact__error a {
    color: inherit;
    font-weight: 600;
}

.contact__success {
    display: grid;
    justify-items: start;
    gap: var(--space-3);
    outline: none;
}

.contact__success[hidden] {
    display: none;
}

.contact__success-dino {
    width: auto;
    height: 72px;
}

.contact__success .rc-title {
    margin: 0;
}

.contact__success p {
    margin: 0 0 var(--space-2);
    color: var(--text-muted);
}

.contact__aside {
    position: relative;
    padding-top: var(--space-4);
}

.contact__aside-title {
    margin: 0 0 var(--space-5);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-accent);
}

.contact__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-5);
}

.contact__list li {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.contact__list b {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
}

.contact__list a,
.contact__list li > span > span {
    color: var(--text-muted);
    font-size: 15px;
    word-break: break-word;
}

.contact__list a:hover {
    color: var(--text-accent);
}

/* Ornement orbite, améthyste sur la lune, sous la liste (jamais derrière du texte) */
.contact__orbit {
    display: block;
    width: 88px;
    height: 88px;
    margin-top: var(--space-7);
    color: var(--amethyste);
    opacity: 0.6;
}

/* ============================================ */
/* ARTICLE                                      */
/* ============================================ */

.article-hero {
    padding-bottom: var(--space-7);
}

.article-hero .rc-wrap {
    max-width: 1100px;
}

.article-hero__back {
    margin-bottom: var(--space-5);
    color: var(--lavande);
}

.article-hero__title {
    margin: 0;
    font-size: clamp(30px, 4.6vw, 48px);
    line-height: 1.12;
}

.article {
    max-width: 760px;
}

/* Article avec carrousel : slides à gauche, texte à droite */
.article--split {
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
    gap: var(--space-7);
    align-items: start;
    max-width: none;
}

/* overflow: clip (et non hidden) pour que le carrousel puisse rester fixe au scroll */
.article-section {
    overflow: clip;
}

.article__media {
    position: sticky;
    top: var(--space-5);
}

.article--split .slides {
    max-width: none;
    margin: 0;
}

.article__content {
    min-width: 0;
    max-width: 62ch;
}

.article__cover {
    margin: 0 0 var(--space-6);
}

.article__cover img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--brume);
}

.article__text p {
    margin: 0 0 var(--space-4);
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
}

.article__text a {
    color: var(--text-accent);
    word-break: break-word;
}

.article__hashtag {
    font-weight: 500;
    text-decoration: none;
}

.article__foot {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
}

/* ============================================ */
/* MOUVEMENT RÉDUIT & RESPONSIVE                */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
    .page-hero__dino {
        animation: none;
    }
}

@media (max-width: 900px) {
    .contact__grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .contact__orbit {
        display: none;
    }
}

@media (max-width: 760px) {
    .page-hero {
        padding-block: calc(40px + var(--header-h)) 72px;
    }

    .contact__card {
        padding: var(--space-5);
    }
}

/* ── Carrousel LinkedIn dans un article ── */
.slides {
    max-width: 560px;
    margin: 0 auto var(--space-6);
}

.slides__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: var(--radius-md);
    background: var(--brume);
}

.slides__track::-webkit-scrollbar {
    display: none;
}

.slides__track:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
}

.slides__item {
    flex: 0 0 100%;
    margin: 0;
    scroll-snap-align: center;
}

.slides__item img {
    display: block;
    width: 100%;
    height: auto;
}

.slides__nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
}

.slides__item img {
    cursor: zoom-in;
}

/* Bouton « déplier », poussé à droite des flèches */
.slides__expand {
    margin-left: auto;
}

.slides__nav:has(.slides__expand) {
    justify-content: flex-start;
}

.slides__nav .rc-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.slides__count {
    min-width: 5ch;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Mise en forme des articles longs (site = source) ── */
.article__text h2 {
    margin: var(--space-6) 0 var(--space-3);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    line-height: 1.25;
    color: var(--text);
}

.article__text ul {
    margin: 0 0 var(--space-4);
    padding-left: 22px;
    font-size: 17px;
    line-height: 1.75;
}

.article__text li::marker {
    color: var(--text-accent);
}

/* ── Carrousel déplié (plein écran) ── */
.slides-viewer {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 64px 80px;
    border: 0;
    background: rgba(23, 21, 58, 0.96);
    color: var(--lune);
}

.slides-viewer[open] {
    display: grid;
    place-items: center;
}

.slides-viewer::backdrop {
    background: transparent;
}

.slides-viewer__img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 128px);
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
}

.slides-viewer .rc-icon-btn {
    position: absolute;
    color: var(--lune);
    box-shadow: inset 0 0 0 1.5px var(--border);
}

.slides-viewer .rc-icon-btn:hover {
    background: rgba(200, 182, 236, 0.16);
}

.slides-viewer .rc-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.slides-viewer__close { top: 16px; right: 16px; }
.slides-viewer__prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.slides-viewer__next  { right: 16px; top: 50%; transform: translateY(-50%); }

.slides-viewer__count {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--lavande);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .article--split {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .article__media {
        position: static;
        max-width: 480px;
    }
}

@media (max-width: 600px) {
    .slides-viewer {
        padding: 64px 16px 72px;
    }

    .slides-viewer__prev,
    .slides-viewer__next {
        top: auto;
        bottom: 10px;
        transform: none;
    }
}
