/**
 * Antigravity Theme – Component Styles
 * Header, Footer, Post Grid, Cards, Mobile Menu, Widgets
 */

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 1000;
  transition: background 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              padding 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.4s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 80px;
}

/* Logo */
.site-branding a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--foreground);
  letter-spacing: -0.02em;
}

.site-branding img {
  height: 40px;
  width: auto;
}

/* Primary Nav */
#site-navigation ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#site-navigation ul li a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast),
              color var(--transition-fast);
}

#site-navigation ul li a:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--secondary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-icon {
  position: relative;
  font-size: 1.2rem;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--secondary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--foreground);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============================================================
   MOBILE MENU DRAWER
   ============================================================ */
.mobile-menu-drawer {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-drawer.is-open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 90vw);
  height: 100%;
  background: #fff;
  padding: 6rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  overflow-y: auto;
}

.mobile-menu-drawer.is-open .mobile-menu-inner {
  transform: translateX(0);
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu-list li a {
  display: block;
  padding: 1rem 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition-fast);
}

.mobile-menu-list li a:hover {
  color: var(--secondary);
}

/* Lock scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* ============================================================
   POSTS GRID
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 2rem;
  margin-block: 3rem;
}

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition-base),
              transform var(--transition-base);
}

.post-card:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.post-card-thumbnail {
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card-thumbnail img {
  transform: scale(1.05);
}

.post-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.post-card-title {
  font-size: 1.2rem;
  line-height: 1.3;
}

.post-card-title a:hover {
  color: var(--secondary);
}

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-muted);
  flex: 1;
}

.post-card-cta {
  margin-top: auto;
  align-self: flex-start;
}

/* ============================================================
   SINGLE POST / PAGE
   ============================================================ */
.single-post,
.single-page {
  max-width: 760px;
  margin-inline: auto;
  padding-block: 8rem 4rem;
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.entry-meta {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.entry-thumbnail {
  margin-block: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.entry-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.entry-content p {
  margin-bottom: 1.5rem;
}

.entry-content h2,
.entry-content h3 {
  margin-block: 2.5rem 1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.7);
  padding-block: 5rem 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-light);
}

.footer-brand .site-branding a {
  color: #fff;
}

.footer-tagline {
  margin-top: 1rem;
  font-size: 0.9375rem;
  opacity: 0.7;
  max-width: 280px;
}

.footer-menus {
  display: contents;
}

.footer-nav .footer-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav .footer-menu-list a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
}

.footer-nav .footer-menu-list a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.copyright {
  font-size: 0.875rem;
}

.copyright a {
  color: rgba(255, 255, 255, 0.8);
}

.copyright a:hover {
  color: #fff;
}

/* ============================================================
   WIDGETS
   ============================================================ */
.widget {
  margin-bottom: 2rem;
}

.widget-title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1rem;
}

/* ============================================================
   PAGE HEADER (Archive / Search / 404)
   ============================================================ */
.page-header {
  padding-block: 8rem 3rem;
}

.page-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* ============================================================
   404 Page
   ============================================================ */
.error-404 {
  text-align: center;
  padding-block: 10rem;
}

.error-404 .page-title {
  font-size: clamp(6rem, 20vw, 14rem);
  line-height: 1;
  color: var(--secondary);
  opacity: 0.15;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 5rem 0;
  }

  #site-navigation {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }
}
