:root {
  --bg: #0a0c10;
  --bg-elev: #12151c;
  --text: #e8eaef;
  --muted: rgba(232, 234, 239, 0.55);
  --accent: #c9a962;
  --accent-soft: rgba(201, 169, 98, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --nav: #2f6fb5;
  --nav-hover: #3a82cf;
  --radius: 14px;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

.bg-glow {
  position: fixed;
  inset: -30% -20%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 20% 0%, rgba(201, 169, 98, 0.12), transparent 70%),
    radial-gradient(ellipse 40% 35% at 85% 15%, rgba(120, 160, 220, 0.08), transparent 65%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(255, 255, 255, 0.04), transparent 55%);
  z-index: 0;
}

.site-head {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(3rem, 8vw, 5.5rem) 1.5rem 3rem;
  max-width: 42rem;
  margin-inline: auto;
}

.site-head.compact {
  padding: 2rem 1.5rem 1rem;
  text-align: left;
  max-width: 56rem;
}

.site-head h1 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.head-nav {
  margin-top: 1.75rem;
}

.link-admin {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  transition: background 0.2s, border-color 0.2s;
}

.link-admin:hover {
  background: var(--accent-soft);
  border-color: rgba(201, 169, 98, 0.35);
}

main,
.page-main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.notice {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--muted);
}

.notice strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.35rem;
}

.notice-error {
  border-color: rgba(220, 100, 100, 0.35);
  color: #e8b4b4;
}

.notice-ok {
  border-color: rgba(120, 200, 160, 0.35);
  color: #b8e0cc;
}

.masonry {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

@media (min-width: 900px) {
  .masonry {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1100px) {
  .masonry {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
  }
}

.tile {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.2s;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  border-color: rgba(201, 169, 98, 0.22);
}

.tile-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tile-img-wrap {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #08090c;
}

.tile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.tile:hover .tile-img-wrap img {
  transform: scale(1.05);
}

.tile-cap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem 1.15rem;
}

.tile-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.tile-desc {
  font-size: 0.82rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.25rem 3rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-foot code {
  font-size: 0.76em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.site-foot a {
  color: var(--accent);
}

/* PhotoSwipe captions */
.pswp-caption-outer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  pointer-events: none;
}

.pswp__custom-caption {
  position: relative;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem clamp(1rem, 5vw, 3rem);
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  pointer-events: none;
}

.pswp__custom-caption h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.pswp__custom-caption p {
  margin: 0;
  opacity: 0.85;
}

/* Admin */
.page-admin .site-head a {
  color: var(--accent);
}

.admin-wrap {
  max-width: 34rem;
  margin-inline: auto;
}

.panel {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
}

.panel label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.panel input[type="text"],
.panel input[type="password"],
.panel input[type="email"],
.panel input[type="file"],
.panel select,
.panel textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.panel button {
  margin-top: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #c9a962, #a88b42);
  color: #15130a;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.upload-form textarea {
  resize: vertical;
  min-height: 4rem;
}

.form-error {
  color: #f0a8a8;
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-list li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.admin-list li:last-child {
  border-bottom: 0;
}

.admin-list img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: rgba(200, 80, 80, 0.2);
  color: #ffb4b4;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.admin-meta {
  flex: 1;
}

.admin-meta strong {
  display: block;
  font-weight: 500;
}

.muted {
  font-size: 0.82rem;
  color: var(--muted);
}

.btn-danger {
  background: rgba(200, 80, 80, 0.25) !important;
  color: #ffb4b4 !important;
}

.btn-ghost {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
}

.logout-row {
  margin-top: 1rem;
}

/* Brand + proguitar-like top menu */
.brand-bar {
  position: relative;
  z-index: 2;
  padding: 1.35rem 1.25rem 1rem;
  background: linear-gradient(180deg, #151820 0%, #0a0c10 100%);
  border-bottom: 1px solid var(--border);
}

.brand-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.brand-inner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(70vw, 220px);
}

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  background: #152038;
  color: #f3e6d4;
  padding: 1rem 1.25rem;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.footer-brand-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  width: 100%;
}

.footer-brand {
  display: inline-flex;
  flex-shrink: 0;
}

.footer-brand img {
  display: block;
  height: 28px;
  width: auto;
  opacity: 0.95;
}

.footer-legal {
  margin: 0;
  color: #c9b8a0;
  font-size: 0.9rem;
  white-space: nowrap;
}

.site-footer .footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0 auto;
  color: #c9b8a0;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.site-footer .footer-credit:hover,
.site-footer .footer-credit:focus-visible {
  color: var(--accent);
}

.site-footer .footer-credit img {
  height: 20px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 3px;
  padding: 0.12rem 0.28rem;
  object-fit: contain;
}

@media (max-width: 640px) {
  .footer-brand-block {
    justify-content: center;
  }

  .site-footer .footer-credit {
    margin-left: 0;
  }
}

.top-nav {
  position: relative;
  z-index: 2;
  background: var(--nav);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.top-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 2.65rem;
}

.nav-left,
.nav-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

.top-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
}

