/**
 * Art Mots Sphère — Mise en page mobile (≤1024px, grands téléphones inclus)
 * Chargée sur téléphones et petites tablettes via media dans layout.
 *
 * ——— Référence breakpoints (CSS + JS amsBreakpoints + MobilePerf) ———
 *
 * | Seuil   | Constante / token              | Rôle |
 * |---------|--------------------------------|------|
 * | 1024px  | LAYOUT_PX / MOBILE             | Layout shell : dock, grilles empilées, mode conversation, padding site-main |
 * | 768px   | TABLET_MIN_PX                  | Tablette portrait : nav header sans dock (768–1024) |
 * | 767px   | PHONE                          | Téléphone : menu hamburger + dock |
 * | 640px   | NARROW_PX / NARROW             | Télé étroit / touch dense : votes discussions, publish, lecteur mobile, particules allégées |
 * | 720px   | (zones admin, charte, eclats)  | Grilles ou formulaires denses — voir zones/*.css |
 * | 600px   | (forum, carte)                 | Layouts intermédiaires — voir zones/forum.css, zones/carte.css |
 *
 * Zones avec bloc @media (max-width: 1024px) dédié :
 *   feed, messages, collab, discussions, profile, home, publish, forum (partiel),
 *   eclats (720/640), onboarding, charte, odyssey, cocreators, expositions (mixte), search (shared.css).
 *
 * main-core.css : règles génériques ≤1024px ; exclure explicitement les layouts dédiés
 * (page-discussions-layout--*, discussions-communities-bar, page-profile .profile-tabs sticky).
 */

