@import url("https://fonts.googleapis.com/css?family=PT+Sans:400,700|PT+Sans+Caption:700|Noto+Sans+Symbols+2|PT+Sans+Narrow:400:700|PT+Mono:400|PT+Serif:400,700|PT+Serif+Caption:400,700|Pridi:300,400,500");

:root {
  --gaps: 12px;
  --art-thumb-background: #F9F9F9;
  --img-height: 360px;
  --target-img-width: 320px;
  --dyn-img-width: 320px;
  --infobox-height: 92px;
  --headernav-height: 48px;
  --home-visual-width: 800px;
  --chead-height: 52px;
  /*--box-shadow-glass: inset 0  1px 3px rgba(255, 255, 255, 0.7),
                      inset 0 -1px 2px rgba(0, 0, 0, 0.3);*/
  --box-shadow-glass: inset 3px 3px 0.5px -3.5px rgba(255,255,255,0.60),
                      inset 2px 2px 0.5px -2px rgba(255,255,255,0.4),
                      inset -2px -2px 0.5px -2px rgba(255,255,255,0.4),
                      inset 0 0 5px 1px rgba(255,255,255,0.04),
                      inset 0 0 0 1px rgba(255,255,255,0.15),
                      inset 0 0 10px 0 rgba(255,255,255,0.255),
                      inset 0 0 24px 0 rgba(255,255,255,0.155),
                            0 0 25px 0 rgba(0,0,0,0.15);
  --box-shadow-tag: inset 0 1px 2px rgba(255, 255, 255, 0.5),
                          0 1px 2px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

p {
  text-align: justify;
  hyphens: auto;
  hyphenate-character: auto;
  line-height: 1.6;
}
red {
  color: #C02;
}
.red {
  color: #C02;
}
.green {
  color: #0A2;
}
h1 {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    font-size: 2.5rem;
}
h2 {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    font-size: 1.6rem;
}
h3 {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    font-size: 1.4rem;
}
h4 {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    font-size: 1.2rem;
}
h5 {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    font-size: 1.1rem;
}
strong {
    font-weight: 700;
}
body, html {
  width: 100vw;
  height: 100vh;
  font-size: 16.5px;
  font-family: 'PT Serif', serif;
  overflow-x: hidden;
}

body {
  height: 100vh; /* Make the container fill the viewport height */
  width: 100vw;
  background-image: url('background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: grid;
}

body.index {
  background-image: linear-gradient(rgba(0, 0, 0, 0.125), rgba(0, 0, 0, 0.125)), url('https://cdn.taimuworld.com/paintings_files/40.webp');
}

.header-main-footer {
  grid-template-columns: 1fr;
  grid-template-rows: var(--headernav-height) 1fr 4em;
  gap: 0; /* Optional: remove gap between rows */
}

.header-control-main-footer {
  grid-template-columns: 1fr;
  grid-template-rows: var(--headernav-height) 6em 1fr 4em;
  gap: 0; /* Optional: remove gap between rows */
}


/* Custom tags as display blocks */
gallery-bg,
gallery-container
art-frame,
art-info,
art-title,
art-author,
tag-container,
tag,
nav-controls,
popup,
featured-container,
featured-artwork,
featured-info,
featured-title,
featured-author,
featured-epic {
  display: block;
}

art-info form {
  display: inline-block;
  margin: 0;
}

quadiblock::before {
  content: "";
  visibility: hidden;
  display: inline-block;
}

quadiblock {
  display: inline-block;
  margin: 0 1em;
  padding: 0;
  width: 0;
  border-left: 1px solid rgba(255,255,255,0.5);
  border-right: 1px solid rgba(0,0,0,0.25);
}

copyright-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: 0 1em;
}

copyright-container p {
  font-family: "PT Sans Caption", sans-serif;
  font-weight: 400;
  font-size: 9pt;
  color: rgba(0,0,0,0.8);
}

/* Container */
gallery-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100vw;
  gap: 0;
  text-align: center;
  padding: 0 0 2rem 0;
}

gallery-container status-line {
  padding: 0.3em 0.5em;
  margin-bottom: 1em;
}

status-line p {
  margin-left: 1em;
  margin-right: 1em;
}

gallery-container.of-viewer {
  padding: 1rem 0 2rem 0;
}

gallery-control {
  display: flex;
  flex-direction: row;
  padding: 0.6rem 1.2rem;
  color: #222;
  width: fit-content;
  height: fit-content;
  place-self: center;
}

gallery-control form label {
  margin-top: 0.2em;
  margin-right: 0.3em;
}

