/* =====================================================================
   Blog listing (/blog/) — layout + animations only.
   Builds on /products/hardware/hw-landing.css (tokens, reveals, letters).
===================================================================== */
:root { --bl-gold: #b8893a; --bl-gold-2: #d9b36a; }
body:has(.bl-page) { padding-top: 0 !important; background: #ffffff !important; }
.bl-page { background: #ffffff; font-family: var(--hw-sans); }
.bl-page h1, .bl-page h2, .bl-page h3, .bl-page p { margin: 0; }
.bl-page button { font-family: var(--hw-sans); }

/* ---------- Hero ---------- */
.bl-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(300px, 24vw, 420px);
    overflow: hidden;
    background: linear-gradient(90deg, #f8f4ee 0%, #f5efe7 50%, #efe6da 100%);
}
.bl-hero-media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 62%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
}
.bl-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% 50%;
    opacity: 0;
    transform: scale(1.12) translateX(30px);
    translate: 0 var(--py, 0px);
    transition: opacity 1.2s var(--hw-ease), transform 1.8s var(--hw-ease), translate 0.6s var(--hw-ease);
}
.hw-ready .bl-hero-media img { opacity: 1; transform: scale(1.03); }
.bl-hero-inner { position: relative; z-index: 2; padding-block: clamp(34px, 3.6vw, 60px); }
.bl-hero-inner > * { max-width: min(560px, 52%); }
.bl-eyebrow { text-transform: uppercase; }
.bl-eyebrow .hw-eyebrow-line { background: var(--bl-gold-2); }
.bl-hero-title { margin: 0 0 14px !important; font-size: clamp(44px, 5vw, 84px); line-height: 1; }
.bl-hero-title .is-gold {
    background: linear-gradient(100deg, #a8762b 0%, #d9b36a 45%, #a8762b 90%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: blShine 6s ease-in-out 2s infinite;
}
@keyframes blShine { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.bl-hero-sub { color: var(--hw-text); font-size: clamp(15.5px, 1.15vw, 18.5px); line-height: 1.6; }

/* ---------- Tools: topic tabs + search ---------- */
.bl-tools { position: relative; z-index: 3; padding-top: clamp(22px, 2.4vw, 36px); }
.bl-tools-inner { display: flex; align-items: center; gap: 16px 24px; }
.bl-tabs {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(31, 36, 33, 0.06), 0 0 0 1px var(--hw-line);
}
.bl-tabs::-webkit-scrollbar { display: none; }
.bl-tab-pill {                                   /* green pill that slides to the active tab */
    position: absolute;
    left: 0;
    top: 0;
    z-index: 0;
    border-radius: 14px;
    background: linear-gradient(160deg, #137a3f 0%, var(--hw-green) 55%, var(--hw-green-dark) 100%);
    box-shadow: 0 10px 22px rgba(13, 92, 47, 0.28);
    transition: transform 0.55s var(--hw-ease), width 0.55s var(--hw-ease), height 0.3s var(--hw-ease);
}
.bl-tab {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 96px;
    padding: 10px 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--hw-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.4s var(--hw-ease);
}
.bl-tab-icon svg { display: block; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--hw-ease); }
.bl-tab:hover .bl-tab-icon svg { transform: translateY(-2px) scale(1.08); }
.bl-tab:not(.is-active):hover { color: var(--hw-green); }
.bl-tab.is-active { color: #ffffff; }
.bl-tab-n {
    position: absolute;
    top: 6px;
    right: 10px;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #eef4f0;
    color: var(--hw-green);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 16px;
    transition: background 0.4s, color 0.4s;
}
.bl-tab.is-active .bl-tab-n { background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.bl-tab:focus-visible { outline: 2px solid var(--hw-green); outline-offset: 2px; }

.bl-search { position: relative; flex: 0 0 clamp(220px, 22vw, 300px); }
.bl-search i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--hw-text); pointer-events: none; transition: color 0.3s; }
.bl-search input {
    width: 100%;
    height: 50px;
    padding: 0 18px 0 46px;
    border: 1px solid var(--hw-line);
    border-radius: 999px;
    background: #faf8f4;
    color: var(--hw-ink);
    font: 500 15px var(--hw-sans);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.bl-search input:focus { border-color: var(--hw-green); background: #ffffff; box-shadow: 0 0 0 4px rgba(13, 92, 47, 0.1); }
.bl-search:focus-within i { color: var(--hw-green); }
.bl-count { margin-top: 12px; color: var(--hw-text); font-size: 13.5px; min-height: 1.3em; }

/* ---------- Featured slider ---------- */
.bl-featured { padding-top: clamp(16px, 1.6vw, 24px); }
.bl-feat {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    min-height: clamp(300px, 24vw, 380px);
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(120deg, #fbf7f1 0%, #f6efe4 100%);
    box-shadow: 0 26px 60px rgba(31, 36, 33, 0.1), 0 0 0 1px var(--hw-line);
    animation: hwFadeUp 0.8s var(--hw-ease) both;
}
.bl-feat-media {
    position: relative;
    overflow: hidden;
    border-radius: 0 50% 50% 0 / 0 120% 120% 0;      /* curved right edge */
    box-shadow: 3px 0 0 var(--bl-gold-2);
    background: #e9e1d4;
}
.bl-feat-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.12) translateX(calc(var(--dir, 1) * 3%));
    transition: opacity 0.9s var(--hw-ease-io), transform 1.6s var(--hw-ease);
}
.bl-feat-img.is-active { opacity: 1; transform: scale(1.02); }
.bl-feat:hover .bl-feat-img.is-active { transform: scale(1.06); transition-duration: 0.9s, 6s; }
.bl-feat-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--hw-ink);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%);
    transition: background 0.35s, color 0.35s, transform 0.45s var(--hw-ease);
}
.bl-feat-arrow.is-prev { left: 18px; }
.bl-feat-arrow.is-next { right: 9%; }
.bl-feat-arrow:hover, .bl-feat-arrow:focus-visible { background: var(--hw-green); color: #ffffff; transform: translateY(-50%) scale(1.08); }
.bl-feat-arrow.is-prev:hover i { animation: blNudgeL 0.5s var(--hw-ease); }
.bl-feat-arrow.is-next:hover i { animation: blNudgeR 0.5s var(--hw-ease); }
@keyframes blNudgeL { 50% { transform: translateX(-4px); } }
@keyframes blNudgeR { 50% { transform: translateX(4px); } }
.bl-feat-dots { position: absolute; left: 22px; bottom: 18px; z-index: 2; display: flex; gap: 6px; padding: 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); }
.bl-feat-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: #c9c9c3; cursor: pointer; transition: width 0.45s var(--hw-ease), background 0.35s; }
.bl-feat-dot.is-active { width: 24px; background: var(--hw-green); }

.bl-feat-body { position: relative; display: grid; align-items: center; padding: clamp(24px, 2.6vw, 44px) clamp(22px, 3vw, 50px); }
.bl-feat-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateX(calc(var(--dir, 1) * 24px));
    transition: opacity 0.45s var(--hw-ease), transform 0.7s var(--hw-ease), visibility 0s linear 0.45s;
}
.bl-feat-slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity 0.6s var(--hw-ease) 0.15s, transform 0.8s var(--hw-ease) 0.15s, visibility 0s; }
.bl-feat-slide > * { transition: opacity 0.6s var(--hw-ease), transform 0.7s var(--hw-ease); }
.bl-feat-slide:not(.is-active) > * { opacity: 0; transform: translateY(10px); }
.bl-feat-slide.is-active > :nth-child(2) { transition-delay: 0.22s; }
.bl-feat-slide.is-active > :nth-child(3) { transition-delay: 0.3s; }
.bl-feat-slide.is-active > :nth-child(4) { transition-delay: 0.38s; }
.bl-feat-slide.is-active > :nth-child(5) { transition-delay: 0.46s; }
.bl-feat-tag {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--hw-green);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.bl-feat-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px !important; color: var(--hw-text); font-size: 13px; font-weight: 600; }
.bl-feat-meta span:first-child:not(:only-child) { color: var(--bl-gold); }
.bl-feat-meta i { margin-right: 6px; }
.bl-feat-title { margin-bottom: 12px !important; font-family: var(--hw-sans); font-size: clamp(22px, 1.9vw, 32px); font-weight: 700; line-height: 1.2; }
.bl-feat-title a { color: var(--hw-ink); text-decoration: none; background: linear-gradient(var(--hw-green), var(--hw-green)) 0 100% / 0 2px no-repeat; transition: background-size 0.5s var(--hw-ease), color 0.3s; }
.bl-feat-title a:hover { color: var(--hw-green); background-size: 100% 2px; }
.bl-feat-desc { margin-bottom: 18px !important; color: var(--hw-text); font-size: 15.5px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bl-feat-progress { position: absolute; left: clamp(22px, 3vw, 50px); right: clamp(22px, 3vw, 50px); bottom: 18px; height: 2px; background: rgba(31, 36, 33, 0.08); overflow: hidden; border-radius: 2px; }
.bl-feat-progress::after { content: ""; position: absolute; inset: 0; background: var(--hw-green); transform: scaleX(0); transform-origin: left; }
.bl-feat.is-timing .bl-feat-progress::after { animation: blProg 6.5s linear forwards; }
.bl-feat.is-paused .bl-feat-progress::after { animation-play-state: paused; }
@keyframes blProg { to { transform: scaleX(1); } }

.bl-read {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--hw-green);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
}
.bl-read span { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; padding-bottom: 2px; transition: background-size 0.45s var(--hw-ease); }
.bl-read i { transition: transform 0.45s var(--hw-ease); }
.bl-read:hover span { background-size: 0 1.5px; background-position: 100% 100%; }
.bl-read:hover i { transform: translateX(6px); }

