/* La communauté reprend les couleurs, boutons et cartes du site. */
.profile-access {
  border: 0;
  cursor: pointer;
}
.community-local-note {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 26px;
}
.community-local-note .status-dot {
  flex: 0 0 7px;
}
.community-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
.community-toolbar h2 {
  font-size: 21px;
}
.community-toolbar-actions,
.community-action-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.community-sort {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}
.community-sort select {
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 30px 9px 12px;
  color: var(--text);
  font: inherit;
}
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
  align-items: start;
}
.community-post {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.community-photo-button {
  width: 100%;
  display: block;
  position: relative;
  border: 0;
  padding: 0;
  background: var(--sage-soft);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: zoom-in;
}
.community-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 180ms ease;
}
@media (hover: hover) {
  .community-photo-button:hover .community-photo {
    transform: scale(1.025);
  }
}
.community-honor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 9px;
  background: #fffefa;
  color: #566232;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 10px #0001;
}
.community-honor .icon {
  width: 14px;
  height: 14px;
}
.community-post-body {
  padding: 16px;
}
.community-post-author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
}
.community-post-author strong {
  overflow-wrap: anywhere;
}
.community-post-author time {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
}
.community-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-dark);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}
.community-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.community-recipe-link {
  display: block;
  padding: 0;
  margin: 14px 0 8px;
  border: 0;
  text-align: left;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.community-recipe-link:hover {
  color: var(--sage-dark);
  text-decoration: underline;
}
.community-caption {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 12px;
}
.community-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.community-like {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 66px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.community-like[aria-pressed="true"] {
  color: #a64055;
  border-color: #d69baa;
  background: #fcf0f3;
}
.community-like[aria-pressed="true"] .icon {
  fill: #a64055;
}
.community-post-options {
  position: relative;
}
.community-post-options summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  list-style: none;
}
.community-post-options summary::-webkit-details-marker {
  display: none;
}
.community-post-options[open] summary {
  background: var(--sage-soft);
}
.community-post-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
}
.community-post-menu button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: right;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.community-post-menu button:hover {
  color: var(--warning);
}
.community-empty {
  grid-column: 1 / -1;
  padding: 48px 20px 58px;
  text-align: center;
  border-block: 1px dashed var(--line);
}
.community-empty > .icon {
  width: 30px;
  height: 30px;
  color: var(--sage);
  margin-bottom: 14px;
}
.community-empty h2,
.community-empty h3 {
  font-size: 21px;
  margin: 0 0 10px;
}
.community-empty p {
  max-width: 420px;
  margin: 0 auto 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}
