/* MPLAN Magazine — styled after sabinemarcelis.com */

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

html, body {
  background: #ffffff;
  color: #000000;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14.9px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

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

sup {
  font-size: 0.6em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
}

/* Top menu: About / Contact — solid white strip so scrolling content
   never bleeds through on mobile. */
.menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #ffffff;
  border-bottom: 1px solid transparent; /* keeps layout steady when we add a hairline */
}
.menu a { pointer-events: auto; }

.menu .homeLink {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.menu .aboutLink { order: 1; }
.menu .imprintLink { order: 3; }

/* Intro text block */
.intro {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 15px 26px;
  text-align: center;
}
.intro p {
  font-size: 14.9px;
  line-height: 1.45;
}
.intro a { text-decoration: none; }
.intro a:hover { text-decoration: underline; }

/* Category filter */
.categories {
  text-align: center;
  padding: 0 15px 40px;
}
.categories .row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 4px;
}
.categories .cat {
  font-size: 14.9px;
  cursor: pointer;
}
.categories .cat.active { text-decoration: underline; }

/* Grid of article thumbnails — max 6 per row, responsive */
.home {
  padding: 0 15px 143px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ececec; /* subtle outline so empty tiles stay visible on white */
}
.thumb.has-image { border-color: transparent; }

.thumb .tile {
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: filter 0.4s 0.1s ease, opacity 0.4s 0.1s ease;
}

/* Sabine-style hover: image blurs + dims slightly under the title overlay */
.thumb.has-image:hover .tile {
  opacity: 0.6;
  filter: blur(4px) brightness(1.1);
}
.thumb:not(.has-image):hover .tile {
  opacity: 0.35;
  filter: blur(4px);
}

.thumb .meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 14px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  color: #000;
}
.thumb:hover .meta { opacity: 1; }

/* Keep hover text legible on any cover image */
.thumb.has-image .meta {
  color: #000;
}

.thumb .meta .title {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 400;
  margin-bottom: 6px;
}
.thumb .meta .author {
  font-size: 11px;
  line-height: 1.3;
  color: #333;
}

/* Tone variants no longer tint — kept as empty hooks in case we want
   subtle per-tile variation later. */
