.exlegi-history-widget {
  --history-blue: #48687a;
  --history-ivory: #f1ebdc;
  --history-sand: #e1d1b3;
  --history-olive: #6d6948;
  --history-celeste: #9db1ac;
  --history-ink: #111719;
  --history-display: "Drugs", "Mulish", Arial, sans-serif;
  --history-body: "Mulish", Arial, sans-serif;
  width: 100%;
  color: var(--history-ink);
  font-family: var(--history-body);
}

.exlegi-history-widget *,
.exlegi-history-widget *::before,
.exlegi-history-widget *::after {
  box-sizing: border-box;
}

.exlegi-history-shell {
  display: grid;
  grid-template-columns: 190px 292px minmax(0, 1fr);
  grid-template-areas: "nav media copy";
  min-height: 628px;
  overflow: hidden;
  border-radius: 26px;
  background: var(--history-ivory);
  box-shadow: 18px 24px 34px rgba(42, 55, 61, 0.16);
}

.exlegi-history-nav {
  grid-area: nav;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--history-blue);
}

.exlegi-history-widget button.exlegi-history-tab,
.exlegi-history-widget button.exlegi-history-accordion-trigger {
  appearance: none;
  width: 100%;
  border: 0;
  box-shadow: none;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.exlegi-history-widget button.exlegi-history-tab {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 13px;
  color: var(--history-ivory);
  background: transparent;
  text-align: left;
  transition: color 0.22s ease, background 0.22s ease;
}

.exlegi-history-widget button.exlegi-history-tab:hover,
.exlegi-history-widget button.exlegi-history-tab:focus,
.exlegi-history-widget button.exlegi-history-tab:active {
  border: 0;
  color: var(--history-ivory);
  background: rgba(241, 235, 220, 0.1);
  box-shadow: none;
}

.exlegi-history-widget button.exlegi-history-tab.is-active {
  color: var(--history-blue);
  background: var(--history-ivory);
}

.exlegi-history-tab-number,
.exlegi-history-accordion-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}

.exlegi-history-tab-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.exlegi-history-tab:focus-visible,
.exlegi-history-accordion-trigger:focus-visible {
  outline: 2px solid var(--history-sand);
  outline-offset: -3px;
}

.exlegi-history-media {
  position: relative;
  grid-area: media;
  min-width: 0;
  min-height: 628px;
  overflow: hidden;
  background: var(--history-celeste);
}

.exlegi-history-media-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.025);
  transition: opacity 0.4s ease, transform 0.6s ease, visibility 0.4s ease;
}

.exlegi-history-media-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.exlegi-history-media-panel img,
.exlegi-history-accordion-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exlegi-history-media-panel::after,
.exlegi-history-accordion-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(58, 70, 53, 0.68), rgba(72, 104, 122, 0.08) 58%);
  pointer-events: none;
}

.exlegi-history-media-copy {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 34px;
  left: 20px;
  color: var(--history-ivory);
}

