:root {
  color-scheme: light;
  --bg: #f2eee6;
  --bg-elevated: rgba(255, 252, 247, 0.82);
  --text: #1c1917;
  --muted: #6b6258;
  --line: rgba(28, 25, 23, 0.12);
  --accent: #8b5e3c;
  --accent-strong: #5f422b;
  --shadow: 0 24px 70px rgba(69, 45, 27, 0.12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171717;
  --bg-elevated: rgba(35, 35, 35, 0.86);
  --text: #f2ece3;
  --muted: #c5b7a8;
  --line: rgba(242, 236, 227, 0.12);
  --accent: #d2a779;
  --accent-strong: #f0c79b;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(210, 167, 121, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(139, 94, 60, 0.12), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 90%, #ffffff 10%) 100%);
  min-height: 100vh;
}

body.has-lightbox {
  overflow: hidden;
}

body.has-lightbox {
  overflow: hidden;
}

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

img {
  display: block;
  width: 100%;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.site-header,
.site-footer,
.post-card,
.collection-card,
.empty-state,
.post-detail,
.image-wall__item {
  backdrop-filter: blur(18px);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 0.95rem;
  z-index: 20;
}

.site-brand {
  display: grid;
  gap: 0.05rem;
}

.site-brand__name {
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.site-brand__tagline {
  font-size: 0.84rem;
  color: var(--muted);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

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

.site-nav a,
.theme-toggle,
.section-link,
.post-pager a {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: 180ms ease;
}

.site-nav a[aria-current="page"],
.site-nav a:hover,
.theme-toggle:hover,
.section-link:hover,
.post-pager a:hover {
  color: #fff7ef;
  background: var(--accent-strong);
  border-color: transparent;
}

.theme-toggle {
  cursor: pointer;
  font: inherit;
  background: transparent;
  color: inherit;
}

.site-main {
  padding-top: 2rem;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero--compact {
  padding-bottom: 1rem;
}

.hero__eyebrow,
.post-card__meta {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero h1,
.post-detail h1 {
  margin: 0.1rem 0 0.8rem;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 0.95;
}

.hero__intro,
.post-detail__text,
.collection-card p,
.post-card__body p,
.empty-state p {
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.65;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.post-list,
.collection-list {
  display: grid;
  gap: 1.2rem;
}

.post-card,
.collection-card,
.empty-state,
.post-detail {
  border-radius: 0.95rem;
  overflow: hidden;
}

.post-card__media {
  display: block;
  background: transparent;
}

.post-card__single,
.post-card__grid figure,
.image-wall__item {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: transparent;
}

.post-card__single,
.post-card__grid figure {
  padding: 0;
  margin: 0;
}

.post-card__single img,
.post-card__grid img,
.image-wall__item img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.post-card__grid {
  display: grid;
  gap: 0.25rem;
  padding: 0;
}

.post-card__grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.post-card__grid--3,
.post-card__grid--4 {
  grid-template-columns: repeat(2, 1fr);
}

.post-card__placeholder {
  display: grid;
  place-items: center;
  min-height: 18rem;
  color: var(--muted);
}

.post-card__body,
.collection-card,
.empty-state,
.post-detail {
  padding: 1.25rem;
}

.post-card__single {
  margin: 0;
}

.post-card__header,
.post-actions,
.search-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-card__body h2,
.post-card__body h3,
.collection-card h2,
.collection-card h3 {
  margin: 0.2rem 0 0.6rem;
  font-size: 1.35rem;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-card__tags span {
  color: var(--accent);
}

.post-card__likes,
.permalink-link {
  color: var(--muted);
}

.post-detail__header {
  margin-bottom: 1.5rem;
}

.post-actions {
  margin-top: 1rem;
}

.like-button,
.permalink-link,
.search-form button {
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: 180ms ease;
}

.like-button:hover,
.permalink-link:hover,
.search-form button:hover,
.like-button.is-liked {
  color: #fff7ef;
  background: var(--accent-strong);
  border-color: transparent;
}

.search-panel {
  margin-bottom: 1.2rem;
}

.search-form {
  padding: 1.25rem;
  border-radius: 1.6rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-form__label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.search-form input {
  flex: 1 1 20rem;
  min-width: 0;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  color: inherit;
  font: inherit;
}

html[data-theme="dark"] .search-form input {
  background: rgba(0, 0, 0, 0.24);
}

.post-gallery {
  display: grid;
  gap: 1rem;
}

.post-gallery__item {
  margin: 0;
}

.post-gallery__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.post-gallery__item img {
  border-radius: 1.2rem;
  max-height: 82vh;
  object-fit: contain;
}

.post-gallery__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.55rem;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
}

.lightbox.is-open {
  display: grid;
  place-items: center;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(98vw, 1680px);
  max-height: 98vh;
  padding: 0.5rem;
  border-radius: 0.8rem;
  background: transparent;
  box-shadow: none;
}

.lightbox__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0 0.5rem;
}

.lightbox__viewport {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.lightbox__image-button {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.lightbox__dialog img {
  width: 100%;
  max-height: calc(98vh - 7rem);
  object-fit: contain;
}

.lightbox__close {
  display: inline-flex;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.lightbox__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  color: var(--muted);
}

.lightbox__meta p {
  margin: 0;
}

.lightbox__counter {
  margin-left: auto;
}

.lightbox__nav {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__nav[hidden] {
  visibility: hidden;
}

.post-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
}

.post-pager span:last-child,
.post-pager a:last-child {
  justify-self: end;
}

.image-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.image-wall__item {
  border-radius: 0.95rem;
  overflow: hidden;
}

.image-wall__item img {
  padding: 0;
}

.image-wall__item span {
  display: block;
  padding: 0.9rem 1rem 1rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  border-radius: 1.4rem;
  color: var(--muted);
}

@media (max-width: 840px) {
  .site-header,
  .section-header,
  .site-footer,
  .site-header__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a,
  .theme-toggle {
    width: 100%;
    text-align: center;
  }

  .post-pager {
    grid-template-columns: 1fr;
  }

  .post-pager span:last-child,
  .post-pager a:last-child {
    justify-self: start;
  }

  .search-form__row {
    align-items: stretch;
  }

  .search-form button,
  .search-form input {
    width: 100%;
  }

  .lightbox__dialog {
    width: 100vw;
    max-height: 100vh;
    padding: 0.35rem;
  }

  .lightbox__topbar {
    padding-bottom: 0.35rem;
  }

  .lightbox__viewport {
    grid-template-columns: 1fr;
  }

  .lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }

  .lightbox__nav--prev {
    left: 0.4rem;
  }

  .lightbox__nav--next {
    right: 0.4rem;
  }

  .lightbox__meta {
    align-items: flex-start;
  }

  .lightbox__counter {
    margin-left: 0;
  }
}
