/*
  Blog-specific styles for Félix Ortega's portfolio & blog.
  Complements styles.css with editorial reading typography and catalog grid.
*/

.blog-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--page-gutter);
}

/* Glass container for blog catalog and articles */
.blog-card {
  width: 100%;
  max-width: 56rem; /* ~896px */
  margin: 0 auto;
  padding: clamp(2rem, 1.25rem + 2.5vw, 4rem) clamp(1.5rem, 0.9rem + 2vw, 3.5rem);
  position: relative;
  z-index: 1;
  border: 1px solid var(--color-card-edge);
  border-radius: var(--card-radius);
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(4px) saturate(140%);
  backdrop-filter: blur(4px) saturate(140%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .blog-card {
    background: rgb(255 255 255 / 88%);
  }
}

/* Top bar with back-to-home and breadcrumb */
.blog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(2rem, 1.5rem + 1.6vw, 3rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgb(17 17 17 / 8%);
}

.blog-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 220ms var(--ease-out), color 220ms var(--ease-out);
}

.blog-nav__back:hover {
  transform: translateX(-3px);
  color: #000000;
}

.blog-nav__back-arrow {
  display: inline-block;
  font-size: 1.125rem;
  line-height: 1;
  transition: transform 220ms var(--ease-out);
}

.blog-nav__back:hover .blog-nav__back-arrow {
  transform: translateX(-3px);
}

.blog-nav__tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  background: rgb(255 255 255 / 50%);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-card-edge);
}

/* Header / Hero */
.blog-hero {
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
  text-align: left;
}

.blog-hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.4rem + 2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.blog-hero__subtitle {
  margin: 1rem 0 0;
  max-width: 42ch;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  color: var(--color-text-soft);
}

/* Article List */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-item {
  position: relative;
  padding: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
  border: 1px solid var(--color-card-edge);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 40%);
  box-shadow: 0 0.5rem 1.5rem -0.5rem rgb(20 30 40 / 8%);
  transition:
    transform 240ms var(--ease-out),
    background-color 240ms var(--ease-out),
    box-shadow 240ms var(--ease-out);
}

.article-item:hover {
  transform: translateY(-3px);
  background: rgb(255 255 255 / 65%);
  box-shadow: 0 1rem 2.5rem -0.75rem rgb(20 30 40 / 16%);
}

.article-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-soft);
  margin-bottom: 0.75rem;
}

.article-item__tag {
  color: #111111;
  background: rgb(46 188 219 / 20%);
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
}

.article-item__bullet {
  opacity: 0.5;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: inline-block;
  vertical-align: -0.1em;
  opacity: 0.7;
  flex-shrink: 0;
}

.meta-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 200ms ease, opacity 200ms ease;
}

.meta-link:hover {
  color: #000000;
}

.meta-link:hover .meta-icon {
  opacity: 1;
}

.article-item__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.875rem);
  font-weight: 700;
  line-height: 1.3;
}

.article-item__title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 200ms ease;
}

.article-item__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.article-item:hover .article-item__title a {
  color: #000000;
}

.article-item__excerpt {
  margin: 0 0 1.25rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-soft);
  max-width: 58ch;
}

/* Article Card Thumbnail in Catalog */
.article-item__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 15rem;
  border-radius: 0.85rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--color-card-edge);
  background: rgb(20 30 40 / 5%);
}

.article-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms var(--ease-out);
}

.article-item:hover .article-item__thumb img {
  transform: scale(1.025);
}

.article-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text);
}

.article-item__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #111111;
  transition: gap 200ms ease;
}

.article-item:hover .article-item__cta {
  gap: 0.6rem;
  color: #000000;
}

/* Single Article Reader */
.article-header {
  margin-bottom: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem);
  text-align: left;
}

.article-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-soft);
  margin-bottom: 1rem;
}

.article-header__title {
  margin: 0 0 1.5rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.45rem + 2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-wrap: balance;
}

.article-header__lead {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.25rem);
  line-height: 1.68;
  color: var(--color-text-soft);
  margin: 0 0 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgb(17 17 17 / 10%);
}

/* Article Hero Cover Image */
.article-cover {
  width: 100%;
  margin: 0 0 clamp(2rem, 1.5rem + 2vw, 3rem);
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--color-card-edge);
  box-shadow: 0 0.75rem 2rem -0.5rem rgb(20 30 40 / 14%);
  aspect-ratio: 16 / 9;
  max-height: 28rem;
  background: rgb(20 30 40 / 5%);
}

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

.article-author-badge {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.article-author-badge__avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 80%);
  border: 1px solid var(--color-card-edge);
  object-fit: cover;
  box-shadow: var(--shadow-icon);
}

.article-author-badge__name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-text);
  margin: 0;
}

.article-author-badge__role {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--color-text-soft);
  margin: 0.15rem 0 0;
}

/* Editorial Content / Prose */
.article-prose {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.78;
  color: #262626;
  max-width: 65ch;
  margin: 0 auto;
}

.article-prose p {
  font-weight: 400;
  margin: 0 0 1.6rem;
}

.article-prose h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2.125rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 2.75rem 0 1rem;
  color: var(--color-text);
}

.article-prose h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 2.25rem 0 0.85rem;
  color: var(--color-text);
}

.article-prose strong {
  font-weight: 700;
  color: #000000;
}

.article-prose a {
  color: #111111;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 180ms ease;
}

.article-prose a:hover {
  color: #000000;
  text-decoration-color: var(--color-status);
}

.article-prose blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.75rem;
  border-left: 3px solid var(--color-status);
  background: rgb(255 255 255 / 35%);
  border-radius: 0 0.75rem 0.75rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.6;
  color: #111111;
}

.article-prose blockquote p:last-child {
  margin-bottom: 0;
}

.article-prose ul,
.article-prose ol {
  margin: 0 0 1.75rem;
  padding-left: 1.5rem;
}

.article-prose li {
  margin-bottom: 0.65rem;
}

.article-prose hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid rgb(17 17 17 / 10%);
}

/* Article footer / next navigation */
.article-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgb(17 17 17 / 10%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.article-footer__author-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgb(255 255 255 / 40%);
  border: 1px solid var(--color-card-edge);
  border-radius: 1rem;
}

.article-footer__share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-soft);
}

/* Mobile adjustments */
@media (max-width: 47.99em) {
  .blog-page {
    padding: 0;
  }

  .blog-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 1.5rem 1.25rem 3rem;
  }

  .article-item {
    border-radius: 1rem;
    padding: 1.25rem;
  }
}