.community-more {
  display: flex;
  margin: 28px auto 0;
}
.community-more[hidden],
.community-unread[hidden],
.community-form [hidden],
.community-upload-preview[hidden] {
  display: none !important;
}
.community-unread {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50%;
  background: var(--sage-dark);
  color: white;
  font-size: 11px;
}
.community-profile {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding: 10px 0 28px;
}
.community-profile .community-avatar {
  flex-basis: 80px;
  width: 80px;
  height: 80px;
  font-size: 27px;
}
.community-profile-name h2 {
  font-size: 23px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.community-profile-name p {
  font-size: 13px;
  color: var(--muted);
}
.community-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-left: auto;
}
.community-profile-stats div {
  display: grid;
  gap: 4px;
  max-width: 185px;
}
.community-profile-stats strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}
.community-profile-stats span {
  font-size: 12px;
  color: var(--muted);
}
.community-month {
  padding: 16px 0 32px;
}
.community-month > h3 {
  margin: 0 0 18px;
  font-size: 15px;
  text-transform: capitalize;
}
.community-moderation {
  border-top: 1px solid var(--line);
  margin-top: 42px;
  padding-top: 18px;
}
.community-moderation > summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  min-height: 34px;
}
.community-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 12px 0 20px;
}
.community-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--sage-dark);
}
.moderation-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.moderation-entry img {
  width: 68px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
}
.moderation-entry p {
  color: var(--muted);
  margin-top: 5px;
  max-width: 420px;
  overflow-wrap: anywhere;
}
.moderation-entry .community-action-buttons {
  margin-left: auto;
  gap: 12px;
}
.recipe-community {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.recipe-community .section-heading {
  flex-wrap: wrap;
  gap: 10px;
}
.community-recipe-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.community-recipe-grid .community-post {
  border: 0;
}
.community-recipe-grid .community-photo-button {
  border-radius: 8px;
}
.community-recipe-grid .community-post-body {
  padding: 12px 0;
}
.community-recipe-grid .community-empty {
  padding: 24px 12px;
  border: 0;
  text-align: left;
}
.community-recipe-grid .community-empty p {
  margin: 0;
  max-width: none;
}
.cooked-button {
  margin: 8px 0 18px;
}
.community-dialog {
  overscroll-behavior: contain;
  width: min(560px, calc(100% - 32px));
  max-height: min(90dvh, 900px);
  margin: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 20px 70px #10241c33;
  overflow-y: auto;
}
.community-dialog::backdrop {
  background: #172b2166;
  backdrop-filter: blur(3px);
}
.community-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.community-dialog-heading h2 {
  font-size: 23px;
  line-height: 1.25;
}
.community-dialog-heading .eyebrow {
  font-size: 10px;
  margin-bottom: 9px;
}
.community-dialog-heading .icon-button {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}
.community-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.community-form .community-dialog-heading {
  margin-bottom: 0;
}
.community-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.community-form input:not([type="file"]),
.community-form select,
.community-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #bcc8be;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  font-size: 16px;
}
.community-form textarea {
  resize: vertical;
  min-height: 94px;
}
.community-form input[type="file"] {
  max-width: 100%;
  font: inherit;
  font-size: 13px;
}
.community-form .field-optional {
  font-weight: 400;
  color: var(--muted);
}
.community-upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.community-upload-actions button {
  min-height: 48px;
  padding-inline: 10px;
  font-size: 13px;
}
.community-form .note {
  margin: 0;
  line-height: 1.65;
}
.community-upload-preview {
  margin: 0;
}
.community-upload-preview img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
  border-radius: 6px;
  background: #f0f3ee;
}
.community-upload-preview figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.community-error {
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}
.community-error:empty {
  display: none;
}
.community-action-buttons > button {
  min-height: 44px;
}
.community-notification {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
}
.community-notification time {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.community-notification button {
  margin-top: 6px;
}
.community-photo-dialog {
  width: min(820px, calc(100% - 32px));
}
.community-full-photo {
  display: block;
  width: 100%;
  max-height: 65dvh;
  object-fit: contain;
  background: #f0f3ee;
  border-radius: 6px;
}
.community-dialog :focus-visible,
.community-grid :focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 3px;
}
.community-dialog button:disabled,
.community-grid button:disabled {
  cursor: wait;
  opacity: 0.6;
}
@media (min-width: 701px) {
  .sidebar .main-nav {
    overflow-y: auto;
    max-height: calc(100dvh - 270px);
  }
}
@media (max-width: 1100px) {
  .community-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  body .main-nav {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    gap: 3px;
  }
  body .main-nav .nav-item {
    flex: 0 0 66px;
    min-width: 66px;
    min-height: 52px;
  }
  .community-profile-stats {
    margin-left: 0;
    flex-basis: 100%;
  }
  .community-toolbar-actions {
    gap: 14px;
  }
}
@media (max-width: 480px) {
  #communityScreen .page-heading,
  #journalScreen .page-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  #communityScreen .page-heading > button,
  #journalScreen .page-heading > button {
    align-self: flex-start;
  }
  .community-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .community-dialog {
    padding: 22px 18px;
    max-height: 92dvh;
  }
  .community-dialog-heading h2 {
    font-size: 21px;
  }
  .community-profile {
    gap: 16px;
  }
  .community-profile .community-avatar {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }
  .community-toolbar {
    align-items: flex-start;
  }
  .community-toolbar > .primary-button {
    width: 100%;
  }
  .community-sort {
    width: 100%;
    justify-content: space-between;
  }
  .community-upload-actions {
    grid-template-columns: 1fr;
  }
  .community-empty {
    padding-inline: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .community-photo {
    transition: none;
  }
}
@media print {
  .recipe-community,
  .cooked-button,
  .community-dialog,
  #communityScreen,
  #journalScreen {
    display: none !important;
  }
}
