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

:root {
  --bg: #151547;
  --bg-header: rgba(21, 21, 71, 0.85);
  --surface: #1d1b41;
  --gold: #d4af37;
  --text: #e5d6a0;
  --text-muted: rgba(229, 214, 160, 0.55);
  --text-faint: rgba(229, 214, 160, 0.4);
  --border: rgba(212, 175, 55, 0.15);
  --border-soft: rgba(212, 175, 55, 0.12);
  --max-narrow: 600px;
  --max-wide: 900px;
}

html,
body {
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
}

.app-container {
  max-width: var(--max-narrow);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background-color: var(--bg);
}

.app-container--wide {
  max-width: var(--max-wide);
}

.site-header {
  position: sticky;
  top: 0;
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-header__brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
  text-decoration: none;
  user-select: none;
}

.site-header__brand:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: rgba(212, 175, 55, 0.5);
}

/* Hub */
.hub {
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.hub__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.hub__tagline {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hub__doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .hub__doors {
    grid-template-columns: 1fr;
  }
}

.hub-door {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.hub-door:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background-color: rgba(212, 175, 55, 0.04);
}

.hub-door__label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.hub-door__desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.section-heading {
  padding: 1.25rem 1.5rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Admin composer */
.composer {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.composer textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: var(--text-faint);
}

.composer textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.btn-primary {
  background-color: var(--gold);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  transition: filter 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

/* Posts */
.post {
  display: flex;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  transition: background-color 0.2s ease;
}

.post:hover {
  background-color: rgba(212, 175, 55, 0.02);
}

.post-avatar-container {
  margin-right: 1rem;
  flex-shrink: 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--surface);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold);
  user-select: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.post-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.author-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gold);
  text-decoration: none;
}

.author-name:hover {
  text-decoration: underline;
}

.author-handle,
.post-time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-dot {
  color: var(--text-faint);
  font-size: 0.9rem;
}

.post-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;
  word-break: break-word;
}

.post-text a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.4);
}

.post-text a:hover {
  border-bottom-style: solid;
}

.post-actions {
  display: flex;
  gap: 2.5rem;
  margin-top: 1rem;
  padding-top: 0.25rem;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: rgba(229, 214, 160, 0.45);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 6px;
  border-radius: 50px;
  transition: all 0.2s ease;
}

.action-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.action-button--like:hover {
  color: #f43f5e;
  background-color: rgba(244, 63, 94, 0.08);
}

.action-button--like.active {
  color: #f43f5e;
}

.action-button--share:hover {
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.08);
}

.action-button--delete:hover {
  color: #f97316;
  background-color: rgba(249, 115, 22, 0.08);
}

.feed-status {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: rgba(229, 214, 160, 0.5);
  font-size: 0.95rem;
}

.site-footer {
  margin-top: auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.admin-link {
  background: none;
  border: none;
  color: rgba(229, 214, 160, 0.35);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  margin-top: 0.75rem;
}

.admin-link:hover {
  color: var(--gold);
}

/* Collection pages */
.collection-hero {
  padding: 2rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.collection-hero__title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.collection-hero__intro {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 36rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.5rem 0;
}

.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: transparent;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1.25rem 1.5rem 2rem;
}

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

@media (max-width: 480px) {
  .collection-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

.card__media {
  aspect-ratio: 4 / 3;
  background: rgba(212, 175, 55, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card__media--book {
  aspect-ratio: 2 / 3;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.35;
}

.card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.card__badge {
  margin-top: 0.5rem;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gold);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

/* Detail */
.detail {
  padding: 1.5rem 1.5rem 2.5rem;
}

.detail__back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid transparent;
}

.detail__back:hover {
  color: var(--gold);
  border-bottom-color: rgba(212, 175, 55, 0.4);
}

.detail__layout {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 700px) {
  .detail__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: start;
  }
}

.detail__gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail__gallery img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail__gallery--book img {
  aspect-ratio: 2 / 3;
  max-width: 280px;
}

.detail__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.detail__subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.detail__fields {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.detail__field {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .detail__field {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.detail__field dt {
  color: var(--text-faint);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail__field dd {
  color: var(--text);
}

.detail__block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
}

.detail__block h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.detail__block p,
.detail__block blockquote {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.detail__block blockquote {
  border-left: 2px solid rgba(212, 175, 55, 0.4);
  padding-left: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

.detail-status {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
