﻿/* ============================================
   Aalto Darkroom — Nordic Minimal Photo Theme
   ============================================ */

:root {
  --surface: #131313;
  --surface-low: #1c1b1b;
  --surface-lowest: #0e0e0e;
  --surface-high: #2a2a2a;
  --text-main: #e5e2e1;
  --text-muted: #c6c6c6;
  --text-quiet: #919191;
  --outline-variant: #474747;
  --primary: #ffffff;
  --radius-sm: 2px;
  --space-1: 0.7rem;
  --space-2: 1.4rem;
  --space-3: 2.1rem;
  --space-4: 2.8rem;
  --space-5: 4.2rem;
}

/* ---- Reset ---- */

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--text-main);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  min-height: 100%;
  overflow-x: hidden;
}

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

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--outline-variant);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- Header ---- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(19, 19, 19, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: background 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(14, 14, 14, 0.92);
}

.header-shell {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* ---- Navigation ---- */

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.menu-primary {
  font-family: "Manrope", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.menu-primary a {
  color: var(--text-muted);
  padding: 0.25rem 0;
  transition: color 300ms ease;
}

.menu-primary a:hover {
  color: var(--primary);
}

.menu-primary .current-menu-item > a,
.menu-primary .current_page_item > a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* ---- Main ---- */

.site-main {
  padding-top: 5rem;
  min-height: calc(100vh - 120px);
}

/* ---- Feed / Archive: True Responsive Masonry ---- */

.feed-layout {
  width: 100%;
  max-width: 100%;
  padding: var(--space-1) 1.5rem var(--space-5);
}

.gallery-grid {
  columns: 1;
  column-gap: 0.75rem;
}

.gallery-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 0.75rem;
  break-inside: avoid;
}

.gallery-card a {
  display: block;
}

.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 500ms ease, box-shadow 500ms ease;
}

.gallery-card:hover img {
  transform: scale(1.015);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.card-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(140deg, #2d2d2d, #1b1b1b);
  border-radius: var(--radius-sm);
}

/* Responsive columns */
@media (min-width: 480px) {
  .gallery-grid { columns: 2; }
}
@media (min-width: 900px) {
  .gallery-grid { columns: 3; column-gap: 1rem; }
  .gallery-card { margin-bottom: 1rem; }
}
@media (min-width: 1400px) {
  .gallery-grid { columns: 3; column-gap: 1.2rem; }
  .gallery-card { margin-bottom: 1.2rem; }
  .feed-layout { padding-left: 2rem; padding-right: 2rem; }
}
@media (min-width: 2000px) {
  .gallery-grid { columns: 4; }
}

/* ---- Single Post Layout ---- */

.single-layout {
  width: 100%;
  min-height: calc(100vh - 5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) 6vw var(--space-5);
}

.single-article {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.single-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.single-featured-image {
  width: 100%;
  max-width: min(88vw, 1100px);
}

.single-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Single post body content */

.single-content img {
  display: block;
  width: 100%;
  max-width: min(88vw, 1100px);
  height: auto;
  margin: 0;
}

.single-content .wp-block-image,
.single-content figure,
.single-content .gallery {
  margin: 0 0 var(--space-2);
  max-width: min(88vw, 1100px);
}

.single-content .wp-block-gallery {
  display: grid;
  gap: 0.9rem;
  margin: 0 0 var(--space-2);
  max-width: min(88vw, 1100px);
}

.single-content .wp-block-gallery .blocks-gallery-item,
.single-content .wp-block-gallery .blocks-gallery-image {
  margin: 0;
}

.single-content p,
.single-content ul,
.single-content ol,
.single-content blockquote {
  max-width: 48rem;
  width: 100%;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 var(--space-2);
}

.single-content h2,
.single-content h3,
.single-content h4 {
  color: var(--text-main);
  font-family: "Manrope", sans-serif;
  margin: var(--space-3) 0 var(--space-1);
  max-width: 48rem;
  width: 100%;
}

/* ---- Fixed Return Link (viewport bottom-right) ---- */

.return-link {
  position: fixed;
  bottom: 3rem;
  right: 3rem;
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--outline-variant);
  text-decoration: none;
  transition: color 500ms ease;
}

.return-link:hover {
  color: var(--primary);
}

.return-link-line {
  width: 1px;
  height: 3rem;
  background: var(--outline-variant);
  transition: background 500ms ease;
}

.return-link:hover .return-link-line {
  background: var(--primary);
}

.return-link-text {
  writing-mode: vertical-lr;
  text-orientation: mixed;
  font-family: "Inter", sans-serif;
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .return-link {
    display: flex;
  }
}

/* ---- No Content ---- */

.no-content {
  background: var(--surface-low);
  padding: var(--space-4);
}

.no-content h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
}

.no-content p {
  margin-top: 0.7rem;
  color: var(--text-muted);
}

/* ---- Footer ---- */

.site-footer {
  background: var(--surface-lowest);
  opacity: 0.5;
  transition: opacity 300ms ease;
}

.site-footer:hover {
  opacity: 1;
}

.footer-shell {
  max-width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-copy {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.6rem;
  color: var(--text-muted);
}

.menu-footer {
  gap: 1.4rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.menu-footer a {
  color: var(--outline-variant);
  transition: color 300ms ease;
}

.menu-footer a:hover {
  color: var(--primary);
}