.thumb.y1, .thumb.y2, .thumb.y3, .thumb.y4,
.thumb.y5, .thumb.y6, .thumb.y7 { background: #ffffff; }

/* Smooth transition for the whole tile so the filter dim feels organic */
.thumb { transition: opacity 0.35s ease; }

/* ---- Touch devices: first tap reveals hover state (blur + title/author),
   second tap navigates. Driven by a `.tapped` class toggled in script.js. ---- */
@media (hover: none) {
  /* Disable sticky :hover — iOS keeps the last-tapped element in :hover */
  .thumb:hover .tile { opacity: 1; filter: none; }
  .thumb:hover .meta { opacity: 0; }

  /* First-tap state mirrors the desktop hover look */
  .thumb.tapped.has-image .tile {
    opacity: 0.6;
    filter: blur(4px) brightness(1.1);
  }
  .thumb.tapped:not(.has-image) .tile {
    opacity: 0.35;
    filter: blur(4px);
  }
  .thumb.tapped .meta { opacity: 1; }
}

/* Category filter: non-matching tiles fade way down but stay in place */
.thumb.dimmed { opacity: 0.08; pointer-events: none; }

/* Hidden state (kept for any other use) */
.thumb.hidden { display: none; }

/* ----- About / Contact pages ----- */

.menu .homeLink-mini {
  font-size: 14.9px;
  pointer-events: auto;
}

.about-page {
  padding: 132px 15px 160px;
  min-height: 100vh;
}

/* Right-column image on the About page */
.about-grid .col-right .side-image { margin: 0; }
.about-grid .col-right .side-image img {
  display: block;
  width: 100%;
  height: auto;
}
.about-grid .col-right .side-image figcaption {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #666;
}
.about-grid .col-right .side-image .cap    { color: #333; }
.about-grid .col-right .side-image .credit { color: #888; }

.about-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  column-gap: 15px;
  row-gap: 48px;
  max-width: 1410px;
  margin: 0 auto;
}

.about-grid .col-left {
  grid-column: 1 / span 3;
  grid-row: 1;
}

.about-grid .col-right {
  grid-column: 7 / span 3;
  grid-row: 1;
}

.about-grid .col-left p {
  font-size: 14.9px;
  line-height: 1.5;
  margin-bottom: 1.1em;
}

.about-grid .col-right .item {
  display: grid;
  grid-template-columns: 180px 1fr;
  column-gap: 12px;
  margin-bottom: 16px;
  font-size: 14.9px;
  line-height: 1.5;
}
.about-grid .col-right .item .note { color: #666; }
.about-grid .section .note { color: #666; margin-top: 10px; }
.about-grid .col-right .item .label { color: #000; }
.about-grid .col-right .item .value { color: #000; }

.about-grid .section {
  grid-column: 1 / span 3;
  font-size: 14.9px;
  line-height: 1.5;
}
.about-grid .section h3 {
  font-size: 14.9px;
  font-weight: 400;
  margin-bottom: 10px;
}
.about-grid .section p {
  color: #000;
}

/* ----- Article detail page ----- */

.article-page {
  padding: 110px 15px 120px;
  max-width: 1410px;
  margin: 0 auto;
}

/* Header block */
.article-header {
  max-width: 720px;
  margin: 0 auto 40px;
  padding: 0 15px;
}
.article-meta {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #666;
  margin-bottom: 18px;
}
.article-cat  { text-transform: uppercase; }
.article-date { }

.article-title {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.005em;
  margin-bottom: 14px;
}
.article-by {
  font-size: 14.9px;
  color: #333;
}

/* Hero image */
.hero-image {
  max-width: 960px;
  margin: 0 auto 48px;
  padding: 0 15px;
}
.hero-image img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-image figcaption,
.inline-image figcaption {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #666;
}
.hero-image .cap,
.inline-image .cap { color: #333; }
.hero-image .credit,
.inline-image .credit { color: #888; }

/* Body column */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 15px;
}
.article-body p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 1.7em;
}
.article-body p + p { margin-top: 0; }
.article-body h2 {
  font-size: 20px;
  font-weight: 400;
  margin: 44px 0 14px;
}
.article-body h3 {
  font-size: 17px;
  font-weight: 400;
  margin: 32px 0 10px;
}
.article-body blockquote {
  margin: 28px 0;
  padding-left: 18px;
  border-left: 2px solid #000;
  font-size: 17px;
  line-height: 1.55;
  color: #111;
}
.article-body a { text-decoration: underline; }
.article-body .muted { color: #888; }

/* Inline images match the text column width */
.inline-image {
  margin: 36px 0;
  width: 100%;
}
.inline-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* View more */
.view-more {
  max-width: 1410px;
  margin: 80px auto 0;
  padding: 60px 0 0;
  border-top: 1px solid #e6e6e6;
}
.view-more-heading {
  font-size: 14.9px;
  font-weight: 400;
  margin: 0 0 20px;
}
.view-more-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
@media (max-width: 900px) {
  .view-more-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .view-more-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Footer on about / contact */
.about-footer {
  max-width: 1410px;
  margin: 80px auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 14.9px;
}
.about-footer .footer-right a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 500px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .home { padding: 0 10px 80px; }
  .categories .row { gap: 12px; }
  .menu { padding: 12px; }

  .about-page { padding: 90px 15px 80px; }

  /* Shrink hover/tapped overlay text so it stays inside small tiles */
  .thumb .meta { padding: 8px; }
  .thumb .meta .title  { font-size: 10px; line-height: 1.25; margin-bottom: 3px; }
  .thumb .meta .author { font-size: 9px;  line-height: 1.25; }
}

@media (max-width: 500px) {
  .thumb .meta { padding: 10px; }
  .thumb .meta .title  { font-size: 11px; line-height: 1.3; margin-bottom: 4px; }
  .thumb .meta .author { font-size: 10px; line-height: 1.3; }
}

/* Below 900px the grid collapses to a single column. Right column slots
   between the intro and the section headings (its DOM order). */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; row-gap: 32px; }
  .about-grid .col-left,
  .about-grid .col-right,
  .about-grid .section { grid-column: 1 / -1; grid-row: auto; }
  .about-grid .col-right .item { grid-template-columns: 100px 1fr; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .about-grid { grid-template-columns: repeat(6, 1fr); }
  .about-grid .col-left { grid-column: 1 / span 3; }
  .about-grid .col-right { grid-column: 4 / span 3; }
  .about-grid .section { grid-column: 1 / span 3; }
}