gallery-control a {
  color: #222;
  cursor: pointer;
  text-decoration: none;
}

@media (hover: hover) {
  gallery-control a:hover {
    text-decoration: underline;
  }
}

/* Art frame */
art-frame {
  padding: 1.2rem;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  background: #fff;
  margin-bottom: 2rem;
}

art-frame a {
  display: block;
  line-height: 0;
}

art-frame img {
/*   max-height: 70vh; */
/*   max-width: 70vw; */
/* img width/height is dynamically defined in JS */
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Info */
.white-frosted-glass, content-wrapper, bandpanel.leaf, popup {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background-color: rgba(255, 255, 255, 0.44);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1),
              var(--box-shadow-glass);
  border-radius: 1rem;
}

header-nav-wrapper.white-frosted-glass {
  border-radius: 0;
}

art-info {
  margin-bottom: 2rem;
}

art-info, art-thumb {
  padding: 1rem 2rem;
  color: #222;
}

art-title {
  display: block;
  line-height: 1.0;
  margin-bottom: 0.4rem;
  font-weight: bold;
}
art-info art-title {
  font-size: 1.3rem;
}
art-thumb infobox art-title {
  font-size: 1.2rem;
}

art-author {
  display: block;
  font-family: "PT Serif Caption", serif;
  color: #555;
}
art-info art-author {
  margin-bottom: 1rem;
}
art-thumb infobox art-author {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Tags */
tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

tag {
  background-color: #d0e6f7;
  color: #003f5c;
  padding: 0 0.6em;
  border-radius: 999px;
  font-family: "Pridi", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  box-shadow: var(--box-shadow-tag);
}
tag.featuring {
  background-color: #a1f7a1;
  color: #004500;
}
tag.nsfw {
  background-color: #eba0b0;
  color: #790032;
}
tag.year {
  background-color: #f7e0b1;
  color: #483900;
}

/* Navigation */
nav-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

button {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border: none;
  border-radius: 999px;
  padding: 0rem 1.2rem;
  height: 36px;
  cursor: pointer;
  font-family: "PT Sans Caption", sans-serif;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1), var(--box-shadow-tag);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  color: #333;
}

button.toggle {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 8px;
}

button.toggle.alt {
  background-color: rgba(255, 255, 255, 0.33);
}

gallery-container.of-viewer > button:first-child {
  margin-bottom: 1rem;
}

form button {
  padding: 0rem 0.6rem;
}

@media (hover: hover) {
  button:hover {
    background-color: rgba(255, 255, 255, 1.0);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1), var(--box-shadow-tag);
    color: #333;
  }

  button.toggle:hover {
    background-color: rgba(255, 255, 255, 0.44);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1), var(--box-shadow-tag);
    color: #333;
  }

  button.toggle.alt:hover {
    background-color: rgba(255, 255, 255, 0.44);
  }
}

@media (hover: hover) {
  button.active, button.active:hover, button.active.alt:hover {
    background-color: rgba(255, 255, 255, 1.0);
    color: #000;
  }
}

button.active.alt {
  background-color: rgba(255, 255, 255, 0.85);
  color: #000;
}

@media (hover: hover) {
  button.nsfw.active, button.nsfw.active:hover {
    background-color: rgba(250, 84, 92, 1.0);
    color: #fff;
  }
}

thumbnail-container-centering {
  width: 100%;
  padding: 0 var(--gaps);
  display: flex;
  justify-content: center;
}

thumbnail-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; /* Align cards from the left */
  gap: var(--gaps);
  padding: var(--gaps) 0;
  width: auto;
  max-width: 100%;
}


@media (max-width: calc( 668px+2em)) { thumbnail-container { width: calc(100vw - 2em) } }

art-thumb {
  padding: 0;
  display: block;
  margin: 0;
  position: relative;
  box-sizing: border-box;
  max-width: var(--dyn-img-width);
  width: var(--dyn-img-width);
  height: calc(var(--img-height) + var(--infobox-height));
  max-height: calc(var(--img-height) + var(--infobox-height));
  animation: smooth 1.5s backwards;
  animation-delay: 0.40s;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  art-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-5px);
    box-shadow: 0 13px 25px rgba(0, 0, 0, 0.1), var(--box-shadow-glass);
  }
}


