/**
 * Webring Boxes CSS
 * Styles for the webring boxes display
 */

/* Container */
.webring-boxes-container {
  --box-spacing: 0.5rem;
  --box-min-width: 500px;
  --columns: 4;

  display: grid;
  grid-template-columns: repeat(var(--columns), 1fr);
  gap: var(--box-spacing);
  padding: var(--box-spacing);
  width: 100%;
  max-width: calc(
    var(--box-min-width) * var(--columns) + var(--box-spacing) *
      (var(--columns) - 1)
  );
  margin: 0 auto;
}

/* Box Item */
.box-item {
  position: relative;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

/* Box Content */
.box-content {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 0.25rem;
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.box-item:hover .box-content {
  transform: translateY(-5px);
}

/* Background */
.box-bg {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.box-item:hover .box-bg {
  opacity: 0.9;
}

/* Box Name and Metadata */
.box-name {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25em;

  /* Typography */
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  text-align: center;
  color: #000;
  opacity: 0.75;

  /* A subtle, spread-out text shadow to mimic a blur */
  text-shadow: 0 0 1.5px rgba(0, 0, 0, 0.5);
}

.box-name .type-m {
  font-size: clamp(0.7rem, 1vw, 0.875rem);
  opacity: 0.85;
}

/* Responsive Layout */
@media screen and (max-width: 2200px) {
  .webring-boxes-container {
    --columns: 4;
  }
}

@media screen and (max-width: 1800px) {
  .webring-boxes-container {
    --columns: 3;
  }
}

@media screen and (max-width: 1400px) {
  .webring-boxes-container {
    --columns: 2;
    max-width: calc(var(--box-min-width) * 2 + var(--box-spacing));
  }
}

@media screen and (max-width: 1000px) {
  .webring-boxes-container {
    --columns: 1;
    max-width: var(--box-min-width);
  }
}

/* Small Screen Layout */
@media screen and (max-width: 600px) {
  .webring-boxes-container {
    max-width: 100%;
    padding: var(--box-spacing);
  }

  .box-item {
    min-width: 100%;
  }

  .box-name {
    padding: 0.75rem 1rem;
  }
}
