/* /styles/theme.blades.css */
/* Used exclusively for /blades/index.html archive view */

/* Blade archive grid layout */
.blade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  padding: 0 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.blade-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.blade-entry a {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.blade-entry a:hover {
  opacity: 0.85;
}

.blade-entry img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  background-color: var(--bg2);
  margin-bottom: 12px;
  transition: transform 0.2s ease;
  min-height: 200px; /* Prevent collapse on missing image */
  aspect-ratio: 3 / 2; /* Maintain visual consistency */
}

.blade-entry img:hover {
  transform: scale(1.01);
}

.blade-entry h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  text-align: center;
}

.blade-entry .blade-date {
  font-size: 0.85rem;
  color: var(--text); /* unified with titles */
  margin: 0;
  letter-spacing: 0.2px;
  text-align: center;
}

/* Compact mode */
body.compact .blade-entry h2 {
  font-size: 1rem;
  line-height: 1.2;
}

body.compact .blade-entry img {
  display: none;
}

body.compact .blade-entry {
  border-left: 2px solid var(--muted);
  padding-left: 12px;
  text-align: left;
  align-items: flex-start;
}

/* Page header */
h1 {
  text-align: center;
  font-size: 2.2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.view-toggle {
  text-align: center;
  margin-top: -24px;
  margin-bottom: 40px;
}

.view-toggle a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: underline;
}

.view-toggle a:hover {
  color: var(--text);
}

.view-switch {
  text-align: center;
  margin-bottom: 30px;
}

.view-switch a {
  font-size: 1rem;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-style: italic;
}

/* Featured blade styling — desktop/tablet */
.blade-featured {
  grid-column: 1 / -1;
  margin-bottom: 2rem;
  text-align: center;
}

.blade-featured img {
  width: 100%;
  max-width: 900px;
  max-height: 500px;   /* Cap height for desktop */
  height: auto;
  margin: 0 auto 12px;
  display: block;
  border-radius: 6px;
  object-fit: cover;   /* Crop instead of stretching */
}

/* Mobile refinement */
@media (max-width: 480px) {
  .blade-grid {
    grid-template-columns: 1fr;
    padding: 0 16px 40px;
  }

  .blade-featured {
    margin-bottom: 1.5rem;
    max-width: 100%;
  }

  .blade-featured img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 2;
  }
}
