/* =========================================================================
   Barre du bas, commune à la Gazette et à la Chambre noire
   Accueil | + (déposer une photo, une vidéo, un mot) | Mur des tirages
   Deux habillages : papier (Gazette) et nuit (Chambre noire).
   Sur grand écran, elle flotte au centre, comme un bandeau de journal.
   ========================================================================= */
.app-bar {
    --bar-bg: #fbf9f8;
    --bar-line: #000;
    --bar-ink: rgba(0, 0, 0, .6);
    --bar-accent: #775a19;
    --add-bg: #000;
    --add-ink: #fbf9f8;
    --add-hover: #775a19;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    background: var(--bar-bg);
    border-top: 4px double var(--bar-line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
}

.app-bar--dark {
    --bar-bg: #141312;
    --bar-line: rgba(244, 239, 228, .35);
    --bar-ink: rgba(244, 239, 228, .6);
    --bar-accent: #e0a83c;
    --add-bg: #f4efe4;
    --add-ink: #0d0c0c;
    --add-hover: #d6402c;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .5);
}

.app-bar-inner {
    max-width: 28rem;
    margin: 0 auto;
    height: 62px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.app-tab {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--bar-ink);
    text-decoration: none;
    transition: color .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-tab .material-symbols-outlined {
    font-size: 26px;
}

/* Les majuscules et l'interlettrage restent sur le libellé : appliqués à
   l'icône, ils casseraient la ligature (on lirait "HOME" au lieu du dessin). */
.app-tab-label {
    font-family: "Libre Caslon Text", serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

/* Chambre noire : libellés plus légers, en Garamond */
.app-bar--dark .app-tab-label {
    font-family: "EB Garamond", serif;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: none;
}

.app-tab.is-active {
    color: var(--bar-accent);
}

@media (hover: hover) {
    .app-tab:hover {
        color: var(--bar-accent);
    }

    .app-add:hover .app-add-disc {
        background: var(--add-hover);
        color: #fff;
    }
}

.app-tab.is-active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

/* Le bouton central "Ajouter" (photo, vidéo ou mot) : un cachet rond qui
   déborde de la barre, avec son libellé dessous pour qu'on sache à quoi il sert. */
.app-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: -28px .75rem 0;
    padding: 0;
    background: none;
    border: 0;
    color: var(--bar-ink);
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.app-add .app-tab-label {
    color: var(--add-bg);
    letter-spacing: .14em;
    white-space: nowrap;
}

.app-bar--dark .app-add .app-tab-label {
    letter-spacing: .04em;
}

.app-add-disc {
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--add-bg);
    color: var(--add-ink);
    box-shadow: 0 0 0 4px var(--bar-bg), 0 0 0 5px var(--bar-line), 0 10px 22px rgba(0, 0, 0, .35);
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.app-add-disc .material-symbols-outlined {
    font-size: 30px;
}

.app-add:active .app-add-disc {
    transform: scale(.94);
}

/* Avant l'ouverture de la chambre noire (compte à rebours, voir
   assets/js/ouverture.js) : « Ajouter » est grisé ; le toucher dit
   seulement de patienter. */
html.cr-ferme .app-bar {
    --add-bg: #bdb8af;
    --add-ink: rgba(0, 0, 0, .42);
}

html.cr-ferme .app-bar--dark {
    --add-bg: #3a3633;
    --add-ink: rgba(244, 239, 228, .38);
}

html.cr-ferme .app-add .app-tab-label {
    color: var(--bar-ink);
    opacity: .55;
}

html.cr-ferme .app-add:hover .app-add-disc,
html.cr-ferme .app-add:active .app-add-disc {
    background: var(--add-bg);
    color: var(--add-ink);
    transform: none;
}

/* Place réservée en bas de page pour que la barre ne masque rien */
.has-app-bar {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
    .app-bar {
        left: 50%;
        right: auto;
        bottom: 20px;
        width: 380px;
        transform: translateX(-50%);
        border: 4px double var(--bar-line);
        padding-bottom: 0;
    }

    .has-app-bar {
        padding-bottom: 110px;
    }
}

/* =========================================================================
   Entre la Gazette et la Chambre noire : un simple fondu (navigateurs récents).
   ========================================================================= */
@view-transition {
    navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }
}
