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

:root {
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --color-text-muted: #777;
  --color-border: #e8e8e8;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 720px;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* === Layout === */
body > header,
main,
body > footer {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* === Site Header === */
body > header {
  padding-block: 2.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3rem;
}

body > header h1 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body > header h1 a {
  text-decoration: none;
}

body > header h1 a:hover {
  opacity: 0.6;
}

.site-description {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* When there is no header, give main some breathing room at the top */
body > header + main {
  /* header present — margin already provided by header's border/margin */
}

body:not(:has(> header)) > main {
  padding-top: 3rem;
}

/* === Post Feed === */
.post-feed {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding-bottom: 4rem;
}

/* === Post Card & Single === */
.post-card,
.post-single {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

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

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

.post-single .post-title {
  font-size: 1.375rem;
}

.post-date {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

/* === Figure & Image === */
.post-figure {
  display: block;
  margin: 0;
}

.post-image-wrap {
  position: relative;
  display: block;
  line-height: 0;
  overflow: hidden;
}

.post-img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.15s ease;
}

.post-image-wrap:hover .post-img {
  opacity: 0.9;
}

figcaption {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* === Lightbox EXIF panel === */
#lb-exif {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  pointer-events: none;
  z-index: 99999;
  max-width: 90vw;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.2s ease;
}


/* === Album Icon === */
.album-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 5px;
  padding: 5px 6px;
  line-height: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Hidden gallery anchors (present in DOM for GLightbox) === */
.hidden-gallery-item {
  display: none;
  position: absolute;
  pointer-events: none;
}

/* === Post Summary === */
.post-summary {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* === Post Content (single page) === */
.post-content {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.7;
  max-width: 65ch;
}

.post-content p {
  margin-bottom: 1em;
}

.post-content p:last-child {
  margin-bottom: 0;
}

/* === Pagination === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding-block: 2rem 4rem;
  font-size: 0.875rem;
}

.pagination-link {
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
}

.pagination-link:hover {
  border-bottom-color: var(--color-text);
}

.pagination-info {
  color: var(--color-text-muted);
}

/* === Footer === */
body > footer {
  padding-block: 2rem;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* === GLightbox: smooth overlay background transitions === */
.glightbox-clean .goverlay {
  transition: background-color 0.2s ease;
}

/* === Lightbox image border classes (applied by gallery.js) === */
.glightbox-clean .gslide-image img.lb-border-white {
  border: 5px solid #ffffff;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.5);
}

.glightbox-clean .gslide-image img.lb-border-black {
  border: 5px solid #000000;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.25);
}
