/* =========================================================
   jaycevdl.com — warm & cozy shared styles
   ========================================================= */

:root {
  /* Coffee-inspired palette */
  --bg:            #faf5ee;   /* warm cream */
  --bg-soft:       #f2e9dd;   /* latte foam */
  --surface:       #fffdf9;   /* card / paper */
  --ink:           #3a2c24;   /* dark roast text */
  --ink-soft:      #6b574b;   /* muted brown */
  --line:          #e4d6c6;   /* hairline */
  --accent:        #b5643f;   /* terracotta */
  --accent-dark:   #97502f;
  --accent-soft:   #e8c9b6;
  --green:         #6f8a5b;   /* garden sprig */
  --shadow:        0 6px 24px rgba(90, 62, 44, 0.10);

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.1) blur(6px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* Handwritten signature */
.signature { display: block; height: 74px; width: auto; margin: 2px auto 20px; opacity: 0.88; }
.brand-signature { height: 34px; width: auto; display: block; }
.brand span { color: var(--accent); }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 22px;
  font-size: 0.98rem;
  font-weight: 500;
  transition: color .15s;
}
.nav a:hover { color: var(--accent); }

/* ---------- Hero (landing) ---------- */
.hero {
  padding: 72px 0 48px;
  text-align: center;
}
.hero .avatar {
  width: 108px; height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  background: var(--bg-soft);
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 26px;
}
.pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pill {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* ---------- Sections ---------- */
.section { padding: 40px 0; }
.section h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 1.15rem;
}
.card p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.card .emoji { font-size: 1.6rem; display: block; margin-bottom: 8px; }

/* ---------- Blog listing ---------- */
.page-head { padding: 56px 0 8px; }
.page-head h1 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.page-head p { color: var(--ink-soft); margin: 0; font-size: 1.08rem; }

.post-list { padding: 24px 0 64px; display: grid; gap: 20px; }
.post-card {
  display: flex;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(90,62,44,.15); }
