/* Colors, type, and sizes */

@layer wp {
  :root {
    color-scheme: light dark;

    /* Page and panels */
    --wp-bg: #f5f5f5;
    --wp-card-bg: #ffffff;
    --wp-sunken-bg: #ececec;
    --wp-hover-bg: #ececec;
    --wp-text: #1a1a1a;
    --wp-text-subtle: #595959; /* 7:1 on white */
    --wp-border: #e0e0e0;
    --wp-border-strong: #8a8a8a; /* control borders, 3.5:1 on white */

    /* Links (Wikimedia blue) */
    --wp-link: #3366cc; /* 5.4:1 on white */
    --wp-link-hover: #2a4b8d;
    --wp-link-soft: #eaf0fb; /* selected items, info notices, and info badges */
    --wp-on-link: #ffffff; /* text on --wp-link */

    /* Brand color for filled buttons */
    --wp-brand: #c8102e;
    --wp-brand-hover: #a50d26;
    --wp-on-brand: #ffffff;

    /* Header logo */
    --wp-logo-size: 40px;
    --wp-logo-bg: #ffffff;
    --wp-logo-color: #000000;
    --wp-logo-radius: 50%;
    --wp-logo-padding: 3px;

    --wp-black: var(--wp-text);
    --wp-black-hover: #000000;
    --wp-on-black: #ffffff;

    /* Status */
    --wp-danger: #b3271e;
    --wp-danger-soft: #fae9e6;
    --wp-success: #28724a; /* 5:1 on --wp-success-soft */
    --wp-success-soft: #e2f2e7;
    --wp-warning: #a04a08;
    --wp-warning-soft: #faf2d9;

    /* Header and footer bar: same in both themes */
    --wp-bar-bg: #1d1d1d;
    --wp-bar-text: #ffffff;
    --wp-bar-current: #ef4058; /* current-page mark, 4.4:1 on the bar */
    --wp-bar-text-subtle: color-mix(
      in srgb,
      var(--wp-bar-text) 72%,
      transparent
    );
    --wp-bar-hover: color-mix(in srgb, var(--wp-bar-text) 12%, transparent);

    /* Over photos: captions and lightbox buttons */
    --wp-on-media: #ffffff;
    --wp-overlay: rgb(0 0 0 / 0.6);
    --wp-media-bg: #000000; /* behind a photo that doesn't fill its box */
    --wp-photo-pressed: #ffc83d; /* background of a pressed photo toggle */

    /* Type */
    --wp-font:
      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
      "Noto Sans", "Liberation Sans", Arial, sans-serif;
    --wp-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --wp-font-size-sm: 0.8125rem; /* 13px */
    --wp-font-size-base: 0.9375rem; /* 15px */
    --wp-font-size-lg: 1.0625rem; /* 17px */
    --wp-font-size-xl: 1.25rem; /* 20px */
    --wp-font-size-2xl: 1.75rem; /* 28px */
    --wp-font-size-3xl: 2.25rem; /* 36px, large page titles */
    --wp-font-size-4xl: 3rem; /* 48px, landing page titles */

    /* Spacing */
    --wp-space-3xs: 0.125rem; /* 2px */
    --wp-space-2xs: 0.25rem; /* 4px */
    --wp-space-xs: 0.5rem; /* 8px */
    --wp-space-sm: 0.75rem; /* 12px */
    --wp-space-md: 1rem; /* 16px */
    --wp-space-lg: 1.25rem; /* 20px */
    --wp-space-xl: 1.5rem; /* 24px */
    --wp-space-2xl: 2rem; /* 32px */
    --wp-space-3xl: 2.5rem; /* 40px */
    --wp-space-4xl: 3.5rem; /* 56px, between full-width sections */

    /* Sizes */
    --wp-control-height: 2.25rem; /* 36px */
    --wp-control-height-sm: 1.875rem; /* 30px */
    --wp-bar-height: 3.75rem; /* 60px */
    --wp-page-width: 1200px;
    --wp-sidebar-width: 15rem; /* 240px, body.wp-sidebar */
    --wp-line-length: 40em; /* reading text, ~75 characters per line */
    --wp-gutter: var(--wp-space-lg);
    --wp-tap-size: 2.75rem; /* 44px */
    --wp-avatar-size: 2.5rem; /* 40px */
    --wp-thumb-size: 4rem; /* 64px */
    --wp-radius: 6px;
    --wp-radius-lg: 10px; /* dialogs */
    --wp-radius-full: 999px;
    --wp-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
    --wp-focus-color: var(--wp-link);
    --wp-focus-ring:
      0 0 0 2px var(--wp-card-bg), 0 0 0 4px var(--wp-focus-color);
    --wp-duration: 0.15s;
  }

  /* Show subtle bar text at full strength without color-mix() */
  @supports not (color: color-mix(in srgb, red, red)) {
    :root {
      --wp-bar-text-subtle: var(--wp-bar-text);
    }
  }

  /* Touch screens: 44px buttons and fields, 36px small buttons */
  @media (pointer: coarse) {
    :root {
      --wp-control-height: var(--wp-tap-size);
      --wp-control-height-sm: 2.25rem;
    }
  }

  /* Same breakpoint as header-footer.css */
  @media (max-width: 760px) {
    :root {
      --wp-gutter: var(--wp-space-md);
    }
  }

  /* Repeated in the [data-theme="dark"] block below */
  @media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --wp-bg: #131518;
      --wp-card-bg: #1d2025;
      --wp-sunken-bg: #0d0f11;
      --wp-hover-bg: #272b31;
      --wp-text: #eaecf0;
      --wp-text-subtle: #a7adb5;
      --wp-border: #383d45;
      --wp-border-strong: #6b727c;
      --wp-link: #7ba6f7;
      --wp-link-hover: #a6c3fa;
      --wp-link-soft: #1d2a45;
      --wp-on-link: #131518;
      --wp-brand-hover: #d81b3a;
      --wp-black-hover: #ffffff;
      --wp-on-black: #131518;
      --wp-danger: #f28b80;
      --wp-danger-soft: #3b1e1b;
      --wp-success: #62d1b2;
      --wp-success-soft: #11332b;
      --wp-warning: #f0b45a;
      --wp-warning-soft: #372b10;
      --wp-shadow: 0 4px 16px rgb(0 0 0 / 0.5);
    }
  }

  :root[data-theme="light"] {
    color-scheme: light;
  }

  @media print {
    :root {
      color-scheme: light;
    }
  }

  @media screen {
    :root[data-theme="dark"] {
      color-scheme: dark;
      --wp-bg: #131518;
      --wp-card-bg: #1d2025;
      --wp-sunken-bg: #0d0f11;
      --wp-hover-bg: #272b31;
      --wp-text: #eaecf0;
      --wp-text-subtle: #a7adb5;
      --wp-border: #383d45;
      --wp-border-strong: #6b727c;
      --wp-link: #7ba6f7;
      --wp-link-hover: #a6c3fa;
      --wp-link-soft: #1d2a45;
      --wp-on-link: #131518;
      --wp-brand-hover: #d81b3a;
      --wp-black-hover: #ffffff;
      --wp-on-black: #131518;
      --wp-danger: #f28b80;
      --wp-danger-soft: #3b1e1b;
      --wp-success: #62d1b2;
      --wp-success-soft: #11332b;
      --wp-warning: #f0b45a;
      --wp-warning-soft: #372b10;
      --wp-shadow: 0 4px 16px rgb(0 0 0 / 0.5);
    }
  }
}
