/* LoomiTV — Learning Center hub styles (blog.html) */

:root{
    --radius:10px; --maxw:1160px;
  }

:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }

.page-head{ padding:150px 0 64px; text-align:center; }

.page-head h1{ font-size:clamp(34px,5vw,54px); margin-bottom:16px;}

.page-head .sub{ color:var(--muted); font-size:16px; max-width:600px; margin:0 auto; }

/* ---- Hub search ---- */
.hub-search{
  display:flex; align-items:center; gap:12px;
  max-width:600px; margin:32px auto 0;
  background:var(--bg-card); border:1px solid var(--line-strong); border-radius:30px;
  padding:15px 22px;
}
.hub-search svg{ width:18px; height:18px; stroke:var(--muted-2); flex-shrink:0; }
.hub-search input{ background:none; border:none; color:var(--fg); font-size:14.5px; width:100%; font-family:inherit; }
.hub-search input:focus{ outline:none; }

/* ---- Category filter chips ---- */
.hub-categories{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; max-width:760px; margin:20px auto 0; }
.cat-chip{
  font-family:inherit; font-size:13px; font-weight:600; color:var(--muted);
  background:var(--bg-card); border:1px solid var(--line-strong); border-radius:20px;
  padding:9px 18px; cursor:pointer; transition:all .2s ease;
}
.cat-chip:hover{ border-color:var(--gold); color:var(--fg); }
.cat-chip.active{ background:var(--gold); border-color:var(--gold); color:#241802; }

/* ---- Sections ---- */
.hub-section{ padding:44px 0 8px; }
.hub-section-head{ margin-bottom:22px; }
.hub-section-head h2{ font-size:22px; }

.empty-state{ color:var(--muted); font-size:14px; padding:40px 0; text-align:center; }

.link-btn{ background:none; border:none; color:var(--gold); font-size:13px; font-weight:600; cursor:pointer; padding:0; font-family:inherit; margin-left:10px; }
.link-btn:hover{ text-decoration:underline; }

/* ---- Pagination ---- */
.pagination{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; font-size:12.5px; color:var(--muted); }
.pagination-controls{ display:flex; gap:8px; }

/* ---- Loading skeleton (shown while a fetch is in flight) ---- */
.guide-card-skeleton{
  height:260px; border-radius:var(--radius); background:linear-gradient(100deg, var(--bg-card) 30%, var(--bg-warm, var(--bg-card)) 50%, var(--bg-card) 70%);
  background-size:200% 100%; animation:hubSkeletonShimmer 1.4s ease infinite;
}
@keyframes hubSkeletonShimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }

/* ---- Newsletter CTA ---- */
.newsletter-cta{ text-align:center; padding:56px 0; border-top:1px solid var(--line); }
.newsletter-cta h2{ font-size:24px; margin-bottom:10px; }
.newsletter-cta p{ color:var(--muted); max-width:480px; margin:0 auto 24px; font-size:14.5px; }
.newsletter-cta form{ display:flex; gap:10px; justify-content:center; max-width:420px; margin:0 auto; flex-wrap:wrap; }
.newsletter-cta input{
  flex:1; min-width:220px; background:var(--bg-card); border:1px solid var(--line-strong); border-radius:24px;
  padding:12px 18px; color:var(--fg); font-size:14px; font-family:inherit;
}
.newsletter-cta input:focus{ outline:none; border-color:var(--gold); }
.newsletter-message{ margin-top:14px; font-size:13.5px; color:var(--muted); }
.newsletter-message.is-error{ color:#E06256; }
.newsletter-message.is-success{ color:#5FBA97; }

/* ---- Guide cards ---- */
.featured-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.guide-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; padding-bottom:64px; }

.guide-card{
  display:block; background:var(--bg-card); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; transition:border-color .2s ease, transform .2s ease;
}
.guide-card:hover{ border-color:var(--line-strong); transform:translateY(-3px); }

.guide-cover{ height:150px; position:relative; }
.guide-cover img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.guide-badge{
  position:absolute; top:16px; left:16px; background:rgba(0,0,0,0.35); color:#fff;
  font-size:10.5px; font-weight:600; letter-spacing:0.05em; text-transform:uppercase;
  padding:6px 12px; border-radius:20px;
}

.guide-body{ padding:22px; }
.guide-meta-top{ display:flex; gap:8px; align-items:center; font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--muted-2); margin-bottom:12px; }
.guide-body h3{ font-family:'Fraunces',serif; font-weight:600; font-size:16.5px; margin-bottom:9px; line-height:1.3; }
.guide-body p{ color:var(--muted); font-size:13px; margin-bottom:14px; line-height:1.5; }
.guide-link{ color:var(--gold); font-weight:600; font-size:13px; }

/* "View All Featured Guides" — only ever shown on mobile when there are
   more than 2 featured cards to reveal; see the ≤768px block below. */
.featured-more{ display:none; }

.cover-installation{ background:linear-gradient(150deg,#C6342A,#7A1E1E); }
.cover-applications{ background:linear-gradient(150deg,#2E5FA8,#152C52); }
.cover-devices{ background:linear-gradient(150deg,#E3A63E,#8A5B12); }
.cover-troubleshooting{ background:linear-gradient(150deg,#3E8F72,#164A38); }
.cover-comparisons{ background:linear-gradient(150deg,#8A3E9E,#3C1A48); }
.cover-news{ background:linear-gradient(150deg,#4E4E9E,#211F52); }

@media (max-width:980px){
  .featured-grid{ grid-template-columns:repeat(2,1fr); }
  .guide-grid{ grid-template-columns:repeat(2,1fr); }
}

/* ======================================================================
   MOBILE (320px–768px) — its own layer, matching the pattern used across
   the rest of the site. Nothing above this point is touched by it.
   ====================================================================== */
@media (max-width:768px){
  html, body{ max-width:100%; overflow-x:hidden; }

  .page-head{ padding:110px 0 48px; }
  .page-head h1{ font-size:clamp(28px, 8vw, 40px); overflow-wrap:break-word; }
  .page-head .sub{ font-size:14.5px; }

  .hub-search{ margin-top:24px; padding:13px 18px; }

  .hub-section{ padding:32px 0 4px; }
  .hub-section-head h2{ font-size:19px; }

  .featured-grid, .guide-grid{ grid-template-columns:1fr; gap:16px; }
  .guide-grid{ padding-bottom:44px; }
  .guide-cover{ height:130px; }
  .guide-body{ padding:18px; }

  /* Show only the first 2 featured cards until expanded */
  .featured-grid > .guide-card:nth-child(n+3){ display:none; }
  .featured-grid.expanded > .guide-card:nth-child(n+3){ display:block; }
  .featured-more.has-more{ display:flex; justify-content:center; margin-top:20px; }

  .hub-categories{ gap:8px; }
  .cat-chip{ padding:8px 14px; font-size:12.5px; }
  .newsletter-cta{ padding:40px 0; }
  .newsletter-cta form{ flex-direction:column; }
}

@media (max-width:480px){
  .guide-body{ padding:16px; }
}
