/* Site-wide palettes. Semantic status colors remain supplied by colors.css. */
/* Optional title decoration follows the complete title/subtitle in normal flow. */
.site-header .top .site-title { display: flex; flex-direction: column; }
.site-header .top .site-title::after {
  content: var(--header-title-decoration, none);
  flex: none;
  align-self: center;
  width: min(100%, 410px);
  height: 20px;
  margin-top: 8px;
  background-image: var(--header-title-shadow, none);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
}
.site-appearance-preview { position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 1000; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.site-appearance-preview form { margin: 0; }
body:has(.site-appearance-preview) { padding-bottom: 100px; }
.appearance-option:is(.theme-classic, .theme-custom) {
  --primary-hover: #245681;
  --surface: #fff; --surface-2: #f1f5fa;
  --text: #192b40; --muted: #52647a; --border: #d7e0eb;
  --font-heading: var(--font-sans); --theme-radius: 10px;
}
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) {
  --link: var(--primary); --link-hover: var(--primary-hover);
  --primary-soft: color-mix(in srgb, var(--primary) 9%, var(--surface));
  --primary-border: color-mix(in srgb, var(--primary) 35%, var(--surface));
  --secondary-hover: color-mix(in srgb, var(--secondary) 85%, black);
  --secondary-soft: color-mix(in srgb, var(--secondary) 9%, var(--surface));
  --secondary-border: color-mix(in srgb, var(--secondary) 35%, var(--surface));
  --surface-muted: var(--surface-2); --surface-hover: var(--surface-2);
  --focus: var(--primary); --border-strong: var(--border);
  color: var(--text);
}
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) { background-color: var(--surface-2); }
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) > .container { border-radius: var(--theme-radius); padding: 24px; }
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) a:not(.btn) { color: var(--primary); }
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) a:not(.btn):hover { color: var(--primary-hover); }
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) :is(h1,h2,h3,h4,h5,h6, .site-title, .page-title h1) { font-family: var(--font-heading); }
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) h1.page-title, body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) .page-title h1 { font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.2rem); }
body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) .horiznav li > :is(a,span) { font-family: var(--font-menu, var(--font-sans)); font-size: .95rem; }
.site-sidebar { display: none; }
/* Default theme: the site title is set in Fjalla One (its font file is always loaded, see SiteAppearance::typography()). */
body:is(.theme-classic, [data-custom-overrides]) header .top .site-title { font-family: "Fjalla One", var(--font-heading, sans-serif); }
@media (min-width: 651px) {
  body:is(.theme-classic, [data-custom-overrides]) header .top .site-title {
    height: auto;
    font-size: var(--header-title-size, 36px);
    line-height: 1.2;
  }
  body.menu-position-left:not(.is-admin) > .container {
    display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 28px;
  }
  body.menu-position-left:not(.is-admin) > .container > :is(header,footer) { grid-column: 1 / -1; }
  body.menu-position-left:not(.is-admin) > .container > main { grid-column: 2; min-width: 0; margin: 10px 0; }
  .site-sidebar { display: block; grid-column: 1; padding: 24px 16px 24px 0; border-right: 1px solid var(--border); }
  .site-sidebar .horiznav { flex-direction: column; gap: 6px; }
  .site-sidebar .horiznav li { white-space: normal; }
  .site-sidebar .horiznav li > :is(a,span) { display: flex; padding: 12px; margin: 0; border-radius: var(--theme-radius); }
  .site-sidebar .horiznav a:is(:hover,:focus-visible,.active) { background: var(--primary-soft); }
  .site-sidebar .horiznav > li > :is(a,span)::before { display: none; }
  /* Expanded children stay reachable by touch and keyboard and never clip at the edge. */
  .site-sidebar .horiznav li > ul { display: block; position: static; min-width: 0; padding: 0 0 0 12px; border: 0; background: transparent; }
}
@media (max-width: 650px) {
  body[class*="theme-"]:where(:not(.theme-classic, .theme-site, [data-custom-overrides])) > .container { padding: 12px; border-radius: 0; }
}
/* A custom color never resets the host site's image or its positioning. */
body[class*="theme-"][data-background-custom] { background-color: var(--site-background-color); }
body[class*="theme-"][data-background-image="none"] { background-image: none; }