/* ---------- Grid ---------- */
.bl-grid-wrap { padding-block: clamp(26px, 2.8vw, 44px) clamp(50px, 5vw, 90px); }
#blogListWrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 1.8vw, 28px); }
.bl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(31, 36, 33, 0.07), 0 0 0 1px var(--hw-line);
    opacity: 0;
    transform: translateY(26px) scale(0.98);
    transition: opacity 0.7s var(--hw-ease), transform 0.8s var(--hw-ease), box-shadow 0.5s var(--hw-ease);
    transition-delay: calc(var(--i, 0) * 70ms), calc(var(--i, 0) * 70ms), 0s;
}
#blogListWrap.is-in .bl-card { opacity: 1; transform: none; }
#blogListWrap.is-in .bl-card:hover { transform: translateY(-8px); box-shadow: 0 28px 54px rgba(31, 36, 33, 0.14), 0 0 0 1px rgba(13, 92, 47, 0.25); transition-delay: 0s; }
.bl-card-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #efe8dd; }
.bl-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--hw-ease), filter 0.6s; }
.bl-card:hover .bl-card-media img { transform: scale(1.08); }
.bl-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.18) 100%); opacity: 0; transition: opacity 0.5s; }
.bl-card:hover .bl-card-media::after { opacity: 1; }
.bl-new { position: absolute; top: 14px; left: 14px; padding: 4px 11px; border-radius: 999px; background: var(--hw-green); color: #ffffff; font-size: 12px; font-weight: 700; box-shadow: 0 6px 14px rgba(13, 92, 47, 0.3); }
.bl-card-body { display: flex; flex: 1; flex-direction: column; padding: 18px 20px 20px; }
.bl-card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.bl-cat {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    padding: 3px 11px;
    border: 1.5px solid var(--bl-gold-2);
    border-radius: 999px;
    color: #8a6424;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.bl-date { flex-shrink: 0; color: var(--hw-text); font-size: 12.5px; white-space: nowrap; }
.bl-date i { margin-right: 6px; }
.bl-cat + .bl-date { padding-left: 10px; border-left: 1px solid var(--hw-line); }
.bl-save {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hw-ink);
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}
.bl-save svg { width: 19px; height: 19px; fill: transparent; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; transition: fill 0.3s; }
.bl-save:hover { background: #f2f7f3; color: var(--hw-green); }
.bl-save.is-on { color: var(--hw-green); }
.bl-save.is-on svg { fill: currentColor; }
.bl-save.is-pop svg { animation: blPop 0.45s var(--hw-ease); }
@keyframes blPop { 40% { transform: scale(1.35); } 70% { transform: scale(0.9); } }
.bl-card-title { margin-bottom: 8px !important; font-size: clamp(17px, 1.3vw, 20px); font-weight: 700; line-height: 1.3; }
.bl-card-title a { color: var(--hw-ink); text-decoration: none; transition: color 0.3s; }
.bl-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }       /* whole card clickable */
.bl-card:hover .bl-card-title a { color: var(--hw-green); }
.bl-card-desc { margin-bottom: 16px !important; color: var(--hw-text); font-size: 14.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-card .bl-read { margin-top: auto; font-size: 15px; }
.bl-card:hover .bl-read i { transform: translateX(6px); }
.bl-save { position: relative; z-index: 1; }
.bl-empty { grid-column: 1 / -1; padding: 40px 20px; border: 1px dashed var(--hw-line); border-radius: 18px; text-align: center; color: var(--hw-text); animation: hwFadeUp 0.5s var(--hw-ease) both; }
.bl-empty button { margin-top: 10px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--hw-green); color: #ffffff; font-weight: 700; cursor: pointer; }

/* ---------- Pagination ---------- */
#paginationWrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: clamp(30px, 3vw, 46px); }
#paginationWrap .pg-btn {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 6px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hw-ink);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.35s, color 0.35s, transform 0.4s var(--hw-ease), box-shadow 0.35s;
}
#paginationWrap .pg-btn:hover:not(:disabled) { background: #eef4f0; color: var(--hw-green); transform: translateY(-2px); }
#paginationWrap .pg-btn.active { background: var(--hw-green); color: #ffffff; box-shadow: 0 8px 18px rgba(13, 92, 47, 0.3); animation: blPop 0.45s var(--hw-ease); }
#paginationWrap .pg-arrow { width: 50px; height: 50px; border-radius: 50%; background: #ffffff; box-shadow: 0 6px 18px rgba(31, 36, 33, 0.1), 0 0 0 1px var(--hw-line); }
#paginationWrap .pg-arrow:disabled { opacity: 0.35; cursor: default; }
#paginationWrap .pg-dots { color: var(--hw-text); padding: 0 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    #blogListWrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bl-tools-inner { flex-direction: column; align-items: stretch; }
    .bl-search { flex: 1 1 auto; }
}
@media (max-width: 991px) {
    .bl-hero { flex-direction: column; align-items: stretch; min-height: 0; }
    .bl-hero-inner > * { max-width: 640px; }
    .bl-hero-media { position: relative; order: 2; width: 100%; height: clamp(180px, 38vw, 300px); -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%); mask-image: linear-gradient(180deg, transparent 0%, #000 22%); }
    .bl-feat { grid-template-columns: 1fr; }
    .bl-feat-media { min-height: clamp(220px, 48vw, 360px); border-radius: 0 0 50% 50% / 0 0 14% 14%; box-shadow: 0 3px 0 var(--bl-gold-2); }
    .bl-feat-arrow.is-next { right: 18px; }
    .bl-feat-body { padding-bottom: 40px; }
}
/* 2-column tablets: category gets its own line so it is not cut short */
@media (min-width: 641px) and (max-width: 1199px) {
    .bl-card-meta { flex-wrap: wrap; row-gap: 8px; }
    .bl-cat { order: 1; flex: 1 1 100%; max-width: max-content; }
    .bl-date { order: 2; }
    .bl-cat + .bl-date { padding-left: 0; border-left: 0; }
    .bl-save { order: 3; }
}
@media (max-width: 640px) {
    #blogListWrap { grid-template-columns: 1fr; }
    .bl-tab { min-width: 84px; padding: 9px 10px; font-size: 13px; }
    .bl-feat-arrow { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    .bl-hero-title .is-gold { animation: none; }
    .bl-card, .bl-feat-img, .bl-feat-slide, .bl-hero-media img { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
