:root {
  --main-col-width: 600px;
  --menu-width: 0px;
  --plot-background: var(--wa-color-surface-default);
}

g[aria-label="tip"] {
  --plot-background: var(--wa-color-surface-default);
}

/* Mobile: stack vertically, full-width input, centered button */
@media (max-width: 640px) {
  .filters {
    display: flex; /* override flank’s inline layout */
    flex-direction: column; /* stack items */
    align-items: stretch; /* children expand to 100% inline size */
    gap: var(--wa-space-xs); /* keep your wa-gap-xs spacing */
  }
  .filters wa-input {
    inline-size: 100%;
  }
  .filters wa-button {
    align-self: center; /* center the button under the input */
  }
  #load-more {
    margin-top: var(--wa-space-xs);
  }
}

/* (Optional) Desktop+: keep current flank behavior */

:host(:not([disable-navigation-toggle])[view="mobile"]) slot[name~="navigation-toggle"],
.navigation-drawer {
  display: none !important;
}

figure h2 {
  font-size: 1em;
}

figcaption {
  font-size: 0.5em;
}

slot[name="navigation-toggle"],
slot[name="navigation-toggle"] * {
  display: none !important;
}

wa-button[part="navigation-toggle"],
.navigation-drawer {
  display: none !important;
}

wa-button[part="navigation-toggle"] {
  display: none !important;
}

wa-page {
  --menu-width: 15%;
  --aside-width: 15%;
  margin: var(--wa-space-xs);
  margin-inline-start: 0;
  &::part(base),
  &::part(main),
  &::part(body) {
    gap: var(--wa-space-xs);
  }
  &::part(header) {
    display: none !important;
  }
}

li {
  margin-block-end: 1em;
}

.card-basic,
#for-summary-plot {
  min-width: var(--main-col-width);
  max-width: var(--main-col-width);
}

[slot="footer"] {
  justify-content: right;
  text-align: right;
}

[slot="main-header"],
main {
  max-inline-size: 60rem;
  margin-inline: auto;
}

[slot="navigation-toggle"],
.navigation-drawer,
.header {
  display: none !important;
}

.slot-content {
  padding: var(--wa-space-m);
  border-radius: var(--wa-border-radius-m);
  height: 100%;
  box-sizing: border-box;
}

p {
  word-break: break-word;
  overflow-wrap: break-word;
}

br::before {
  content: " ";
}

.quote-inline::after,
.h-card::after {
  content: " ";
}

@media (max-width: 768px) {
  :root {
    --main-col-width: 100%;
  }

  .show-help {
    display: none;
  }

  wa-page {
    --menu-width: 0;
    --aside-width: 0;
  }

  .card-basic,
  #for-summary-plot {
    min-width: 100%;
    max-width: 100%;
  }

  [slot="navigation-toggle"] {
    display: none !important;
  }

  :host(:not([disable-navigation-toggle])[view="mobile"]) slot[name~="navigation-toggle"] {
    display: none;
  }

  wa-button[part="navigation-toggle"],
  .header {
    display: none !important;
  }

  wa-page {
    --menu-width: 0%;
    --aside-width: 0%;
    margin: 0px;
    margin-inline-start: 0;
    &::part(base),
    &::part(main),
    &::part(body) {
      gap: 0px;
    }
    &::part(header) {
      display: none !important;
    }
  }
}

/* Authenticity score color coding */
.authenticity-high {
  --wa-color-neutral-fill-normal: var(--wa-color-success-fill-loud);
}

.authenticity-medium {
  --wa-color-neutral-fill-normal: var(--wa-color-warning-fill-loud);
}

.authenticity-low {
  --wa-color-neutral-fill-normal: var(--wa-color-danger-fill-loud);
}

/* Burst indicator styling */
wa-tag[appearance="accent"] wa-icon {
  margin-inline-end: 0.25em;
}

/* Card media container styles */
wa-card [slot="media"] {
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--wa-color-neutral-10);
}

/* Lazy loading image styles */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  aspect-ratio: auto;
  display: block;
}

img[src]:not([data-src]) {
  opacity: 1;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

img.loading {
  filter: blur(5px);
  opacity: 0.5;
  min-height: 100px;
  max-height: 400px;
}

img.loaded {
  filter: blur(0);
  opacity: 1;
  animation: fadeIn 0.3s ease-in-out;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
