/**
 * Client-supplied notebook and featured-article homepage design.
 * Scoped to the blog section. No external fonts or frameworks.
 */
/* ---------- Design tokens (scoped to the component) ---------- */
    .blg {
      --blg-red: #C8102E;
      --blg-red-deep: #9B0C23;
      --blg-red-soft: #FDECEE;
      --blg-green: #0E4D3A;
      --blg-green-dark: #0A3528;
      --blg-green-mid: #1F8A5B;
      --blg-green-soft: #E8F4EE;
      --blg-white: #FFFFFF;
      --blg-ink: #0B2A21;
      --blg-text: #3D524B;
      --blg-gap: clamp(18px, 2.2vw, 26px);
      --blg-ease: cubic-bezier(0.22, 1, 0.36, 1);
      --blg-font: inherit;

      position: relative;
      overflow: hidden;
      padding: clamp(48px, 7vw, 96px) 14px;
      background: var(--blg-white);
      color: var(--blg-text);
      font-family: var(--blg-font);
    }

    .blg *,
    .blg *::before,
    .blg *::after {
      box-sizing: border-box;
    }

    .blg__inner {
      max-width: 1200px;
      margin: 0 auto;
    }

    /* ---------- Journal sheet: gives the section a page of its own ---------- */
    .blg__sheet {
      position: relative;
      max-width: 1320px;
      margin: 0 auto;
      padding: clamp(64px, 8vw, 104px) clamp(18px, 4vw, 60px) clamp(48px, 7vw, 88px);
      border-radius: clamp(24px, 3vw, 36px);
      background-color: #F4F9F6;
      background-image: radial-gradient(rgba(14, 77, 58, 0.11) 1px, transparent 1.4px);
      background-size: 22px 22px;
      background-position: 11px 11px;
      box-shadow:
        inset 0 0 0 1px rgba(14, 77, 58, 0.08),
        0 34px 60px -42px rgba(11, 42, 33, 0.4);
    }

    /* Spiral binding along the top edge */
    .blg-binding {
      position: absolute;
      top: -16px;
      left: clamp(28px, 5vw, 72px);
      right: clamp(28px, 5vw, 72px);
      display: flex;
      justify-content: space-between;
      pointer-events: none;
    }

    .blg-binding span {
      position: relative;
      display: block;
      width: 18px;
      height: 36px;
    }

    /* Punched hole */
    .blg-binding span::before {
      content: "";
      position: absolute;
      bottom: 0;
      left: 0;
      width: 12px;
      height: 9px;
      border-radius: 50%;
      background: rgba(11, 42, 33, 0.2);
      box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.25);
    }

    /* Wire loop: rises from the hole, arches over the edge, tucks behind the page */
    .blg-binding span::after {
      content: "";
      position: absolute;
      top: 0;
      left: 3px;
      width: 15px;
      height: 32px;
      border: 3.5px solid var(--blg-green);
      border-top-color: var(--blg-green-mid);
      border-radius: 8px;
      clip-path: polygon(0 0, 100% 0, 100% 17px, 50% 17px, 50% 100%, 0 100%);
    }

    @media (max-width: 1023px) {
      .blg-binding span:nth-child(3n) {
        display: none;
      }
    }

    @media (max-width: 639px) {
      .blg-binding span {
        display: none;
      }

      .blg-binding span:nth-child(odd) {
        display: block;
      }
    }

    /* ---------- Heading ---------- */
    .blg__head {
      display: grid;
      gap: 22px;
      margin-bottom: clamp(36px, 5vw, 56px);
    }

    @media (min-width: 1024px) {
      .blg__head {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        align-items: end;
        column-gap: clamp(40px, 5vw, 72px);
      }
    }

    .blg__eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin: 0 0 16px;
      padding: 6px 16px 6px 6px;
      border-radius: 999px;
      background: var(--blg-green-soft);
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--blg-green);
    }

    .blg__eyebrow-icon {
      display: grid;
      place-items: center;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--blg-green);
      color: var(--blg-white);
    }

    .blg__eyebrow-icon svg {
      width: 15px;
      height: 15px;
    }

    .blg__title {
      margin: 0;
      font-size: clamp(2rem, 4vw, 3rem);
      font-weight: 800;
      line-height: 1.1;
      letter-spacing: -0.02em;
      color: var(--blg-ink);
    }

    .blg__trail {
      display: block;
      width: 132px;
      height: 14px;
      margin-top: 18px;
    }

    .blg__trail path {
      stroke-dasharray: 1;
      stroke-dashoffset: 0;
    }

    /* Description written on ruled notebook paper */
    .blg__lead {
      position: relative;
      margin: 0;
      padding: 0 0 0 30px;
      font-size: 1.02rem;
      line-height: 1.9rem;
      color: var(--blg-text);
      background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(1.9rem - 1px),
        rgba(14, 77, 58, 0.14) calc(1.9rem - 1px),
        rgba(14, 77, 58, 0.14) 1.9rem
      );
    }

    /* Red notebook margin */
    .blg__lead::before {
      content: "";
      position: absolute;
      top: -6px;
      bottom: -6px;
      left: 10px;
      width: 2px;
      background: rgba(200, 16, 46, 0.6);
      box-shadow: 4px 0 0 rgba(200, 16, 46, 0.25);
      transform-origin: top center;
    }

    /* ---------- Grid ---------- */
    .blg__grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: var(--blg-gap);
    }

    .blg__side {
      display: flex;
      flex-direction: column;
      gap: var(--blg-gap);
    }

    @media (min-width: 1024px) {
      .blg__grid {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
      }
    }

    /* ---------- Card (shared) ---------- */
    .blg-card {
      position: relative;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border-radius: 22px;
      background: var(--blg-white);
      box-shadow:
        0 0 0 1px rgba(14, 77, 58, 0.1),
        0 18px 40px -26px rgba(11, 42, 33, 0.45);
      transition: transform 0.5s var(--blg-ease), box-shadow 0.5s var(--blg-ease);
    }

    .blg-card:hover {
      transform: translateY(-6px);
      box-shadow:
        0 0 0 1px rgba(14, 77, 58, 0.12),
        0 30px 50px -28px rgba(11, 42, 33, 0.55);
    }

    .blg-card:focus-within {
      outline: 3px solid var(--blg-red);
      outline-offset: 3px;
    }

    .blg-card__media {
      position: relative;
      flex-shrink: 0;
      margin: 0;
      overflow: hidden;
      aspect-ratio: 16 / 10;
      background: var(--blg-green-soft);
    }

    .blg-card__img {
      position: absolute;
      inset: 0;
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 1.2s var(--blg-ease);
    }

    .blg-card:hover .blg-card__img {
      transform: scale(1.06);
    }

    .blg-card__body {
      display: flex;
      flex: 1;
      flex-direction: column;
      padding: 22px 24px 22px;
    }

    .blg-card__title {
      margin: 0 0 10px;
      font-size: 1.16rem;
      font-weight: 800;
      line-height: 1.32;
      color: var(--blg-ink);
    }

    .blg-card__link {
      color: inherit;
      text-decoration: none;
      background-image: linear-gradient(var(--blg-red), var(--blg-red));
      background-position: 0 100%;
      background-repeat: no-repeat;
      background-size: 0 2px;
      transition: background-size 0.5s var(--blg-ease);
    }

    .blg-card:hover .blg-card__link {
      background-size: 100% 2px;
    }

    .blg-card__link:focus {
      outline: none;
    }

    /* Whole card is clickable through this one link */
    .blg-card__link::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 3;
    }

    .blg-card__excerpt {
      display: -webkit-box;
      overflow: hidden;
      margin: 0 0 18px;
      font-size: 0.95rem;
      line-height: 1.65;
      color: var(--blg-text);
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      line-clamp: 2;
    }

    /* Read full article: dashed trail that turns solid red on hover */
    .blg-read {
      display: inline-flex;
      align-items: center;
      align-self: flex-start;
      gap: 10px;
      margin-top: auto;
      padding-bottom: 6px;
      font-size: 0.78rem;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--blg-green-mid);
      background-image:
        linear-gradient(var(--blg-red), var(--blg-red)),
        repeating-linear-gradient(90deg, rgba(31, 138, 91, 0.5) 0 6px, transparent 6px 11px);
      background-position: 0 100%, 0 100%;
      background-repeat: no-repeat;
      background-size: 0 2px, 100% 2px;
      transition: color 0.3s ease, background-size 0.6s var(--blg-ease);
    }

    .blg-read svg {
      width: 16px;
      height: 16px;
      transition: transform 0.5s var(--blg-ease);
    }

    .blg-card:hover .blg-read {
      color: var(--blg-red);
      background-size: 100% 2px, 100% 2px;
    }

    .blg-card:hover .blg-read svg {
      transform: translateX(5px);
    }

    /* ---------- Tear-off calendar date ---------- */
    .blg-date {
      position: absolute;
      top: 20px;
      left: 18px;
      z-index: 2;
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 3.75em;
      border-radius: 0.75em;
      background: var(--blg-white);
      box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
      font-size: 16px;
      line-height: 1;
      text-align: center;
      transform-origin: top center;
    }

    /* Binder rings */
    .blg-date::before,
    .blg-date::after {
      content: "";
      position: absolute;
      top: -0.4em;
      z-index: 1;
      width: 0.4em;
      height: 0.8em;
      border-radius: 0.2em;
      background: var(--blg-green);
      box-shadow: inset 0 -0.12em 0 rgba(255, 255, 255, 0.25);
    }

    .blg-date::before { left: 0.85em; }
    .blg-date::after { right: 0.85em; }

    .blg-date__month {
      display: block;
      align-self: stretch;
      padding: 0.6em 0 0.4em;
      border-radius: 0.75em 0.75em 0 0;
      background: var(--blg-red);
      font-size: 0.7em;
      font-weight: 800;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--blg-white);
    }

    .blg-date__day {
      display: block;
      padding-top: 0.3em;
      font-size: 1.6em;
      font-weight: 800;
      color: var(--blg-ink);
    }

    .blg-date__year {
      display: block;
      align-self: stretch;
      margin-top: 0.45em;
      padding: 0.45em 0 0.65em;
      border-top: 1px dashed rgba(14, 77, 58, 0.25);
      font-size: 0.7em;
      font-weight: 700;
      letter-spacing: 0.06em;
      color: var(--blg-text);
    }

    /* "Latest" tag on the featured article */
    .blg-card__tag {
      position: absolute;
      top: 20px;
      right: 18px;
      z-index: 2;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 13px 7px 10px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.92);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.45);
      font-size: 0.74rem;
      font-weight: 800;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--blg-red);
    }

    .blg-card__tag svg {
      width: 14px;
      height: 14px;
    }

    /* ---------- Featured card ---------- */
    .blg-card--featured .blg-card__body {
      flex: 0 0 auto;
      padding: 26px 30px 28px;
    }

    .blg-card--featured .blg-card__title {
      margin-bottom: 12px;
      font-size: clamp(1.4rem, 2.2vw, 1.8rem);
      line-height: 1.25;
      letter-spacing: -0.01em;
    }

    .blg-card--featured .blg-card__excerpt {
      margin-bottom: 22px;
      font-size: 1rem;
      -webkit-line-clamp: 3;
      line-clamp: 3;
    }

    .blg-card--featured .blg-card__img {
      object-position: 50% 20%;
    }

    @media (min-width: 1024px) {
      .blg-card--featured .blg-card__media {
        flex: 1 1 auto;
        min-height: 360px;
        aspect-ratio: auto;
      }
    }

    /* ---------- Compact cards ---------- */
    .blg-card--compact .blg-date {
      top: 16px;
      left: 14px;
      font-size: 13px;
    }

    @media (min-width: 640px) {
      .blg-card--compact {
        flex-direction: row;
      }

      .blg-card--compact .blg-card__media {
        width: 42%;
        min-height: 200px;
        aspect-ratio: auto;
      }

      .blg-card--compact .blg-card__body {
        padding: 20px 22px;
      }
    }

    /* ---------- See all articles panel ---------- */
    .blg-all {
      position: relative;
      isolation: isolate;
      display: flex;
      flex: 1;
      align-items: center;
      gap: 16px;
      min-height: 104px;
      overflow: hidden;
      padding: 26px 24px 22px;
      border-radius: 22px;
      background: linear-gradient(120deg, var(--blg-green) 0%, var(--blg-green-dark) 100%);
      box-shadow: 0 24px 44px -28px rgba(10, 53, 40, 0.85);
      font-size: 1.15rem;
      font-weight: 800;
      color: var(--blg-white);
      text-decoration: none;
    }

    /* Airmail stripe, matching the About section */
    .blg-all::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 6px;
      background: repeating-linear-gradient(
        135deg,
        var(--blg-red) 0 12px,
        var(--blg-white) 12px 18px,
        var(--blg-green-mid) 18px 30px,
        var(--blg-white) 30px 36px
      );
    }

    .blg-all__topo {
      position: absolute;
      right: -120px;
      bottom: -170px;
      z-index: -1;
      width: 420px;
      height: auto;
      color: var(--blg-white);
      opacity: 0.1;
      transition: transform 1.2s var(--blg-ease);
      pointer-events: none;
    }

    .blg-all:hover .blg-all__topo {
      transform: scale(1.12) rotate(-6deg);
    }

    .blg-all__icon {
      display: grid;
      flex-shrink: 0;
      place-items: center;
      width: 50px;
      height: 50px;
      border: 1.5px solid rgba(255, 255, 255, 0.25);
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.06);
    }

    .blg-all__icon svg {
      width: 22px;
      height: 22px;
    }

    .blg-all__arrow {
      display: grid;
      flex-shrink: 0;
      place-items: center;
      width: 46px;
      height: 46px;
      margin-left: auto;
      border-radius: 50%;
      background: var(--blg-white);
      color: var(--blg-red);
      transition: background-color 0.4s ease, color 0.4s ease, transform 0.5s var(--blg-ease);
    }

    .blg-all__arrow svg {
      width: 18px;
      height: 18px;
    }

    .blg-all:hover .blg-all__arrow,
    .blg-all:focus-visible .blg-all__arrow {
      background: var(--blg-red);
      color: var(--blg-white);
      transform: translateX(4px);
    }

    .blg-all:focus-visible {
      outline: 3px solid var(--blg-red);
      outline-offset: 3px;
    }

    /* ---------- Entrance animation (enabled by JS only) ---------- */
    .blg--anim .blg__eyebrow,
    .blg--anim .blg__title,
    .blg--anim .blg__lead {
      opacity: 0;
      transform: translateY(18px);
    }

    .blg--anim .blg__lead::before {
      transform: scaleY(0);
    }

    .blg--anim .blg__trail path {
      stroke-dashoffset: 1;
    }

    .blg--anim .blg-binding {
      clip-path: inset(0 100% 0 0);
    }

    .blg--anim .blg__sheet.is-bound .blg-binding {
      clip-path: inset(-10px 0 0 0);
      transition: clip-path 1.3s var(--blg-ease);
    }

    .blg--anim .blg-card--featured {
      opacity: 0;
      transform: translateX(-40px);
    }

    .blg--anim .blg-card--compact,
    .blg--anim .blg-all {
      opacity: 0;
      transform: translateX(40px);
    }

    .blg--anim .blg-card__img {
      opacity: 0;
      transform: scale(1.15);
    }

    .blg--anim .blg-date {
      opacity: 0;
      transform: perspective(300px) rotateX(-100deg);
    }

    .blg--anim .is-in .blg__eyebrow,
    .blg--anim .is-in .blg__title,
    .blg--anim .is-in .blg__lead {
      opacity: 1;
      transform: none;
      transition: opacity 0.8s ease var(--blg-d, 0s), transform 0.9s var(--blg-ease) var(--blg-d, 0s);
    }

    .blg__eyebrow { --blg-d: 0s; }
    .blg__title { --blg-d: 0.1s; }
    .blg__lead { --blg-d: 0.25s; }

    .blg--anim .is-in .blg__lead::before {
      transform: none;
      transition: transform 1s var(--blg-ease) 0.4s;
    }

    .blg--anim .is-in .blg__trail path {
      stroke-dashoffset: 0;
      transition: stroke-dashoffset 1.1s var(--blg-ease) 0.4s;
    }

    .blg--anim .is-in .blg-card--featured,
    .blg--anim .is-in .blg-card--compact,
    .blg--anim .is-in .blg-all {
      opacity: 1;
      transform: none;
      transition:
        opacity 0.8s ease var(--blg-d, 0s),
        transform 1s var(--blg-ease) var(--blg-d, 0s),
        box-shadow 0.5s var(--blg-ease);
    }

    .blg-card--featured { --blg-d: 0s; }
    .blg__side > :nth-child(1) { --blg-d: 0.15s; }
    .blg__side > :nth-child(2) { --blg-d: 0.3s; }
    .blg__side > :nth-child(3) { --blg-d: 0.45s; }

    /* Keep hover lift working after the entrance */
    .blg--anim .is-in .blg-card:hover {
      transform: translateY(-6px);
      transition: transform 0.5s var(--blg-ease), box-shadow 0.5s var(--blg-ease);
    }

    .blg--anim .is-in .blg-card__img {
      opacity: 1;
      transform: none;
      transition:
        opacity 0.9s ease calc(var(--blg-d, 0s) + 0.15s),
        transform 1.4s var(--blg-ease) calc(var(--blg-d, 0s) + 0.15s);
    }

    .blg--anim .is-in .blg-card:hover .blg-card__img {
      transform: scale(1.06);
      transition: transform 1.2s var(--blg-ease);
    }

    /* Calendar page flips down into place */
    .blg--anim .is-in .blg-date {
      opacity: 1;
      transform: perspective(300px) rotateX(0deg);
      transition:
        opacity 0.3s ease calc(var(--blg-d, 0s) + 0.7s),
        transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--blg-d, 0s) + 0.7s);
    }

    /* ---------- Accessibility: reduced motion ---------- */
    @media (prefers-reduced-motion: reduce) {
      .blg *,
      .blg *::before,
      .blg *::after {
        transition: none !important;
        animation: none !important;
      }

      .blg-card:hover,
      .blg-card:hover .blg-card__img,
      .blg-card:hover .blg-read svg,
      .blg-all:hover .blg-all__topo,
      .blg-all:hover .blg-all__arrow {
        transform: none;
      }
    }