@media (max-width: 1024px) {
  :root {
    --gutter: clamp(0.65rem, 3.5vw, 1.15rem);
    --radius: clamp(12px, 3vw, 16px);
    --radius-sm: clamp(8px, 2vw, 10px);
    --text-fluid-sm: clamp(0.72rem, 2.5vw, 0.82rem);
    --text-fluid-base: clamp(0.9rem, 2.8vw, 1rem);
    --text-fluid-lg: clamp(1.05rem, 3.5vw, 1.2rem);
    /* Pile FAB mobile — chrome → player → publish → salon → forum « Haut » */
    --ams-fab-gap: 0.65rem;
    --ams-fab-stack-player: 0px;
    --ams-fab-stack-publish-bar: 0px;
    --ams-fab-stack-publish-float: 0px;
    --ams-fab-stack-lounge-layer: 0px;
  }

  body {
    --ams-fab-stack-bottom: calc(
      var(--mobile-bottom-chrome-h, calc(var(--mobile-dock-h) + var(--mobile-quick-bar-h, 3.35rem)))
      + env(safe-area-inset-bottom)
      + var(--ams-fab-stack-player)
      + var(--ams-fab-stack-publish-bar)
      + var(--ams-fab-stack-publish-float)
    );
  }

  body.has-global-player.global-player-active {
    --ams-fab-stack-player: 3.25rem;
  }

  body.has-publish-mobile-bar {
    --ams-fab-stack-publish-bar: var(--publish-mobile-bar-h, 4.25rem);
  }

  body.has-publish-mobile-bar.has-publish-float-visible {
    --ams-fab-stack-publish-float: var(
      --publish-float-cta-stack,
      calc(var(--ams-fab-gap) + var(--touch-min, 2.75rem))
    );
  }

  body:not(.site-lounge-collapsed):has(#siteLounge) {
    --ams-fab-stack-lounge-layer: calc(var(--site-lounge-launcher, 2.85rem) + var(--ams-fab-gap));
  }

  body {
    font-size: var(--text-fluid-base);
    overflow-x: hidden;
  }

  img,
  video,
  audio,
  iframe,
  embed,
  object,
  svg {
    max-width: 100%;
  }

  /* ——— Structure globale ——— */
  .site-main {
    max-width: 100%;
    padding-top: clamp(0.85rem, 3vw, 1.25rem);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    padding-bottom: calc(var(--mobile-bottom-chrome-h, calc(var(--mobile-dock-h) + var(--mobile-quick-bar-h, 3.35rem))) + 1.25rem + env(safe-area-inset-bottom));
    overflow-x: clip;
  }

  .has-global-player.global-player-active .site-main {
    padding-bottom: calc(var(--mobile-bottom-chrome-h, calc(var(--mobile-dock-h) + var(--mobile-quick-bar-h, 3.35rem))) + 6.5rem + env(safe-area-inset-bottom));
  }

  .site-footer {
    padding: 1.25rem var(--gutter) calc(var(--mobile-bottom-chrome-h, calc(var(--mobile-dock-h) + var(--mobile-quick-bar-h, 3.35rem))) + 0.85rem + env(safe-area-inset-bottom));
    font-size: var(--text-fluid-sm);
  }

  body.layout-auth .site-footer--auth {
    padding: 0.85rem var(--gutter) calc(0.85rem + env(safe-area-inset-bottom));
  }

  .has-global-player .site-footer {
    padding-bottom: calc(var(--mobile-bottom-chrome-h, calc(var(--mobile-dock-h) + var(--mobile-quick-bar-h, 3.35rem))) + 1.25rem + env(safe-area-inset-bottom));
  }

  .alert {
    max-width: none;
    margin-left: var(--gutter);
    margin-right: var(--gutter);
    font-size: var(--text-fluid-sm);
  }

  .empty-state {
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: var(--text-fluid-base);
    line-height: 1.55;
  }

  /* ——— En-têtes de page ——— */
  .page-header {
    margin-bottom: 1.25rem;
    text-align: center;
  }

  .page-header h1 {
    font-size: clamp(1.4rem, 6.5vw, 2rem);
    line-height: 1.2;
  }

  .feed-hero {
    padding: 1.15rem 1rem 1.25rem;
    text-align: center;
  }
  .feed-hero-inner {
    flex-direction: column;
    align-items: center;
  }
  .feed-hero-main {
    flex-basis: auto;
  }
  .feed-hero-eyebrow {
    margin-inline: auto;
  }
  .feed-hero-sub {
    margin-inline: auto;
  }
  .feed-hero-formats {
    justify-content: center;
  }
  .feed-hero-aside {
    align-items: center;
    width: 100%;
  }
  .feed-hero-cta {
    width: 100%;
    max-width: 18rem;
  }
  .feed-hero-cta-note {
    text-align: center;
    max-width: 18rem;
  }
  .feed-hero--messages .feed-hero-sub {
    max-width: none;
  }
  .feed-hero--messages .pm-header-badge {
    margin-top: 0.35rem;
  }

  .page-sub,
  .page-sub-actions {
    text-align: center;
    font-size: var(--text-fluid-sm);
  }

  .page-sub-actions .btn {
    width: 100%;
    max-width: 16rem;
  }

  .feed-section-title,
  .search-section-title {
    font-size: clamp(1rem, 4.2vw, 1.2rem);
    text-align: center;
    justify-content: center;
  }

  /* ——— Boutons & formulaires ——— */
  .btn {
    font-size: clamp(0.8rem, 2.6vw, 0.875rem);
    padding: 0.55rem clamp(0.85rem, 3vw, 1.1rem);
  }

  .btn-lg {
    width: 100%;
    max-width: 20rem;
    padding: 0.75rem 1.25rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: none;
  }

  .auth-form input,
  .auth-form textarea,
  .publish-form input,
  .publish-form textarea,
  .publish-form select,
  .comment-form textarea,
  .chat-input input,
  .collab-create-form input,
  .collab-join-form input,
  .search-page-input,
  .admin-search-input {
    font-size: 16px;
  }

  .auth-main {
    padding: 1.25rem var(--gutter);
    padding-top: max(1.25rem, env(safe-area-inset-top));
    justify-content: flex-start;
    min-height: 100dvh;
  }

  .auth-shell {
    gap: 1.25rem;
  }

  .site-public-proof--auth {
    margin-bottom: 1rem;
    padding: 0.9rem 0.95rem;
  }

  .site-public-proof-previews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }


  .site-public-proof--auth .site-public-proof-metric {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .site-public-intro-hero {
    margin-bottom: 1rem;
  }

  .site-public-intro-pledges {
    margin-bottom: 1rem;
  }

  .site-public-intro-pledge-title {
    font-size: 0.88rem;
  }

  .site-public-intro-pledge-text {
    font-size: 0.78rem;
  }

  .auth-feature-card-inner {
    padding: 0.95rem 1rem;
  }

  .auth-feature-title {
    font-size: 1.05rem;
  }

  .site-public-intro-footer {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
  }

  .auth-feature-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: none;
    margin: 0;
  }

  .auth-card,
  .auth-card.auth-gateway,
  .publish-card {
    max-width: 100%;
    width: 100%;
    padding: clamp(1.1rem, 4vw, 1.5rem);
  }

  .auth-card h1,
  .auth-gateway-panel h1 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    text-align: center;
  }

  .auth-gateway-tabs {
    gap: 0.35rem;
  }

  .publish-form label,
  .auth-form label {
    margin-bottom: 0.85rem;
  }

  .field-hint {
    font-size: var(--text-fluid-sm);
  }

  /* ——— Accueil ——— */
  .hero {
    min-height: 0;
    padding: 0.75rem 0 1.5rem;
    text-align: center;
  }

  .hero-visual {
    min-height: 220px;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }

  .hero-lead {
    font-size: var(--text-fluid-base);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .content-types .section-header {
    text-align: center;
    padding: 0 var(--gutter);
  }

  .content-types .section-header h2 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  @media (min-width: 768px) {
    .content-types .type-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: clamp(0.85rem, 1.5vw, 1.15rem);
      width: min(100%, 48rem);
      margin-left: auto;
      margin-right: auto;
    }
  }

  @media (max-width: 767px) {
    .content-types .type-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: clamp(0.65rem, 2.5vw, 0.85rem);
      width: min(100%, 28rem);
      margin-left: auto;
      margin-right: auto;
    }

    .type-card h3 {
      font-size: clamp(0.88rem, 3.5vw, 1.05rem);
    }

    .type-card p {
      font-size: clamp(0.72rem, 3vw, 0.82rem);
    }
  }

  .preview-grid {
    margin-top: 0.75rem;
  }

  .sphere-poem-input {
    font-size: 16px;
    max-height: min(40vh, 16rem);
  }

  .profile-grid .grid-thumb-wrap:has(.grid-snippet--overlay) .grid-post-manage--menu,
  .profile-grid .grid-thumb-wrap:has(.grid-snippet--overlay) .grid-post-manage--pin-only {
    bottom: 2.5rem;
    left: 0.12rem;
  }

  .profile-grid .grid-thumb-wrap:not(:has(.grid-snippet--overlay)) .grid-post-manage--menu,
  .profile-grid .grid-thumb-wrap:not(:has(.grid-snippet--overlay)) .grid-post-manage--pin-only {
    top: 0.15rem;
    right: 0.15rem;
  }

  .profile-grid .grid-post-manage-menu {
    min-width: 9.75rem;
  }

  /* ——— Publication / lecture ——— */
  .post-view {
    padding: clamp(0.85rem, 3vw, 1.15rem);
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
  }

  .post-view-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .post-view-title {
    font-size: clamp(1.3rem, 5.5vw, 1.85rem);
    line-height: 1.2;
  }

  .post-content {
    font-size: var(--text-fluid-base);
    overflow-wrap: anywhere;
  }

  .post-content img,
  .post-media img,
  .post-media video,
  .post-media .video-player,
  .post-media .audio-player {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
  }

  .post-media-zoom-hint {
    top: 0.5rem;
    right: 0.5rem;
    bottom: auto;
    padding: 0.4rem 0.7rem;
    font-size: 0.68rem;
  }

  .image-lightbox {
    padding: env(safe-area-inset-top) 0.35rem env(safe-area-inset-bottom);
  }

  .image-lightbox-img,
  .image-lightbox-video {
    max-height: min(88dvh, 88vh);
    border-radius: 0;
  }

  .image-lightbox-video {
    width: 100%;
  }

  .image-lightbox-close {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    min-height: 3rem;
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
    z-index: 10;
  }

  .image-lightbox-backdrop {
    touch-action: manipulation;
  }

  .post-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .post-actions-bar .btn,
  .post-audio-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .post-audio-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .comments-section h2 {
    font-size: clamp(1.15rem, 4.5vw, 1.35rem);
    text-align: center;
  }

  .comment-form textarea {
    min-height: 5rem;
  }

  .mention-autocomplete-list {
    max-height: min(14rem, 42vh);
    padding: 0.25rem;
  }

  .mention-autocomplete-option {
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem;
    touch-action: manipulation;
  }

  .mention-autocomplete-avatar {
    width: 2.25rem;
    height: 2.25rem;
  }

  .comment-item {
    gap: 0.5rem;
  }

  .comment-head {
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
  }

  .comment-reactions {
    width: 100%;
    padding: 0.35rem 0.4rem;
    gap: 0;
    margin-top: 0.5rem;
  }

  .comment-reactions-label {
    display: none;
  }

  .comment-reactions-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
    width: 100%;
    justify-content: stretch;
  }

  .comment-reaction-btn,
  .comment-reaction-pill {
    justify-content: center;
    width: 100%;
    min-height: var(--touch-min, 2.75rem);
    padding: 0.28rem 0.35rem;
    gap: 0.2rem;
    font-size: 0.7rem;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }

  .comment-reaction-btn:hover,
  .comment-reaction-btn:active {
    transform: none;
  }

  .comment-reaction-glyph {
    width: 1.45rem;
    height: 1.45rem;
  }

  .comment-reaction-glyph svg {
    width: 0.88rem;
    height: 0.88rem;
  }

  .comment-reaction-count {
    max-width: 1.5rem;
  }

  .comment-reactions--readonly .comment-reactions-group {
    grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr));
  }

  .chapter-reactions {
    padding: 0.65rem 0.75rem;
    margin-top: 0.85rem;
  }

  .chapter-reactions-lead {
    display: none;
  }

  .chapter-reactions-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
  }

  .chapter-reaction-btn,
  .chapter-reaction-pill {
    justify-content: center;
    width: 100%;
    min-height: var(--touch-min, 2.75rem);
    padding: 0.28rem 0.35rem;
    font-size: 0.7rem;
    -webkit-tap-highlight-color: transparent;
  }

  .chapter-reaction-btn:hover,
  .chapter-reaction-btn:active {
    transform: none;
  }

  .chapter-reaction-label {
    display: none;
  }

  .chapter-reaction-glyph {
    width: 1.25rem;
    height: 1.25rem;
  }

  .chapter-reactions--readonly .chapter-reactions-group {
    grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr));
  }

  /* ——— Profil ——— */
  .profile-hero,
  .feed-hero.profile-hero {
    margin-bottom: 1.25rem;
  }

  .profile-cover,
  .feed-hero--profile .profile-cover {
    height: clamp(120px, 32vw, 160px);
    border-radius: var(--radius-sm);
    margin-bottom: -44px;
  }

  .feed-hero--profile .profile-head,
  .profile-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 0.25rem;
  }

  .profile-intro {
    min-width: 0;
    width: 100%;
  }

  .profile-intro h1 {
    font-size: clamp(1.4rem, 6vw, 1.85rem);
  }

  .profile-bio {
    max-width: none;
    font-size: var(--text-fluid-sm);
  }

  .profile-actions {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .profile-actions .btn {
    flex: 1 1 auto;
    min-width: min(100%, 8.5rem);
  }

  .profile-stats {
    justify-content: center;
    gap: 1rem 1.5rem;
    font-size: var(--text-fluid-sm);
  }

  .profile-publish-roman {
    text-align: center;
  }

  .profile-edit-panel {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
  }

  .profile-edit-card {
    max-width: none;
    border-radius: var(--radius-sm);
    border-left: none;
    border-right: none;
  }

  .profile-edit-cover-preview {
    min-height: 100px;
  }

  .profile-edit-avatar-ring {
    width: 88px;
    height: 88px;
  }

  .profile-edit-avatar-wrap {
    margin-top: -2.25rem;
  }

  .profile-upload-zone-inner {
    padding: 0.65rem 0.9rem;
  }

  .profile-upload-title {
    font-size: 0.82rem;
  }

  .profile-edit-actions {
    flex-direction: column-reverse;
  }

  .profile-edit-actions .btn {
    width: 100%;
  }

  /* ——— Recherche ——— */
  .page-search-header .search-page-form,
  .feed-hero--search .search-page-form {
    max-width: 100%;
  }

  .search-page-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-page-input {
    width: 100%;
    min-width: 0;
  }

  .search-page-row .btn {
    width: 100%;
    min-height: var(--touch-min, 2.75rem);
  }

  .search-type-chips {
    margin-bottom: 1.25rem;
  }

  .search-section {
    margin-bottom: 1.75rem;
  }

  .search-user-card {
    padding: 0.65rem 0.85rem;
  }

  .search-tag-list {
    justify-content: center;
  }

  /* ——— Discussions & collab ——— */
  .reddit-layout,
  .collab-layout {
    gap: 1rem;
  }

  .sidebar-card {
    padding: 0.85rem;
  }

  .thread-card {
    padding: 0.85rem;
  }

  .thread-body h2 {
    font-size: var(--text-fluid-lg);
  }

  .thread-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .collab-workspace {
    padding: 0;
  }

  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .workspace-header h2 {
    font-size: clamp(1.2rem, 4.5vw, 1.45rem);
  }

  .workspace-panels {
    grid-template-columns: 1fr !important;
    min-width: 0;
  }

  body:not(.page-collab--workspace) .workspace-panels {
    min-height: auto;
  }

  .editor-panel textarea,
  #collabEditor {
    min-height: 220px;
    font-size: 16px;
  }

  body:not(.page-collab--workspace) .chat-panel {
    min-height: 220px;
    max-height: min(52vh, 420px);
    min-width: 0;
    overflow: hidden;
  }

  .page-collab .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .page-collab .chat-attachment--image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(280px, 62vw);
    object-fit: contain;
  }

  .page-collab .chat-attachment--file a {
    display: inline-flex;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .space-list .space-item {
    padding: 0.65rem 0.75rem;
  }

  /* ——— Romans ——— */
  .story-hero {
    grid-template-columns: 1fr;
    max-width: min(240px, 78vw);
    margin-left: auto;
    margin-right: auto;
    gap: 1rem;
    text-align: center;
  }

  .story-hero-cover {
    margin: 0 auto;
  }

  .story-hero-title {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  }

  .story-hero-synopsis {
    font-size: var(--text-fluid-sm);
  }

  .story-hero-stats,
  .story-hero-meta {
    justify-content: center;
    flex-wrap: wrap;
    font-size: var(--text-fluid-sm);
  }

  .story-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .story-hero-actions .btn {
    width: 100%;
  }

  .story-chapter-read {
    padding: 0 0.15rem;
    font-size: var(--text-fluid-base);
    line-height: 1.65;
  }

  .story-chapter-read h1 {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
    text-align: center;
  }

  .story-chapter-nav {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }

  .story-chapter-nav a {
    justify-self: center !important;
    width: 100%;
    max-width: 16rem;
  }

  .story-chapter-list {
    padding-left: 1.1rem;
    font-size: var(--text-fluid-sm);
  }

  .story-chapter-list a {
    padding: 0.35rem 0;
    display: inline-block;
  }

  /* ——— Admin ——— */
  .page-admin .page-header {
    text-align: left;
  }

  .admin-search-row {
    flex-direction: column;
  }

  .admin-search-row .btn {
    width: 100%;
  }

  .admin-post-card {
    flex-direction: column;
    padding: 0.85rem;
  }

  .admin-post-actions {
    width: 100%;
    flex-direction: column;
  }

  .admin-post-actions .btn {
    width: 100%;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .admin-user-banner {
    flex-direction: column;
    text-align: center;
  }

  .admin-report-actions {
    flex-direction: column;
  }

  .admin-report-actions .btn {
    width: 100%;
  }

  /* ——— Lecteur global ——— */
  .global-player {
    width: calc(100% - 2 * var(--gutter));
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius-sm);
  }

  .gp-title,
  .gp-artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ——— Divers ——— */
  .link-arrow {
    display: inline-block;
    margin-top: 0.35rem;
  }

  .tag-chip,
  .tag-chip-lg,
  a.tag-chip,
  button.tag-chip {
    font-size: clamp(0.72rem, 2.85vw, 0.84rem);
    padding: 0.3rem 0.58rem;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Cibles tactiles : sphère (44px) et listes dédiées — pas les rangées inline sous les posts */
  @media (pointer: coarse) {
    .post-tags .tag-chip {
      padding: 0.34rem 0.62rem;
    }
  }

  .tag-chip-lg {
    font-size: clamp(0.74rem, 2.9vw, 0.86rem);
    padding: 0.32rem 0.62rem;
  }

  a.tag-chip-sphere,
  .tag-chip-sphere {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min, 44px);
    min-height: var(--touch-min, 44px);
    width: var(--touch-min, 44px);
    height: var(--touch-min, 44px);
    padding: 0;
    font-size: 0.9rem;
    line-height: 1;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .post-tags {
    justify-content: center;
    gap: 0.35rem;
    align-items: center;
  }

  .post-tags .tag-chip-group {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
  }

  .grid-post .post-tags {
    padding-left: 0.28rem;
    padding-right: 0.28rem;
  }

  .report-form {
    padding: 0.85rem;
  }

  .report-form .btn {
    width: 100%;
  }

  /* Ambient allégé */
  .orb-1 {
    width: min(260px, 75vw);
    height: min(260px, 75vw);
  }

  .orb-2 {
    width: min(200px, 60vw);
    height: min(200px, 60vw);
  }

  .orb-3 {
    width: min(160px, 50vw);
    height: min(160px, 50vw);
  }

  /* ——— Dock mobile (6 onglets : 5 + Plus) ——— */
  :root {
    --mobile-dock-h: 3.85rem;
  }

  .mobile-bottom-chrome .mobile-dock.mobile-dock--five-plus {
    align-items: stretch;
  }

  .mobile-bottom-chrome .mobile-dock {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    min-height: var(--mobile-dock-h);
    gap: 0;
    padding-top: 0.06rem;
    padding-bottom: 0.06rem;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    box-sizing: border-box;
  }

  .mobile-dock .dock-link {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-height: 0;
    min-width: 0;
    font-size: clamp(0.58rem, 2.55vw, 0.66rem);
    padding: 0.12rem 0 0.08rem;
    letter-spacing: -0.01em;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    gap: 0.14rem;
  }

  .mobile-dock .dock-link:not(.dock-link--publish) .dock-icon {
    width: clamp(1.15rem, 4.35vw, 1.38rem);
    height: clamp(1.15rem, 4.35vw, 1.38rem);
  }

  .mobile-dock .dock-icon {
    width: clamp(1.15rem, 4.35vw, 1.38rem);
    height: clamp(1.15rem, 4.35vw, 1.38rem);
    margin: 0;
    flex: 0 0 auto;
    align-self: center;
  }

  .mobile-dock .dock-label {
    display: block;
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    font-size: inherit;
    font-weight: 550;
    line-height: 1.02;
    letter-spacing: inherit;
    text-align: center;
    align-self: stretch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dock .dock-link--publish {
    flex: 1.15 1 0;
    align-self: flex-end;
    margin-top: -0.5rem;
    padding-bottom: 0.08rem;
    gap: 0.1rem;
  }

  .mobile-dock .dock-link--publish .dock-icon--publish {
    width: clamp(2.05rem, 7.5vw, 2.28rem);
    height: clamp(2.05rem, 7.5vw, 2.28rem);
  }

  .mobile-dock .dock-link--publish .dock-publish-glow {
    width: clamp(2.05rem, 7.5vw, 2.28rem);
    height: clamp(2.05rem, 7.5vw, 2.28rem);
  }

  .mobile-dock .dock-link--publish .dock-label {
    font-size: clamp(0.58rem, 2.5vw, 0.66rem);
    font-weight: 650;
  }

  /* Libellés : Expo. un peu plus serré */
  .mobile-dock .dock-link[data-nav="expositions"] .dock-label {
    font-size: clamp(0.56rem, 2.45vw, 0.64rem);
    letter-spacing: -0.018em;
  }

  /* Bouton Plus — aligné sur les autres onglets du dock */
  .mobile-dock .dock-link--plus {
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-muted);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-dock .dock-link--plus.is-active {
    color: var(--accent-3);
    background: var(--mint-mist);
    border-radius: var(--radius-sm);
  }

  .mobile-dock .dock-link--plus .dock-icon--plus,
  .mobile-dock .dock-link[data-nav="plus"] .dock-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6 10a2 2 0 1 0-4 0 2 2 0 0 0 4 0zm8 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0zm-8 8a2 2 0 1 0-4 0 2 2 0 0 0 4 0zm8 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6 10a2 2 0 1 0-4 0 2 2 0 0 0 4 0zm8 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0zm-8 8a2 2 0 1 0-4 0 2 2 0 0 0 4 0zm8 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0z'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
  }

  .mobile-dock .dock-link--plus.is-active .dock-icon {
    opacity: 1;
  }

  /* ——— Tiroir Plus (toujours ici : mobile.css est chargé sur toutes les pages ≤1024px) ——— */
  .mobile-dock-plus {
    position: fixed;
    inset: 0;
    z-index: 130;
    pointer-events: none;
  }

  .mobile-dock-plus:not([hidden]) {
    pointer-events: auto;
  }

  body.mobile-dock-plus-open {
    overflow: hidden;
  }

  .mobile-dock-plus-backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: var(--ams-scrim-soft);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
  }

  .mobile-dock-plus-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-bottom-chrome-h, calc(var(--mobile-dock-h) + var(--mobile-toolbar-h))) + env(safe-area-inset-bottom));
    width: 100%;
    max-height: min(62dvh, 24rem);
    padding: 0.55rem 1rem 1rem;
    border-radius: 1.35rem 1.35rem 0 0;
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-bottom: none;
    box-shadow:
      var(--shadow),
      inset 0 1px 0 var(--ams-border-highlight);
    box-sizing: border-box;
    overflow: auto;
    animation: mobile-dock-plus-in 0.24s var(--ease, ease-out);
  }

  @keyframes mobile-dock-plus-in {
    from {
      opacity: 0;
      transform: translateY(1rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .mobile-dock-plus-handle {
    width: 2.5rem;
    height: 0.28rem;
    margin: 0 auto 0.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 38%, transparent);
  }

  .mobile-dock-plus-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    text-align: center;
  }

  .mobile-dock-plus-lead {
    margin: 0.25rem 0 0.85rem;
    font-size: 0.74rem;
    line-height: 1.4;
    text-align: center;
    color: var(--text-muted);
  }

  .mobile-dock-plus-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.15rem 0 0.75rem;
  }

  .mobile-dock-plus-shortcut {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    padding: 0.72rem 0.85rem;
    border: 1px solid color-mix(in srgb, var(--accent-3) 35%, var(--border));
    border-radius: var(--radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--mint-mist) 85%, var(--bg-elevated)), var(--bg-elevated));
    color: var(--text);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition:
      background 0.15s ease,
      border-color 0.15s ease,
      transform 0.15s ease;
  }

  .mobile-dock-plus-shortcut:active {
    transform: scale(0.99);
  }

  .mobile-dock-plus-shortcut-label {
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  .mobile-dock-plus-shortcut-hint {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-muted);
  }

  .mobile-dock-plus-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .mobile-dock-plus-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.55rem;
    min-height: 5.25rem;
    padding: 0.8rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    background: var(--ams-hover-surface);
    border: 1px solid var(--border);
    transition:
      background 0.15s ease,
      border-color 0.15s ease,
      transform 0.15s ease;
  }

  .mobile-dock-plus-link:active {
    transform: scale(0.98);
  }

  .mobile-dock-plus-link:hover,
  .mobile-dock-plus-link:focus-visible {
    background: var(--mint-mist);
    border-color: color-mix(in srgb, var(--accent-3) 32%, var(--border));
    outline: none;
  }

  .mobile-dock-plus-link.is-active {
    background: color-mix(in srgb, var(--mint-mist) 72%, var(--bg-elevated));
    border-color: color-mix(in srgb, var(--accent-3) 42%, var(--border));
    color: var(--accent-3);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-3) 18%, transparent);
  }

  .mobile-dock-plus-link .dock-icon {
    position: relative;
    z-index: 0;
    display: block;
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    opacity: 1;
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
  }

  .mobile-dock-plus-link .dock-icon::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -0.48rem;
    border-radius: 0.72rem;
    background: var(--ams-hover-surface);
  }

  .mobile-dock-plus-link[data-nav="forum"] .dock-icon {
    background-color: var(--accent-3);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-9l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm2 5h12v1.5H6V9zm0 2.5h12V13H6v-1.5zm0 2.5h8V15H6v-1.5z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-9l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm2 5h12v1.5H6V9zm0 2.5h12V13H6v-1.5zm0 2.5h8V15H6v-1.5z'/%3E%3C/svg%3E");
  }

  .mobile-dock-plus-link[data-nav="forum"] .dock-icon::before {
    background: var(--mint-mist);
  }

  .mobile-dock-plus-link[data-nav="collab"] .dock-icon {
    background-color: var(--accent);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M16 11c1.66 0 3-1.34 3-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 3-1.34 3-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M16 11c1.66 0 3-1.34 3-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 3-1.34 3-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
  }

  .mobile-dock-plus-link[data-nav="collab"] .dock-icon::before {
    background: var(--violet-mist);
  }

  .mobile-dock-plus-link[data-nav="romans"] .dock-icon {
    background-color: var(--gold);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 4h9l7 7v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm8 1.4L18.6 12H13V5.4z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 4h9l7 7v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm8 1.4L18.6 12H13V5.4z'/%3E%3C/svg%3E");
  }

  .mobile-dock-plus-link[data-nav="romans"] .dock-icon::before {
    background: color-mix(in srgb, var(--gold) 22%, transparent);
  }

  .mobile-dock-plus-link[data-nav="discussions"] .dock-icon {
    background-color: var(--accent-2);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 4a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7zm-6.5 9A3.5 3.5 0 1 0 12 20a3.5 3.5 0 0 0-6.5-7zm13 0A3.5 3.5 0 1 1 12 20a3.5 3.5 0 0 1 6.5-7z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 4a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7zm-6.5 9A3.5 3.5 0 1 0 12 20a3.5 3.5 0 0 0-6.5-7zm13 0A3.5 3.5 0 1 1 12 20a3.5 3.5 0 0 1 6.5-7z'/%3E%3C/svg%3E");
  }

  .mobile-dock-plus-link[data-nav="discussions"] .dock-icon::before {
    background: var(--rose-mist);
  }

  .mobile-dock-plus-link-copy {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
    width: 100%;
  }

  .mobile-dock-plus-link-label {
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  .mobile-dock-plus-link-hint {
    font-size: 0.66rem;
    line-height: 1.35;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-dock-plus-link.is-active .mobile-dock-plus-link-hint {
    color: color-mix(in srgb, var(--accent-3) 72%, var(--text-muted));
  }

  .mobile-dock-plus-close {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-dock-plus-sheet {
      animation: none;
      transform: none;
      opacity: 1;
    }
  }

  @media (hover: none) and (pointer: coarse) {
    .mobile-dock .dock-link {
      min-height: 0;
      min-width: 0;
    }
  }
}

/* ——— Shell tablette (768–1024px) : navigation header, pas de dock ——— */
@media (min-width: 768px) and (max-width: 1024px) {
  .btn-menu {
    display: none !important;
  }

  .header-search-wrap--desktop {
    display: block;
  }

  .site-header {
    flex-wrap: nowrap;
    gap: 0.45rem;
  }

  .brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  .main-nav {
    display: flex !important;
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    gap: 0.04rem;
  }

  .main-nav-search,
  .main-nav-mobile-actions {
    display: none !important;
  }

  .main-nav .nav-link {
    width: auto;
    min-height: 0;
    padding: 0.38rem 0.42rem;
    font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  }

  .header-actions .header-user {
    display: inline-flex;
  }

  .header-actions .header-user span {
    display: none;
  }

  .header-actions .btn-admin,
  .header-actions .btn-logout-header {
    display: inline-flex !important;
  }

  .header-actions .btn-publish {
    display: inline-flex !important;
  }

  .mobile-bottom-chrome .mobile-dock {
    display: none !important;
  }

  .mobile-bottom-chrome:not(:has(.mobile-toolbar)) {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --gutter: clamp(0.55rem, 4vw, 0.85rem);
    --mobile-dock-h: 3.5rem;
  }

  .mobile-dock .dock-link {
    font-size: clamp(0.56rem, 2.4vw, 0.62rem);
    padding: 0.1rem 0 0.06rem;
    gap: 0.12rem;
  }

  .mobile-dock .dock-link:not(.dock-link--publish) .dock-icon,
  .mobile-dock .dock-icon {
    width: clamp(1.08rem, 4.1vw, 1.28rem);
    height: clamp(1.08rem, 4.1vw, 1.28rem);
  }

  .mobile-dock .dock-link--publish .dock-icon--publish {
    width: clamp(1.95rem, 7vw, 2.18rem);
    height: clamp(1.95rem, 7vw, 2.18rem);
  }

  .mobile-dock .dock-link--publish .dock-publish-glow {
    width: clamp(1.95rem, 7vw, 2.18rem);
    height: clamp(1.95rem, 7vw, 2.18rem);
  }

  .mobile-dock .dock-link[data-nav="expositions"] .dock-label {
    font-size: clamp(0.54rem, 2.25vw, 0.6rem);
  }

  .hero-visual {
    min-height: 240px;
  }

  .content-types .type-grid {
    gap: 0.5rem;
    width: min(100%, 100%);
  }

  .type-card {
    padding: 0.75rem 0.55rem;
  }
}
