/* Additions to the design system for things the static prototypes did not need. */

/* Log out is a form post: make its button sit in the dropdown like the links do. */
.logout-form { display: contents; }
button.dropdown__item { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.dropdown__item:hover { background: var(--paper-deep); }

/* Visitor header: Log in / Sign up in place of the user menu. */
.app-header__guest { display: flex; align-items: center; gap: var(--space-2); }
@media (max-width: 899px) { .app-header__guest .btn { min-height: 40px; padding-inline: var(--space-3); } }

/* Stand-alone notice pages (errors, unsubscribe confirmation). */
.notice { max-width: 560px; margin: var(--space-12) auto; }
.notice .row { margin-top: var(--space-5); }

/* Longer account confirmation must stay scrollable in short and mobile viewports. */
.account-deletion-dialog { max-height: 100%; overflow-y: auto; }

/* The only screen of an installation without a town: the empty state, centred like a notice. */
.no-town { max-width: 640px; margin: var(--space-12) auto; }

/* Necessary-cookie names use the same typeface as the surrounding notice. */
code { font-family: var(--font-body); font-size: inherit; }

/* Wrap links as complete labels, without separators stranded at line ends. */
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.notice-links { display: inline-flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.site-footer__legal a { color: inherit; }

/* The deletion card has one action, aligned with the other settings actions. */
#delete-account .settings__foot { justify-content: flex-end; }

/* Report comments can be 500 characters without spaces; keep the admin cards within the viewport. */
.report-comment { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Reports never contribute to the intrinsic width of the admin event column. */
.event-report-count { contain: inline-size; overflow-wrap: anywhere; }
.admin-reports-link { min-height: 0; }
.event-report-note { font-size: var(--text-sm); }
.report-form { max-width: 640px; }
.report-dismiss { display: contents; }

/* Keep the event column near the admin table's quarter-width and bound long comments. */
@media (min-width: 900px) {
  .reports-table { table-layout: fixed; width: 100%; }
  .reports-event { width: 23%; }
  .reports-reason { width: 13%; }
  .reports-comment { width: 21%; }
  .reports-reporter { width: 10%; }
  .reports-date { width: 10%; }
  .reports-actions { width: 23%; }
  .reports-table td { overflow-wrap: anywhere; }
  .reports-table .table__actions { flex-wrap: wrap; }
}
@media (max-width: 899px) {
  .reports-table tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .reports-table .reports-comment-cell { grid-column: 1 / -1; }
  .reports-table .table__actions .btn { flex-basis: 0; padding-inline: var(--space-2); }
}

/* Addresses may wrap while headings keep whole words at desktop widths. */
.email-address { overflow-wrap: anywhere; }

/*
 * Language switcher: its button reads as the neighbouring links do, in each footer.
 * The language being read is plain text; `·` separates the two names.
 */
.lang-switch { display: inline-flex; align-items: baseline; gap: var(--space-2); white-space: nowrap; }
.lang-switch button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch [aria-current] { font-weight: 700; }
.site-footer .lang-switch button { text-decoration: none; }
.site-footer .lang-switch button:hover { color: inherit; text-decoration: underline; }
/* On the log-in and sign-up pages the legal line keeps the blue of its links. */
.auth .lang-switch button { color: var(--blue); }
.auth .lang-switch button:hover { color: var(--ink); }

/*
 * French only, small screens: "Événements" and "Calendrier" need more room than the columns of the
 * first header row leave them when a visitor's "Connexion" and "S'inscrire" sit above. The second
 * row keeps navigation in its own tracks and the add button at the right edge.
 */
@media (max-width: 899px) {
  /* A town admin has a third link: tighter pills, and the shield alone stands for "Mairie" (still read aloud). */
  :lang(fr) .app-header__nav .nav-link { padding-inline: var(--space-2); }
  :lang(fr) .app-header__nav .nav-link__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  :lang(fr) .app-header__nav { grid-column: 1 / -1; min-width: 0; margin-right: calc(var(--gutter) * -1); padding-right: calc(7rem + var(--gutter)); }
  :lang(fr) .app-header__add { grid-column: 1 / -1; grid-row: 2; justify-self: end; margin-left: 0; padding-left: 0; border-top: 0; }
}

/* The design system writes the state of a switch ("Off" / "On") in CSS: say it in French on French pages. */
:lang(fr) .switch__state::after { content: "Non"; }
:lang(fr) .switch input:checked ~ .switch__control .switch__state::after { content: "Oui"; }

/* Keep the longer French controls compact until the full desktop header has room. */
@media (min-width: 900px) and (max-width: 1199px) {
  :lang(fr) .app-header__inner { column-gap: var(--space-2); }
  :lang(fr) .app-header__nav { margin-left: 0; }
  :lang(fr) .app-header__nav .nav-link { padding-inline: var(--space-2); }
  :lang(fr) .app-header__add-long { display: none; }
}

@media (max-width: 359px) {
  .app-header__city > summary { display: flex; min-width: 0; padding-inline: var(--space-2); }
  .app-header__city > summary > .icon { display: none; }
  .app-header__guest { gap: var(--space-1); }
  .app-header__guest .btn { padding-inline: var(--space-2); }
}
@media (max-width: 390px) {
  :lang(fr) .app-header__city > summary { display: flex; min-width: 0; padding-inline: var(--space-1); }
  :lang(fr) .app-header__city > summary > .icon { display: none; }
  :lang(fr) .app-header__guest { gap: var(--space-1); }
  :lang(fr) .app-header__guest .btn { padding-inline: var(--space-2); }
  :lang(fr) .app-header__nav .nav-link { padding-inline: var(--space-1); }
}

/* A single-column grid must shrink to the viewport instead of its children's intrinsic widths. */
:lang(fr) .app-layout > *, :lang(fr) .sidebar > * { min-width: 0; }
@media (max-width: 390px) {
  :lang(fr) .side-status { flex-wrap: wrap; }
}
@media (max-width: 389px) {
  .app-layout > *, .sidebar > * { min-width: 0; }
  .side-status { flex-wrap: wrap; }
  :lang(en) .app-header__nav .nav-link { padding-inline: var(--space-2); }
  :lang(en) .app-header__nav .nav-link__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.app-intro { background: var(--paper-deep); }
.app-intro__features { margin-block: var(--space-6); padding-left: var(--space-6); }
.app-intro__download { padding: var(--space-8); align-self: center; }
.app-intro__download p { margin-block: var(--space-4); }
.offer-price { font-size: var(--text-2xl); font-weight: 800; margin-block: var(--space-6); }
.offer-order { margin-top: var(--space-6); }
.offer-contact { overflow-wrap: anywhere; margin-top: var(--space-3); }
.prose { overflow-wrap: anywhere; }

.offer-terms, .offer-terms:hover { color: var(--sun); }
.offer-order .btn { max-width: 100%; white-space: normal; text-align: center; }

/* Leave the narrow-screen kicker below the decorative seal. */
@media (max-width: 899px) {
  .townhall__panel { padding-top: var(--space-16); }
}
@media (max-width: 359px) {
  .site-header__links { flex-wrap: wrap; }
}

/* Found events (event import): the review screen reuses the admin tables; these only arrange its extras. */
.inline-action { display: contents; }
.import-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.import-address { display: block; }
.import-source { display: grid; gap: var(--space-1); min-width: 0; }
.import-url { overflow-wrap: anywhere; font-size: var(--text-sm); }
.import-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.import-tags:empty { display: none; }
.imports-subhead { margin: var(--space-6) 0 var(--space-3); font-size: var(--text-lg); }
.imports-rejected { margin-top: var(--space-6); }
.imports-rejected summary { cursor: pointer; font-weight: 600; margin-bottom: var(--space-3); }
.imports-add { margin-top: var(--space-6); max-width: 720px; }
.imports-add__fields { display: grid; gap: var(--space-4); align-items: start; margin-bottom: var(--space-4); }
.imports-add__fields .field { margin: 0; }
@media (min-width: 900px) {
  .imports-add__fields { grid-template-columns: 3fr 2fr; }
}
.imports-drafts td, .imports-sources td { overflow-wrap: anywhere; }
.imports-drafts .table__event > div { min-width: 0; }
/* Long titles, addresses and URLs wrap inside the mobile cards instead of widening them. */
@media (max-width: 899px) {
  .imports-drafts tr, .imports-sources tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .imports-drafts .cat-badge { max-width: 100%; white-space: normal; }
}
/* The last day of an event over several days sits under its times, and may wrap in French. */
.imports-drafts .import-until { display: block; white-space: normal; }
