/* =============================================================
   KIANIRO · blog.css
   Blog (blog/post_list.html). Loaded after css/style.css, which holds
   the tokens, base styles, buttons, header, menus, cart and footer;
   this file only adds what is unique to this page.

   TABLE OF CONTENTS
     01  Hero: title, search, stats
     02  Featured article
     03  Toolbar: topic pill, sort, count
     04  Article cards
     05  Empty state & load more
     06  Newsletter
     07  Responsive
   ============================================================= */


/* =============================================================
   01  HERO
   ============================================================= */
.bhero {
  position: relative; overflow: hidden;
  padding-top: calc(var(--header-h) + clamp(36px, 6vw, 88px));
  padding-bottom: clamp(34px, 4.4vw, 60px);
}
/* faint blueprint grid behind the title */
.bhero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--hair) 1px, transparent 1px), linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(55% 80% at 75% 40%, #000, transparent 75%);
          mask-image: radial-gradient(55% 80% at 75% 40%, #000, transparent 75%);
  opacity: .7;
}
.bhero__in { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); align-items: end; gap: 32px clamp(32px, 5vw, 80px); }
.bhero__title { margin: 22px 0 18px; font-size: clamp(40px, 5.6vw, 84px); font-weight: 200; line-height: 1.22; }
.bhero__title b { font-weight: 800; }
.bhero__lead { max-width: 50ch; font-size: clamp(15.5px, 1.2vw, 17.5px); line-height: 2.05; }

.bhero__side { display: grid; gap: 26px; padding-bottom: 8px; }
.bsearch {
  display: flex; align-items: center; gap: 12px; height: 62px; padding-inline: 22px 14px; border-radius: 100px;
  background: var(--pearl); border: 1px solid var(--hair-2); color: var(--mist);
  box-shadow: 0 30px 60px -45px rgba(10, 27, 46, .45);
  transition: border-color .4s var(--ease-out), box-shadow .6s var(--ease-out);
}
.bsearch:focus-within { border-color: var(--ink); box-shadow: 0 0 0 5px rgba(10, 27, 46, .06), 0 30px 60px -45px rgba(10, 27, 46, .45); }
.bsearch input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); caret-color: var(--ember); }
.bsearch input::placeholder { color: var(--mist); }
.bsearch input::-webkit-search-cancel-button { display: none; }
.bsearch kbd { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--hair-2); font-family: var(--f-mono); font-size: 12px; color: var(--mist); }

.bstats { display: flex; flex-wrap: wrap; gap: 12px 0; }
.bstats li { display: grid; gap: 2px; padding-inline-end: 24px; margin-inline-end: 24px; border-inline-end: 1px solid var(--hair-2); }
.bstats li:last-child { border: 0; margin: 0; padding: 0; }
.bstats b { font-size: clamp(22px, 2vw, 28px); font-weight: 300; line-height: 1.3; color: var(--ink); }
.bstats span { font-size: 12.5px; color: var(--mist); }


/* =============================================================
   02  FEATURED ARTICLE
   ============================================================= */
.feat {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden;
  border-radius: 32px; background: var(--pearl); border: 1px solid var(--hair);
}
.feat__media { position: relative; display: block; min-height: 420px; overflow: hidden; }
.feat__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease-out); }
/* Post.cover_style = product: the product photo on its tinted panel, like the product cards */
.feat__media--product { background: radial-gradient(70% 80% at 50% 45%, #fff, var(--tint, #EEF1F5)); }
.feat__media--product img { inset: 14% 24%; width: 52%; height: 72%; object-fit: contain; mix-blend-mode: multiply; }
.feat__badge {
  position: absolute; top: 20px; right: 20px; padding: 6px 14px; border-radius: 100px;
  background: rgba(10, 27, 46, .82); color: #fff; font-size: 12.5px; font-weight: 600;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.feat__body { display: grid; align-content: center; gap: 16px; padding: clamp(28px, 4vw, 56px); }
.feat__title { font-size: clamp(24px, 2.5vw, 36px); font-weight: 800; line-height: 1.55; text-wrap: balance; }
.feat__title a { background-image: linear-gradient(var(--ember), var(--ember)); background-size: 0 2px; background-repeat: no-repeat; background-position: 100% 100%; transition: background-size .8s var(--ease-out); }
.feat__text { font-size: 15.5px; line-height: 2.1; color: var(--slate); }
.feat__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--hair); }
@media (hover: hover) {
  .feat:hover .feat__media img { transform: scale(1.04); }
  .feat:hover .feat__title a { background-size: 100% 2px; }
}

.author { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--mist); }
.author b { display: block; font-size: 14px; color: var(--ink); }
.author__ava { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(140deg, #1D4F82, #0A1B2E); color: #fff; font-size: 17px; font-weight: 700; }
.author__ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }   /* Author.avatar, else the first letter */

.bmeta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--mist); }
.btopic { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ember); }
.btopic::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }


