/* Blog CSS - Home-Baked for Homeless */

:root {
  --bg:        #faf7f2;
  --brown:     #3d2b1a;
  --caramel:   #b5834a;
  --rose:      #c4806e;
  --parchment: #f3ede1;
  --card-bg:   #2e1f10;
  --deep:      #1e1208;
  --warm-red:  #a85d4a;
  --amber:     #c9924d;
  --radius:    22px;
  --shadow:    0 8px 40px rgba(61,43,26,.18);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--brown);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .55;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.12); }
  30% { transform: scale(1); }
  45% { transform: scale(1.06); }
}

@keyframes postFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,242,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(181,131,74,.15);
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}

.nav-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }

.nav-heart { font-size: 1.4rem; animation: heartbeat 2.5s ease-in-out infinite; }

.nav-brand-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; font-weight: 500; color: var(--brown); line-height: 1.2;
}

.nav-brand-text span {
  display: block; font-family: 'Jost', sans-serif;
  font-size: .62rem; font-weight: 400; letter-spacing: .15em;
  text-transform: uppercase; color: var(--rose);
}

.nav-links { display: flex; align-items: center; gap: 1.8rem; list-style: none; }

.nav-links a {
  font-family: 'Jost', sans-serif; font-size: .78rem; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase; color: var(--brown);
  text-decoration: none; transition: color .2s; cursor: pointer;
}

.nav-links a:hover { color: var(--rose); }

.nav-links .btn-nav {
  background: var(--rose); color: #faf7f2;
  padding: .45rem 1.2rem; border-radius: 50px;
  transition: background .2s, transform .15s;
}

.nav-links .btn-nav:hover { background: var(--warm-red); transform: translateY(-1px); }

/* ── Hamburger Menu ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: .35rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--brown);
  border-radius: 2px;
  transition: all .3s cubic-bezier(.22,1,.36,1);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links.mobile-open {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  flex-direction: column;
  background: rgba(250,247,242,.98);
  backdrop-filter: blur(14px);
  padding: 1.5rem;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(181,131,74,.15);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}

.nav-links.mobile-open li {
  width: 100%;
}

.nav-links.mobile-open a {
  display: block;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  transition: background .2s, color .2s;
}

.nav-links.mobile-open a:hover {
  background: rgba(196,128,110,.1);
}

.nav-links.mobile-open .btn-nav {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* ── Blog Header ── */
.blog-header {
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
  text-align: center;
  border-bottom: 1px solid rgba(181,131,74,.12);
  position: relative; overflow: hidden;
}

.blog-header::before {
  content: ''; position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(196,128,110,.08) 0%, transparent 65%);
  top: -200px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}

.blog-header-label {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(196,128,110,.1); border: 1px solid rgba(196,128,110,.25);
  color: var(--rose); font-family: 'Jost', sans-serif;
  font-size: .66rem; letter-spacing: .22em; text-transform: uppercase;
  padding: .35rem 1rem; border-radius: 50px; margin-bottom: 1.2rem;
  animation: riseIn .75s cubic-bezier(.22,1,.36,1) forwards;
  opacity: 0; animation-delay: .1s;
}

.blog-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 300;
  color: var(--brown); line-height: 1.08; margin-bottom: 1rem;
  animation: riseIn .75s cubic-bezier(.22,1,.36,1) forwards;
  opacity: 0; animation-delay: .2s;
}

.blog-header h1 em { font-style: italic; color: var(--rose); }

.blog-header-sub {
  font-size: .95rem; line-height: 1.85; color: var(--brown); opacity: .65;
  max-width: 500px; margin: 0 auto;
  animation: riseIn .75s cubic-bezier(.22,1,.36,1) forwards;
  opacity: 0; animation-delay: .32s;
}

/* ── Blog Layout ── */
.blog-layout {
  display: grid; grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 72px - 200px);
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem); gap: 0;
}

/* ── Sidebar ── */
.blog-sidebar {
  padding: 2.5rem 1.5rem 2.5rem 0;
  border-right: 1px solid rgba(181,131,74,.12);
  position: sticky; top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(181,131,74,.2) transparent;
}

.blog-sidebar::-webkit-scrollbar { width: 4px; }

.blog-sidebar::-webkit-scrollbar-track { background: transparent; }

.blog-sidebar::-webkit-scrollbar-thumb { background: rgba(181,131,74,.2); border-radius: 4px; }

