:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --accent: #0071e3;
  --border: #d2d2d7;
  --radius: 18px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 36px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 22px;
}

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

/* Header — minimal, Apple-style nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo-img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

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

.site-header nav a {
  color: var(--text-soft);
  text-decoration: none;
  margin-left: 1.8rem;
  font-size: 0.85rem;
}

.site-header nav a:hover {
  color: var(--text);
}

/* Hero — big centered headline like apple.com */
.hero {
  text-align: center;
  padding: 7rem 0 4rem;
}

.hero-eyebrow {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.3rem;
  color: var(--text-soft);
  font-weight: 400;
  max-width: 560px;
  margin: 0 auto;
}

/* Category filters — segmented control style */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

/* Posts — featured card + responsive grid */
.posts {
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.post-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8e8ed;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .card-image img {
  transform: scale(1.04);
}

/* Featured post — horizontal on wider screens */
.featured {
  flex-direction: row;
}

.featured .card-image {
  flex: 0 0 48%;
  aspect-ratio: auto;
  min-height: 280px;
}

.featured-body {
  padding: 2rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.featured h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.card-body {
  padding: 1.4rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.8rem;
}

.category-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
  padding: 4px 10px;
  border-radius: 980px;
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.post-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  flex: 1;
}

.read-more {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.read-more:hover {
  text-decoration: underline;
}

.post-empty {
  color: var(--text-soft);
  font-style: italic;
  text-align: center;
  padding: 3rem 0;
  grid-column: 1 / -1;
}

/* Single post — clean reading view */
.post {
  max-width: 760px;
  margin: 4rem auto;
  padding: 0 22px;
}

.post-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.2rem;
  aspect-ratio: 16 / 8;
  background: var(--bg-alt);
}

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

.post h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.post h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}

.post h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.post p {
  font-size: 1.05rem;
  color: #3a3a3c;
  margin-bottom: 1.3rem;
}

.post .post-meta {
  margin-bottom: 1.4rem;
}

/* Images placed inside post content */
.post > img,
.post p img {
  border-radius: 14px;
  margin: 1.6rem 0;
  box-shadow: var(--shadow);
}

.zoomable {
  cursor: zoom-in;
}

/* Photo gallery block — use <div class="gallery"> with <img> children */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 1.8rem 0;
}

.gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.post code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.back-link {
  display: inline-block;
  max-width: 1024px;
  margin: 0 auto 4rem;
  padding: 0 22px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* About & Footer */
.about {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 4rem 0;
  text-align: center;
}

.about h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.about p {
  color: var(--text-soft);
  max-width: 540px;
  margin: 0 auto 1rem;
}

.about code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.8rem;
}

/* ===== Responsive breakpoints ===== */

/* Tablet: 2-column grid, featured stacks vertically */
@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Laptop/desktop: roomier featured card */
@media (min-width: 900px) {
  .featured .card-image {
    flex: 0 0 52%;
    min-height: 340px;
  }
}

/* Large screens: 3-column grid */
@media (min-width: 1100px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile adjustments */
@media (max-width: 639px) {
  .hero {
    padding: 4rem 0 3rem;
  }

  .featured {
    flex-direction: column;
  }

  .featured .card-image {
    flex: none;
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .featured-body {
    padding: 1.6rem 1.4rem;
  }

  .site-header nav a {
    margin-left: 1rem;
    font-size: 0.8rem;
  }

  .post-hero {
    aspect-ratio: 16 / 10;
  }
}
