/* Focused refinements for the Quantum Dawn inner pages. */

/* Weekly cards need even padding without the shared lists' forced heights. */
html[data-theme="qrl-dawn"] .weekly-list .listPage__item {
  min-height: 0;
  padding-block: 1.25rem;
  margin-bottom: 0;
}
html[data-theme="qrl-dawn"] .weekly-list .listPage__item h2 {
  min-height: 0;
}
html[data-theme="qrl-dawn"] .weekly-list .listPage__pag {
  margin-top: 60px;
}

/* Country filtering uses the shared daisyUI select and theme tokens. */
#markets [hidden] {
  display: none !important;
}

#markets .market-filter {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--qrl-line);
}

#markets .market-filter__field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .625rem;
}

#markets .market-filter .qrl-label {
  color: var(--color-base-content);
  font-size: 1rem;
  font-weight: 600;
}

#markets .market-filter .qrl-select {
  width: 100%;
  max-width: 26rem;
  min-height: 3rem;
  /* Restore daisyUI's layered component styles over the legacy form reset. */
  padding: revert-layer;
  background-image: revert-layer;
  background-position: revert-layer;
  background-size: revert-layer;
  background-repeat: revert-layer;
  box-shadow: revert-layer;
}

#markets .market-filter .qrl-select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

#markets .country-picker {
  position: relative;
  width: 100%;
  max-width: 26rem;
}

#markets .country-picker__control {
  position: relative;
  border-radius: var(--radius-field);
}

#markets .country-picker__control:focus-within {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

#markets .country-picker .qrl-input {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: .625rem 3rem .625rem .875rem;
  box-sizing: border-box;
  font-size: 1rem;
  caret-color: var(--color-primary);
}

#markets .country-picker .qrl-input:focus {
  outline: none;
}

#markets .country-picker__toggle {
  position: absolute;
  inset-inline-end: .25rem;
  top: .25rem;
  width: 2.5rem;
  height: 2.5rem;
  min-height: 0;
  padding: .5rem;
  border: 0;
  background: transparent;
  color: var(--color-base-content);
  cursor: pointer;
}

#markets .country-picker__toggle svg {
  display: block;
  margin: auto;
}

#markets .country-picker__popup {
  position: absolute;
  z-index: 25;
  inset-inline: 0;
  top: calc(3rem + .5rem);
  overflow: hidden;
  background: var(--color-base-300);
  border-radius: var(--radius-field);
  box-shadow: 0 .75rem 2rem #0008;
}

#markets .country-picker__list {
  display: block;
  width: 100%;
  max-height: min(22rem, 50svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .375rem;
  box-sizing: border-box;
}

#markets .country-picker__popup.is-above {
  top: auto;
  bottom: calc(100% + .5rem);
}

#markets .country-picker__option {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 2rem;
  padding: .25rem .625rem;
  border-radius: var(--radius-selector);
  color: var(--color-base-content);
  font-size: 1rem;
  line-height: 1.35;
  cursor: pointer;
  overflow-wrap: anywhere;
}

@media (pointer: coarse) {
  #markets .country-picker__option {
    min-height: 2.5rem;
  }
}

#markets .country-picker__option[aria-selected="true"] {
  color: var(--color-primary);
  font-weight: 600;
}

#markets .country-picker__option:is(:hover, .is-active) {
  background: var(--color-base-100);
}

#markets .country-picker .country-picker__search-status {
  margin: 0;
  padding: .625rem 1rem;
  color: var(--color-base-content);
  font-size: .875rem;
  line-height: 1.4;
}

#markets .market-filter :is(.market-filter__help, .market-filter__status, .market-filter__location-status) {
  margin: .75rem 0 0;
  padding: 0;
  line-height: 1.5;
  font-size: 1rem;
}

#markets .market-filter :is(.market-filter__help, .market-filter__location-status) {
  font-size: .875rem;
}

#markets #market-country-help {
  font: inherit;
}

#markets .market-filter .market-filter__status {
  color: var(--color-base-content);
  font-weight: 600;
}

#markets .market-results__empty {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  color: var(--color-base-content);
  display: block;
  white-space: normal;
}

#markets .market-results {
  margin-bottom: 2.5rem;
}

#markets .market-results > p {
  margin-block: 1rem 2rem;
}

#markets .market-policy-sources {
  margin: 1rem 0 0;
  padding: 0;
  font-size: .875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#markets .market-access {
  border-radius: 0;
  border-top: 1px solid var(--qrl-line);
}

