/* ============================================================
   style.css — shared stylesheet for Cake's personal site
   ============================================================ */

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

/* ── DESIGN TOKENS ── */
:root {
  --bg:     #1a1a1a;
  --text:   #fafafa;
  --muted:  #9a9999;
  --accent: #2d6a4f;
  --border: #e5e5e5;
  --max:    720px;
  --sans:   'Helvetica Neue', Arial, sans-serif;
  --serif:  'Georgia', serif;
}

/* ── BASE ── */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* ── NAV ── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

nav .logo {
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--text);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .9rem;
  letter-spacing: .04em;
  transition: color .2s;
}

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

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: .1rem .3rem;
  line-height: 1;
}

@media (max-width: 680px) {
  .nav-toggle {
    display: block;
  }

  nav ul {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: .6rem 0 .2rem;
    margin-top: .6rem;
    border-top: 1px solid var(--border);
  }

  nav ul li a {
    display: block;
    padding: .45rem 0;
  }

  nav.open ul {
    display: flex;
  }
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .82rem;
  margin-top: 3rem;
}

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

footer a:hover {
  color: var(--accent);
}

/* ── SECTION LABEL (shared h2 style) ── */
.section-label {
  font-size: 1rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
  margin-bottom: 1rem;
}

/* ── DIVIDER ── */
.divider {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  border: none;
  border-top: 1px solid var(--border);
}

/* ── PAGE HEADER (blog / recipes) ── */
.page-header {
  max-width: var(--max);
  margin: 4rem auto 2.5rem;
  padding: 0 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: .4rem;
}

.page-header p {
  color: var(--muted);
}

/* ============================================================
   INDEX — hero, about, photo grid, page cards, social
   ============================================================ */

/* Hero */
.hero {
  max-width: var(--max);
  margin: 4rem auto 3rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  margin-bottom: .6rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42ch;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .8rem;
  text-align: center;
  padding: 1rem;
}

/* About */
.about {
  max-width: var(--max);
  margin: 3rem auto;
  padding: 0 2rem;
}

.about h2 { margin-bottom: 1rem; }

.about p {
  margin-bottom: 1rem;
  color: var(--text);
}

/* Photos */
.photos {
  max-width: var(--max);
  margin: 3rem auto;
  padding: 0 2rem;
}

.photos h2 { margin-bottom: 1.2rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
}

.photo-grid .photo-slot {
  aspect-ratio: 1;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .75rem;
  text-align: center;
  padding: .5rem;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Page cards (Explore section) */
.pages {
  max-width: var(--max);
  margin: 3rem auto;
  padding: 0 2rem;
}

.pages h2 { margin-bottom: 1.2rem; }

.page-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.page-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}

.page-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.page-card .card-icon {
  font-size: 1.6rem;
  margin-bottom: .5rem;
}

.page-card h3 {
  font-size: 1.1rem;
  margin-bottom: .3rem;
}

.page-card p {
  color: var(--muted);
  font-size: .9rem;
}

/* Social links */
.social {
  max-width: var(--max);
  margin: 3rem auto;
  padding: 0 2rem;
}

.social h2 { margin-bottom: 1rem; }

.social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .4rem 1rem;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .88rem;
  transition: border-color .2s, color .2s;
}

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   BLOG
   ============================================================ */

.post-list {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
}

