/*
 * Shared styles for the #2942404 system messages demonstration.
 *
 * Plain CSS, no dependencies. The same message markup and the same rules are
 * used on the Before, After and native-section pages, so the only visual
 * difference between them is the page's own explanatory text.
 */

:root {
  color-scheme: light dark;
  --fg: #1b1b1b;
  --bg: #ffffff;
  --muted: #4a4f5a;
  --line: #767b86;
  --surface: #f4f5f7;
  --link: #0b5cad;
  --focus: #0b5cad;
  --status-fg: #0f5132;
  --status-bg: #eaf5ee;
  --status-border: #1f6b3a;
  --warning-fg: #5c3a00;
  --warning-bg: #fff4d6;
  --warning-border: #8a5300;
  --error-fg: #7a1710;
  --error-bg: #fdecea;
  --error-border: #b0261c;
  --mark-bg: #ffe8a3;
  --mark-fg: #3d2c00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #eef1f5;
    --bg: #16171a;
    --muted: #b9bec8;
    --line: #8b919c;
    --surface: #202228;
    --link: #9cc7ff;
    --focus: #9cc7ff;
    --status-fg: #b9f0cd;
    --status-bg: #10261a;
    --status-border: #7fcf9f;
    --warning-fg: #ffe0a8;
    --warning-bg: #2b210f;
    --warning-border: #f2c36b;
    --error-fg: #ffc2bb;
    --error-bg: #321513;
    --error-border: #ff968c;
    --mark-bg: #5a4a12;
    --mark-fg: #fff6d6;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 0.5rem;
  inset-block-start: -5rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid currentColor;
}

.skip-link:focus {
  inset-block-start: 0.5rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-header,
.site-footer,
main {
  width: min(100% - 2rem, 58rem);
  margin-inline: auto;
}

.site-header {
  padding-block-start: 1.25rem;
}

.site-header p {
  margin: 0 0 0.25rem;
  color: var(--muted);
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
  line-height: 1.2;
}

nav.demo-nav {
  border-block: 1px solid var(--line);
  margin-block: 0.75rem 1.5rem;
  padding-block: 0.5rem;
}

nav.demo-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav.demo-nav a {
  display: inline-block;
  padding: 0.35rem 0.15rem;
}

nav.demo-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration-thickness: 0.2em;
}

main {
  padding-block-end: 2rem;
}

h2 {
  margin-block: 2rem 0.5rem;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.3;
}

h3 {
  margin-block: 1.4rem 0.4rem;
  font-size: 1.05rem;
}

p,
li {
  max-width: 44rem;
}

.lede {
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
}

/* The message area is deliberately narrow: it is a form message strip, not a page section. */
[data-drupal-messages],
.messages-area {
  margin-block: 1rem 1.5rem;
}

.messages {
  border: 1px solid var(--line);
  border-inline-start-width: 0.5rem;
  border-radius: 0.3rem;
  margin-block: 0 0.75rem;
  padding: 0.75rem 1rem;
}

.messages:last-child {
  margin-block-end: 0;
}

.messages--status {
  border-color: var(--status-border);
  background: var(--status-bg);
  color: var(--status-fg);
}

.messages--warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.messages--error {
  border-color: var(--error-border);
  background: var(--error-bg);
  color: var(--error-fg);
}

.messages .kind {
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.messages .text {
  margin: 0;
}

.messages .text + .text {
  margin-block-start: 0.4rem;
}

/* Demo controls */
fieldset.controls {
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  margin-block: 1rem 1.25rem;
  padding: 0.75rem 1rem;
  max-width: 44rem;
}

fieldset.controls legend {
  padding-inline: 0.3rem;
  font-weight: 700;
}

.controls .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

button {
  min-height: 2.75rem;
  padding: 0.55rem 0.95rem;
  border: 2px solid currentColor;
  border-radius: 0.3rem;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  text-decoration: underline;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.state {
  border-inline-start: 0.3rem solid var(--line);
  margin-block: 1rem 0;
  padding-inline-start: 0.75rem;
  font-weight: 600;
}

/* Comparison and documentation blocks */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.cards li {
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.9rem 1rem;
}

.cards h3 {
  margin-block-start: 0;
}

.cards p {
  margin-block: 0.35rem 0.6rem;
}

pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  margin-block: 0.75rem 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  font-size: 0.86rem;
  line-height: 1.5;
  tab-size: 2;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

pre code {
  font-size: inherit;
}

mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: 0 0.15em;
  border-radius: 0.15rem;
  font-weight: 700;
}

.tree {
  font-size: 0.86rem;
}

.note {
  border: 1px solid var(--line);
  border-inline-start-width: 0.4rem;
  border-radius: 0.3rem;
  padding: 0.8rem 1rem;
  margin-block: 1rem;
  max-width: 46rem;
}

.note h3,
.note h2 {
  margin-block-start: 0;
}

.note--future {
  border-inline-start-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.links {
  margin-block-start: 1rem;
  padding-inline-start: 1.1rem;
}

.links li {
  margin-block: 0.25rem;
}

.site-footer {
  border-block-start: 1px solid var(--line);
  margin-block-start: 2rem;
  padding-block: 1rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 30rem) {
  .controls .buttons {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }
}

@media (forced-colors: active) {
  .messages,
  .note,
  .cards li,
  fieldset.controls {
    border: 2px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  .messages {
    border-inline-start-width: 0.6rem;
  }

  mark {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  :focus-visible {
    outline: 3px solid Highlight;
  }

  .skip-link {
    background: Canvas;
    color: CanvasText;
  }
}

@media print {
  nav.demo-nav,
  .controls,
  .skip-link {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}

/* #3545814: simplified Views exposed filter form */
.filters {
  max-width: 44rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 1rem;
  margin-block: 1rem 1.5rem;
}

.filters fieldset {
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.8rem;
}

.filters legend {
  padding-inline: 0.3rem;
  font-weight: 700;
}

.filters .field {
  display: grid;
  gap: 0.25rem;
  margin-block-start: 0.55rem;
}

.filters label {
  font-weight: 600;
}

.filters select,
.filters input[type="text"] {
  width: 100%;
  max-width: 26rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

.filters .apply {
  margin-block-start: 0.5rem;
}

.reveal {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  max-width: 44rem;
  margin-block: 1rem 0;
  font-weight: 600;
}

.reveal input {
  inline-size: 1.3rem;
  block-size: 1.3rem;
}

.reveal-labels .visually-hidden {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  display: inline-block;
  border: 2px dashed var(--focus);
  padding: 0.05rem 0.25rem;
}