#markets .market-access > summary {
  display: block;
  min-height: 3.25rem;
  padding: 1rem 3rem 1rem 1rem;
  color: var(--color-base-content);
  font-size: 1rem;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

#markets .market-access > summary::after {
  right: 1rem;
}

#markets .market-access > summary::-webkit-details-marker {
  display: none;
}

#markets .market-access > summary:hover {
  color: var(--color-primary);
}

#markets .market-access > summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -3px;
}

#markets .market-access > .qrl-collapse-content {
  padding: 0 1rem 1rem;
  visibility: visible;
  font-size: 1rem;
  line-height: 1.5;
}

#markets .market-access:not([open]) > .qrl-collapse-content {
  display: none;
}

#markets .market-result-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

/* Keep legacy article link styles from stripping the section buttons. */
#markets .market-result-links a.qrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  height: auto;
  padding: .5rem .875rem;
  border: 1px solid var(--qrl-line);
  border-radius: var(--radius-field);
  background: transparent;
  box-shadow: none;
  color: var(--color-base-content);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

#markets .market-result-links a.qrl-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-base-200);
  color: var(--color-primary);
  text-decoration: none;
}

#markets .market-result-links a.qrl-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 40rem) {
  #markets .market-result-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#market-notes,
#markets .market-results h3 {
  scroll-margin-top: 6rem;
}

.market-disclaimers {
  margin-block: 2rem 3rem;
  border: 1px solid var(--qrl-line);
  border-radius: var(--radius-field);
}

.market-disclaimers > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 1rem 1.25rem;
  color: var(--color-base-content);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.market-disclaimers > summary::-webkit-details-marker {
  display: none;
}

.market-disclaimers > summary:hover {
  color: var(--color-primary);
}

.market-disclaimers > summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.market-disclaimers > summary svg {
  flex: none;
}

.market-disclaimers[open] > summary svg {
  transform: rotate(180deg);
}

.market-disclaimers__content {
  padding: 0 1.25rem 1.25rem;
}

