/**
 * ARTW Pulse Modern Index 0.3.2
 * Copyright (C) 2026 ARTWINGS. All rights reserved.
 */

.artw-modern-index {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--artw-mi-max-width, 100%);
  margin-block: 1.75rem;
  color: var(--artw-mi-text-color, #212529);
  font-size: var(--artw-mi-font-size, 17px);
  line-height: 1.55;
  text-align: start;
}

.artw-modern-index *,
.artw-modern-index *::before,
.artw-modern-index *::after {
  box-sizing: inherit;
}

.artw-modern-index__inner,
.artw-modern-index__details,
.artw-modern-index__body {
  min-width: 0;
}

.artw-modern-index__inner,
.artw-modern-index__details {
  position: relative;
}

.artw-modern-index__header,
.artw-modern-index__summary-main {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.artw-modern-index__header {
  margin: 0 0 1rem;
}

.artw-modern-index__title {
  margin: 0;
  color: var(--artw-mi-text-color, #212529);
  font-size: var(--artw-mi-title-size, 22px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}

.artw-modern-index__icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.45em;
  height: 1.45em;
  place-items: center;
  color: var(--artw-mi-icon-color, #16c8c8);
}

.artw-modern-index__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.artw-modern-index__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.artw-modern-index__list .artw-modern-index__list {
  margin-block-start: .35rem;
  margin-inline-start: var(--artw-mi-indent, 20px);
}

.artw-modern-index__item {
  position: relative;
  margin: 0;
  padding: 0;
}

.artw-modern-index__item + .artw-modern-index__item {
  margin-block-start: .18rem;
}

/* Gentle hierarchy: H2 entries read slightly larger without overpowering the article. */
.artw-modern-index__item--h2 > .artw-modern-index__link {
  font-size: 1.04em;
  font-weight: 650;
}

.artw-modern-index__item--h3 > .artw-modern-index__link {
  font-size: 1em;
}

.artw-modern-index__item--h4 > .artw-modern-index__link {
  font-size: .97em;
}

.artw-modern-index__link {
  display: inline-flex;
  align-items: baseline;
  gap: .55rem;
  max-width: 100%;
  padding-block: .28rem;
  color: var(--artw-mi-link-color, #212529);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}

.artw-modern-index__link:hover {
  color: var(--artw-mi-hover-color, #0b5960);
  text-decoration: none;
}

.artw-modern-index__link:focus-visible,
.artw-modern-index__summary:focus-visible {
  outline: 3px solid var(--artw-mi-accent, #16c8c8);
  outline: 3px solid color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 38%, transparent);
  outline-offset: 3px;
  border-radius: .3rem;
}

.artw-modern-index__link.is-active,
.artw-modern-index__link[aria-current="location"] {
  color: var(--artw-mi-hover-color, #0b5960);
  font-weight: 700;
}

/* Native, accessible collapsible mode. */
.artw-modern-index__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.artw-modern-index__summary::-webkit-details-marker {
  display: none;
}

.artw-modern-index__summary::marker {
  content: "";
}

.artw-modern-index__chevron {
  flex: 0 0 auto;
  color: var(--artw-mi-accent, #16c8c8);
  font-size: 1.4em;
  line-height: 1;
  transition: transform .18s ease;
}

.artw-modern-index__details[open] > .artw-modern-index__summary .artw-modern-index__chevron {
  transform: rotate(180deg);
}

.artw-modern-index__body {
  padding: 0 1.15rem 1.15rem;
}

/* Optional back-to-index links, intentionally outside heading text. */
.artw-modern-index__back {
  margin: -.2rem 0 1rem;
  font-size: .82em;
  line-height: 1.3;
}

.artw-modern-index__back-link {
  color: var(--artw-mi-hover-color, #0b5960);
  text-decoration: none;
  opacity: .78;
}

.artw-modern-index__back-link:hover,
.artw-modern-index__back-link:focus-visible {
  text-decoration: none;
  opacity: 1;
}

/* 1. Clean Line */
.artw-modern-index--clean :is(.artw-modern-index__inner, .artw-modern-index__details) {
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--artw-mi-accent, #16c8c8);
}

.artw-modern-index--clean.artw-modern-index--collapsible .artw-modern-index__details {
  padding-inline-start: 0;
}

.artw-modern-index--clean.artw-modern-index--collapsible .artw-modern-index__summary,
.artw-modern-index--clean.artw-modern-index--collapsible .artw-modern-index__body {
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--artw-mi-accent, #16c8c8);
}

/* 2. Soft Card */
.artw-modern-index--card :is(.artw-modern-index__inner, .artw-modern-index__details) {
  background: var(--artw-mi-background, #fff);
  border: 1px solid var(--artw-mi-border, #dfe3e7);
  border-radius: var(--artw-mi-radius, 18px);
  box-shadow: 0 14px 38px rgba(15, 23, 42, .07);
}

.artw-modern-index--card .artw-modern-index__inner {
  padding: clamp(1.1rem, 3vw, 1.65rem);
}

/* 3. Editorial */
.artw-modern-index--editorial :is(.artw-modern-index__inner, .artw-modern-index__details) {
  padding-block: 1.25rem;
  border-block: 1px solid var(--artw-mi-border, #dfe3e7);
}

.artw-modern-index--editorial .artw-modern-index__details {
  padding-block: 0;
}

.artw-modern-index--editorial .artw-modern-index__title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}

.artw-modern-index--editorial .artw-modern-index__item + .artw-modern-index__item {
  border-block-start: 1px dotted color-mix(in srgb, var(--artw-mi-border, #dfe3e7) 85%, transparent);
}

.artw-modern-index--editorial .artw-modern-index__link {
  width: 100%;
  padding-block: .5rem;
}

/* 4. Accent Flow */
.artw-modern-index--accent :is(.artw-modern-index__inner, .artw-modern-index__details) {
  overflow: hidden;
  background: var(--artw-mi-background, #fff);
  background: linear-gradient(135deg, color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 9%, var(--artw-mi-background, #fff)), var(--artw-mi-background, #fff) 65%);
  border: 1px solid color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 32%, var(--artw-mi-border, #dfe3e7));
  border-radius: var(--artw-mi-radius, 18px);
}

.artw-modern-index--accent .artw-modern-index__inner {
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.artw-modern-index--accent :is(.artw-modern-index__inner, .artw-modern-index__details)::before {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 5px;
  content: "";
  background: var(--artw-mi-accent, #16c8c8);
}

/* 5. Modern Numbered */
.artw-modern-index--numbered :is(.artw-modern-index__inner, .artw-modern-index__details) {
  background: var(--artw-mi-background, #fff);
  border: 1px solid var(--artw-mi-border, #dfe3e7);
  border-radius: var(--artw-mi-radius, 18px);
}

.artw-modern-index--numbered .artw-modern-index__inner {
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.artw-modern-index--numbered.artw-modern-index--numbers .artw-modern-index__list {
  counter-reset: modern-index-item;
}

.artw-modern-index--numbered.artw-modern-index--numbers .artw-modern-index__item {
  counter-increment: modern-index-item;
}

.artw-modern-index--numbered.artw-modern-index--numbers .artw-modern-index__link::before {
  display: inline-grid;
  flex: 0 0 1.8rem;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  content: counter(modern-index-item);
  color: var(--artw-mi-accent, #16c8c8);
  font-size: .78em;
  font-weight: 800;
  line-height: 1;
  background: color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 11%, transparent);
  border-radius: 999px;
}

.artw-modern-index--numbered.artw-modern-index--numbers .artw-modern-index__list .artw-modern-index__list .artw-modern-index__link::before {
  width: auto;
  height: auto;
  min-width: 1.2rem;
  content: "↳";
  background: transparent;
  border-radius: 0;
}

/* 6. Soft Glass */
.artw-modern-index--glass :is(.artw-modern-index__inner, .artw-modern-index__details) {
  background: var(--artw-mi-background, #fff);
  background: color-mix(in srgb, var(--artw-mi-background, #fff) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--artw-mi-border, #dfe3e7) 78%, transparent);
  border-radius: var(--artw-mi-radius, 18px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .09);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}

.artw-modern-index--glass .artw-modern-index__inner {
  padding: clamp(1.1rem, 3vw, 1.65rem);
}

/* 7. Compact */
.artw-modern-index--compact {
  margin-block: 1rem;
}

.artw-modern-index--compact :is(.artw-modern-index__inner, .artw-modern-index__details) {
  background: var(--artw-mi-background, #fff);
  background: color-mix(in srgb, var(--artw-mi-background, #fff) 92%, var(--artw-mi-border, #dfe3e7));
  border-radius: min(var(--artw-mi-radius, 18px), 12px);
}

.artw-modern-index--compact .artw-modern-index__inner {
  padding: .85rem 1rem;
}

.artw-modern-index--compact .artw-modern-index__header {
  margin-block-end: .45rem;
}

.artw-modern-index--compact .artw-modern-index__link {
  padding-block: .12rem;
}

.artw-modern-index--compact .artw-modern-index__summary {
  padding-block: .75rem;
}

/* 8. Minimal Rail */
.artw-modern-index--rail :is(.artw-modern-index__inner, .artw-modern-index__details) {
  padding: 1rem 1rem 1rem 1.35rem;
  background: color-mix(in srgb, var(--artw-mi-background, #fff) 96%, var(--artw-mi-accent, #16c8c8));
  border-radius: var(--artw-mi-radius, 18px);
}

.artw-modern-index--rail .artw-modern-index__details {
  padding: 0;
}

.artw-modern-index--rail .artw-modern-index__item::before {
  position: absolute;
  inset-block: .72rem auto;
  inset-inline-start: -.95rem;
  width: .42rem;
  height: .42rem;
  content: "";
  background: var(--artw-mi-accent, #16c8c8);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 12%, transparent);
}

.artw-modern-index--rail .artw-modern-index__list {
  border-inline-start: 1px solid color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 32%, var(--artw-mi-border, #dfe3e7));
  padding-inline-start: .8rem;
}

/* 9. Split Header */
.artw-modern-index--split :is(.artw-modern-index__inner, .artw-modern-index__details) {
  overflow: hidden;
  background: var(--artw-mi-background, #fff);
  border: 1px solid var(--artw-mi-border, #dfe3e7);
  border-radius: var(--artw-mi-radius, 18px);
}

.artw-modern-index--split .artw-modern-index__inner {
  padding: 1.2rem;
  border-block-start: 5px solid var(--artw-mi-accent, #16c8c8);
}

.artw-modern-index--split .artw-modern-index__header,
.artw-modern-index--split .artw-modern-index__summary {
  margin: 0;
  padding: .9rem 1.15rem;
  background: color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 11%, var(--artw-mi-background, #fff));
  border-block-end: 1px solid color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 20%, var(--artw-mi-border, #dfe3e7));
}

.artw-modern-index--split .artw-modern-index__inner > .artw-modern-index__list {
  margin-block-start: 1rem;
}

/* 10. Pill Links */
.artw-modern-index--pills :is(.artw-modern-index__inner, .artw-modern-index__details) {
  padding: 1rem;
  background: var(--artw-mi-background, #fff);
  border: 1px solid var(--artw-mi-border, #dfe3e7);
  border-radius: var(--artw-mi-radius, 18px);
}

.artw-modern-index--pills .artw-modern-index__details {
  padding: 0;
}

.artw-modern-index--pills .artw-modern-index__link {
  margin-block: .14rem;
  padding: .38rem .72rem;
  background: color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 8%, transparent);
  border: 1px solid transparent;
  border-radius: 999px;
}

.artw-modern-index--pills .artw-modern-index__link:hover,
.artw-modern-index--pills .artw-modern-index__link.is-active {
  background: color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 14%, transparent);
  border-color: color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 34%, transparent);
  text-decoration: none;
}

/* 11. Neo Outline */
.artw-modern-index--outline :is(.artw-modern-index__inner, .artw-modern-index__details) {
  padding: clamp(1rem, 3vw, 1.45rem);
  background: var(--artw-mi-background, #fff);
  border: 1px solid var(--artw-mi-border, #dfe3e7);
  border-radius: var(--artw-mi-radius, 18px);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--artw-mi-background, #fff) 65%, transparent), inset 0 0 0 5px color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 23%, transparent);
}

.artw-modern-index--outline .artw-modern-index__details {
  padding: 0;
}

.artw-modern-index--outline .artw-modern-index__link:hover {
  transform: translateX(.2rem);
}

/* 12. Aurora Soft */
.artw-modern-index--aurora :is(.artw-modern-index__inner, .artw-modern-index__details) {
  overflow: hidden;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 18%, transparent), transparent 38%),
    radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--artw-mi-hover-color, #0b5960) 10%, transparent), transparent 42%),
    var(--artw-mi-background, #fff);
  border: 1px solid color-mix(in srgb, var(--artw-mi-accent, #16c8c8) 24%, var(--artw-mi-border, #dfe3e7));
  border-radius: var(--artw-mi-radius, 18px);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .06);
}

.artw-modern-index--aurora .artw-modern-index__details {
  padding: 0;
}

/* Native ordered/unordered markers for non-numbered themes. */
.artw-modern-index--ol.artw-modern-index--numbers:not(.artw-modern-index--numbered) .artw-modern-index__list,
.artw-modern-index--ul .artw-modern-index__list {
  padding-inline-start: 1.2rem;
}

.artw-modern-index--ol.artw-modern-index--numbers:not(.artw-modern-index--numbered) .artw-modern-index__list {
  list-style: decimal;
}

.artw-modern-index--ul .artw-modern-index__list {
  list-style: disc;
}

.artw-modern-index--ol.artw-modern-index--numbers:not(.artw-modern-index--numbered) .artw-modern-index__list .artw-modern-index__list {
  list-style: lower-alpha;
}

.artw-modern-index--ul .artw-modern-index__list .artw-modern-index__list {
  list-style: circle;
}

.artw-modern-index--ol.artw-modern-index--numbers:not(.artw-modern-index--numbered) .artw-modern-index__item::marker,
.artw-modern-index--ul .artw-modern-index__item::marker {
  color: var(--artw-mi-accent, #16c8c8);
  font-weight: 700;
}

/* Compact mobile layer: preserves the selected theme, changes only scale/density. */
@media (max-width: 767.98px) {
  .artw-modern-index--mobile-compact {
    margin-block: .85rem;
    font-size: var(--artw-mi-mobile-font-size, 15px);
    line-height: 1.42;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__title {
    font-size: var(--artw-mi-mobile-title-size, 18px);
    line-height: 1.18;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__header,
  .artw-modern-index--mobile-compact .artw-modern-index__summary-main {
    gap: .5rem;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__header {
    margin-block-end: .55rem;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__icon {
    width: 1.2em;
    height: 1.2em;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__list .artw-modern-index__list {
    margin-block-start: .2rem;
    margin-inline-start: var(--artw-mi-mobile-indent, 12px);
  }

  .artw-modern-index--mobile-compact .artw-modern-index__item + .artw-modern-index__item {
    margin-block-start: .08rem;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__link {
    gap: .4rem;
    padding-block: .18rem;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__summary {
    gap: .65rem;
    padding: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact .artw-modern-index__body {
    padding: 0 var(--artw-mi-mobile-padding, 12px) var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact .artw-modern-index__chevron {
    font-size: 1.2em;
  }

  .artw-modern-index--mobile-compact .artw-modern-index__back {
    margin-block-end: .75rem;
    font-size: .78em;
  }

  /* Theme-specific density only. Theme identity remains unchanged. */
  .artw-modern-index--mobile-compact.artw-modern-index--clean .artw-modern-index__inner {
    padding-inline-start: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--clean.artw-modern-index--collapsible .artw-modern-index__summary,
  .artw-modern-index--mobile-compact.artw-modern-index--clean.artw-modern-index--collapsible .artw-modern-index__body {
    padding-inline-start: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact:is(.artw-modern-index--card, .artw-modern-index--accent, .artw-modern-index--numbered, .artw-modern-index--glass) .artw-modern-index__inner {
    padding: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--editorial :is(.artw-modern-index__inner, .artw-modern-index__details) {
    padding-block: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--compact .artw-modern-index__inner {
    padding: calc(var(--artw-mi-mobile-padding, 12px) * .7) var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--rail :is(.artw-modern-index__inner, .artw-modern-index__details) {
    padding: var(--artw-mi-mobile-padding, 12px) var(--artw-mi-mobile-padding, 12px) var(--artw-mi-mobile-padding, 12px) calc(var(--artw-mi-mobile-padding, 12px) + .25rem);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--rail .artw-modern-index__details {
    padding: 0;
  }

  .artw-modern-index--mobile-compact.artw-modern-index--split .artw-modern-index__inner {
    padding: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--split .artw-modern-index__header,
  .artw-modern-index--mobile-compact.artw-modern-index--split .artw-modern-index__summary {
    padding: calc(var(--artw-mi-mobile-padding, 12px) * .75) var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--split .artw-modern-index__inner > .artw-modern-index__list {
    margin-block-start: .65rem;
  }

  .artw-modern-index--mobile-compact.artw-modern-index--pills :is(.artw-modern-index__inner, .artw-modern-index__details) {
    padding: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--pills .artw-modern-index__details {
    padding: 0;
  }

  .artw-modern-index--mobile-compact.artw-modern-index--pills .artw-modern-index__link {
    margin-block: .07rem;
    padding: .28rem .55rem;
  }

  .artw-modern-index--mobile-compact.artw-modern-index--outline :is(.artw-modern-index__inner, .artw-modern-index__details),
  .artw-modern-index--mobile-compact.artw-modern-index--aurora :is(.artw-modern-index__inner, .artw-modern-index__details) {
    padding: var(--artw-mi-mobile-padding, 12px);
  }

  .artw-modern-index--mobile-compact.artw-modern-index--outline .artw-modern-index__details,
  .artw-modern-index--mobile-compact.artw-modern-index--aurora .artw-modern-index__details {
    padding: 0;
  }

  .artw-modern-index--mobile-compact.artw-modern-index--numbered.artw-modern-index--numbers .artw-modern-index__link::before {
    flex-basis: 1.55rem;
    width: 1.55rem;
    height: 1.55rem;
  }
}

/* Basic narrow-screen protection also when compact mobile mode is disabled. */
@media (max-width: 575.98px) {
  .artw-modern-index:not(.artw-modern-index--mobile-compact) .artw-modern-index__list .artw-modern-index__list {
    margin-inline-start: min(var(--artw-mi-indent, 20px), 16px);
  }

  .artw-modern-index:not(.artw-modern-index--mobile-compact) .artw-modern-index__summary,
  .artw-modern-index:not(.artw-modern-index--mobile-compact) .artw-modern-index__body {
    padding-inline: .9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .artw-modern-index *,
  .artw-modern-index *::before,
  .artw-modern-index *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .artw-modern-index {
    max-width: none;
    break-inside: avoid;
  }

  .artw-modern-index__details:not([open]) > .artw-modern-index__body {
    display: block !important;
  }

  .artw-modern-index__chevron,
  .artw-modern-index__back {
    display: none !important;
  }

  .artw-modern-index :is(.artw-modern-index__inner, .artw-modern-index__details) {
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .artw-modern-index__link {
    color: inherit;
    text-decoration: none;
  }
}
