/* Blog — extends portfolio shell */

.page-blog {
  --hover-bg: rgba(220, 38, 38, 0.06);
}

.page-blog #bl-hero {
  min-height: 50vh;
  padding: 0 4vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  border-bottom: var(--rule);
}

.page-blog #bl-hero .hero__headline {
  font-size: clamp(4.95vw, 7.2vw, 9vw);
  padding-top: 3vh;
}

.page-blog #bl-hero .hero__sub {
  padding-bottom: 2.5vh;
}

.page-blog #bl-hero .hero__taglines {
  max-width: min(34rem, 52vw);
}

@media (max-width: 900px) {
  .page-blog #bl-hero .hero__headline {
    margin-top: calc(var(--mobile-clock-top) + var(--mobile-clock-height) - var(--mobile-nav-inset) + 0.35rem);
    padding-top: 0;
  }

  .page-blog #bl-hero .hero__taglines {
    max-width: 100%;
  }
}

.page-blog #bl-hero .hero__tagline {
  font-size: clamp(0.82rem, 1.35vw, 1.05rem);
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.page-blog #bl-hero .hero__geometry canvas {
  width: min(100vw, 720px);
  height: min(100vw, 720px);
  max-height: 50vh;
}

.page-blog #bl-hero .hero__live-clock {
  font-size: clamp(3rem, 6vw, 6.5rem);
}

.page-blog .section-title,
.page-blog .pf-section__subtitle {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.page-blog .pf-section,
.page-workshop .pf-section {
  position: relative;
  z-index: 1;
}

/* Filter */
.blog-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: var(--rule-thin);
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.blog-filter .btn {
  background: rgba(10, 10, 10, 0.92);
  isolation: isolate;
}

.blog-filter__group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
}

.blog-filter__field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.blog-filter__field input[type="date"] {
  font-family: var(--mono);
  font-size: var(--fs-sm-plus);
  color: var(--text-white);
  background: rgba(10, 10, 10, 0.9);
  border: var(--rule-thin);
  padding: 0.65rem 0.85rem;
  min-width: 11rem;
  color-scheme: dark;
  accent-color: var(--accent-red);
  transition: border-color 0.25s ease;
}

.blog-filter__field input[type="date"]:focus {
  outline: none;
  border-color: var(--accent-red);
}

.blog-filter__field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(27%) sepia(89%) saturate(2562%) hue-rotate(346deg) brightness(92%);
}

/* Accordion list */
.blog-acc-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-acc {
  border: var(--rule);
  background: rgba(26, 26, 26, 0.82);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.blog-acc[hidden] {
  display: none !important;
}

.blog-acc:hover,
.blog-acc.is-open {
  border-color: rgba(220, 38, 38, 0.45);
}

.blog-acc.is-open {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.blog-acc__summary {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.3s ease;
}
.blog-acc__summary:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: -3px;
  background: var(--hover-bg);
}

.blog-acc:hover .blog-acc__summary,
.blog-acc.is-open .blog-acc__summary {
  background: var(--hover-bg);
}

/* Thumbnail */
.blog-acc__thumb {
  flex: 0 0 120px;
  width: 120px;
  height: 64px;
  border: var(--rule-thin);
  overflow: hidden;
  background: #0a0a0a;
  margin: 0;
}

.blog-acc__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-acc:hover .blog-acc__thumb img,
.blog-acc.is-open .blog-acc__thumb img {
  filter: grayscale(0%);
}

.blog-acc:hover .blog-acc__thumb img {
  transform: scale(1.04);
}

.blog-acc__date {
  flex: 0 0 7.5rem;
  font-family: var(--mono);
  font-size: var(--fs-sm-plus);
  letter-spacing: 0.08em;
  color: var(--accent-red);
}

.blog-acc__title {
  flex: 1;
  font-family: var(--condensed);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-white);
}

.blog-acc__chevron {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  border: var(--rule-thin);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease, border-color 0.25s ease;
}

.blog-acc.is-open .blog-acc__chevron {
  transform: rotate(180deg);
  color: var(--accent-red);
  border-color: rgba(220, 38, 38, 0.4);
}

/* Expandable body */
.blog-acc__expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.82s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-acc.is-open .blog-acc__expand {
  grid-template-rows: 1fr;
}

.blog-acc__expand-inner {
  overflow: hidden;
  min-height: 0;
}

.blog-acc__body {
  padding: 0 1.25rem 1.35rem;
  border-top: var(--rule-thin);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.blog-acc.is-open .blog-acc__body {
  opacity: 1;
  transform: translateY(0);
}

.blog-acc__body p {
  font-family: var(--mono);
  font-size: var(--fs-sm-plus);
  line-height: 1.65;
  color: var(--text-gray);
  margin: 0 0 0.85rem;
}

.blog-acc__body p:last-of-type {
  margin-bottom: 1.1rem;
}

.blog-acc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
  position: relative;
  z-index: 2;
}

.blog-acc__actions .btn {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .blog-acc__summary {
    flex-wrap: wrap;
    padding: 0.9rem 1rem;
  }
  .blog-acc__thumb {
    flex: 0 0 100%;
    width: 100%;
    height: 120px;
  }
  .blog-acc__date {
    flex: 1 1 auto;
  }
  .blog-filter {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-acc__expand,
  .blog-acc__body,
  .blog-acc__thumb img,
  .blog-acc__chevron {
    transition: none !important;
  }
  .blog-acc__body {
    opacity: 1;
    transform: none;
  }
}

html.browser-yandex .blog-acc.is-open .blog-acc__body,
html.viewport-mobile .blog-acc.is-open .blog-acc__body {
  opacity: 1 !important;
  transform: none !important;
}
