/* ========================================================================
   Blog layout — F12.rocks style (black, #f12f12 accent, rounded images)
   ======================================================================== */

html.blog,
html.blog body {
  width: 100%;
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background: #000;
  color: #e8e8e8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.blog a {
  color: #f12f12;
  text-decoration: none;
}

.blog a:hover,
.blog a:focus {
  text-decoration: underline;
}

.blog a:focus-visible {
  outline: 2px solid #f12f12;
  outline-offset: 2px;
}

/* ---- Site chrome (logo bar) ---- */

.blog-site {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.blog-site__logo {
  display: flex;
  align-items: center;
  line-height: 0;
}

.blog-site__logo:hover,
.blog-site__logo:focus {
  text-decoration: none;
  opacity: 0.85;
}

.blog-site__logo img {
  display: block;
  width: 2.5rem;
  height: auto;
}

.blog-site__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f12f12;
}

/* ---- Header / nav ---- */

.blog-header {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 1rem;
  border-bottom: 1px solid #1a1a1a;
}

.blog-header__back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #888;
}

.blog-header__back:hover,
.blog-header__back:focus {
  color: #f12f12;
  text-decoration: none;
}

.blog-header__title {
  margin: 0 0 0.35em;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

.blog-header__meta {
  margin: 0;
  font-size: 0.9375rem;
  color: #777;
}

/* ---- Article body ---- */

.blog-article {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.blog-article p {
  margin: 0 0 1.25em;
}

.blog-article h2 {
  margin: 2em 0 0.75em;
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
}

.blog-article blockquote {
  margin: 1.5em 0;
  padding-left: 1rem;
  border-left: 3px solid #f12f12;
  color: #bbb;
  font-style: italic;
}

/* ---- Images (inline + masonry) — #f12f12 border like gallery thumbs ---- */

.blog-figure {
  margin: 2rem 0;
}

.blog-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #f12f12;
  border-radius: 8px;
  box-shadow: 0 0 32px #000;
  background: #111;
  cursor: pointer;
}

.blog-figure figcaption {
  margin-top: 0.6em;
  font-size: 0.875rem;
  color: #888;
  text-align: center;
}

/* ---- Masonry section ---- */

.blog-masonry-section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  border-top: 1px solid #1a1a1a;
}

.blog-masonry-section h2 {
  margin: 2.5rem 0 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-masonry {
  column-count: 2;
  column-gap: 0.75rem;
}

@media (min-width: 640px) {
  .blog-masonry {
    column-count: 3;
    column-gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .blog-masonry {
    column-count: 4;
  }
}

.blog-masonry__item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
}

.blog-masonry__item img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #f12f12;
  border-radius: 8px;
  box-shadow: 0 0 24px #000;
  background: #111;
  transition: opacity 0.2s, transform 0.2s;
}

.blog-masonry__item:hover img {
  opacity: 0.9;
  transform: scale(1.01);
}

/* ---- Blog index listing ---- */

.blog-index {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.blog-index > h1 {
  margin: 0 0 2rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: #fff;
}

.blog-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-index__item {
  margin: 0;
  padding: 0;
  border: none;
}

.blog-index__card {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid #222;
  border-radius: 10px;
  background: #0a0a0a;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.blog-index__card:hover,
.blog-index__card:focus {
  border-color: #f12f12;
  background: #111;
  text-decoration: none;
}

.blog-index__thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid #f12f12;
  border-radius: 8px;
  background: #111;
}

.blog-index__body {
  min-width: 0;
}

.blog-index__title {
  margin: 0 0 0.35em;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.blog-index__card:hover .blog-index__title,
.blog-index__card:focus .blog-index__title {
  color: #f12f12;
}

.blog-index__date {
  display: block;
  font-size: 0.8125rem;
  color: #666;
}

.blog-index__excerpt {
  margin: 0.5em 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #999;
}

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

  .blog-index__thumb {
    max-height: 12rem;
  }
}

/* ---- Footer ---- */

.blog-footer {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  border-top: 1px solid #1a1a1a;
}

.blog-footer__home {
  display: inline-flex;
  line-height: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.blog-footer__home:hover,
.blog-footer__home:focus {
  opacity: 1;
  text-decoration: none;
}

.blog-footer__home img {
  display: block;
  width: 3rem;
  height: auto;
}

/* ---- Modal (blog pages) ---- */

html.blog .f12__modal-img {
  cursor: pointer;
  border: 2px solid #f12f12;
}