/* =============================================================
   03  TOOLBAR
   ============================================================= */
.btools { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; margin-top: clamp(48px, 6vw, 84px); }
.topics {
  position: relative; display: flex; gap: 4px; min-width: 0; padding: 4px; border-radius: 100px;
  background: var(--pearl); border: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none;
}
.topics::-webkit-scrollbar { display: none; }
.topics__pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 100px; background: var(--ink); pointer-events: none; }
.topic {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 42px; padding-inline: 18px; border-radius: 100px; font-size: 14px; font-weight: 500; color: var(--slate); white-space: nowrap;
  transition: color .5s var(--ease-out);
}
.topic small { font-family: var(--f-mono); font-size: 10.5px; color: var(--mist); transition: color .5s; }
.topic[aria-selected="true"] { color: var(--pearl); }
.topic[aria-selected="true"] small { color: rgba(255, 255, 255, .55); }
@media (hover: hover) { .topic:not([aria-selected="true"]):hover { color: var(--ink); } }
html:not(.blog-ready) .topic[aria-selected="true"] { background: var(--ink); }   /* before the pill is placed */
/* The server renders every card; with scripts on, the grid waits until blog.js has applied the URL filters
   and the first page, so the full list never flashes (the page's inline script adds .blog-js). */
.blog-js:not(.blog-ready) .bgrid { visibility: hidden; }

