/* ==========================================================================
   Rinjani Atlas — blog.css  (Blog page only; requires main.css)
   Shared patterns used here (main.css): .text-hero/.page-hero__head/.h1, .photo/.grade, .ticks, .btn
   Sections: Hero (page content) · Stories (rinjani/story-grid block: filter + grid + load more)
   ========================================================================== */

/* Intro elements stay hidden until blog.js animates them; cards wait for the grid to be built */
.js-motion:not(.ra-ready) :is(.site-header > *, .page-hero__title > *, .page-hero__side > *, .stories__bar) { visibility: hidden; }
.js-motion .posts:not(.is-built) { visibility: hidden; }
.story-grid { display: contents; }
.post-card[hidden] { display: none; }


/* ==========================================================================
   2. STORIES — category pills + count
   ========================================================================== */
.stories { padding: clamp(32px, 6vw, 48px) var(--gutter) 0; scroll-margin-top: 90px; }

/* mobile/tablet: one swipeable row of pills (bleeds to the screen edge) */
.cats {
  position: relative; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); scroll-padding-inline: var(--gutter);
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; height: 44px; padding: 0 16px; border: none; border-radius: 999px; background: var(--pill); color: var(--ink);
  display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .35s, color .35s;
}
.cat:hover { background: var(--pill-hover); }
.cat__n { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 14px; color: var(--kicker); transition: color .35s; }
.cat[aria-selected="true"] { background: var(--ink); color: var(--white); }
.cat[aria-selected="true"] .cat__n { color: var(--line-3); }

.stories__meta { margin-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stories__label { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--kicker); }
.stories__count { display: flex; align-items: center; gap: 16px; font-family: var(--serif); font-style: italic; font-size: 19px; white-space: nowrap; }
.stories__count-line { display: none; width: 56px; height: 1px; background: var(--line-3); }

@media (min-width: 1280px) {
  .stories { padding: 64px 48px 32px; }
  .stories__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
  .cats { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .cat { padding: 0 18px; }
  .stories__meta { margin: 0; padding: 0; border: none; }
  .stories__label { display: none; }
  .stories__count { font-size: 22px; }
  .stories__count-line { display: block; }
}

/* ==========================================================================
   Grid
   ========================================================================== */
.posts { margin-top: clamp(24px, 5vw, 36px); display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(40px, 7vw, 48px) 16px; }
@media (min-width: 1280px) {
  .posts { margin-top: 40px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 20px; }
}

/* Shared meta line: date · read time */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; font-weight: 500; color: var(--kicker); }
.post-meta__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.post-meta__opt { display: none; }

/* ---------- Small card: photo + text below ---------- */
.post-card { display: flex; flex-direction: column; color: var(--ink); }
.post-card:hover { color: var(--ink); }
.post-card__photo { height: clamp(220px, 56vw, 260px); border-radius: 24px; }
.post-card__photo img { transition: transform 1.1s var(--ease); }
.post-card__cat { position: absolute; left: 14px; top: 14px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--white); display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink); }
.post-card__body { display: flex; flex-direction: column; padding: 20px 2px 0; }
.post-card__title { margin-top: 10px; font-size: clamp(21px, 4.8vw, 24px); font-weight: 500; line-height: 1.2; letter-spacing: -0.03em; text-wrap: balance; }
.post-card__ex { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--text-3); text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; }
.post-card__author { display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--chip); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-2); }
.post-card__arrow svg, .feature-card__go svg { transition: transform .55s var(--ease); }

