/* Additions to the site's original stylesheet (style.css): static-page animations and the blog. */

/* ---------- Page-load animation (hero) ---------- */
@keyframes rise-30 { from { opacity: 0; transform: translateY(30px); } }
@keyframes rise-20 { from { opacity: 0; transform: translateY(20px); } }
@keyframes slide-40 { from { opacity: 0; transform: translateX(40px); } }

.anim-hero-text { animation: rise-30 .7s ease-out backwards; }
.anim-hero-panel { animation: slide-40 .8s ease-out .3s backwards; }
.anim-hero-card { animation: rise-20 .5s ease-out var(--d, 0s) backwards; }

/* ---------- Reveal on scroll (only when JavaScript is running) ---------- */
.js [data-reveal] {
  opacity: 0;
  transition: opacity var(--t, .6s) ease-out var(--d, 0s), transform var(--t, .6s) ease-out var(--d, 0s);
}
.js [data-reveal="up"] { transform: translateY(30px); }
.js [data-reveal="up-sm"] { transform: translateY(20px); }
.js [data-reveal="left"] { transform: translateX(-20px); }
.js [data-reveal="right"] { transform: translateX(20px); }
.js [data-reveal="right-lg"] { transform: translateX(30px); }
.js [data-reveal].in { opacity: 1; transform: none; }

.js [data-line] { transform: scaleX(0); transition: transform 1.2s ease-out .3s; }
.js [data-line].in { transform: scaleX(1); }

/* ---------- Inventory tabs and testimonials ---------- */
@keyframes panel-in { from { opacity: 0; transform: translateY(15px); } }
.panel-in { animation: panel-in .3s ease-out; }

@keyframes slide-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes slide-out { to { opacity: 0; transform: translateX(-40px); } }
.slide-in { animation: slide-in .4s ease-out; }
.slide-out { animation: slide-out .3s ease-in forwards; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows .25s ease, opacity .25s ease, visibility .25s;
}
.mobile-menu > div { min-height: 0; overflow: hidden; }
.mobile-menu.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  border-bottom: 1px solid #e5e7eb;
}
@media (min-width: 1024px) { .mobile-menu { display: none; } }

/* Keeps the logo and the nav (now with Blog) on one line on small laptops */
@media (min-width: 1024px) and (max-width: 1399px) {
  .site-nav { gap: .25rem; }
  .site-nav > a { white-space: nowrap; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .site-nav { gap: 0; }
  .site-nav > a { padding-left: .5rem; padding-right: .5rem; }
  .site-nav > button { margin-left: .5rem; }
  .site-logo { padding-left: 0; padding-right: 0; }
}
@media (min-width: 1024px) and (max-width: 1099px) {
  .site-nav > a { padding-left: .3rem; padding-right: .3rem; }
}

/* ---------- Honeypot field ---------- */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Blog ---------- */
.blog-hero { padding: 9rem 0 4rem; background-color: hsl(var(--section-alt)); }
.blog-section { padding: 4rem 0 6rem; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; font-size: .875rem; color: hsl(var(--muted-foreground)); }
.breadcrumb a { transition: color .3s; }
.breadcrumb a:hover { color: hsl(var(--primary)); }
.breadcrumb li + li::before { content: "/"; margin-right: .5rem; color: hsl(var(--border)); }

.blog-title { font-size: 2.25rem; line-height: 1.15; font-weight: 800; }
.post-title { max-width: 56rem; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font-size: .875rem; color: hsl(var(--muted-foreground)); }
.blog-meta img { width: 2.5rem; height: 2.5rem; border-radius: 9999px; object-fit: cover; }
.blog-meta strong { color: hsl(var(--foreground)); font-weight: 600; }

/* Blog home: featured post card */
.post-card {
  display: grid;
  overflow: hidden;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
  transition: box-shadow .3s, transform .3s;
}
.post-card:hover { transform: translateY(-.25rem); box-shadow: 0 8px 32px hsl(0 0% 0% / .08), 0 2px 8px hsl(0 0% 0% / .04); }
.post-card img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card-body { display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: 2rem; }
.post-card h2 { font-size: 1.5rem; line-height: 1.25; font-weight: 700; transition: color .3s; }
.post-card:hover h2 { color: hsl(var(--primary)); }
.post-card-more { font-size: .875rem; font-weight: 600; color: hsl(var(--primary)); }
.post-card p { font-size: .9375rem; line-height: 1.625; color: hsl(var(--muted-foreground)); }

/* Article layout */
.post-grid { display: grid; gap: 3rem; }
.post-grid > * { min-width: 0; }
.post-image { width: 100%; height: auto; margin-bottom: 2rem; border-radius: 1rem; box-shadow: 0 8px 32px hsl(0 0% 0% / .08), 0 2px 8px hsl(0 0% 0% / .04); }
.post-sidebar-title { margin-bottom: .25rem; font-size: 1.25rem; font-weight: 700; }

.post-summary { margin-bottom: 2.5rem; padding: 1.5rem; border: 1px solid hsl(var(--primary) / .1); border-radius: .75rem; background-color: hsl(var(--trust-bg)); }
.post-summary h2 { margin: 0 0 .5rem; font-size: 1.125rem; font-weight: 700; }
.post-summary p { margin: 0; font-size: .9375rem; line-height: 1.7; color: hsl(var(--muted-foreground)); }

.post-content { line-height: 1.8; color: hsl(var(--muted-foreground)); }
.post-content > p { margin-bottom: 1.25rem; }
.post-content h2 { margin: 2.5rem 0 1rem; font-size: 1.625rem; line-height: 1.25; font-weight: 700; color: hsl(var(--foreground)); }
.post-content h3 { margin: 1.75rem 0 .75rem; font-size: 1.25rem; line-height: 1.3; font-weight: 700; color: hsl(var(--foreground)); }
.post-content ul, .post-content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: .5rem; padding-left: .25rem; }
.post-content li::marker { color: hsl(var(--primary)); font-weight: 600; }

