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

:root {
  --background: #101010;
  --surface: #191919;
  --border: #303030;
  --text: #f1eee8;
  --muted: #99938b;
  --accent: #c5a47e;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.gallery-header {
  max-width: 1100px;
  margin: auto;
  padding: 65px 25px 45px;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  margin-bottom: 55px;
}

.back-link:hover {
  color: var(--accent);
}

.eyebrow {
  color: var(--accent);
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.gallery-header h1 {
  font-size: clamp(38px, 7vw, 65px);
  font-weight: 400;
  letter-spacing: -2px;
  margin-bottom: 15px;
}

.gallery-header h1 span {
  color: var(--accent);
}

.intro {
  color: var(--muted);
  font-size: 15px;
  max-width: 500px;
}

.gallery-container {
  max-width: 1100px;
  margin: auto;
  padding: 0 25px 70px;
}

.upload-section {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 65px;
}

.section-heading h2,
.gallery-title h2 {
  font-size: 27px;
  font-weight: 400;
}

#memoryForm {
  display: flex;
  flex-direction: column;
  margin-top: 25px;
}

#memoryForm label {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  margin: 15px 0 8px;
}

#memoryCaption {
  width: 100%;
  padding: 14px;
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

#memoryCaption:focus {
  border-color: var(--accent);
}

#memoryFiles {
  width: 100%;
  padding: 12px;
  background: #101010;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.upload-hint {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 11px;
  margin-top: 10px;
}

#uploadBtn {
  margin-top: 22px;
  padding: 14px 22px;
  background: var(--accent);
  color: #17130f;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity 0.2s;
}

#uploadBtn:hover {
  opacity: 0.85;
}

#uploadBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#uploadStatus {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  margin-top: 15px;
  overflow-wrap: anywhere;
}

.gallery-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 15px;
  margin-bottom: 25px;
}

#memoryCount {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.memory-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  min-width: 0;
}

.memory-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #080808;
}

.memory-content {
  padding: 16px;
}

.memory-caption {
  font-size: 16px;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}

.memory-date {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 10px;
}

.delete-memory {
  margin-top: 15px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: #d68d83;
  font-family: Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
}

.delete-memory:hover {
  background: #2b1919;
}

.empty-message {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  padding: 25px 0;
  grid-column: 1 / -1;
}

footer {
  border-top: 1px solid var(--border);
  padding: 25px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 750px) {
  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .gallery-header {
    padding-top: 35px;
  }

  .back-link {
    margin-bottom: 40px;
  }

  .gallery-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .upload-section {
    padding: 20px;
  }

  .memory-grid {
    grid-template-columns: 1fr;
  }

  .gallery-title {
    align-items: start;
    flex-direction: column;
  }
}