.post-card .thumb {
  width: 150px; min-height: 130px;
  object-fit: cover;
  background: var(--bg-soft);
  flex-shrink: 0;
}
.post-card .body { padding: 18px 20px; }
.post-card .body h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  margin: 0 0 6px;
  line-height: 1.2;
}
.post-card .meta { color: var(--accent); font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.post-card .excerpt { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 0.78rem; color: var(--green); background: rgba(111,138,91,.12); padding: 3px 10px; border-radius: 999px; }

@media (max-width: 560px) {
  .post-card { flex-direction: column; }
  .post-card .thumb { width: 100%; height: 180px; }
}

/* ---------- Single post ---------- */
.post-hero { padding: 48px 0 8px; }
.post-hero .back { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.post-hero .back:hover { color: var(--accent); }
.post-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.12;
  margin: 18px 0 10px;
  letter-spacing: -0.02em;
}
.post-hero .meta { color: var(--accent); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: .03em; }
.post-cover {
  width: 100%;
  border-radius: 16px;
  margin: 26px 0 8px;
  box-shadow: var(--shadow);
}

/* Rendered markdown */
.article { padding: 20px 0 72px; font-size: 1.08rem; }
.article h1, .article h2, .article h3 {
  font-family: var(--font-head);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 1.8em;
}
.article h2 { font-size: 1.55rem; }
.article h3 { font-size: 1.25rem; }
.article p { margin: 1.1em 0; }
.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article img { max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); margin: 1.4em 0; }
.article ul, .article ol { padding-left: 1.4em; }
.article li { margin: .4em 0; }
.article blockquote {
  border-left: 4px solid var(--accent-soft);
  margin: 1.4em 0;
  padding: 4px 20px;
  color: var(--ink-soft);
  font-style: italic;
  background: var(--bg-soft);
  border-radius: 0 10px 10px 0;
}
.article code {
  background: var(--bg-soft);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
.article pre {
  background: #2f2620;
  color: #f4ece2;
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.article pre code { background: none; padding: 0; color: inherit; }
.article hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
.article table { border-collapse: collapse; width: 100%; margin: 1.4em 0; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.article th { background: var(--bg-soft); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.site-footer a { color: var(--accent); text-decoration: none; }

/* ---------- Unified feed / timeline ---------- */
.feed { display: flex; flex-direction: column; gap: 26px; padding: 20px 0 64px; }

.feed-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.feed-item.note, .feed-item.photo { padding: 20px 22px; }
.feed-item.photo { padding-top: 0; padding-left: 0; padding-right: 0; }
.feed-item.photo .feed-meta,
.feed-item.photo .feed-title,
.feed-item.photo .feed-body,
.feed-item.photo .tags { padding-left: 22px; padding-right: 22px; }

.feed-meta { color: var(--accent); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.feed-meta a { color: inherit; text-decoration: none; }
.feed-meta a:hover { text-decoration: underline; }

.feed-title { font-family: var(--font-head); font-size: 1.3rem; margin: 6px 0 2px; line-height: 1.2; }
.feed-title a { color: var(--ink); text-decoration: none; }
.feed-title a:hover { color: var(--accent); }

.feed-body { font-size: 1.04rem; }
.feed-body p:first-child { margin-top: .4em; }
.feed-body p:last-child { margin-bottom: 0; }

/* Photo galleries */
.feed-gallery { display: block; margin-bottom: 14px; }
.feed-gallery img { width: 100%; display: block; object-fit: cover; max-height: 620px; }
.feed-gallery.multi { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.feed-gallery.multi img { max-height: 320px; height: 100%; }
.feed-item.note .feed-meta { margin-bottom: 6px; }

.read-more { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 600; font-size: 0.95rem; }

/* Feed intro strip (homepage) */
.feed-intro { padding: 40px 0 8px; display: flex; align-items: center; gap: 18px; }
.feed-intro img.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow); background: var(--bg-soft); flex-shrink: 0; }
.feed-intro h1 { font-family: var(--font-head); font-size: 1.7rem; margin: 0 0 2px; letter-spacing: -0.01em; }
.feed-intro p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.feed-intro .pills { justify-content: flex-start; margin-top: 8px; }
@media (max-width: 520px) {
  .feed-intro { flex-direction: column; text-align: center; }
  .feed-intro .pills { justify-content: center; }
}

/* Post permalink gallery (photo/note entries) */
.post-gallery { margin: 8px 0 6px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.post-gallery img { width: 100%; display: block; }
.post-gallery.multi { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; box-shadow: none; }
.post-gallery.multi img { border-radius: 12px; box-shadow: var(--shadow); }
.post-caption { font-family: var(--font-head); font-size: 1.7rem; margin: 18px 0 4px; letter-spacing: -0.01em; }

.feed-gallery img, .post-gallery img, .post-cover, .article img { cursor: zoom-in; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(30, 22, 17, 0.92);
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox .lb-img {
  max-width: 92vw; max-height: 88vh;
  border-radius: 10px; box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox button {
  position: absolute; background: rgba(250,245,238,0.14); color: #fff;
  border: none; cursor: pointer; border-radius: 999px;
  font-family: var(--font-body); line-height: 1;
  transition: background .15s;
}
.lightbox button:hover { background: rgba(250,245,238,0.28); }
.lightbox .lb-close { top: 20px; right: 22px; width: 44px; height: 44px; font-size: 1.6rem; }
.lightbox .lb-prev, .lightbox .lb-next {
  top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem;
}
.lightbox .lb-prev { left: 20px; }
.lightbox .lb-next { right: 20px; }
@media (max-width: 560px) {
  .lightbox .lb-prev { left: 8px; } .lightbox .lb-next { right: 8px; }
  .lightbox .lb-prev, .lightbox .lb-next { width: 44px; height: 44px; }
}

/* ---------- Email subscribe ---------- */
.subscribe-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.subscribe-card h3 { font-family: var(--font-head); font-size: 1.2rem; margin: 0 0 4px; }
.subscribe-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.98rem; }
.subscribe {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.subscribe input[type="email"] {
  flex: 1 1 220px;
  font-family: var(--font-body); font-size: 1rem;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.subscribe input[type="email"]:focus { border-color: var(--accent); }
.subscribe button {
  background: var(--accent); color: #fff; border: none;
  padding: 12px 24px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: background .15s;
}
.subscribe button:hover { background: var(--accent-dark); }
.subscribe-note { font-size: 0.82rem; color: var(--ink-soft); margin: 10px 0 0; }

/* Simple footer email form */
.footer-subscribe-label { font-weight: 600; color: var(--ink); font-size: 0.95rem; margin: 0 0 10px; }
.footer-subscribe { max-width: 400px; margin: 0 auto 20px; justify-content: center; }
.footer-subscribe input[type="email"] { flex: 1 1 200px; }

/* ---------- States ---------- */
.loading, .empty { text-align: center; color: var(--ink-soft); padding: 48px 0; }