.post-item {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child {
  border-top: 1px solid var(--border);
}

.post-date {
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

.post-item h2 {
  font-size: 1.25rem;
  margin-bottom: .4rem;
}

.post-item h2 a {
  text-decoration: none;
  color: var(--text);
  transition: color .2s;
}

.post-item h2 a:hover {
  color: var(--accent);
}

.post-item p {
  color: var(--muted);
  font-size: .97rem;
}

.empty-state {
  max-width: var(--max);
  margin: 4rem auto;
  padding: 0 2rem;
  text-align: center;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: .95rem;
}

/* ============================================================
   RECIPES
   ============================================================ */

.filters {
  max-width: var(--max);
  margin: 0 auto 2rem;
  padding: 0 2rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.filter-tag {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .3rem .9rem;
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  transition: border-color .2s, color .2s;
}

.filter-tag:hover,
.filter-tag.active {
  border-color: var(--accent);
  color: var(--accent);
}

.recipe-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.recipe-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color .2s, box-shadow .2s;
}

.recipe-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.recipe-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .75rem;
}

.recipe-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-body {
  padding: 1rem 1.1rem 1.2rem;
}

.recipe-meta {
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}

.recipe-body h3 {
  font-size: 1.05rem;
  margin-bottom: .3rem;
}

.recipe-body p {
  color: var(--muted);
  font-size: .88rem;
}

/* ============================================================
   BLOG POST (individual post pages in /posts/)
   ============================================================ */

.post-article {
  max-width: var(--max);
  margin: 4rem auto 5rem;
  padding: 0 2rem;
}

/* Post / recipe header */
.post-article .post-date {
  margin-bottom: .6rem;
}

/* Meta line on recipe pages: "Breakfast · 20 min · Serves 2" */
.recipe-page-meta {
  color: var(--muted);
  font-family: var(--sans);
  font-size: .9rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.recipe-page-meta em {
  font-style: normal;
}

.post-article h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: .5rem;
  padding-bottom: 0;
  border-bottom: none;
  border-bottom: 1px solid var(--border);
}

/* Post body typography */
.post-body p {
  margin-bottom: 1.4rem;
}

.post-body h2 {
  font-size: 1.35rem;
  margin: 2.2rem 0 .7rem;
}

.post-body h3 {
  font-size: 1.1rem;
  margin: 1.8rem 0 .5rem;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.4rem 1.6rem;
}

.post-body li {
  margin-bottom: .3rem;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.6rem 0;
  padding: .4rem 0 .4rem 1.2rem;
  color: var(--muted);
  font-style: italic;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.2rem 0;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--sans);
  font-size: .88rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color .2s;
}

.back-link:hover {
  color: var(--accent);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox.open #lb-img {
  transform: scale(1);
}

#lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  transform: scale(.96);
  transition: transform .25s ease;
  /* prevent clicks on the image from closing the lightbox */
  pointer-events: none;
}

/* Shared button base */
#lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  opacity: .7;
  transition: opacity .15s;
}

#lightbox button:hover { opacity: 1; }

#lb-close {
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2rem;
}

#lb-prev,
#lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  padding: 0 1rem;
}

#lb-prev { left: .5rem; }
#lb-next { right: .5rem; }

#lb-caption {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .8);
  font-family: var(--sans);
  font-size: .85rem;
  text-align: center;
  max-width: 70vw;
  line-height: 1.5;
  pointer-events: all;
}

#lb-caption:empty { display: none; }

#lb-caption a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Hide prev/next when there's only one photo */
#lightbox.single #lb-prev,
#lightbox.single #lb-next {
  display: none;
}

/* Make photo thumbnails feel clickable */
.photo-grid .photo-slot.has-image {
  cursor: zoom-in;
}

.photo-grid .photo-slot.has-image img {
  transition: opacity .15s;
}

.photo-grid .photo-slot.has-image:hover img {
  opacity: .85;
}

/* ============================================================
   ILLUSTRATED — art gallery
   ============================================================ */

.art-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.art-slot {
  aspect-ratio: 1;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .75rem;
  text-align: center;
  padding: .5rem;
}

/* When the slot contains a real image */
img.art-slot,
.art-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

img.art-slot {
  cursor: zoom-in;
  transition: opacity .15s;
}

img.art-slot:hover {
  opacity: .88;
}

/* Caption shown below each piece */
.art-caption {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--muted);
  margin-top: .45rem;
  text-align: center;
}

/* ============================================================
   MAKING — project listing
   ============================================================ */

.project-list {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.project-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.project-thumb {
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .7rem;
  text-align: center;
  flex-shrink: 0;
  min-height: 100px;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 1.1rem 1.2rem 1.1rem 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.project-date {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-status {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .15rem .55rem;
  border-radius: 20px;
  border: 1px solid currentColor;
}

.project-status.complete   { color: var(--accent); }
.project-status.in-progress { color: #b07d2a; }
.project-status.ongoing    { color: var(--muted); }

.project-card h2 {
  font-size: 1.1rem;
  margin: 0;
}

.project-card p {
  color: var(--muted);
  font-size: .9rem;
  margin: 0;
}

@media (max-width: 480px) {
  .project-card {
    grid-template-columns: 1fr;
  }

  .project-thumb {
    height: 100px;
    min-height: unset;
  }

  .project-info {
    padding: .9rem 1rem 1rem;
  }
}

/* ============================================================
   PHOTOGRAPHED — photo gallery
   ============================================================ */

.photo-page-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
}

.photo-page-slot {
  aspect-ratio: 1;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .75rem;
  text-align: center;
  padding: .5rem;
}

img.photo-page-slot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: opacity .15s;
}

img.photo-page-slot:hover {
  opacity: .88;
}

@media (max-width: 520px) {
  .photo-page-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 560px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .avatar-placeholder {
    margin: 0 auto;
  }

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

  .page-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}
