/* ============================================================
   AIS · Articles
   /articles and its three tab pages (/articles/guides, /articles/for-ceos,
   /articles/industry) load this after site.css, and nothing else does, so no
   rule here can reach the tour on index.html or the four footer subpages.
   Laid out after blog.railway.com: a title row, a row of tabs that are real
   pages, up to two featured cards on the first tab, then a grid of post cards.
   Desktop first; the phone rules sit inside the gate query site.css uses.

   Every list ships empty. The markup for a featured card, a post card and a
   phone row is in docs/ARTICLES.md, so publishing is markup only: no new CSS.
   ============================================================ */

/* the band: clears the fixed header the way .crumbs does, since it opens the page */
.blog{padding:calc(74px + var(--sat) + clamp(34px,5vh,56px)) 0 clamp(64px,10vh,120px);background:var(--onyx)}
.blog .wrap{max-width:var(--wrap);margin:0 auto;padding:0 clamp(20px,4vw,48px)}

/* --- title row --- */
.blog-bar{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px 22px;margin-bottom:22px}
.blog-name{
  font-weight:720;font-stretch:105%;font-size:clamp(1.6rem,2.4vw,2rem);
  line-height:1.1;letter-spacing:-.016em;color:var(--bone);
}
a.blog-name:hover{color:var(--mint)}
.blog-sub{font-size:15px;line-height:1.55;color:var(--bone-66);max-width:62ch}

/* --- the tabs: four real pages, the current one bright --- */
.blog-tabs{
  display:flex;flex-wrap:wrap;gap:4px 30px;
  padding-bottom:16px;border-bottom:1px solid var(--hair);margin-bottom:clamp(36px,5vh,56px);
}
.blog-tabs a{font-size:15px;font-weight:500;color:var(--bone-40);padding:6px 0;transition:color .2s;position:relative}
.blog-tabs a:hover{color:var(--bone)}
.blog-tabs a[aria-current]{color:var(--bone)}
.blog-tabs a[aria-current]::after{
  content:"";position:absolute;left:0;right:0;bottom:-17px;height:1.5px;background:var(--mint);
}

/* --- a section heading over a grid: "Latest" on /articles, the tab's name elsewhere --- */
.blog-h{
  font-weight:700;font-stretch:105%;font-size:clamp(1.5rem,2.2vw,1.9rem);
  line-height:1.15;letter-spacing:-.014em;color:var(--bone);margin-bottom:10px;
}
.blog-desc{font-size:15.5px;line-height:1.6;color:var(--bone-66);max-width:64ch;margin-bottom:clamp(26px,4vh,40px)}

/* --- category badges: one tint per tab, all from the site's own tokens --- */
.tag{
  display:inline-block;font-family:var(--mono);font-size:10.5px;font-weight:500;line-height:1;
  letter-spacing:.14em;text-transform:uppercase;padding:5px 8px;border-radius:4px;
}
.tag-article{background:rgba(244,242,237,.08);color:var(--bone-66)}
.tag-guide{background:rgba(92,191,149,.14);color:var(--mint)}
.tag-ceo{background:rgba(1,121,80,.32);color:var(--bone)}
.tag-industry{background:transparent;color:var(--bone-66);border:1px solid var(--hair);padding:4px 7px}

/* --- the grid of post cards: three across, a hairline under each row --- */
.post-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 clamp(24px,3vw,44px)}
.post{border-bottom:1px solid var(--hair-soft)}
.post-link{display:flex;flex-direction:column;gap:10px;height:100%;padding:28px 0 26px}
.post-tags{display:flex;flex-wrap:wrap;gap:6px}
.post-t{
  font-weight:700;font-stretch:104%;font-size:1.12rem;line-height:1.32;letter-spacing:-.008em;
  color:var(--bone);transition:color .2s;
}
.post-link:hover .post-t{color:var(--mint)}
.post-d{
  font-size:14.5px;line-height:1.6;color:var(--bone-66);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.post-meta{
  margin-top:auto;padding-top:8px;display:flex;justify-content:space-between;gap:12px;
  font-size:13px;color:var(--bone-40);
}

/* --- featured: the two newest pieces, large, with a cover, above "Latest" --- */
.feat-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(24px,3vw,44px);
  padding-bottom:clamp(40px,6vh,64px);margin-bottom:clamp(40px,6vh,64px);border-bottom:1px solid var(--hair);
}
.post-feat{border-bottom:0}
.post-feat .post-link{padding:0}
.post-cover{
  display:block;aspect-ratio:16/9;border-radius:10px;overflow:hidden;margin-bottom:10px;
  background:var(--carbon);border:1px solid var(--hair-soft);
}
.post-cover img{width:100%;height:100%;object-fit:cover;transition:transform .6s cubic-bezier(.16,1,.3,1)}
.post-feat .post-link:hover .post-cover img{transform:scale(1.03)}
.post-feat .post-t{font-size:clamp(1.3rem,1.8vw,1.55rem);line-height:1.25}

/* --- the empty state, sitting where the first row of cards will go --- */
.post-empty{
  grid-column:1 / -1;border:1px dashed var(--hair);border-radius:10px;padding:26px 30px;max-width:760px;
}
.post-empty .cap{
  display:block;margin-bottom:8px;
  font-family:var(--mono);font-size:10.5px;letter-spacing:.22em;text-transform:uppercase;color:var(--mint);
}
.post-empty p{font-size:15.5px;line-height:1.65;color:var(--bone-66)}

@media (max-width:1020px){
  .post-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ============================================================
   phone: title, the four tabs as chips, then rows
   ============================================================ */
@media (max-width:760px), (max-height:480px) and (pointer:coarse){
  #app .m-tabs{
    display:flex;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;
    margin:6px -20px 4px;padding:2px 20px 14px;border-bottom:1px solid var(--hair);
  }
  #app .m-tabs::-webkit-scrollbar{display:none}
  #app .m-tabs a{
    flex:0 0 auto;display:inline-flex;align-items:center;min-height:40px;padding:0 16px;
    border:1px solid var(--hair);border-radius:999px;font-size:15px;font-weight:600;color:var(--bone-66);
  }
  #app .m-tabs a[aria-current]{background:var(--bone);border-color:var(--bone);color:var(--onyx)}

  #app .m-lib-empty{border:1px dashed var(--hair);border-radius:10px;padding:18px 20px;margin:4px 0 8px}
  #app .m-lib-empty .m-cap{color:var(--mint);margin-bottom:6px}
  #app .m-lib-empty p{font-size:15px;line-height:1.55;color:var(--bone-66)}

  #app .m-lib-list{border-top:1px solid var(--hair)}
  #app .m-lib-item{
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:center;
    min-height:52px;padding:16px 2px;border-bottom:1px solid var(--hair-soft);
  }
  #app .m-li-meta{grid-column:1;display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;color:var(--bone-40)}
  #app .m-li-t{grid-column:1;font-size:16px;font-weight:600;line-height:1.3;color:var(--bone)}
  #app .m-lib-item .arr{grid-column:2;grid-row:1 / span 2;color:var(--mint)}
  #app .m-lib-item:active .m-li-t{color:var(--mint)}
}
