/* ── Writing & Media — Editorial Grid ── */

/* Masthead */
.masthead {
  text-align: center;
  padding: 0 var(--spacing) calc(var(--spacing-2x) * 1.5);
  max-width: 1200px;
  margin: 0 auto;
}

.masthead h1 {
  font-size: 3em;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0;
  line-height: 1.1;
}

.masthead .rule-double {
  border: none;
  border-top: 3px double rgba(255, 255, 255, 0.35);
  margin: 0.5em auto 0.35em;
  max-width: 680px;
}

.masthead .subtitle {
  font-size: 0.7em;
  color: var(--hint-text-light);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ── Editorial Grid ── */
.editorial-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.pub-box {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.4em 1.5em 1.6em;
}

/* Internal column dividers only */
.pub-box:nth-child(1),
.pub-box:nth-child(3),
.pub-box:nth-child(4) {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* Last row items don't need bottom border */
.pub-box:last-child {
  border-bottom: none;
}

/* Spanning */
.pub-box.span-2 { grid-column: span 2; }
.pub-box.span-4 { grid-column: span 4; }

/* ── Publication Header ── */
.pub-header {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1em;
  padding-bottom: 0.6em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pub-name {
  font-size: 0.65em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--primary-text-light);
  text-decoration: none;
  transition: color 0.2s;
}

a.pub-name:hover {
  color: var(--secondary-200);
}

.pub-badge {
  font-size: 0.45em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2em 0.6em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  color: var(--hint-text-light);
  white-space: nowrap;
  font-weight: 500;
}

.pub-badge.badge-substack {
  border-color: rgba(255, 136, 0, 0.4);
  color: rgba(255, 170, 60, 0.8);
}

.pub-badge.badge-video {
  border-color: rgba(255, 0, 0, 0.3);
  color: rgba(255, 80, 80, 0.8);
}

.pub-badge.badge-archive {
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
}

.pub-badge.badge-social {
  border-color: rgba(100, 255, 160, 0.35);
  color: rgba(100, 255, 160, 0.75);
}

/* ── Article List ── */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  margin-bottom: 1em;
}

.article-list li:last-child {
  margin-bottom: 0;
}

.article-list a {
  font-size: 0.72em;
  line-height: 1.4;
  font-weight: 500;
  display: block;
  text-decoration: none;
  transition: color 0.15s;
}

.article-list a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Featured first article in primary boxes */
.article-list .featured a {
  font-size: 1em;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.article-list .featured {
  margin-bottom: 1.2em;
  padding-bottom: 1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.article-list .excerpt {
  font-size: 0.65em;
  color: var(--secondary-text-light);
  line-height: 1.5;
  margin-top: 0.4em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-date {
  font-size: 0.55em;
  font-style: italic;
  color: var(--hint-text-light);
  margin-top: 0.2em;
}

/* Read all link */
.read-all {
  display: inline-block;
  margin-top: 1em;
  font-size: 0.6em;
  color: var(--hint-text-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.2s;
}

.read-all:hover {
  color: var(--secondary-200);
}

/* ── YouTube Videos (list style) ── */
.video-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.video-list li {
  display: flex;
  gap: 0.75em;
  margin-bottom: 0.85em;
  align-items: flex-start;
}

.video-list li:last-child {
  margin-bottom: 0;
}

.video-thumb {
  width: 150px;
  min-width: 150px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.video-info {
  flex: 1;
  min-width: 0;
}

.video-info a {
  font-size: 0.7em;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-info .article-date {
  font-size: 0.55em;
}

/* ── YouTube Shorts (horizontal scroll) ── */
.shorts-scroll {
  display: flex;
  gap: 0.75em;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5em;
  -webkit-overflow-scrolling: touch;
}

.shorts-scroll::-webkit-scrollbar {
  height: 4px;
}

.shorts-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.shorts-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.short-card {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 120px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.short-card:hover {
  opacity: 0.8;
}

.short-card img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
}

.short-card .short-title {
  font-size: 0.52em;
  line-height: 1.3;
  margin-top: 0.35em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--secondary-text-light);
}

/* ── Social Links ── */
.social-box {
  text-align: center;
}

.social-grid {
  display: flex;
  justify-content: center;
  gap: 1em;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45em;
  text-decoration: none;
  color: var(--hint-text-light);
  transition: color 0.25s;
  padding: 0.8em 1.2em;
  min-width: 70px;
}

.social-link:hover {
  color: var(--secondary-200);
}

.social-link svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.social-link span {
  font-size: 0.52em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Old Blog Archive ── */
.archive-box {
  opacity: 0.55;
  transition: opacity 0.3s;
}

.archive-box:hover {
  opacity: 0.85;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 3;
  column-gap: 2.5em;
}

.archive-list li {
  margin-bottom: 0.6em;
  break-inside: avoid;
}

.archive-list a {
  font-size: 0.62em;
  line-height: 1.35;
}

.archive-list .article-date {
  font-size: 0.48em;
}

/* ── No posts fallback ── */
.no-posts {
  font-size: 0.65em;
  color: var(--hint-text-light);
  font-style: italic;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .masthead h1 {
    font-size: 1.8em;
  }

  .masthead .subtitle {
    font-size: 0.6em;
  }

  .editorial-grid {
    display: block;
  }

  .pub-box {
    border-right: none;
    padding: 1.1em var(--spacing) 1.3em;
  }

  .short-card {
    width: 80px;
  }

  .short-card img {
    width: 80px;
    height: 107px;
  }

  .video-thumb {
    width: 100px;
    min-width: 100px;
  }

  .archive-list {
    columns: 1;
  }

  .article-list .featured a {
    font-size: 0.85em;
  }
}