art-thumb infobox {
  display: flex;
  height: var(--infobox-height);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

art-thumb imgbox {
  display: block;
  height: var(--img-height);
  overflow: hidden;
  border-radius: 1rem 1rem 0 0;
  box-shadow: var(--box-shadow-glass);
}

art-thumb imgbox img {
  object-fit: cover;
  width: 100%;
  height: var(--img-height);
  filter: brightness(0.9375) saturate(0.9375);
  transition: filter 0.2s ease;
}

@media (hover: hover) {
  art-thumb imgbox img:hover {
    filter: brightness(1.0) saturate(1.0);
    box-shadow: var(--box-shadow-glass);
  }
}

art-thumb infobox h4{display:inline; margin: 0 0.18em;}


/* header nav bar */
header-nav-container {
  display: block;
  position: fixed;
  z-index: 9999999;
  width: calc(100vw + 10px);
  left: -4px;
  height: var(--headernav-height);
}

header-nav-wrapper {
  display: grid;
  position: relative;
  grid-template-rows: 1fr;
  grid-template-columns: var(--headernav-height) 1fr; /* picture | buttons */
  width: 100%;
  height: 100%;
  padding: 0;
/*   background: rgba(240, 234, 226, 0.85) !important; */
}

.header-nav-image {
  height: calc(var(--headernav-height) - 0.12em);
  padding: 0.2em 1em 0 1em;
}

header-nav-list {
  display: flex;
  gap: 0;
  align-items: center;
  padding: 0.2em 0 0.2em 1em;
}

/* "The Taimu World" link */
header-nav-list ul {
  display: flex;
  gap: var(--gaps);
}

header-nav-list ul li {
  display: inline-block;
  line-height: 0;
  font-size: 1.1rem;
  font-family: "PT Sans", sans-serif;
  font-weight: 900;
}

/* the subsequent links */
header-nav-list ul li + li {
  display: inline-block;
  line-height: 0;
  font-family: "PT Sans", sans-serif;
  font-weight: 400;
}

header-nav-list ul li a {
  font-size: 1rem;
  text-decoration: none;
  color: inherit;
  text-shadow: 0 0 20px rgba(255, 255, 255, 1.0);
}

@media (hover: hover) {
  header-nav-list ul li a:hover {
    text-decoration: underline;
  }
}

foldable-menubar {
  display: flex;
  flex-direction: column;
  justify-content: right;
  gap: 4px;
  width: 100%
}

/* Index page */
/* content-wrapper is also captured by .white-frosted-glass */

#notfirstpanel {
  margin: 0 calc(min(6vw, 3rem));
  width: calc(var(--home-visual-width) - min(12vw, 6rem));
  max-width: calc(100vw - min(12vw, 6rem));
}

#landingsectionhead {
  width: var(--home-visual-width);
  max-width: 100vw;
  aspect-ratio: 16 / 15;
  background-image: linear-gradient(rgba(0, 0, 0, 0.0625), rgba(0, 0, 0, 0.0625)),
                    url('header.webp');
  background-size: cover;
  background-position: center 0;
  background-repeat: no-repeat;
  border-radius: 1rem 1rem 0 0;
  box-shadow: var(--box-shadow-glass);
}

lobby-container content-wrapper {
  display: grid;
  grid-template-rows: auto 4px auto;
  grid-template-columns: 1fr;
  width: 100vw;
  max-width: var(--home-visual-width);
  margin: 1em auto;
}

popup {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: 1fr;
  padding: 1.5rem 2rem;
  max-width: 550px;
/*   width: 100vw; */
/*   max-width: var(--home-visual-width); */
  margin: 1em auto;
}

.horizontal-bar {
  height: 4px;
  width: 100%;
  background: rgb(0,0,0);
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.25) 35%, rgba(0,0,0,0) 100%);
}

@media(min-width: 1592px) {
  lobby-container content-wrapper {
    grid-template-columns: auto 4px auto;
    grid-template-rows: 1fr;
    max-width: calc(2 * var(--home-visual-width));
  }

  #landingsectionhead {
    border-radius: 1rem 0 0 1rem;
    width: var(--home-visual-width);
    height: 100%
  }

  #notfirstpanel {
    margin: 0 calc(min(6vw, 3rem));
    width: calc(100vw - var(--home-visual-width) - 4px - min(12vw, 6rem));
    max-width: calc(var(--home-visual-width) - 4px - min(12vw, 6rem));
  }

  .horizontal-bar {
  width: 4px;
  height: 100%;
  background: rgb(0,0,0);
  background: linear-gradient(90deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.25) 35%, rgba(0,0,0,0) 100%);
}
}

/* put margin on second */
lobby-container content-wrapper div section {
  margin: 1.4rem 0;
}

char-profile-container {
  margin-top: 2.5rem;
}

