/* ==========================================================================
   Mace Travels — organic travel-journal stylesheet
   ========================================================================== */

:root {
  --cream: #f6f1e7;
  --cream-deep: #efe7d7;
  --ink: #2c2620;
  --ink-soft: rgba(44, 38, 32, 0.85);
  --ink-muted: rgba(44, 38, 32, 0.6);
  --terracotta: #c86d52;
  --terracotta-deep: #a8583f;
  --sage: #52735a;
  --gold: #b88b4a;
  --border: rgba(44, 38, 32, 0.12);
  --hairline: rgba(44, 38, 32, 0.18);
  --shadow-soft: 0 2px 10px rgba(44, 38, 32, 0.06);
  --shadow-lift: 0 14px 34px rgba(44, 38, 32, 0.14);
  --shadow-polaroid: 0 8px 22px rgba(44, 38, 32, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--cream);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.17  0 0 0 0 0.15  0 0 0 0 0.13  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color .25s ease;
}
a:hover { color: var(--terracotta-deep); }

/* ==========================================================================
   Loader
   ========================================================================== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .7s ease, visibility .7s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.ld-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.6rem;
  color: var(--ink);
  letter-spacing: .02em;
  opacity: 0;
  animation: fadeUp .8s ease forwards .2s;
}
.ld-sub {
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
  color: var(--terracotta);
  margin-top: .4rem;
  opacity: 0;
  animation: fadeUp .7s ease forwards .5s;
}
.ld-bar {
  width: 0;
  height: 1px;
  background: var(--terracotta);
  margin-top: 1.1rem;
  animation: barW 1s ease forwards .8s;
}
@keyframes barW { to { width: 110px; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Layout shell
   ========================================================================== */
.site-wrapper {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */
.site-header {
  text-align: center;
  padding: 4rem 1rem 1.2rem;
  position: relative;
}
.site-header::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: var(--hairline);
  margin: 1.8rem auto 0;
}
.site-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4rem);
  color: var(--ink);
  letter-spacing: .005em;
  line-height: 1;
}
.site-title a { color: inherit; }
.site-title a:hover { color: var(--terracotta); }
.site-tagline {
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  color: var(--terracotta);
  margin-top: .45rem;
  font-weight: 500;
}

.site-nav {
  text-align: center;
  padding: .6rem 0 1.8rem;
}
.site-nav a {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .24em;
  text-transform: uppercase;
  padding: .35rem .6rem;
  margin: 0 .35rem;
  position: relative;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--terracotta);
  transition: width .3s ease, left .3s ease;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--terracotta); }
.site-nav a:hover::after,
.site-nav a.is-active::after {
  width: 60%;
  left: 20%;
}

/* ==========================================================================
   Hero (homepage only)
   ========================================================================== */
.journal-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  opacity: 0;
  animation: fadeUp .8s ease forwards .2s;
}
.journal-hero p {
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
  color: var(--sage);
  line-height: 1.4;
}

/* ==========================================================================
   Main 2-col layout
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3.5rem;
  padding: 1rem 0 4rem;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  background: var(--cream-deep);
  padding: 2rem 1.6rem;
  border-radius: 3px;
  align-self: start;
  position: sticky;
  top: 1.5rem;
  box-shadow: var(--shadow-soft);
}
.sidebar-section { margin-bottom: 2rem; }
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: .8rem;
}
.sidebar-title::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--terracotta);
  margin-top: .45rem;
}
.archive-list { list-style: none; }
.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .35rem 0;
  border-bottom: 1px dashed var(--hairline);
}
.archive-list li:last-child { border-bottom: 0; }
.archive-list a {
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  color: var(--gold);
  line-height: 1;
}
.archive-list a:hover { color: var(--terracotta); }
.archive-list .count {
  font-size: .75rem;
  color: var(--sage);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.sidebar-divider {
  border: none;
  border-top: 1px dashed var(--hairline);
  margin: 1.5rem 0;
}
.label-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.label-chips a {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .65rem;
  background: var(--cream);
  color: var(--terracotta);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all .25s ease;
}
.label-chips a:hover {
  background: var(--terracotta);
  color: var(--cream);
  border-color: var(--terracotta);
}

/* ==========================================================================
   Post cards (homepage feed)
   ========================================================================== */
.posts-area { min-width: 0; }