.exlegi-history-media-copy p {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.exlegi-history-media-copy h3,
.exlegi-history-media-copy h4 {
  margin: 0;
  color: inherit;
  font-family: var(--history-display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.28;
}

.exlegi-history-copy {
  grid-area: copy;
  min-width: 0;
  padding: 40px 30px 34px;
  background: var(--history-ivory);
}

.exlegi-history-content[hidden] {
  display: none;
}

.exlegi-history-kicker {
  margin: 0 0 14px;
  color: var(--history-olive);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.exlegi-history-title {
  margin: 0 0 26px;
  color: var(--history-blue);
  font-family: var(--history-display);
  font-size: 31px;
  font-weight: 400;
  line-height: 1.35;
}

.exlegi-history-body {
  color: var(--history-ink);
  font-size: 13px;
  line-height: 1.45;
}

.exlegi-history-body p {
  margin: 0 0 16px;
}

.exlegi-history-highlight {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 48px;
}

.exlegi-history-highlight span {
  color: var(--history-blue);
  font-size: 11px;
  font-weight: 500;
}

.exlegi-history-highlight strong {
  color: var(--history-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.exlegi-history-footer {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 54px;
  align-items: center;
  min-height: 58px;
  padding: 10px 4px 0;
  color: var(--history-blue);
}

.exlegi-history-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.exlegi-history-counter strong {
  font-size: 14px;
}

.exlegi-history-footer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.exlegi-history-mobile {
  display: none;
}

@media (max-width: 1024px) {
  .exlegi-history-shell {
    grid-template-columns: 154px minmax(0, 1fr);
    grid-template-areas: "nav media" "copy copy";
    min-height: 0;
  }

  .exlegi-history-nav {
    min-height: 360px;
    padding: 14px 10px;
  }

  .exlegi-history-widget button.exlegi-history-tab {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
    min-height: 48px;
    padding: 7px;
  }

  .exlegi-history-tab-number {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .exlegi-history-tab-label {
    font-size: 11px;
  }

  .exlegi-history-media {
    min-height: 360px;
  }

  .exlegi-history-media-copy {
    right: 22px;
    bottom: 28px;
    left: 22px;
  }

  .exlegi-history-media-copy h3 {
    max-width: 390px;
    font-size: 26px;
  }

  .exlegi-history-copy {
    min-height: 330px;
    padding: 28px 28px 32px;
  }

  .exlegi-history-title {
    max-width: 650px;
    margin-bottom: 18px;
    font-size: 27px;
    line-height: 1.3;
  }

  .exlegi-history-body {
    font-size: 13px;
  }

  .exlegi-history-highlight {
    margin-top: 24px;
  }

  .exlegi-history-footer {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 30px;
    padding-right: 10px;
    padding-left: 10px;
  }
}

@media (max-width: 767px) {
  .exlegi-history-desktop {
    display: none;
  }

  .exlegi-history-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .exlegi-history-accordion-item {
    overflow: hidden;
    border-radius: 18px;
    background: var(--history-ivory);
    box-shadow: 0 10px 24px rgba(42, 55, 61, 0.1);
  }

  .exlegi-history-accordion-heading {
    margin: 0;
  }

  .exlegi-history-widget button.exlegi-history-accordion-trigger {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 24px;
    gap: 12px;
    align-items: center;
    min-height: 64px;
    padding: 12px 16px;
    color: var(--history-ivory);
    background: var(--history-blue);
    text-align: left;
  }

  .exlegi-history-widget button.exlegi-history-accordion-trigger:hover,
  .exlegi-history-widget button.exlegi-history-accordion-trigger:focus,
  .exlegi-history-widget button.exlegi-history-accordion-trigger:active {
    border: 0;
    color: var(--history-ivory);
    background: var(--history-blue);
    box-shadow: none;
  }

  .exlegi-history-accordion-item.is-open .exlegi-history-accordion-trigger {
    color: var(--history-blue);
    background: var(--history-ivory);
  }

  .exlegi-history-accordion-number {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .exlegi-history-accordion-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
  }

  .exlegi-history-accordion-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    border: 1px solid currentColor;
    border-radius: 50%;
  }

  .exlegi-history-accordion-icon::before,
  .exlegi-history-accordion-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 1px;
    background: currentColor;
    transform: translate(-50%, -50%);
  }

  .exlegi-history-accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: transform 0.22s ease;
  }

  .exlegi-history-accordion-item.is-open .exlegi-history-accordion-icon::after {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  .exlegi-history-accordion-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.42s ease, opacity 0.28s ease;
  }

  .exlegi-history-accordion-item.is-open .exlegi-history-accordion-panel {
    grid-template-rows: 1fr;
    opacity: 1;
  }

  .exlegi-history-accordion-inner {
    min-height: 0;
    overflow: hidden;
  }

  .exlegi-history-accordion-media {
    position: relative;
    min-height: 310px;
    overflow: hidden;
    background: var(--history-celeste);
  }

  .exlegi-history-media-copy {
    right: 18px;
    bottom: 22px;
    left: 18px;
  }

  .exlegi-history-media-copy p {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .exlegi-history-media-copy h4 {
    font-size: 24px;
    line-height: 1.3;
  }

  .exlegi-history-accordion-copy {
    padding: 24px 18px 28px;
  }

  .exlegi-history-kicker {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .exlegi-history-title {
    margin-bottom: 18px;
    font-size: 27px;
    line-height: 1.3;
  }

  .exlegi-history-body {
    font-size: 14px;
    line-height: 1.5;
  }

  .exlegi-history-body p {
    margin-bottom: 15px;
  }

  .exlegi-history-highlight {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(72, 104, 122, 0.24);
  }

  .exlegi-history-highlight span {
    font-size: 12px;
  }

  .exlegi-history-highlight strong {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exlegi-history-widget *,
  .exlegi-history-widget *::before,
  .exlegi-history-widget *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