#landingsectionfeatured {
  margin: 1.4rem 0 1rem 0;
}

#landingsectionhead h1 {
  padding: 6% 0 0 10%;
  width: 25rem;
}

#landingsectionhead h5 {
  font-size: 1.2rem;
  font-family: "PT Serif", serif;
  font-weight: 400;
  padding: 1em 0 0 10.5%;
  width: 22rem;
  line-height: 1.6;
}

.text-welcome {
  font-family: "PT Serif", serif;
  color: #FFF;
  text-shadow: 0 0 128px rgba(0, 0, 0, 0.25),
               0 0  64px rgba(0, 0, 0, 0.25),
               0 0  32px rgba(0, 0, 0, 0.25),
               0 0  16px rgba(0, 0, 0, 0.25),
               0 0   8px rgba(0, 0, 0, 0.25),
               0 0   4px rgba(0, 0, 0, 0.25);
}

char-profile-container {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 3.2rem;
}

char-profile-container div img {
  width: 12rem;
  height: 12rem;
}

/* section 3 */
feature-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  max-width: 100%;
  gap: var(--gaps);
  text-align: center;
  overflow-y: visible;
  touch-action: pan-x;
}

feature-card {
  display: block;
  width: calc((var(--home-visual-width) - 6rem - 40px) / 3);
  height: 384px;
  padding: 1rem;
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), var(--box-shadow-glass);
  background: #fff;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  feature-card:hover {
    background: #FFF;
    transform: translateY(-3px);
    box-shadow: 0 7px 12px rgba(0,0,0,0.1), var(--box-shadow-glass);
  }
}

feature-card h3 {
  margin-top: 0.6rem;
  margin-bottom: 1.333rem;
}

feature-card > p {
  text-align: left;
  hyphens: none;
  padding: 0 1rem 2rem 1rem;
}

feature-card > img {
  width: calc((var(--home-visual-width) - 6rem - 40px) / 3 - 2rem);
  height: 200px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), var(--box-shadow-tag);
}

feature-container a {
  display: block;
  text-decoration: none;
  color: unset;
}

/* Contacts section */
contactbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  max-width: 100%;
  gap: var(--gaps);
  overflow-y: visible;
}

feature-container, contactbox {
  padding: 5px 8px 10px 8px;
}

contact-card {
  display: block;

  background: #F8F8F8;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1), var(--box-shadow-glass);
  padding: 0 0.2rem;

  width: calc((var(--home-visual-width) - 6rem - 40px) / 3);
  height: calc(var(--chead-height) * 1.2);

  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  contact-card:hover {
    background: #FFF;
    transform: translateY(-3px);
    box-shadow: 0 7px 12px rgba(0,0,0,0.1), var(--box-shadow-glass);
  }
}

contact-card a {
  width: calc((var(--home-visual-width) - 6rem - 40px) / 3);
  height: calc(var(--chead-height) * 1.2);

  display: grid;
  grid-template-columns: var(--chead-height) 1fr;
  gap: 0.5rem;
}

contact-card a sitebox {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.2rem;
}

contact-card a img {
  width: var(--chead-height);
  height: var(--chead-height);
  margin: auto 0;
}

contact-card a {
  text-decoration: none;
  color: unset;
}

sitename {
  font-weight: bold;
  font-size: 1.2rem;
  line-height: 0;
}

sitebox > sitename {
  font-weight: bold;
  font-size: 1.2rem;
  padding: 1.15rem 0.3rem 0 0.3rem;
  line-height: 0;
}

sitebox > handle {
  font-size: 1rem;
  color: #777;
  padding: 0 0.4rem 0 0.3rem;
  line-height: 0;
}

sitebox > handle.atmark {
  font-size: 1rem;
  color: #777;
  padding: 0 0.4rem 0 0.1rem;
  line-height: 0;
}

h2.home {
  margin-bottom: 0.6rem;
}

/* Featured Artworks section */
#featuredsection {
  margin: 1.4rem 0;
}

featured-artwork {
  display: block;
  width: calc((var(--home-visual-width) - 6rem - 40px) / 3);
  height: 274px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), var(--box-shadow-glass);
  background: #fff;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

featured-artwork, featured-artwork * {
  touch-action: pan-x;
}

@media (hover: hover) {
  featured-artwork:hover {
    background: #FFF;
    transform: translateY(-3px);
    box-shadow: 0 7px 12px rgba(0,0,0,0.1), var(--box-shadow-glass);
  }
}

