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

/* Base */
:root {
  --text: #000;
  --muted: #888;
  --bg: #fff;
  --content-width: 900px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
}

/* ── Layout ── */

.page {
  padding: 1rem 1.75rem;
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ── Header ── */

header {
  margin-bottom: 2.5rem;
  text-align: center;
}

/* ── Nav — sits above logo, centered ── */

nav {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding-top: 1.5rem; /* 24px breathing room at the very top */
  margin-bottom: 0.75rem;
}

nav a {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--muted);
  letter-spacing: 0.04em;
}

nav a:hover {
  color: var(--text);
}

/* ── Site name (text treatment, all non-homepage pages) ── */

.site-name {
  margin-bottom: 0;
  line-height: 1;
  text-align: center;
}

.site-name a {
  text-decoration: none;
  display: inline-block;
  width: max-content;
  margin: 0 auto;
}

.site-name-text {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 0.85;
}

/* ── Homepage intro ── */

.home-intro {
  font-size: 1rem;
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 3rem;
  text-align: center;
  line-height: 1.6;
}

/* ── View the Archive CTA (homepage) ── */
.archive-cta {
  text-align: center;
  margin-top: 7rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Post list (homepage) ── */

.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 2.25rem;
}

.post-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
  letter-spacing: 0.01em;
}

.post-title {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
}

.post-title a {
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Individual post ── */

/* Wrapper: title/date on left, Categories/Recent on right */
.post-header-wrap {
  display: flex;
  gap: 2.5rem;
  align-items: stretch;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 2.5rem;
}

.post-header-wrap .post-header {
  flex: 1;
  margin-bottom: 0;
  padding-bottom: 2rem;
}

.post-sidebar {
  flex-shrink: 0;
  display: flex;
  gap: 0;
  padding-left: 1.5rem;
}

.sidebar-col {
  width: 120px;
  /* padding-bottom creates content-to-divider breathing room without
     moving the border-left (which sits on the border-box edge) */
  padding-bottom: 2rem;
}

/* Space between Categories and Recent, with connecting vertical divider */
.sidebar-col:first-child {
  padding-right: 1.25rem;
}

.sidebar-col + .sidebar-col {
  padding-left: 1.25rem;
}

.sidebar-label {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.sidebar-col ul {
  list-style: none;
}

.sidebar-col li {
  margin-bottom: 0.85rem;
}

.sidebar-col a {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  display: block;
  line-height: 1.35;
}

.sidebar-col a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recent-post-date {
  font-size: 0.7rem;
  color: var(--muted);
  display: block;
  margin-top: 0.1rem;
}

/* mobile post-header-wrap rules consolidated in the mobile section below */

.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post-header .post-date {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--muted);
}

.post-cover {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 2.5rem;
}

/* ── Topic box links ── */
.topic-box a {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
}

/* ── Homepage post grid — strict left-to-right, top-to-bottom order ── */
.home-post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .home-post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* ── Homepage post boxes (whole box is the link) ── */
a.home-post-box {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.home-post-box:hover .topic-label {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-post-box .topic-label {
  font-weight: 400;
}

.home-post-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 1rem;
}

/* ── Post body ── */

.post-body {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.6rem;
}

.post-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.4rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.4rem;
  margin-bottom: 1.5rem;
}

.post-body li {
  margin-bottom: 0.3rem;
}

.post-body blockquote {
  padding-left: 1.25rem;
  border-left: 2px solid #ddd;
  color: var(--muted);
  font-style: italic;
  margin: 2rem 0;
}

.post-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── About page image ── */
.about-image {
  display: block;
  margin: 2rem auto 0;
}

/* ── Back link ── */

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  margin-top: 3.5rem;
}

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

/* ── Footer ── */

