/*
 * Tafrah web preview — local cover art.
 *
 * The six fictional shows in src/demo.js have no artwork URL, so each gets a
 * drawn cover here. A real `coverUrl` from the API always takes precedence
 * (see `cover()` in src/ui.js).
 */

@layer components {
  .cover-frame--editorial .generated-cover {
    display: block;
    background: #29335b;
    color: #f7f2ea;
  }

  .cover-frame--editorial .generated-cover::before,
  .cover-frame--editorial .generated-cover::after {
    position: absolute;
    display: block;
    opacity: 1;
  }

  .cover-edition,
  .cover-footer {
    position: absolute;
    z-index: 2;
    inset-inline-start: 8%;
    font-weight: 650;
    text-shadow: none;
  }

  .cover-edition {
    inset-block-start: 7%;
    font-family: var(--font-latin), var(--font-ar);
    font-size: clamp(0.27rem, 3.8cqw, 0.65rem);
    letter-spacing: 0.13em;
  }

  .cover-edition b {
    color: var(--coral);
  }

  .cover-footer {
    inset-block-end: 6%;
    font-size: clamp(0.24rem, 3cqw, 0.55rem);
    opacity: 0.78;
  }

  .cover-frame--editorial .cover-monogram {
    position: absolute;
    z-index: 2;
    inset-inline-start: 8%;
    inset-block-end: 19%;
    max-width: 77%;
    font-size: clamp(0.6rem, 16cqw, 3.5rem);
    font-weight: 700;
    line-height: 1.16;
    text-align: start;
    text-shadow: none;
  }

  .cover-frame[data-cover-art='ala-mahl'] .generated-cover {
    background: #253662;
  }

  .cover-frame[data-cover-art='ala-mahl'] .generated-cover::before {
    width: 58%;
    height: 58%;
    inset: 17% auto auto -7%;
    border: 0;
    background: #e08a79;
  }

  .cover-frame[data-cover-art='ala-mahl'] .generated-cover::after {
    width: 108%;
    height: 108%;
    inset: auto auto -69% -31%;
    border: 1px solid #dfc6c0;
    box-shadow: 0 0 0 10cqw #253662, 0 0 0 calc(10cqw + 1px) #dfc6c0;
  }

  .cover-frame[data-cover-art='bayna-satrayn'] .generated-cover {
    background: #e9d9bd;
    color: #27304b;
  }

  .cover-frame[data-cover-art='bayna-satrayn'] .generated-cover::before {
    width: 57%;
    height: 78%;
    inset: 11% auto auto -8%;
    border: 0;
    border-radius: 0.1rem;
    background: repeating-linear-gradient(0deg, #283452 0 1px, transparent 1px 10cqw), #f3e9d5;
    transform: rotate(-10deg);
  }

  .cover-frame[data-cover-art='bayna-satrayn'] .generated-cover::after {
    width: 9%;
    height: 90%;
    inset: -8% auto auto 63%;
    border: 0;
    border-radius: 0;
    background: #d16c61;
    transform: rotate(13deg);
  }

  .cover-frame[data-cover-art='madon-tasmaa'] .generated-cover {
    background: #247280;
  }

  .cover-frame[data-cover-art='madon-tasmaa'] .generated-cover::before {
    width: 67%;
    height: 67%;
    inset: -18% auto auto -14%;
    border: 0;
    background: #e8aa68;
  }

  .cover-frame[data-cover-art='madon-tasmaa'] .generated-cover::after {
    width: 104%;
    height: 42%;
    inset: auto -2% -1% auto;
    border: 0;
    border-radius: 0;
    background: #183b5b;
    clip-path: polygon(0 35%, 13% 35%, 13% 5%, 29% 5%, 29% 48%, 40% 48%, 40% 20%, 51% 20%, 51% 55%, 64% 55%, 64% 0, 77% 0, 77% 41%, 100% 41%, 100% 100%, 0 100%);
  }

  .cover-frame[data-cover-art='nuqtat-tahawol'] .generated-cover {
    background: #ce665b;
  }

  .cover-frame[data-cover-art='nuqtat-tahawol'] .generated-cover::before {
    width: 81%;
    height: 81%;
    inset: 7% auto auto -17%;
    border: 1.5cqw solid #f0b9a0;
    box-shadow: 0 0 0 9cqw #ce665b, 0 0 0 10cqw #f0b9a0;
  }

  .cover-frame[data-cover-art='nuqtat-tahawol'] .generated-cover::after {
    width: 24%;
    height: 24%;
    inset: 21% 15% auto auto;
    border: 0;
    background: #263967;
  }

  .cover-frame[data-cover-art='athar'] .generated-cover {
    background: #244f4b;
  }

  .cover-frame[data-cover-art='athar'] .generated-cover::before {
    width: 87%;
    height: 106%;
    inset: -39% auto auto -27%;
    border: 0;
    border-radius: 45% 55% 42% 58%;
    background: #a9c1a3;
    transform: rotate(28deg);
  }

  .cover-frame[data-cover-art='athar'] .generated-cover::after {
    width: 72%;
    height: 72%;
    inset: 3% auto auto -30%;
    border: 1px solid #d5e1b6;
    box-shadow: 0 0 0 9cqw #244f4b, 0 0 0 calc(9cqw + 1px) #d5e1b6;
  }

  .cover-frame[data-cover-art='madaad'] .generated-cover {
    background: #302b4b;
  }

  .cover-frame[data-cover-art='madaad'] .generated-cover::before {
    width: 93%;
    height: 93%;
    inset: -37% auto auto -32%;
    border: 1.2cqw solid #bd956c;
    box-shadow: 0 0 0 8cqw #302b4b, 0 0 0 calc(8cqw + 1px) #bd956c;
  }

  .cover-frame[data-cover-art='madaad'] .generated-cover::after {
    width: 20%;
    height: 86%;
    inset: 12% 18% auto auto;
    border: 0;
    border-radius: 0;
    background: #b76c6d;
    transform: rotate(-25deg);
  }
}