.post-card {
  background: var(--cream-deep);
  padding: 1.8rem;
  margin-bottom: 2.2rem;
  border-radius: 3px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.6rem;
  align-items: start;
  box-shadow: var(--shadow-soft);
  transition: transform .4s ease, box-shadow .4s ease;
  position: relative;
}
.post-card.no-thumb {
  grid-template-columns: 1fr;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.post-thumb {
  background: #fff;
  padding: 10px 10px 34px;
  box-shadow: var(--shadow-polaroid);
  transform: rotate(-1.5deg);
  transition: transform .5s ease;
  display: block;
}
.post-card:nth-child(even) .post-thumb { transform: rotate(1.5deg); }
.post-card:hover .post-thumb { transform: rotate(0deg); }
.post-thumb img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.post-body { min-width: 0; }

.post-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: .35rem;
}
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--terracotta); }

.post-meta {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: .9rem;
  line-height: 1;
}

.post-excerpt {
  font-size: .92rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .9rem;
  border-top: 1px solid var(--hairline);
  gap: 1rem;
  flex-wrap: wrap;
}
.post-comments {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--sage);
}
.post-comments a { color: var(--sage); }
.post-comments a:hover { color: var(--terracotta); }

.read-more {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.read-more .arrow {
  transition: transform .3s ease;
  display: inline-block;
}
.read-more:hover .arrow { transform: translateX(4px); }

/* Reveal animation */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.rv.on {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   More posts / footer
   ========================================================================== */
.more-posts {
  text-align: center;
  margin-top: 1.5rem;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
}
.more-posts a { color: var(--terracotta); }

.site-footer {
  text-align: center;
  padding: 3rem 1.5rem 3.5rem;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: var(--sage);
  border-top: 1px solid var(--hairline);
  margin-top: 2rem;
}
.site-footer .heart { color: var(--terracotta); }

/* ==========================================================================
   Single post page
   ========================================================================== */
.single-post {
  max-width: 740px;
  margin: 0 auto;
  padding: .5rem 0 2rem;
}
.back-link {
  display: inline-block;
  margin-bottom: 1.8rem;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.back-link:hover { color: var(--terracotta-deep); }

.single-post h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  color: var(--ink);
  line-height: 1.18;
  margin-bottom: .5rem;
}
.single-post .post-meta {
  font-size: 1.3rem;
  margin-bottom: 1.8rem;
}

.post-hero {
  background: #fff;
  padding: 14px 14px 46px;
  box-shadow: var(--shadow-polaroid);
  transform: rotate(-0.8deg);
  margin: 0 auto 2.2rem;
  max-width: 640px;
  position: relative;
}
.post-hero img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}
.post-hero .polaroid-caption {
  position: absolute;
  left: 0; right: 0;
  bottom: 10px;
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--ink-muted);
}

.single-post .post-body p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.single-post .post-body > p:first-of-type::first-letter {
  font-family: 'DM Serif Display', Georgia, serif;
  float: left;
  font-size: 3.6rem;
  line-height: .9;
  padding: .35rem .55rem .15rem 0;
  color: var(--terracotta);
}

.post-images-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.6rem 0;
}
.post-images-grid .polaroid {
  background: #fff;
  padding: 10px 10px 30px;
  box-shadow: var(--shadow-polaroid);
}
.post-images-grid .polaroid:nth-child(odd) { transform: rotate(-1.2deg); }
.post-images-grid .polaroid:nth-child(even) { transform: rotate(1.2deg); }
.post-images-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}
.comments-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.35rem;
  color: var(--ink);
  margin-bottom: 1.4rem;
}
.comments-title::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--terracotta);
  margin-top: .5rem;
}
.comment {
  background: var(--cream-deep);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
  font-size: .92rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.comment-author {
  font-family: 'Caveat', cursive;
  color: var(--terracotta);
  font-size: 1.25rem;
  margin-bottom: .2rem;
  line-height: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .sidebar {
    position: static;
    padding: 1.3rem 1.4rem;
  }
  .archive-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }
  .archive-list li {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .25rem .75rem;
    background: var(--cream);
  }
  .sidebar-divider { margin: 1rem 0; }
}

@media (max-width: 620px) {
  .site-wrapper { padding: 0 1rem; }
  .site-header { padding: 2.4rem 1rem 1rem; }
  .post-card {
    grid-template-columns: 1fr;
    padding: 1.4rem;
  }
  .post-thumb,
  .post-card:nth-child(even) .post-thumb {
    transform: rotate(0);
    max-width: 320px;
    margin: 0 auto .4rem;
  }
  .post-thumb img { height: 200px; }
  .post-images-grid {
    grid-template-columns: 1fr;
  }
  .post-hero {
    padding: 10px 10px 34px;
  }
}