/* Title options only affect the shared page heading, not editorial headings. */
body main h1.page-title--none { text-transform: none; }
body main h1.page-title--uppercase { text-transform: uppercase; }
body main h1.page-title--lowercase { text-transform: lowercase; }
body main h1.page-title--capitalize { text-transform: capitalize; }
body main h1.page-title-hidden { padding: 0; margin: -1px; }

/* The pale hover tint is reserved for dropdown entries, not top-level links. */
body[class*="theme-"] :is(.horiznav, .nav-drawer) li > ul > li > :is(a, span):is(:hover, :focus-visible),
body[class*="theme-"] header .profile-menu > li > a:is(:hover, :focus-visible),
body[class*="theme-"] header .profile-menu .btn-logout:is(:hover, :focus-visible) {
  background-color: var(--primary-soft, rgba(0, 0, 0, .05));
}
body[class*="theme-"] header .profile-menu .logout-form { display: block; }
body[class*="theme-"] header .profile-menu .logout-form:hover { background: transparent; }
body[class*="theme-"] header .profile-menu .btn-logout { width: 100%; }

/* Keep the profile above its shortcut and align the latter with top navigation. */
@media (min-width: 651px) {
  /* Classic's container already has 10px padding. Let the header own its
     outer inset so its 10px padding is measured from the visible shell. */
  body:is(.theme-classic, [data-custom-overrides]) > .container > header:has(> .top):has(.icons):has(.menu-desktop) {
    margin: -10px -10px 0;
    --header-navigation-gap: 2px;
  }
  body:is(.theme-classic, [data-custom-overrides]) .site-header .top .site-title::after {
    height: 10px;
    margin-top: 4px;
  }
  body:is(.theme-classic, [data-custom-overrides]) .site-header .menu-desktop .horiznav > li > :is(a, span) {
    padding: var(--top-menu-padding-y, 10px) var(--top-menu-padding-x, 0px);
  }
  body[class*="theme-"] .container > header:has(> .top):has(.icons):has(.menu-desktop) {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) auto minmax(80px, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 16px;
    row-gap: var(--header-navigation-gap, 8px);
    padding: var(--header-padding, 10px 10px 0 10px);
  }
  body[class*="theme-"] header:has(> .top):has(.icons):has(.menu-desktop) > .logo {
    grid-column: 1; grid-row: 1 / 3; width: auto;
    align-self: stretch; align-items: flex-start;
    padding-bottom: 10px;
  }
  body[class*="theme-"] header:has(> .top):has(.icons):has(.menu-desktop) > :is(.top, .user) { display: contents; }
  body[class*="theme-"] header:has(> .top):has(.icons):has(.menu-desktop) .site-title { grid-column: 2; grid-row: 1; }
  body[class*="theme-"] header:has(> .top):has(.icons):has(.menu-desktop) .menu-desktop { grid-column: 2; grid-row: 2; }
  /* Row spacing belongs to the header grid, not to the menu alone. Older
     host styles may add top padding that offsets links from the action row. */
  body[class*="theme-"] header:has(> .top):has(.icons):has(.menu-desktop) .menu-desktop .horiznav {
    padding-block: 0;
    margin-block: 0;
  }
  body[class*="theme-"] header:has(> .top):has(.icons):has(.menu-desktop) .profile {
    position: relative; inset: auto; grid-column: 3; grid-row: 1; justify-self: end;
    align-self: start;
  }
  body[class*="theme-"] header:has(> .top):has(.icons):has(.menu-desktop) .icons {
    position: static; grid-column: 3; grid-row: 2; justify-self: end;
    align-self: center; margin: 0; line-height: 1;
  }
}

.appearance-swatch span { flex: 1; background: var(--primary); }
.appearance-swatch span:nth-child(2) { background: var(--secondary); }
.appearance-swatch span:nth-child(3) { background: var(--surface-3); }

/* Background image chosen on the appearance page, and the overlay that tints it. */
body[class*="theme-"][data-background-image="custom"] {
  background-image: var(--site-background-image);
  background-size: var(--custom-background-size, cover);
  background-position: var(--custom-background-position, center);
  background-repeat: no-repeat;
  background-attachment: var(--custom-background-attachment, fixed);
}
body[data-background-overlay]::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--site-overlay); }

/* Identity: logo height, title size, hidden title (kept for screen readers). */
body[data-logo-height] header .logo img { height: var(--logo-height); width: auto; max-width: none; }
body[data-site-title-size][class] header .top .site-title { font-size: var(--site-title-size); }
body[data-site-title="hidden"] header .top .site-title {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