footer {
  margin-top: 5rem;
  padding-bottom: 2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ────────────────────────────────────────
   Magazine / Collage Layout
   Opt in: .page--wide on the .page div
   Collage zone sits below the post body,
   full-width CSS grid, no absolute pos,
   no rotated text or boxes.
───────────────────────────────────────── */

.page--wide {
  max-width: 1080px;
}

/* ── Collage zone wrapper ── */
.collage-zone {
  margin-top: 2rem;
  padding-top: 0;
}

.collage-zone-label {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

/* ── Topic boxes ── */
.topic-box {
  border: 1px solid #e0e0e0;
  padding: 1.25rem;
}

/* Topic label: Bodoni Moda italic, mixed case, clearly larger than body */
.topic-label {
  display: block;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

/* Body text: Manrope, smaller than header to create clear hierarchy */
.topic-box p,
.topic-box ul {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0;
}

.topic-box p + p {
  margin-top: 1rem;
}

.topic-box p + ul {
  margin-top: 0.6rem;
}

/* ── Tags ── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.tag {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 0.7rem;
  text-decoration: none;
  border: 1px solid #ccc;
  padding: 0.15rem 0.5rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.tag:hover {
  color: var(--text);
  border-color: #999;
}

/* Tag pages */
.tag-heading {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 1.75rem;
}

.topic-box ul {
  padding-left: 1.25rem;
}

.topic-box li {
  margin-bottom: 0.35rem;
}

/* ── Photo cells ──
   Own grid slots only — never share space with text.
   Figure wraps img + caption so rotation moves both together. */
.photo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  min-height: 200px;
  border: 1px dashed #ddd; /* mobile placeholder outline */
}

.photo-figure {
  width: 100%;
}

/* Printed-photo cutout look */
.photo-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 5px solid #fff;
  outline: 1px solid #ddd;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
}

/* Caption: small, muted, sits just under the image */
.photo-figure figcaption {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 0.72rem;
  color: #888;
  margin-top: 0.45rem;
  line-height: 1.4;
  text-align: center;
}

/* ── CSS columns layout ──
   Items pack by content height — no row locking, no empty bands.
   break-inside: avoid keeps each box/photo from splitting across columns.
   Mobile: 1 column. Desktop: 2 columns with consistent gap. */

.collage-grid {
  column-count: 1;
}

/* Each direct child: don't split, consistent bottom gap */
.collage-grid > * {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

@media (min-width: 800px) {
  .collage-grid {
    column-count: 2;
    column-gap: 2rem;
  }

  .collage-grid > * {
    margin-bottom: 2rem;
  }

  .photo-cell { border: none; }

  /* Cutout rotation — desktop only, on figure (img + caption),
     never on any element containing text */
  .photo-cell-1 .photo-figure {
    transform: rotate(-3deg);
    transform-origin: center;
  }

  .photo-cell-2 .photo-figure {
    transform: rotate(2.5deg);
    transform-origin: center;
  }
}

/* ────────────────────────────────────────
   Mobile & Tablet — max 700px
───────────────────────────────────────── */

@media (max-width: 700px) {
  /* Tighter page padding on small screens */
  .page,
  .page--wide {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Logo fills most of the screen width on mobile */
  .site-name img {
    width: 90vw;
    max-width: 100%;
  }

  /* Post title smaller on mobile */
  .post-header h1 {
    font-size: 1.3rem;
  }

  /* Post body full width */
  .post-body {
    max-width: 100%;
  }

  /* Sidebar stacks below title/date */
  .post-header-wrap {
    flex-direction: column;
    gap: 0;
    border-bottom: none;
  }

  .post-header-wrap .post-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1.25rem;
  }

  .post-sidebar {
    width: 100%;
    border-left: none;
    padding-left: 0;
    padding-bottom: 1.25rem;
    /* no border-bottom — post-header already has one, so only one line total */
    margin-bottom: 1.5rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }

  .sidebar-col {
    width: auto;
    flex: 1;
    min-width: 120px;
    padding-bottom: 0;
  }

  /* Remove vertical divider between cols when stacked horizontally */
  .sidebar-col + .sidebar-col {
    border-left: 1px solid #e0e0e0;
  }

  /* Photo cells full width, no min-height */
  .photo-cell {
    min-height: 0;
    padding: 0.75rem 0;
    border: none;
  }

  /* Less footer spacing */
  footer {
    margin-top: 3rem;
  }

  /* Collage grid gap */
  .collage-grid > * {
    margin-bottom: 1rem;
  }

  .topic-box {
    padding: 1rem;
  }
}
