/**
 * ELF Locations / Countries — align with boarding-pass content shell.
 * Plugin defaults (.elf-country max-width: 960px centered) sit far inside the header.
 */

body.tax-elf_country,
body.post-type-archive-elf_location,
body.single-elf_location {
  background: var(--cfd-page-bg, #f5f2ed);
}

/* Theme country hub shell (with optional sidebar) */
.cfd-country-archive__wrap {
  max-width: var(--cfd-ticket-max, var(--cfd-max, 1496px));
  width: 100%;
  margin: 0 auto 3rem;
  padding: 28px var(--cfd-gutter, 24px) 48px;
  box-sizing: border-box;
}

.cfd-country-archive__layout .cfd-single-sidebar {
  position: sticky;
  top: 1.25rem;
  padding-top: 0.25rem;
}

@media (max-width: 1023px) {
  .cfd-country-archive__layout .cfd-single-sidebar {
    position: static;
  }
}

/* Country taxonomy archive — match site shell / icon-nav left edge */
body.tax-elf_country .elf-country,
.elf-country {
  max-width: var(--cfd-ticket-max, var(--cfd-max, 1496px)) !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 0 !important;
  margin-bottom: 3rem !important;
  padding: 28px var(--cfd-gutter, 24px) 48px !important;
  box-sizing: border-box !important;
}

/* Inside theme wrap + sidebar grid: content fills the main column */
body.tax-elf_country .cfd-country-archive__wrap > .elf-country,
body.tax-elf_country .cfd-country-archive__layout .elf-country {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.tax-elf_country .elf-country__breadcrumb,
.elf-country__breadcrumb {
  margin: 0 0 12px !important;
  font-family: var(--cfd-sans, "DM Sans", system-ui, sans-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cfd-muted, #6b6558);
}

body.tax-elf_country .elf-country__breadcrumb a,
.elf-country__breadcrumb a {
  color: var(--cfd-accent, #a8322d) !important;
  text-decoration: none;
}

body.tax-elf_country .elf-country__breadcrumb a:hover,
.elf-country__breadcrumb a:hover {
  text-decoration: underline;
}

body.tax-elf_country .elf-country__crumb-current,
.elf-country__crumb-current {
  color: var(--cfd-muted, #6b6558) !important;
}

body.tax-elf_country .elf-country__title,
.elf-country__title {
  font-family: var(--cfd-serif, "Playfair Display", Georgia, serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--cfd-text, #1a1a1a);
}

body.tax-elf_country .elf-country__section h2,
.elf-country__section h2 {
  font-family: var(--cfd-sans, "DM Sans", system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--cfd-text, #1a1a1a);
}

/* Full-card hit target for location dossiers */
body.tax-elf_country .elf-country__card,
.elf-country__card {
  padding: 0;
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

body.tax-elf_country .elf-country__card-link,
.elf-country__card-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.65rem;
  height: 100%;
  padding: 1rem 1.05rem 1.1rem;
  box-sizing: border-box;
  color: var(--cfd-text, #1a1a1a);
  text-decoration: none;
  font-weight: 700;
}

body.tax-elf_country .elf-country__card-top,
.elf-country__card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

body.tax-elf_country .elf-country__card-summary,
.elf-country__card-summary {
  display: block;
  margin: 0;
  font-family: var(--cfd-sans, "DM Sans", system-ui, sans-serif);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--cfd-muted, #6b6558);
}

body.tax-elf_country .elf-country__card:hover,
body.tax-elf_country .elf-country__card:focus-within,
.elf-country__card:hover,
.elf-country__card:focus-within {
  border-color: var(--cfd-accent, #a8322d);
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.06);
}

body.tax-elf_country .elf-country__card-link:hover .elf-country__card-name,
body.tax-elf_country .elf-country__card-link:focus-visible .elf-country__card-name,
.elf-country__card-link:hover .elf-country__card-name,
.elf-country__card-link:focus-visible .elf-country__card-name {
  color: var(--cfd-accent, #a8322d);
  text-decoration: none;
}

body.tax-elf_country .elf-country__card-link:focus-visible,
.elf-country__card-link:focus-visible {
  outline: 2px solid var(--cfd-accent, #a8322d);
  outline-offset: -2px;
}

/* Location singles — keep full shell width when wrap is present */
body.single-elf_location .cfd-single-wrap:has(.elf-loc),
body.single-elf_location .content-area.cfd-single-main:has(.elf-loc) .cfd-single-wrap {
  max-width: var(--cfd-ticket-max, var(--cfd-max, 1496px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--cfd-gutter, 24px) !important;
  padding-right: var(--cfd-gutter, 24px) !important;
  box-sizing: border-box;
}

/* Score changes inset (mobile + desktop).
 * Owned here on purpose: ELF self-updates widget.css from GitHub every ~15m,
 * so plugin-side padding patches get wiped. Keep all inset rules in this file.
 */
body.single-elf_location .elf-changes__panel {
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
  box-sizing: border-box;
}
body.single-elf_location .elf-changes__toolbar,
body.single-elf_location .elf-changes__summary,
body.single-elf_location .elf-changes__list,
body.single-elf_location .elf-changes__select {
  max-width: 100%;
  box-sizing: border-box;
}
body.single-elf_location .elf-changes__row {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  box-sizing: border-box;
}
body.single-elf_location .elf-changes__summary-row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