.sidebar-heading {
  font-family: 'Jost', sans-serif; font-size: .65rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--caramel);
  margin-bottom: 1.2rem; padding-bottom: .75rem;
  border-bottom: 1px solid rgba(181,131,74,.15);
}

/* Sidebar loading/error */
.sidebar-state {
  font-family: 'Jost', sans-serif; font-size: .82rem;
  color: var(--brown); opacity: .45; line-height: 1.6;
  display: flex; align-items: center; gap: .6rem;
}

.sidebar-spinner {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid rgba(181,131,74,.2);
  border-top-color: var(--caramel);
  border-radius: 50%; animation: spin .7s linear infinite;
}

.post-nav { list-style: none; display: flex; flex-direction: column; gap: .5rem; }

.post-nav-item {
  display: block; padding: 1rem 1.1rem; background: transparent;
  border-radius: 14px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s, transform .2s;
}

.post-nav-item:hover { background: var(--parchment); border-color: rgba(181,131,74,.18); transform: translateX(3px); }

.post-nav-item.active { background: var(--card-bg); border-color: var(--card-bg); }

.post-nav-item.active .nav-item-title { color: var(--parchment); }

.post-nav-item.active .nav-item-date  { color: rgba(243,237,225,.4); }

.post-nav-item.active .nav-item-tag   { background: rgba(196,128,110,.25); color: var(--rose); }

.nav-item-tag {
  display: inline-block; font-family: 'Jost', sans-serif;
  font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(181,131,74,.1); color: var(--caramel);
  padding: .25rem .6rem; border-radius: 6px; margin-bottom: .4rem;
}

.nav-item-title {
  display: block; font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-weight: 400; color: var(--brown);
  margin-bottom: .35rem;
}

.nav-item-date {
  display: block; font-family: 'Jost', sans-serif;
  font-size: .65rem; color: var(--caramel); opacity: .6;
}

/* ── Blog Content ── */
.blog-content {
  padding: 3rem 2rem;
  border-left: 1px solid rgba(181,131,74,.12);
  min-height: 100%;
}

.blog-welcome {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 300px; text-align: center;
}

.blog-welcome-icon { font-size: 3rem; margin-bottom: 1rem; }

.blog-welcome h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem; font-weight: 300; color: var(--brown); margin-bottom: .5rem;
}

.blog-welcome h2 em { font-style: italic; color: var(--rose); }

.blog-welcome p { font-size: .95rem; color: var(--brown); opacity: .5; }

.post-content {
  display: none; animation: postFadeIn .5s cubic-bezier(.22,1,.36,1) forwards;
}

.post-content.active { display: block; }

.post-header { margin-bottom: 2.5rem; }

.post-tag {
  display: inline-block; font-family: 'Jost', sans-serif;
  font-size: .65rem; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(196,128,110,.1); color: var(--rose);
  padding: .4rem .9rem; border-radius: 50px; margin-bottom: 1.2rem;
}

.post-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 300;
  color: var(--brown); line-height: 1.1; margin-bottom: 1rem;
}

.post-meta {
  display: flex; gap: 0; align-items: center;
  font-family: 'Jost', sans-serif; font-size: .8rem;
  color: var(--caramel); opacity: .7;
}

.post-meta-sep {
  margin: 0 .6rem; opacity: .4;
}

.post-body {
  font-size: 1rem; line-height: 1.85; color: var(--brown);
  margin-bottom: 3rem;
}

.post-body p {
  margin-bottom: 1.5rem; opacity: .85;
}

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

.post-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; font-weight: 400; color: var(--brown);
  margin: 2.5rem 0 1rem;
}

.post-body h3:first-child { margin-top: 0; }

.post-body em { font-style: italic; color: var(--rose); }

.post-body blockquote {
  border-left: 3px solid var(--rose); padding-left: 1.5rem;
  margin: 2rem 0; font-style: italic; color: var(--brown); opacity: .8;
}

.post-body hr {
  border: none; height: 1px; background: rgba(181,131,74,.1);
  margin: 2.5rem 0;
}

.post-nav-footer {
  display: flex; gap: 1rem; margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid rgba(181,131,74,.1);
}

.post-nav-btn {
  flex: 1; padding: 1rem 1.5rem;
  font-family: 'Jost', sans-serif; font-size: .8rem;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--parchment); color: var(--brown);
  border: 1px solid rgba(181,131,74,.2); border-radius: 12px;
  cursor: pointer; transition: all .2s;
}

