/* ============================================
   A Gradual Epiphany — Core Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

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

/* ---- Base ---- */
:root {
  --bg: #3b3534;
  --bg-darker: #2e2928;
  --text: #d8d0b8;
  --text-muted: #9e9680;
  --text-bright: #f0e8d0;
  --accent: #d4cfc9;
  --nav-bg: #2e2928;
  --grid-gap: 4px;
}

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

body {
  font-family: 'Merriweather', Georgia, serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* ---- Navigation ---- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-name {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
}

.site-name a {
  color: inherit;
}

.nav-sections {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-sections a {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  padding: 0.35rem 0.75rem;
  transition: all 0.15s ease;
  min-width: 130px;
  text-align: center;
}

.nav-sections a:hover {
  color: var(--text-bright);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-sections a.active {
  color: var(--text-bright);
  border-color: rgba(255, 255, 255, 0.4);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-bright);
}

/* ---- Photo Grid (Index) ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  padding: 15px;
}

.grid-item {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.grid-item:hover img {
  opacity: 0.85;
}

/* ---- Photo Post ---- */
.post-header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}

.post-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

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

.post-images {
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-frame {
  margin-bottom: 2.5rem;
  text-align: center;
}

.photo-frame img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.post-description {
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
}

.post-meta {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 1.5rem 2rem;
}

.post-meta a {
  color: var(--text-muted);
}

.post-meta a:hover {
  color: var(--text-bright);
}

.post-categories,
.post-tags {
  display: inline;
}

.post-categories + .post-tags::before {
  content: "  \00b7  ";
}

/* Prev / Next */
.post-nav {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.post-nav a {
  color: var(--text-muted);
}

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

.post-nav .prev-link {
  text-align: left;
}

.post-nav .next-link {
  text-align: right;
  margin-left: auto;
}

/* ---- Homepage ---- */
.home-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  flex-direction: column;
  gap: 1rem;
}

.home-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 1rem;
}

.home-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.home-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.8rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
  min-width: 200px;
  text-align: center;
}

.home-links a:hover {
  color: var(--text-bright);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---- Tag Cloud ---- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.tag-btn {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.tag-btn.active {
  color: var(--text-bright);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---- Categories & Archive ---- */
.list-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.list-page h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-bright);
  margin-bottom: 2.5rem;
  text-align: center;
}

.category-section,
.archive-year {
  margin-bottom: 2.5rem;
}

.category-section h2,
.archive-year h2 {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.category-section ul,
.archive-year ul {
  list-style: none;
}

.category-section li,
.archive-year li {
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.category-section li .post-date,
.archive-year li .post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* ---- Blog ---- */
.blog-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  font-size: 1rem;
  line-height: 1.85;
}

.blog-content p {
  margin-bottom: 1.5rem;
}

.blog-content h2,
.blog-content h3 {
  color: var(--text-bright);
  margin: 2rem 0 1rem;
}

.blog-content a {
  border-bottom: 1px solid var(--text-muted);
}

.blog-content a:hover {
  border-color: var(--text-bright);
}

.blog-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.blog-content code {
  font-size: 0.9em;
  background: var(--bg-darker);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.blog-content pre {
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.blog-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.blog-content blockquote {
  border-left: 3px solid var(--text-muted);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.blog-content blockquote p {
  margin-bottom: 0.5rem;
}

.blog-content ul,
.blog-content ol {
  margin: 0 0 1.5rem 1.5rem;
}

.blog-content li {
  margin-bottom: 0.4rem;
}

.blog-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 2.5rem 0;
}

/* ---- Blog List ---- */
.blog-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.blog-list-item {
  padding: 0.5rem 0;
}

.blog-list-item a {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.blog-list-item a:hover {
  color: var(--text-bright);
}

.blog-list-item .post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* ---- Contact ---- */
.contact-page {
  max-width: 540px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.contact-page h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
}

.contact-page p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.contact-page a {
  color: var(--text);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .site-nav {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
  }

  .site-name {
    text-align: center;
  }

  .nav-sections {
    position: static;
    transform: none;
  }

  .nav-sections a {
    min-width: 0;
    padding: 0.3rem 0.6rem;
  }

  .nav-links {
    gap: 1.2rem;
  }

  .nav-links a {
    font-size: 0.6rem;
  }

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

  .post-title {
    font-size: 1.4rem;
  }

  .home-links {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}