/* ---------- Big card: full photo with text overlay ---------- */
.feature-card {
  grid-column: 1 / -1; display: block; min-height: clamp(440px, 88vw, 520px);
  margin: 0 calc(var(--inset) - var(--gutter)); border-radius: var(--r-panel); color: var(--white);
}
.feature-card:hover { color: var(--white); }
.feature-card > img { transition: transform 1.1s var(--ease); }
.feature-card__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(28,24,18,.1) 0%, rgba(28,24,18,0) 25%, rgba(28,24,18,.25) 50%, rgba(28,24,18,.72) 100%); }
.feature-card__chips { position: absolute; left: clamp(18px, 4vw, 28px); top: clamp(18px, 4vw, 28px); display: flex; flex-wrap: wrap; gap: 8px; }
.feature-card__cat { height: 32px; padding: 0 13px; border-radius: 999px; background: var(--white); display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink); }
.feature-card__latest {
  height: 32px; padding: 0 13px; border-radius: 999px; background: rgba(255,255,255,.22);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--white);
}
/* mobile/tablet: title + excerpt full width, meta + round arrow on one row */
.feature-card__body {
  position: absolute; left: clamp(20px, 4vw, 32px); right: clamp(20px, 4vw, 32px); bottom: clamp(20px, 4vw, 32px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 16px;
}
.feature-card__text { display: contents; }
.feature-card__title { grid-column: 1 / -1; max-width: 600px; font-size: clamp(28px, 6.6vw, 42px); font-weight: 500; line-height: 1.08; letter-spacing: -0.035em; color: var(--white); text-wrap: balance; }
.feature-card__ex { grid-column: 1 / -1; max-width: 520px; font-size: 15px; line-height: 1.55; color: var(--white); text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feature-card .post-meta { margin-top: 4px; color: var(--white); }
.feature-card .post-meta__dot { background: var(--white); }
.feature-card__go { margin-top: 4px; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--white); color: var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }

@media (min-width: 700px) {
  .feature-card { margin: 0; }
}

@media (min-width: 1280px) {
  .post-card__photo { height: 300px; border-radius: 26px; }
  .post-card__cat { left: 16px; top: 16px; height: 32px; padding: 0 13px; font-size: 13px; }
  .post-card__body { padding: 24px 4px 0; }
  .post-card__title { margin-top: 12px; font-size: 25px; line-height: 1.18; }
  .post-card__ex { margin-top: 12px; }
  .post-card__foot { margin-top: 20px; padding-top: 16px; }

  .feature-card { grid-column: span var(--span, 2); min-height: 540px; border-radius: 30px; }
  .feature-card__shade { background: linear-gradient(180deg, rgba(28,24,18,.1) 0%, rgba(28,24,18,0) 30%, rgba(28,24,18,.2) 55%, rgba(28,24,18,.66) 100%); }
  .feature-card__chips { left: 28px; top: 28px; }
  .feature-card__cat { height: 34px; padding: 0 14px; font-size: 13px; }
  .feature-card__latest { height: 34px; padding: 0 14px; font-size: 15px; }
  .feature-card__body { left: 32px; right: 32px; bottom: 32px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
  .feature-card__text { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
  .feature-card__title { max-width: none; font-size: 44px; line-height: 1.06; }
  .feature-card__ex { font-size: 16px; display: block; overflow: visible; }
  .feature-card .post-meta { margin-top: 0; font-size: 14px; }
  .feature-card .post-meta__opt { display: contents; }
  .feature-card__go { margin-top: 0; width: 56px; height: 56px; }
}

/* Hover (desktop pointer only): photo zooms, arrow nudges */
@media (hover: hover) and (min-width: 1280px) {
  .post-card:hover .post-card__photo img, .feature-card:hover > img { transform: scale(1.05); }
  .post-card:hover .post-card__arrow svg, .feature-card:hover .feature-card__go svg { transform: translateX(4px); }
}

/* ==========================================================================
   Load more — tick progress + count + button
   ========================================================================== */
.more { margin-top: clamp(52px, 9vw, 64px); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.more .ticks { gap: 7px; }
.more .tick { height: 16px; transition: background .5s; }
.more__text { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--text-3); }
.more__btn { width: 100%; max-width: 320px; height: 56px; padding: 0 8px 0 24px; justify-content: space-between; gap: 14px; font-size: 16px; }
.more__btn[hidden] { display: none; }
.more__btn .btn__round { background: var(--white); color: var(--ink); }

@media (min-width: 1280px) {
  .more { margin-top: 72px; gap: 20px; }
  .more__text { font-size: 18px; }
  .more__btn { width: auto; max-width: none; padding: 0 9px 0 26px; }
}