featured-artwork img {
  width: calc((var(--home-visual-width) - 6rem - 40px) / 3);
  height: 180px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px 8px 0 0;
  filter: brightness(0.9375) saturate(0.9375);
  transition: filter 0.2s ease;
}

@media (hover: hover) {
  featured-artwork:hover img {
    filter: brightness(1.0) saturate(1.0);
  }
}

featured-artwork featured-info {
  display: block;
  padding: 0.8rem;
  height: 100px;
}

featured-artwork featured-title {
  display: block;
  font-family: 'PT Serif', serif;
  font-weight: bold;
  font-size: 1.1rem;
  line-height: 1.2;
  margin-bottom: 0.3rem;
  color: #222;
}

featured-artwork featured-author {
  display: block;
  font-family: "PT Serif Caption", serif;
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

featured-artwork featured-epic {
  display: inline-block;
  background-color: #ffd700;
  color: #8b6914;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-family: "Pridi", sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  box-shadow: var(--box-shadow-tag);
}

/* error page */
h3.errorpage {
  margin-bottom: 1em;
}

@media(max-width: 383px) {
  header-nav-list ul li {
    font-family: "PT Sans Narrow";
  }
}

/* Home screen */
@media(max-width: 799px) {
  feature-container, contactbox {
    overflow-x: scroll;
/*     overflow-y: visible; */
    overflow-y: clip;
    touch-action: pan-x;
  }

  feature-container *, contactbox * {
    touch-action: pan-x;
  }
}

@media(max-width: 625px) {
  char-profile-container {
    grid-template-columns: unset;
    grid-template-rows: auto 1fr;
    gap: 1rem;
  }

  #aboutthecharacter, #insigniacontainer {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  sitebox, sitename {
    display: none !important;
  }

  contact-card {
    width: calc(var(--chead-height) * 1.17);
    height: calc(var(--chead-height) * 1.17);
  }

  contact-card a {
    width: var(--chead-height) !important;
    height: calc(var(--chead-height) * 1.17) !important;
  }

  contactbox {
    overflow: hidden;
    text-align: center;
    justify-content: center;
    gap: calc(2 * var(--gaps));
  }
}

/* pure CSS loading ring */
.lds-dual-ring {
  display: inline-block;
  width: 80px;
  height: 80px;
}
.lds-dual-ring:after {
  content: " ";
  display: block;
  width: 64px;
  height: 64px;
  margin: 3px;
  border-radius: 50%;
  border: 6px solid #333;
  border-color: #333 transparent #333 transparent;
  animation: lds-dual-ring 1.2s linear infinite;
}
@keyframes lds-dual-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* partband */

gallery {
  display: grid;
  padding: var(--gaps);
  width: 100vw;

  gap: var(--gaps);
}
band {
  display: flex;
  gap: var(--gaps);
  width: 100%;
  flex-direction: row;
  height: 480px; /* temporary. should be dynamic */
}
band[dir="v"] {
  grid-row: span 2;
  flex-direction: column;
  height: 800px; /* temporary. should be dynamic */
}
.panel {
  background-size: cover;
  background-position: center;
  border-radius: 4px;
}
bandpanel {
  display: grid;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  gap: var(--gaps);
}

bandpanel[nsfw="1"] {
  position: relative;
  overflow: hidden;
}

bandpanel[nsfw="1"]::before {
  content: "";
  position: absolute;
  inset: -65536px;
  background: inherit;
  z-index: 0;
  opacity: var(--nsfw-blur-enabled);
}

bandpanel.leaf {
  filter: brightness(0.9375) saturate(0.9375);
  transition: filter 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  bandpanel.leaf:hover {
    filter: brightness(1.0) saturate(1.0);
    background-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-5px);
    box-shadow: 0 13px 25px rgba(0, 0, 0, 0.1), var(--box-shadow-glass);
  }
}

/* Lazy loading styles */
bandpanel[data-bg-src] {
  background-color: #f0f0f0; /* Placeholder color while loading */
  transition: opacity 0.3s ease-in-out;
  transition: filter 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

bandpanel[data-bg-src]:not(.bg-loaded) {
  opacity: 0.8;
  transition: filter 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;

}

bandpanel.bg-loaded {
  opacity: 1;
  transition: filter 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;

}

bandpanel.bg-error {
  background-color: #ffcccc;
  transition: filter 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;

}

/* Optional: Add a loading spinner */
bandpanel[data-bg-src]:not(.bg-loaded):not(.bg-error)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ddd;
  border-top-color: #666;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transition: filter 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;

}

@keyframes spin {
  to { transform: rotate(360deg); }
}
