:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #22201e;
  --text-muted: #6e6a66;
  --border: #e6e2dc;
  --tag-bg: #f1eee9;
  --accent: #22201e;
  --max-w: 1120px;
  --col-gap: 28px;
  --body-size: 15px;
  --radius: 3px;
  --cols: 3;
  --border-style: solid;
  --bg-repeat: repeat;
  --font-body: "Dotum", "MS Gothic", "Mistral", "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Mistral", "Dotum", "MS Gothic", "Playfair Display", Georgia, serif;
}

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

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  background-color: var(--bg);
  background-repeat: var(--bg-repeat);
  background-position: center top;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.site-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  min-width: 0;
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  padding: 22px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
  max-width: 100%;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.site-title-img {
  display: inline-block;
  line-height: 1;
}

.site-title-img img {
  max-height: 48px;
  width: auto;
  display: block;
}

.site-subtitle {
  font-size: 0.88em;
  color: var(--text-muted);
}

nav.site-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

nav.site-nav a {
  color: var(--text-muted);
  font-size: 0.9em;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

nav.site-nav a:hover {
  color: var(--accent);
}

main {
  padding: 40px 0 80px;
  min-width: 0;
  max-width: 100%;
}

.gallery-grid {
  column-count: var(--cols);
  column-gap: var(--col-gap);
  min-width: 0;
  max-width: 100%;
}

.post-card {
  break-inside: avoid;
  margin-bottom: var(--col-gap);
  background: var(--surface);
  border: 1px var(--border-style) var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-width: 0;
  max-width: 100%;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(34, 32, 30, 0.05);
}

.media-wrap {
  position: relative;
  overflow: hidden;
  background: var(--tag-bg);
  min-width: 0;
  max-width: 100%;
}

.media-wrap img {
  width: 100%;
  transition: opacity 0.25s ease;
}

.post-card:hover .media-wrap img {
  opacity: 0.94;
}

.photoset-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.72em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius);
}

.card-body,
.text-post-pad {
  padding: 16px 18px;
  min-width: 0;
  max-width: 100%;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.card-caption {
  font-size: 0.88em;
  color: var(--text-muted);
  margin-bottom: 10px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.card-caption p + p {
  margin-top: 8px;
}

.card-caption a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.card-tags a {
  background: var(--tag-bg);
  color: var(--text-muted);
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: var(--radius);
}

.card-tags a:hover {
  color: var(--accent);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78em;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-meta a:hover {
  color: var(--accent);
}

.video-embed,
.audio-embed {
  max-width: 100%;
  overflow: hidden;
}

.video-embed iframe,
.audio-embed iframe,
.post-card iframe,
.post-card embed,
.post-card object,
.post-card video {
  max-width: 100% !important;
}

.video-embed iframe {
  width: 100% !important;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
}

footer.site-footer {
  padding: 24px 0 48px;
  border-top: 1px solid var(--border);
  font-size: 0.82em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  body {
    font-size: max(15px, var(--body-size));
    line-height: 1.7;
    overflow-x: hidden;
  }

  .site-shell {
    padding: 0 18px;
  }

  header.site-header {
    position: static;
    padding: 24px 0 18px;
    gap: 12px;
  }

  .site-title {
    font-size: 1.45rem;
  }

  .site-title-img img {
    max-height: 38px;
  }

  nav.site-nav {
    gap: 8px 14px;
    width: 100%;
  }

  nav.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 2px;
    font-size: 0.92rem;
  }

  main {
    padding: 24px 0 60px;
  }

  .gallery-grid {
    column-count: 1;
    column-gap: 18px;
  }

  .post-card {
    margin-bottom: 18px;
  }

  .card-body,
  .text-post-pad {
    padding: 15px 16px;
  }
}