/* ═══════════════════════════════════════════════
   WEAK SKATEBOARDS — blog.css
   Blog index + single post page styles
═══════════════════════════════════════════════ */

/* ── BLOG PAGE HEADER ── */
.page-hero {
  padding-top: var(--nav-h);
  background: var(--black);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(212,43,43,0.03) 79px, rgba(212,43,43,0.03) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(212,43,43,0.03) 79px, rgba(212,43,43,0.03) 80px);
  pointer-events: none;
}
.page-hero .container { position: relative; }
.page-hero-inner {
  padding: 64px 0 54px;
}
.page-hero-inner .section-title {
  margin-bottom: 0;
}

/* ── BLOG INDEX ── */
.blog-section {
  background: var(--gray);
  padding: 60px 0 100px;
}

.blog-filters {
  display: -webkit-flex;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.filter-btn {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 7px 18px;
  border: 1px solid var(--border);
  background: none;
  color: var(--light);
  cursor: pointer;
  transition: all var(--transition);
  -webkit-appearance: none;
}
.filter-btn:hover       { border-color: var(--white); color: var(--white); }
.filter-btn.active      { border-color: var(--red); color: var(--red); background: rgba(212,43,43,0.06); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 3px;
}

/* ── BLOG CARD ── */
.blog-card {
  background: var(--black);
  border: 1px solid var(--border);
  display: -webkit-flex;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  -webkit-transform: translateY(-3px);
}

.blog-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--gray);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  -webkit-transition: -webkit-transform 0.5s ease;
  display: block;
}
.blog-card:hover .blog-card-media img {
  transform: scale(1.06);
  -webkit-transform: scale(1.06);
}

.blog-card-media-ph {
  width: 100%;
  height: 100%;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 4px;
  color: rgba(212,43,43,0.18);
}

/* Video thumbnail overlay */
.blog-card-media .video-play {
  position: absolute;
  inset: 0;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
}
.video-play-icon {
  width: 48px;
  height: 48px;
  background: rgba(212,43,43,0.85);
  border-radius: 50%;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding-left: 4px;
}

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

.blog-card-meta {
  display: -webkit-flex;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.blog-tag {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 2px 8px;
  white-space: nowrap;
}
.blog-date {
  font-size: 10px;
  color: var(--light);
  white-space: nowrap;
}

.blog-card h3 {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.2;
  flex: 1;
}

.blog-card p {
  font-size: 12px;
  color: var(--light);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-arrow {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  transition: letter-spacing var(--transition);
}
.blog-card:hover .blog-card-arrow { letter-spacing: 5px; }

/* No posts state */
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  font-family: var(--font-ui);
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--light);
  text-transform: uppercase;
}
.blog-empty a { color: var(--red); }

/* ── SINGLE POST PAGE ── */
.post-hero {
  padding-top: var(--nav-h);
  background: var(--black);
}

.post-hero-media {
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--gray);
  position: relative;
  max-height: 560px;
}
.post-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-hero-media .video-wrap {
  width: 100%;
  height: 100%;
}
.post-hero-media .video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.post-hero-media-ph {
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 8px;
  color: rgba(212,43,43,0.12);
}

.post-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.post-meta {
  display: -webkit-flex;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.post-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 0;
}

.post-body {
  padding: 56px 0 100px;
}

.post-content {
  max-width: 720px;
}
.post-content p {
  color: var(--light);
  line-height: 1.9;
  margin-bottom: 20px;
  font-size: 14px;
}
.post-content h2 {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 3px;
  margin: 40px 0 16px;
  color: var(--white);
}
.post-content h3 {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 32px 0 12px;
  color: var(--white);
}
.post-content img {
  max-width: 100%;
  margin: 28px 0;
  border: 1px solid var(--border);
  display: block;
}
/* Immagini con posizione esplicita dall'editor */
.post-content .img-wrap        { margin: 20px 0; overflow: hidden; }
.post-content .img-wrap img    { margin: 0; display: block; }
.post-content .img-wrap.left   { float: left; margin-right: 24px; margin-bottom: 8px; max-width: 45%; }
.post-content .img-wrap.right  { float: right; margin-left: 24px; margin-bottom: 8px; max-width: 45%; }
.post-content .img-wrap.center { text-align: center; }
.post-content .img-wrap.center img { display: inline-block; max-width: 80%; }
.post-content .img-wrap.full   { width: 100%; }
.post-content .img-wrap.full img { width: 100%; max-width: 100%; }
.post-content .img-caption     { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; font-style: italic; }
/* clearfix dopo float */
.post-content .img-wrap.left + *,
.post-content .img-wrap.right + * { overflow: hidden; }
.post-content::after { content:''; display:table; clear:both; }
@media (max-width: 600px) {
  .post-content .img-wrap.left,
  .post-content .img-wrap.right { float: none; max-width: 100%; margin: 20px 0; }
}
.post-content a       { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.post-content ul, .post-content ol { margin: 16px 0 16px 24px; color: var(--light); font-size: 14px; line-height: 1.9; }
.post-content li      { margin-bottom: 8px; }
.post-content blockquote {
  border-left: 3px solid var(--red);
  padding: 12px 24px;
  margin: 24px 0;
  color: var(--light);
  font-style: italic;
}
.post-content strong  { color: var(--white); font-weight: 700; }

/* Inline video in post body */
.post-video-embed {
  margin: 32px 0;
  aspect-ratio: 16 / 9;
  background: var(--gray);
  overflow: hidden;
}
.post-video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Back nav */
.post-back {
  display: -webkit-inline-flex;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 40px;
  transition: color var(--transition);
}
.post-back:hover { color: var(--red); }

/* Related posts */
.related-posts {
  border-top: 1px solid var(--border);
  padding-top: 60px;
  margin-top: 60px;
}
.related-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 3px;
  margin-bottom: 32px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 3px;
}

/* ── RESPONSIVE BLOG ── */
@media (max-width: 900px) {
  .blog-grid    { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .post-hero-media { aspect-ratio: 16/9; max-height: 320px; }
  .post-title   { font-size: clamp(32px, 8vw, 56px); }
}

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

/* ── CE-GALLERY in post view ── */
.post-content .ce-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 24px 0;
}
.post-content .ce-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.post-content .ce-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.post-content .ce-gallery img    { width: 100%; height: 160px; object-fit: cover; border: 1px solid var(--border); margin: 0; }
@media (max-width: 700px) {
  .post-content .ce-gallery {
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-color: #d42b2b #1a1a1a;
  }
  .post-content .ce-gallery img {
    flex-shrink: 0;
    width: 72vw;
    max-width: 280px;
    height: 180px;
    scroll-snap-align: start;
  }
}

/* ── GALLERY NEI POST ── */
.post-content .ce-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 24px 0;
}
.post-content .ce-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.post-content .ce-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.post-content .ce-gallery img {
  width: 100%; height: 180px; object-fit: cover;
  display: block; margin: 0;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity .2s;
}
.post-content .ce-gallery img:hover { opacity: .85; }
@media (max-width: 700px) {
  .post-content .ce-gallery {
    display: flex; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 8px; padding-bottom: 8px;
  }
  .post-content .ce-gallery img {
    flex-shrink: 0; width: 72vw; max-width: 280px; height: 180px;
    scroll-snap-align: start;
  }
}
