/* Blog Layout
   Shares tokens with main.css (--accent-*, --radius-*, fonts, shadows). */

.blog-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.blog-hero {
  text-align: center;
  padding: 60px 0 40px;
}

.blog-hero h1 {
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.blog-hero p {
  color: var(--text-secondary);
  font-size: clamp(17px, 1.6vw, 20px);
  max-width: 600px;
  margin: 0 auto;
}

.blog-rss-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 16px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.blog-rss-link:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

/* Tag filter chips */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 20px 0 40px;
}

.blog-tag {
  display: inline-block;
  padding: 8px 18px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.blog-tag:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.blog-tag.is-active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(224, 93, 78, 0.25);
}

/* Post grid (index) */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  padding: 20px 0 60px;
}

.post-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.9);
}

.post-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.post-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #f3f4f6;
  background-size: cover;
  background-position: center;
}

.post-card-body {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.post-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.5;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
  flex: 1;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.post-card-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Load more */
.blog-load-more-wrap {
  text-align: center;
  padding: 20px 0 80px;
}

.blog-load-more {
  background: var(--text-primary);
  color: white;
  border: none;
  padding: 16px 36px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blog-load-more:hover {
  transform: translateY(-3px);
  background: #000;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.blog-load-more[hidden] {
  display: none;
}

.blog-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 0;
  font-size: 17px;
}

/* ---------- POST PAGE ---------- */

.post-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 28px;
  transition: color 0.2s ease;
}

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

.post-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  background: #f3f4f6;
}

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

.post-hero-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.post-hero-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.post-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.post-title {
  font-size: clamp(34px, 4.5vw, 52px);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  line-height: 1.1;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}

.post-byline-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-light);
  flex-shrink: 0;
}

.post-byline-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.post-byline-author {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.post-byline-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.post-share {
  margin-left: auto;
  position: relative;
}

.post-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.post-share-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-1px);
}

.post-share-btn svg {
  width: 16px;
  height: 16px;
}

.post-share-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  min-width: 200px;
  z-index: 50;
}

.post-share-menu.is-open {
  display: flex;
}

.post-share-menu a,
.post-share-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: none;
  border: none;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.post-share-menu a:hover,
.post-share-menu button:hover {
  background: var(--accent-light);
  color: var(--accent-color);
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: white;
  padding: 12px 22px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.share-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Article body */
.post-body {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-primary);
}

.post-body h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 32px 0 12px;
}

.post-body p {
  margin-bottom: 22px;
  color: var(--text-primary);
}

.post-body a {
  color: var(--accent-color);
  border-bottom: 1px solid rgba(224, 93, 78, 0.3);
  transition: border-color 0.2s ease;
}

.post-body a:hover {
  border-bottom-color: var(--accent-color);
}

.post-body ul,
.post-body ol {
  margin: 0 0 22px 24px;
  padding-left: 8px;
}

.post-body li {
  margin-bottom: 8px;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}

.post-body blockquote {
  margin: 28px 0;
  padding: 20px 28px;
  border-left: 4px solid var(--accent-color);
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-primary);
}

.post-body code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.post-body pre {
  background: #111;
  color: #e5e7eb;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 28px 0;
  font-size: 14px;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-body hr {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 40px 0;
}

.post-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.post-footer a {
  color: var(--accent-color);
  font-weight: 600;
}

/* ---------- HOME PAGE: "From the Blog" SECTION ---------- */

.home-blog-section {
  padding: 80px 0 40px;
}

.home-blog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.home-blog-head h2 {
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.home-blog-head p {
  color: var(--text-secondary);
  margin-top: 10px;
  font-size: 18px;
}

.home-blog-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.home-blog-view-all:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.home-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 0;
}

.home-blog-grid .post-card-title {
  font-size: 22px;
}

@media (max-width: 900px) {
  .home-blog-grid { grid-template-columns: 1fr; }
  .home-blog-section { padding: 60px 0 20px; }
}

@media (max-width: 700px) {
  .post-article { padding: 20px 20px 60px; }
  .post-byline { flex-wrap: wrap; }
  .post-share { margin-left: 0; width: 100%; }
  .post-share-menu { left: 0; right: auto; }
  .post-body { font-size: 17px; }
  .blog-hero { padding: 30px 0 20px; }
  .post-grid { gap: 24px; }
}