.top-nav a:hover,
.top-nav a.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.nav-user {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  padding: 0 0.5rem;
}

.hero-block {
  margin-bottom: 1.75rem;
}

.hero-block h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 400;
}

.crumb {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.crumb a {
  color: var(--accent);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

@media (min-width: 900px) {
  .topic-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1100px) {
  .topic-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
  }
}

.topic-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s, border-color 0.2s, box-shadow 0.3s;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 111, 181, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.topic-cover {
  display: block;
  aspect-ratio: 1;
  background: #0d1118;
  overflow: hidden;
}

.topic-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--accent);
  background: radial-gradient(circle at 30% 20%, rgba(47, 111, 181, 0.35), transparent 55%);
}

.topic-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem 1.1rem;
}

.topic-meta strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.topic-meta span {
  font-size: 0.82rem;
  color: var(--muted);
}

.topic-meta em {
  font-style: normal;
  font-size: 0.8rem;
  color: rgba(232, 234, 239, 0.4);
}

.page-auth .page-main {
  max-width: 32rem;
}

.auth-card.wide {
  max-width: 40rem;
}

.auth-card h1 {
  margin-top: 0;
  font-family: var(--font-display);
  font-weight: 400;
}

.stack-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-links {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-links a {
  color: var(--accent);
}

.admin-row {
  flex-wrap: wrap;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-actions form {
  margin: 0;
}

.admin-actions button {
  margin-top: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.status-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.status-pending {
  background: rgba(201, 169, 98, 0.2);
  color: #e6d3a0;
}

.status-approved {
  background: rgba(90, 180, 130, 0.2);
  color: #b8e0cc;
}

.status-rejected {
  background: rgba(200, 80, 80, 0.2);
  color: #ffb4b4;
}

.panel-sub {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
}

.panel-hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--muted);
}

.topic-admin-list .admin-meta {
  min-width: 12rem;
}

.panel input[type="number"] {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .top-nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.35rem 0.5rem 0.55rem;
  }

  .nav-left,
  .nav-right {
    justify-content: flex-start;
  }

  .nav-dropdown-panel {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 0.25rem;
    box-shadow: none;
  }
}

/* Emner pulldown */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

.nav-dropdown.is-active .nav-dropdown-toggle,
.nav-dropdown.is-open .nav-dropdown-toggle,
.nav-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #fff;
  opacity: 0.9;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 40;
  min-width: 260px;
  max-width: min(90vw, 360px);
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 0.4rem;
  border-radius: 8px;
  background: #1a2330;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.nav-dropdown-panel[hidden] {
  display: none !important;
}

.nav-dd-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  color: #fff !important;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-dd-link:hover,
.nav-dd-link.is-current {
  background: rgba(255, 255, 255, 0.12);
}

.nav-dd-child {
  padding-left: 1.15rem;
  font-weight: 400;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.88) !important;
}

.nav-dd-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.65;
}

.nav-dropdown-empty {
  display: block;
  padding: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.nav-sub-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0 0 0.25rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  margin: 0.15rem 0 0.35rem 0.55rem;
  padding-left: 0.35rem;
}

.album-section {
  margin-bottom: 2.75rem;
}

.album-section-head {
  margin-bottom: 1rem;
}

.album-section-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
}

.album-section-head h2 a {
  color: inherit;
  text-decoration: none;
}

.album-section-head h2 a:hover {
  color: var(--accent);
}

.album-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.album-section-desc {
  margin-top: 0.35rem !important;
  max-width: 40rem;
}

.topic-grid-single {
  margin-bottom: 2rem;
}