.post-nav-btn:hover { background: rgba(196,128,110,.1); border-color: var(--rose); color: var(--rose); }

.post-nav-btn.hidden { display: none; }

/* ── Footer ── */
footer {
  background: var(--brown);
  color: var(--parchment);
  padding: 3rem clamp(1.5rem, 6vw, 5rem) 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(243,237,225,.08);
}

.footer-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--parchment);
  flex: 0 1 auto;
}

.footer-brand span {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: .65rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--rose);
  margin-top: .25rem;
  opacity: .7;
}

.footer-links-row {
  display: flex;
  gap: 1rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links-row a {
  color: rgba(243,237,225,.45);
  text-decoration: none;
  font-size: .82rem;
  cursor: pointer;
  transition: color .2s;
  white-space: nowrap;
}

.footer-links-row a:hover { color: var(--parchment); }

.footer-bottom {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .72rem;
  color: rgba(243,237,225,.28);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bcc-link {
  color: var(--caramel);
  text-decoration: none;
  opacity: .7;
  transition: opacity .2s;
  white-space: nowrap;
}

.footer-bcc-link:hover { opacity: 1; }

/* ── Post Body Table ── */
.post-body .post-table-wrap {
  margin: 2rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(181,131,74,.18);
}

.post-body .post-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Jost', sans-serif;
  font-size: .88rem;
  font-weight: 300;
  color: var(--brown);
  min-width: 320px;
}

.post-body .post-table thead tr {
  background: var(--card-bg);
}

.post-body .post-table thead th {
  padding: .75rem 1.1rem;
  font-family: 'Jost', sans-serif;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--parchment);
  text-align: left;
  white-space: nowrap;
}

.post-body .post-table thead th:last-child { text-align: right; }

.post-body .post-table tbody tr {
  border-bottom: 1px solid rgba(181,131,74,.1);
  transition: background .15s;
}

.post-body .post-table tbody tr:last-child {
  border-bottom: none;
}

.post-body .post-table tbody tr:hover {
  background: rgba(181,131,74,.04);
}

.post-body .post-table tbody td {
  padding: .7rem 1.1rem;
  line-height: 1.5;
  color: var(--brown);
  opacity: .85;
}

.post-body .post-table tbody td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--caramel);
  font-weight: 400;
}

.post-body .post-table tfoot tr {
  border-top: 2px solid rgba(181,131,74,.2);
  background: var(--parchment);
}

.post-body .post-table tfoot td {
  padding: .7rem 1.1rem;
  font-family: 'Jost', sans-serif;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--brown);
}

.post-body .post-table tfoot td:last-child {
  text-align: right;
  color: var(--rose);
  font-weight: 500;
  white-space: nowrap;
}

.post-table-caption {
  font-family: 'Jost', sans-serif;
  font-size: .72rem;
  color: var(--brown);
  opacity: .4;
  letter-spacing: .06em;
  margin-top: .6rem;
  text-align: right;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar {
    position: static;
    height: auto;
    padding: 2rem 0 0;
    border-right: none;
    border-bottom: 1px solid rgba(181,131,74,.12);
    margin-bottom: 2rem;
  }
  .blog-content {
    padding: 2rem 1rem;
    border-left: none;
    border-top: 1px solid rgba(181,131,74,.12);
  }
}

@media (max-width: 768px) {
  .nav-brand-text { display: none; }
  .hamburger { display: flex; }
  .nav-links { display: none; }
  .nav-links.mobile-open { display: flex; }
  .blog-header {
    padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 3vw, 2rem);
  }
  .blog-layout {
    padding: 0 clamp(1rem, 4vw, 1.5rem);
  }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 2rem; }
  .footer-links-row { gap: 0.5rem; justify-content: flex-start; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

@media (max-width: 480px) {
  nav { padding: 0 1rem; }
  .nav-links li:not(:last-child):not(:first-child) { display: none; }
  .nav-links.mobile-open li { display: block !important; }
  .blog-header-sub { font-size: .85rem; }
  .post-title { font-size: 1.8rem; }
  .post-body { font-size: .95rem; }
  .post-nav-footer { flex-direction: column; }
  .footer-inner { padding: 1.5rem 0; }
  .footer-brand { font-size: 1rem; }
  .footer-links-row { gap: 0; flex-direction: column; }
  .footer-links-row a { padding: 0.5rem 0; }
  .footer-bottom { margin-top: 1rem; }
}
