/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --accent-color: #ff0000;
  --border-width: 3px;
  --font-main: "Courier New", Courier, monospace; /* Brutalist vibe */
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.4;
  overflow-x: hidden;
}

/* Typography */
h1 {
  font-size: 2.5rem;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 0.9;
  border-bottom: var(--border-width) solid var(--text-color);
  padding: 1rem;
}

.text-red {
  color: var(--accent-color);
}

/* Grid Layout */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile first: 1 column */
  gap: 0; /* Brutalist grids often touch */
  border-bottom: var(--border-width) solid var(--text-color);
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tiles */
.tile {
  border-bottom: var(--border-width) solid var(--text-color);
  padding: 1.5rem;
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

/* Add right border to odd items on tablet+ to create grid lines */
@media (min-width: 768px) {
  .tile:nth-child(odd) {
    border-right: var(--border-width) solid var(--text-color);
  }
}
@media (min-width: 1024px) {
  .tile {
    border-right: var(--border-width) solid var(--text-color);
  }
  /* Reset nth-child logic for 3 columns if needed, but simple border-right is usually fine for brutalism */
  .tile:nth-child(3n) {
    border-right: none;
  }
}

.tile:hover {
  background-color: var(--accent-color);
  color: var(--bg-color);
}

.tile:active {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.tile-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  word-break: break-word;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.overlay.hidden {
  display: none;
}

.close-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: var(--accent-color);
  border: none;
  border-left: var(--border-width) solid var(--text-color);
  border-bottom: var(--border-width) solid var(--text-color);
  color: var(--bg-color);
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  font-family: sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 5px; /* Visual adjustment */
}

.close-btn:hover {
  background-color: var(--text-color);
  color: var(--accent-color);
}

.overlay-content {
  width: 100%;
  max-width: 800px;
  text-align: center;
}

.media-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  border: var(--border-width) solid var(--text-color);
  padding: 1rem;
  background: var(--bg-color);
  box-shadow: 5px 5px 0px var(--text-color);
}

.player-container {
  width: 100%;
}

audio,
video {
  width: 100%;
  outline: none;
  border: var(--border-width) solid var(--text-color);
}

/* Custom Audio Player Styling (Basic Brutalist Tweaks) */
audio::-webkit-media-controls-panel {
  background-color: var(--bg-color);
  border-radius: 0;
}