.bsort { position: relative; flex: none; }
.bsort select {
  appearance: none; -webkit-appearance: none; height: 52px; padding-inline: 20px 42px; border-radius: 100px;
  background: var(--pearl); border: 1px solid var(--hair); font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.bsort .ico { position: absolute; left: 16px; top: 50%; translate: 0 -50%; color: var(--mist); pointer-events: none; }
.bsort select:focus-visible { outline: 1.5px solid var(--ember); outline-offset: 3px; }
.bcount { margin: 18px 4px 20px; font-size: 13.5px; color: var(--mist); }
.bcount b { color: var(--ink); }


/* =============================================================
   04  ARTICLE CARDS
   ============================================================= */
.bgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.bcard {
  position: relative; isolation: isolate; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border-radius: 26px; background: var(--pearl); border: 1px solid var(--hair);
  transition: border-color .7s var(--ease-out), box-shadow .9s var(--ease-out), transform .9s var(--ease-out);
}
.bcard[hidden] { display: none; }
/* rim of light that follows the pointer */
.bcard::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(229, 101, 42, .7), rgba(29, 79, 130, .35) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .7s var(--ease-out);
}
.bcard__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--porcelain); }
.bcard__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
/* product photo on a soft tinted plate instead of a cover image */
.bcard__media--product { background: radial-gradient(70% 80% at 50% 45%, #fff, var(--tint, #EEF1F5)); }
.bcard__media--product img { inset: 12% 22%; width: 56%; height: 76%; object-fit: contain; mix-blend-mode: multiply; }

.bcard__body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; padding: 20px 22px 20px; }
.bcard__title { font-size: 17px; font-weight: 700; line-height: 1.8; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* the whole card is clickable */
.bcard__text { font-size: 14px; line-height: 2; color: var(--slate); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 12.5px; color: var(--mist); }
.bcard__go {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--hair-2); color: var(--ink);
  transition: background-color .5s var(--ease-out), color .5s, border-color .5s;
}
.bcard__go .ico { transform: rotate(45deg); transition: transform .7s var(--ease-out); }
mark { background: rgba(229, 101, 42, .18); color: inherit; border-radius: 4px; padding-inline: 2px; }

@media (hover: hover) {
  .bcard:hover { border-color: var(--hair-2); box-shadow: 0 50px 90px -60px rgba(10, 27, 46, .55); transform: translateY(-5px); }
  .bcard:hover::after { opacity: 1; }
  .bcard:hover .bcard__media img { transform: scale(1.06); }
  .bcard:hover .bcard__go { background: var(--ink); border-color: var(--ink); color: #fff; }
  .bcard:hover .bcard__go .ico { transform: none; }
}


/* =============================================================
   05  EMPTY STATE & LOAD MORE
   ============================================================= */
.bempty { display: grid; justify-items: center; gap: 10px; padding: 64px 16px 30px; text-align: center; }
.bempty > .ico { width: 44px; height: 44px; color: var(--hair-2); }
.bempty h2 { font-size: 22px; font-weight: 700; }
.bempty p { margin-bottom: 10px; color: var(--mist); }
.bmore { display: grid; justify-items: center; margin-top: clamp(36px, 4.4vw, 56px); }
.bmore[hidden] { display: none; }


/* =============================================================
   06  NEWSLETTER
   ============================================================= */
.news {
  --t1: #F2F5F9; --t2: #A8B7C7;
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 28px clamp(28px, 5vw, 80px);
  margin-block: clamp(70px, 9vw, 120px); padding: clamp(30px, 4.4vw, 64px);
  border-radius: 32px; color: var(--t2);
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(29, 79, 130, .6), transparent 70%),
    radial-gradient(50% 80% at 0% 100%, rgba(229, 101, 42, .22), transparent 70%),
    #07121F;
}
.news__title { margin: 16px 0 10px; font-size: clamp(26px, 3vw, 42px); font-weight: 800; line-height: 1.4; color: var(--t1); }
.news__copy p:last-child { font-size: 15px; line-height: 2; max-width: 46ch; }
.news__form { position: relative; display: flex; gap: 8px; padding: 6px; border-radius: 100px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); transition: border-color .4s; }
.news__form:focus-within { border-color: rgba(255, 255, 255, .4); }
.news__form.is-invalid { border-color: #F29A88; }
.news__form input { flex: 1; min-width: 0; height: 54px; padding-inline: 18px; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--t1); text-align: right; caret-color: var(--ember); }
.news__form input::placeholder { color: #6C8197; }
.news__btn { display: inline-flex; align-items: center; gap: 8px; height: 54px; padding-inline: 26px; border-radius: 100px; background: var(--ember); color: #fff; font-size: 15px; font-weight: 600; transition: background-color .4s, transform .3s; }
.news__btn .ico { transition: transform .5s var(--ease-out); }
@media (hover: hover) { .news__btn:hover { background: #F07A42; } .news__btn:hover .ico { transform: translateX(-4px); } }
.news__btn:active { transform: scale(.97); }
.news__msg { position: absolute; top: calc(100% + 10px); right: 20px; font-size: 13px; color: #F29A88; }
.news__form.is-done { justify-content: center; background: rgba(46, 170, 94, .12); border-color: rgba(46, 170, 94, .4); }
.news__form.is-done input, .news__form.is-done .news__btn { display: none; }
.news__form.is-done .news__msg { position: static; display: flex; align-items: center; height: 54px; color: #9FE0B8; font-size: 15px; font-weight: 600; }


/* =============================================================
   07  RESPONSIVE
   ============================================================= */
@media (max-width: 1100px) {
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btools { flex-wrap: wrap; }
  .topics { flex-basis: 100%; }
  .bsort { margin-inline-start: auto; }
}

@media (max-width: 900px) {
  .bhero__in { grid-template-columns: minmax(0, 1fr); }
  .feat { grid-template-columns: minmax(0, 1fr); }
  .feat__media { min-height: 0; aspect-ratio: 16 / 9; }
  .news { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .bhero { padding-top: calc(var(--header-h) + 14px); }
  .bhero__title { margin-block: 16px 12px; }
  .bsearch { height: 56px; }
  .bsearch kbd { display: none; }
  .bstats li { padding-inline-end: 16px; margin-inline-end: 16px; }
  .feat { border-radius: 24px; }
  .feat__body { gap: 12px; }
  .feat__foot .btn { width: 100%; justify-content: space-between; }
  .bgrid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .bcard { border-radius: 22px; }
  .topic { height: 38px; padding-inline: 14px; font-size: 13.5px; }
  .bsort select { height: 44px; }
  .news { border-radius: 24px; }
  .news__form { flex-direction: column; border-radius: 24px; }
  .news__form input { text-align: center; }
  .news__btn { justify-content: center; }
  .news__msg { position: static; text-align: center; }
}
