/* Мобила */
* {
  --line-width: 0.07rem;
  --logo: 2rem;
  --gap: 1rem;
  --gaph: calc(var(--gap) / 2);
  --gap2: calc(var(--gap) * 2);
  border: 0;
  box-sizing: border-box;
  color:  var(--color);
  font-family: Jost, system-ui;
  font-weight: lighter;
  gap: 0;
  margin: 0;
  padding: 0;
}
a {
    text-decoration-thickness: 0.03em;
}

body {
  background-color: var(--bg);
}
main {
  overflow-wrap: anywhere;
}
article {
  align-items: start;
  display: grid;
  gap: var(--gap);
  grid-auto-flow: dense;
  margin: 0 0 var(--gap) 0;
}
article h1 {
  grid-column: 1/-1;
  text-align: center;
}
article .albdesc{
  column-gap: var(--gaph);
  column-width: 30rem;
  margin: 0 var(--gap);
}
section {
  align-items: start;
  display: grid;
  gap: var(--gap);
  grid-auto-flow: dense;
  margin: 0 0 var(--gap);
  padding: 0 var(--gap);
}
[data-display="hidden"]
{
  display: none;
}
figure {
  grid-auto-flow: column;
  margin: 0 auto;
  width: fit-content;
}
figure:has([data-ratio=tal]) {
  grid-row: span 2;
  place-self: center;
}
figure:has([data-ratio=xtl]) {
  grid-row: span 3;
  place-self: center;
}
figure:has([data-letters=epic]) {
  grid-row: span 2;
}

figure > figcaption:only-child h2::before
{
  background-image: url('../images/file.svg');
  background-size: contain;
  background-repeat: no-repeat;
  content: '';
  display: block;
  height: 8rem;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.8;
  width: 8rem;
}
figure[data-ext=pdf] > figcaption:only-child h2::before {
  background-image: url('../images/pdf.svg');
}
figure[data-type=directory] > figcaption:only-child h2:only-child::before {
  background-image: url('../images/folder.svg');
}

section figure {
  position: relative;
}
figure img {
  display: block;
  margin: 0 auto;
}
figcaption {
  max-height: 32rem;
  overflow: hidden;
  column-gap: var(--gaph);
  column-width: 30rem;
}
article figcaption {
  max-width: calc(100svw - var(--gap2));
  width: 100%;
  margin: 0 auto;
}
figcaption h2 {
  text-align: center;
}
footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin: var(--gap);
  justify-content: space-evenly;
  text-align: center;
}
footer ul {
  display: contents;
  list-style-type: none;
}
aside {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin: var(--gap);
}
aside a {
  height: 15vmin;
  flex: 1 1 auto;
}
aside img {
  filter: drop-shadow(0 0 var(--gaph) rgba(0,0,0,.8));
  max-height: 100%;
  max-width: 100%;
  min-width: 100%;
  object-fit: cover;
}
main img,
main video {
  max-height: 90svh;
  max-width: 100%;
}
article img {
  scroll-snap-align: center;
}
section img {
  filter: drop-shadow(0 0 var(--gaph) rgba(0,0,0,.8));
}

/* Мини */
@media (min-width: 577px) {
* {
  --gap: 2rem;
}
section {
  grid-template-columns: repeat(2,1fr);
}
section figure:has([data-ratio=xwd]) {
  grid-column: span 2;
}
}

/* Планшет */
@media (min-width: 1201px) {
  * {
    --gap: 3rem;
  }
section {
  grid-template-columns: repeat(3,1fr);
}
}

/* Телек */
@media (min-width: 1401px) {
  * {
    --gap: 4rem;
  }
section {
  grid-template-columns: repeat(4,1fr);
}
}

/* Комп */
@media (min-width: 1920px) {
  * {
    --gap: 5rem;
  }
article {
  grid-template-columns: repeat(2,1fr);
  margin: var(--gap);
}
article figure:has([data-ratio=xwd]) {
  grid-column: span 2;
}
section {
  grid-template-columns: repeat(5,1fr);
}
}

/* Тач */
@media (pointer:coarse) {
[data-fancybox] {
    pointer-events: none;
}
html {
  scroll-snap-type: y proximity;
}
main img,
main video {
  max-height: 100svh;
}
}

/* Темы */
@media  (prefers-color-scheme: dark) {
  * {
    --link: #fafafa;
    --color: #eeeeee;
    --visited: #bdbdbd;
    --bg: #212121;
  }
  header img.logo {
    filter: invert(100%);
  }
 figure > figcaption:only-child h2::before
 {
    filter: invert(100%);
  }
}

@media  (prefers-color-scheme: no-preference),
        (prefers-color-scheme: light) {
  * {
    --link: #212121;
    --color: #616161;
    --visited: #9e9e9e;
    --bg: #fafafa;
  }
  aside img,
  section img
  {
  filter: drop-shadow(0 0 var(--gaph) rgba(0,0,0,.3));
  }
}