/* FAQ */
.post-faq { margin-top: 3rem; }
.post-faq > h2 { margin-bottom: 1.25rem; font-size: 1.625rem; font-weight: 700; }
.post-faq details { margin-bottom: .75rem; border: 1px solid hsl(var(--border)); border-radius: .75rem; background: hsl(var(--card)); }
.post-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: color .3s;
}
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary:hover { color: hsl(var(--primary)); }
.post-faq summary svg { flex-shrink: 0; color: hsl(var(--primary)); transition: transform .3s; transform: rotate(90deg); }
.post-faq details[open] summary svg { transform: rotate(-90deg); }
.post-faq details p { padding: 0 1.25rem 1.25rem; font-size: .9375rem; line-height: 1.7; color: hsl(var(--muted-foreground)); }

/* Tags and author */
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.5rem; }
.post-tags li { padding: .25rem .75rem; border: 1px solid hsl(var(--primary) / .2); border-radius: 9999px; background: hsl(var(--primary) / .1); font-size: .75rem; font-weight: 600; color: hsl(var(--primary)); }

.post-author { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 2.5rem; padding: 1.5rem; border: 1px solid hsl(var(--border)); border-radius: 1rem; background: hsl(var(--card)); }
.post-author img { width: 4rem; height: 4rem; border-radius: 9999px; object-fit: cover; }
.post-author p { font-size: .875rem; color: hsl(var(--muted-foreground)); }
.post-author .post-author-name { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.125rem; font-weight: 700; color: hsl(var(--foreground)); }
.post-author-name a { transition: color .3s; }
.post-author-name a:hover { color: hsl(var(--primary)); }

/* 404 */
.not-found { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 8rem 1rem 4rem; text-align: center; background-color: hsl(var(--muted)); }

@media (min-width: 768px) {
  .blog-title { font-size: 3rem; }
}
@media (min-width: 1024px) {
  .post-card { grid-template-columns: 1fr 1fr; }
  .post-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .post-sidebar { position: sticky; top: 7rem; align-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .anim-hero-text, .anim-hero-panel, .anim-hero-card, .panel-in, .slide-in, .slide-out { animation: none; }
  .js [data-reveal], .js [data-line] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
