/* =========================================================
   TART BLOG
   home.php / Posts page
   ========================================================= */

/* ---------------------------------------------------------
   PAGE
   --------------------------------------------------------- */

.blog-page-main {
  background: var(--paper-soft);
  color: var(--ink);
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */

.blog-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(340px, 0.42fr);
  align-items: end;
  gap: clamp(50px, 8vw, 140px);

  min-height: clamp(650px, 76svh, 880px);

  padding: clamp(72px, 9vw, 145px) var(--rail);

  overflow: hidden;

  color: var(--paper);

  background:
    linear-gradient(90deg,
      rgba(18, 16, 13, 0.96) 0%,
      rgba(18, 16, 13, 0.82) 41%,
      rgba(18, 16, 13, 0.38) 72%,
      rgba(18, 16, 13, 0.6) 100%),
    linear-gradient(0deg, rgba(18, 16, 13, 0.58), transparent 55%),
    url('../assets/images/blog-hero-v4.webp') center 45% / cover no-repeat;
  /* LCP image: preloaded in <head> by tarttattoo_preload_blog_hero() — keep both URLs in sync. */

  border-bottom: 1px solid rgba(20, 17, 13, 0.14);
}

.blog-hero>div:first-child>p {
  margin-bottom: 24px;

  color: var(--mark-soft);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-hero h1 {
  font-family: var(--display-font);
  font-size: clamp(92px, 12vw, 198px);
  font-weight: 400;
  line-height: 0.73;

  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.blog-hero h1 em {
  display: block;

  color: var(--mark-soft);

  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.62em;
  font-style: italic;
  font-weight: 400;
  line-height: 0.95;

  text-transform: none;
}

.blog-hero-copy {
  align-self: end;

  padding: clamp(20px, 3vw, 34px);

  border: 1px solid rgba(240, 234, 220, 0.26);

  background: rgba(14, 12, 9, 0.8);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.blog-hero-copy p {
  color: rgba(240, 234, 220, 0.84);

  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(21px, 2vw, 32px);
  font-style: italic;
  line-height: 1.42;
}

.blog-hero-copy a {
  display: inline-block;
  text-decoration: none;
  margin-top: 32px;
  padding-bottom: 8px;

  border-bottom: 1px solid currentColor;

  color: var(--paper);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------
   FEATURED ARTICLE
   --------------------------------------------------------- */

.blog-featured {
  width: min(1320px, calc(100% - 48px));

  margin: clamp(56px, 7vw, 110px) auto;

  color: var(--paper);
}

.blog-featured>a {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 0.58fr);
  gap: clamp(42px, 7vw, 90px);
  align-items: center;
  text-decoration: none;
  padding: clamp(14px, 1.5vw, 22px);

  overflow: hidden;

  background: var(--ink);
  color: inherit;

  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.blog-featured figure {
  position: relative;

  min-height: 580px;
  height: min(65vw, 780px);

  overflow: hidden;

  background: #090909;

  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}

.blog-featured figure img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  transition: transform 0.65s ease;
}

.blog-featured>a:hover figure img {
  transform: scale(1.025);
}

.blog-featured figure>span {
  position: absolute;
  top: 16px;
  left: 16px;

  padding: 10px 12px;

  background: var(--mark);
  color: var(--paper);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blog-featured-copy {
  display: grid;
  align-content: center;

  gap: clamp(20px, 2.5vw, 36px);
}

.blog-tag {
  width: max-content;

  padding: 7px 10px;

  background: rgba(78, 58, 138, 0.12);
  color: var(--mark);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;

  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-featured .blog-tag {
  background: var(--mark);
  color: var(--paper);
}

.blog-featured h2 {
  font-family: var(--display-font);
  font-size: clamp(46.08px, 5.472vw, 92.16px);
  font-weight: 400;
  line-height: 1;
  margin: 0px;
  text-transform: uppercase;
}

.blog-featured-copy>p {
  max-width: 720px;

  color: rgba(240, 234, 220, 0.7);

  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(20px, 1.8vw, 30px);
  font-style: italic;
  line-height: 1.45;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;

  gap: 10px 24px;

  padding-top: 20px;

  border-top: 1px solid rgba(240, 234, 220, 0.2);

  color: rgba(240, 234, 220, 0.68);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;

  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-featured-copy>strong {
  color: var(--mark-soft);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;

  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------
   FILTERS
   --------------------------------------------------------- */

.blog-controls {
  position: relative;
  z-index: 2;

  display: grid;
  grid-template-columns: minmax(260px, 0.3fr) 1fr;
  gap: clamp(24px, 4vw, 70px);

  align-items: start;

  width: min(1320px, calc(100% - 48px));

  margin: 0 auto;

  padding: 20px 22px;

  border: 1px solid rgba(20, 17, 13, 0.18);

  background: rgba(240, 234, 220, 0.94);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

/* Search */

.blog-search {
  display: grid;
  grid-template-columns: 30px 1fr;

  align-items: center;

  border-bottom: 1px solid rgba(20, 17, 13, 0.35);

  transition: border-color 0.2s ease;
}

.blog-search:focus-within {
  border-bottom-color: var(--mark);
}

.blog-search-icon {
  color: var(--mark);

  font-size: 22px;
  line-height: 1;
}

.blog-search input {
  min-width: 0;
  min-height: 44px;

  padding: 10px 0;

  border: 0;
  outline: none;

  background: transparent;
  color: var(--ink);

  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.blog-search input::placeholder {
  color: var(--mute);

  opacity: 1;
}

/* Chips */

/*
 * Chips wrap instead of scrolling sideways. Without JS every category is
 * visible; js/blog-listing.js collapses the group to one row (two on mobile)
 * and appends a "+N more" toggle for the rest.
 */
.blog-chips {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;

  gap: 8px;

  min-width: 0;
}

.blog-chips [hidden] {
  display: none !important;
}

.blog-chips button {
  flex: none;

  min-height: 44px;

  padding: 10px 14px;

  border: 1px solid rgba(20, 17, 13, 0.25);

  background: transparent;
  color: var(--ink);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;

  letter-spacing: 0.045em;
  text-transform: uppercase;

  cursor: pointer;

  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.blog-chips button span {
  margin-left: 7px;

  color: var(--mute);

  font-size: 14px;
}

.blog-chips button:hover,
.blog-chips button.is-active {
  border-color: var(--ink);

  background: var(--ink);
  color: var(--paper);
}

.blog-chips button.is-active span {
  color: var(--mark-soft);
}

/* "+N more" / "Show less" toggle */

.blog-chips .blog-chips__toggle {
  border-style: dashed;
  border-color: var(--mark);

  color: var(--mark);
}

.blog-chips .blog-chips__toggle:hover {
  border-style: solid;
  border-color: var(--mark);

  background: var(--mark);
  color: var(--paper);
}

/* Keyboard accessibility */

.blog-chips button:focus-visible,
.blog-card>a:focus-visible,
.blog-load-more:focus-visible {
  outline: 3px solid var(--mark);
  outline-offset: 4px;
}

/* ---------------------------------------------------------
   LISTING
   --------------------------------------------------------- */

.blog-listing {
  width: min(1320px, calc(100% - 48px));

  margin: 0 auto;

  padding: clamp(52px, 7vw, 110px) 0 clamp(90px, 10vw, 160px);
}

.blog-results {
  margin-bottom: 28px;

  color: var(--mute);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;

  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-results strong {
  color: var(--ink);
}

/* ---------------------------------------------------------
   ARTICLE GRID
   --------------------------------------------------------- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: clamp(34px, 4vw, 72px) clamp(14px, 2vw, 30px);

  align-items: stretch;
}

/* ---------------------------------------------------------
   SMALL ARTICLE CARD
   --------------------------------------------------------- */

.blog-card[hidden] {
  display: none;
}

.blog-card {
  height: 100%;

  overflow: hidden;

  background: var(--paper);

  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.blog-card>a {
  display: grid;
  grid-template-rows: auto 1fr;
  text-decoration: none;
  height: 100%;

  color: inherit;
}

/* Image */

.blog-card figure {
  height: clamp(330px, 34vw, 490px);
  margin: 0px;
  overflow: hidden;

  background: var(--ink);

  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.blog-card figure img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  filter: saturate(0.85) contrast(1.04);

  transition:
    transform 0.5s ease,
    filter 0.5s ease;
}

.blog-card:hover figure img {
  transform: scale(1.035);

  filter: saturate(1.04) contrast(1.06);
}

/* Content */

.blog-card>a>div {
  display: flex;
  flex-direction: column;

  gap: 15px;

  min-height: 330px;

  padding: 20px 18px 18px;

  border-top: 1px solid rgba(20, 17, 13, 0.24);
}

/* Category */

.blog-card .blog-tag {
  align-self: flex-start;

  font-size: 14px;
}

/* Title */

.blog-card h2 {
  margin: 0;

  color: var(--ink);

  font-family: var(--display-font);
  font-size: clamp(31px, 2.7vw, 46px);
  font-weight: 400;
  line-height: 0.92;

  text-transform: uppercase;

  /*
   * Maximum 3 lines so an unusually long title
   * doesn't destroy card rhythm.
   */
  display: -webkit-box;

  overflow: hidden;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;

  transition: color 0.18s ease;
}

.blog-card>a:hover h2 {
  color: var(--mark);
}

/* Excerpt */

.blog-card p {
  margin: 0;

  color: var(--ink-2);

  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;

  /*
   * Fixed visual maximum.
   * Longer excerpts end cleanly with …
   */
  display: -webkit-box;

  overflow: hidden;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Date + reading time */

.blog-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 16px;

  /*
   * This is the important part:
   * footer is always pushed to the bottom.
   */
  margin-top: auto;

  padding-top: 15px;

  border-top: 1px solid rgba(20, 17, 13, 0.14);

  color: var(--mute);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;

  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.blog-card footer span:last-child {
  white-space: nowrap;
}

/* ---------------------------------------------------------
   EMPTY STATE
   --------------------------------------------------------- */

.blog-empty {
  padding: 70px 0;

  color: var(--ink-2);

  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(22px, 2vw, 32px);
  font-style: italic;
  line-height: 1.4;

  text-align: center;
}

/* ---------------------------------------------------------
   LOAD MORE
   --------------------------------------------------------- */

.blog-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 14px;

  width: max-content;
  min-height: 48px;

  margin: clamp(60px, 8vw, 110px) auto 0;

  padding: 14px 20px;

  border: 0;
  background: var(--ink);
  color: var(--paper);

  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;

  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;

  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);

  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.blog-load-more[hidden] {
  display: none;
}

.blog-load-more:disabled {
  cursor: wait;
  opacity: .68;
}

.blog-load-more.is-loading span[aria-hidden] {
  animation: blog-load-spin .8s linear infinite;
}

@keyframes blog-load-spin {
  to { transform: rotate(360deg); }
}

.blog-load-more span[aria-hidden] {
  color: var(--mark-soft);
}

.blog-load-more:hover {
  background: var(--mark);

  transform: translateY(-1px);
}

/* =========================================================
   TABLET
   ========================================================= */

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

  .blog-hero-copy {
    max-width: 680px;
  }

  .blog-featured>a {
    grid-template-columns: 1fr;
  }

  .blog-featured figure {
    height: min(110vw, 760px);
  }

  .blog-controls {
    grid-template-columns: 1fr;
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-card figure {
    height: 58vw;
  }

  .blog-card>a>div {
    min-height: 315px;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 680px) {
  .blog-hero {
    min-height: 760px;

    padding-top: 54px;
    /* 900px-wide copy of blog-hero-v4.webp (real studio photo, IMG_8986), same
       framing as desktop at a lighter weight. Preloaded by inc/performance.php. */
       framing on phones is unchanged while the file is a third lighter. */
    background-image:
      linear-gradient(90deg,
        rgba(18, 16, 13, 0.96) 0%,
        rgba(18, 16, 13, 0.82) 41%,
        rgba(18, 16, 13, 0.38) 72%,
        rgba(18, 16, 13, 0.6) 100%),
      linear-gradient(0deg, rgba(18, 16, 13, 0.58), transparent 55%),
      url('../assets/images/blog-hero-v4-mobile.webp');
    background-position: center 45%;
  }

  .blog-hero h1 {
    font-size: clamp(78px, 24vw, 116px);
  }

  .blog-featured,
  .blog-controls,
  .blog-listing {
    width: calc(100% - 28px);
  }

  .blog-featured figure {
    min-height: 430px;
    height: 120vw;
  }

  .blog-featured h2 {
    font-size: clamp(41.76px, 12.24vw, 60.48px);
  }

  .blog-controls {
    padding: 16px;
  }

  .blog-chips {
    gap: 6px;
  }

  .blog-chips button {
    padding: 10px 11px;

    font-size: 13px;
    letter-spacing: 0.03em;
  }

  .blog-chips button span {
    margin-left: 5px;

    font-size: 13px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card figure {
    height: 120vw;
  }

  .blog-card>a>div {
    min-height: 0;

    padding: 20px 18px 18px;
  }

  .blog-card footer {
    margin-top: 8px;
  }
}