.market-disclaimers__content p {
  margin-block: 0 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Keep logo panels dark, with visible hover and keyboard focus states. */
html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets > .market-listing {
  display: block;
  min-width: 0;
  margin-block: -20px 40px;
  cursor: auto;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .market-listing__link {
  display: block;
  cursor: pointer;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets .core__el__top {
  cursor: inherit;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets a:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
  border-radius: var(--radius-box);
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .market-listing__link:focus-visible {
  outline-offset: -3px;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets .core__el {
  margin: 0;
  min-height: 0;
  border-bottom: 1px solid var(--qrl-line);
  transition: border-color .2s ease;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets .core__el:has(> .market-listing__link:is(:hover, :focus-visible)) {
  border-color: var(--color-primary);
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets .core__el__img {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  background: var(--color-base-200);
  padding: clamp(1rem, 3vw, 2rem);
  overflow: hidden;
  transition: background-color .2s ease;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets a:is(:hover, :focus-visible) .core__el__img {
  background: var(--color-base-300);
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .market-logo-plate {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  width: min(100%, 23rem);
  height: 100%;
  max-height: 8rem;
  min-width: 0;
  min-height: 0;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .market-logo-plate img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: none;
  transition: none;
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .market-logo-plate img.market-logo--monochrome {
  filter: grayscale(1) brightness(0) invert(.92);
}

/* Preserve the embedded bitmap's detail while whitening Biconomy's fallback. */
html[data-theme="qrl-dawn"] body.coreTeam #markets .market-logo-plate img.market-logo--monochrome[src$="/biconomy.svg"] {
  filter: grayscale(1) invert(1) brightness(1.3);
}

html[data-theme="qrl-dawn"] body.coreTeam #markets .market-logo-plate > .qrl-logo-fallback {
  color: var(--color-base-content);
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="qrl-dawn"] body.coreTeam #markets .grid-markets :is(.core__el, .core__el__img) {
    transition: none;
  }
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline .event.info .welcome__btn {
  display: block;
  height: auto;
  min-height: 3.375rem;
  padding: .8rem 1rem;
  white-space: normal;
  text-align: center;
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline .heading::before {
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: .04em;
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline .heading::after {
  left: -7px;
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline.pro .heading.complete::after {
  left: -14px;
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline.pro .event.complete::after {
  left: -64px;
}

/* Keep release context and delivery checklists readable within the timeline. */
html[data-theme="qrl-dawn"] #project-zond .roadmap-event {
  scroll-margin-top: 6rem;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event h3 {
  margin-bottom: .65rem;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event .roadmap-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem 1rem;
  margin: 0 0 1rem;
  color: var(--qrl-muted);
  font-size: .875rem;
  letter-spacing: 0;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-state {
  color: var(--color-primary);
  font-weight: 600;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-state-complete {
  color: var(--color-success);
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event-current .roadmap-state {
  color: var(--color-secondary);
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event .roadmap-progress-label {
  margin: 1rem 0 .4rem;
  color: var(--qrl-muted);
  font-size: .875rem;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event .progress {
  width: min(100%, 19rem);
  margin-bottom: 1rem;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event .progress div {
  background: var(--color-base-300);
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event .progress .complete {
  background: var(--color-success);
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-event .roadmap-release-note {
  margin: 1rem 0;
  color: var(--qrl-muted);
  font-size: .875rem;
  line-height: 1.6;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-details {
  margin-top: 1.25rem;
  border-top: 1px solid var(--qrl-line);
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-details-title {
  margin: .85rem 0 .75rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}

html[data-theme="qrl-dawn"] #project-zond .timeline .roadmap-checklist {
  display: grid;
  gap: .8rem;
  margin: .25rem 0 1rem;
  padding: 0;
  list-style: none;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-checklist-item {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  color: var(--color-base-content);
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

html[data-theme="qrl-dawn"] #project-zond .roadmap-checklist-icon {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  align-self: flex-start;
  margin-top: .2rem;
  color: var(--color-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="qrl-dawn"] #project-zond .is-complete .roadmap-checklist-icon {
  color: var(--color-success);
}

#project-zond .network-metrics > a,
.tokenomics-metrics > a {
  display: flex;
}

#project-zond .network-metrics .core__el,
.tokenomics-metrics .core__el {
  width: 100%;
}

#project-zond .network-metrics .core__el__indicator,
.tokenomics-metrics .core__el__indicator {
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#project-zond .network-metrics .metric-unit,
.tokenomics-metrics .metric-unit {
  display: block;
  font-size: 0.65em;
  line-height: 1.25;
}

.roadmap-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .roadmap-section-heading {
  padding-block: 0;
  margin-top: clamp(2.5rem, 5vw, 3.25rem);
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .roadmap-section-heading > .section-title-header {
  margin: 0 0 1.5rem;
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .network-map {
  margin-bottom: 2rem;
}

html[data-theme="qrl-dawn"] body.coreTeam #project-zond .network-map > img.network-map {
  display: block;
  width: 100%;
  height: auto;
  padding-top: 1.25rem;
  margin: 0;
}

@media (max-width: 767px) {
  /* Collapse the stacked section and article padding above mobile post titles. */
  html[data-theme="qrl-dawn"] .blogPageInner .blogPage__inner {
    padding-block-start: 1rem;
  }

  html[data-theme="qrl-dawn"] .blogPageInner :is(.article-content, .blog-article) {
    padding-block-start: 0;
  }

  html[data-theme="qrl-dawn"] .blogPageInner .blog-article > h1 {
    font-size: clamp(32px, 8.5vw, 40px);
    line-height: 1.15;
    margin-bottom: 1.25rem;
  }

  html[data-theme="qrl-dawn"] .blogPageInner .blog-article > h1 + .date-box,
  html[data-theme="qrl-dawn"] .blogPageInner .blog-article > h1 + .date-box > span {
    font-size: 18px;
    line-height: 1.6;
  }

  html[data-theme="qrl-dawn"] #project-zond > .timeline {
    max-width: 100%;
    padding: 0 1.25rem 1.25rem;
  }

  html[data-theme="qrl-dawn"] #project-zond > .timeline > .heading {
    margin-inline: -1.25rem;
    padding: 1rem 1.25rem;
  }

  html[data-theme="qrl-dawn"] #project-zond > .timeline > .event::after {
    left: calc(-1.25rem - 7px);
  }

  html[data-theme="qrl-dawn"] body.coreTeam #markets .market-logo-plate {
    max-height: 6rem;
  }

  html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline .heading::before {
    position: static;
    display: block;
    width: auto;
    min-width: 0;
    margin-bottom: .3rem;
    text-align: left;
  }

  html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline .heading:not([data-date])::before,
  html[data-theme="qrl-dawn"] body.coreTeam #project-zond .timeline .heading[data-date=""]::before {
    display: none;
  }
}
