/*
Theme Name: AvantCredit
Author: Assistant
Description: Creative, non-standard financial theme.
Version: 1.0
*/

:root {
  /* Palette: Terra/Green/Eggshell */
  --bg-color: #F4F1DE;
  --text-color: #1A1A1A;
  --accent-primary: #E07A5F; /* Terracotta */
  --accent-secondary: #81B29A; /* Soft Green */
  --dark-green: #3D405B;
  
  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Cormorant Garamond', serif;
  
  /* Sizes */
  --fs-hero: clamp(3rem, 15vw, 10rem);
  --fs-h1: clamp(2.5rem, 8vw, 6rem);
  --fs-h2: clamp(2rem, 5vw, 4rem);
  --fs-body: clamp(1rem, 1.2vw, 1.25rem);
  
  /* Spacing */
  --container-pad: max(2rem, 5vw);
  --grid-gap: clamp(1rem, 3vw, 3rem);
  
  /* Effects */
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Noise Texture */
.noise-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.italic-accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Layout Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* HEADER & NAV */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem var(--container-pad);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  mix-blend-mode: difference;
  color: #fff; /* Invert against bg due to blend mode */
}

.brand-logo {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -1px;
  text-transform: uppercase;
}

.menu-trigger {
  background: none;
  border: none;
  color: inherit;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-text {
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* Overlay Menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--dark-green);
  color: var(--bg-color);
  z-index: 900;
  transform: translateY(-100%);
  transition: transform 0.8s var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.nav-overlay.active {
  transform: translateY(0);
}

.overlay-menu-list li {
  margin: 1rem 0;
  overflow: hidden;
}

.overlay-menu-list a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1;
  display: block;
  transition: color 0.3s;
  position: relative;
}

.overlay-menu-list a:hover {
  color: var(--accent-primary);
  transform: translateX(20px);
}

/* HERO SECTION */
.hero-section {
  padding: 10rem var(--container-pad) 4rem;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 2px solid var(--text-color);
  position: relative;
}

.hero-title {
  font-size: var(--fs-hero);
  line-height: 0.85;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.hero-title .line {
  display: block;
}

.hero-title .indent {
  margin-left: 20vw;
}

.hero-sub {
  max-width: 600px;
  margin-left: auto;
  font-size: 1.2rem;
  font-weight: 500;
  border-left: 2px solid var(--accent-primary);
  padding-left: 1.5rem;
}

/* Scrolling Marquee */
.marquee-wrap {
  background: var(--accent-primary);
  color: var(--bg-color);
  padding: 1rem 0;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 2px solid var(--text-color);
}

.marquee-content {
  display: inline-block;
  animation: scroll 20s linear infinite;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
}

.marquee-content span {
  margin-right: 4rem;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* MAIN CONTENT - BENTO/MASONRY */
.main-content {
  padding: 4rem var(--container-pad);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--grid-gap);
  grid-auto-flow: dense;
}

.post-card {
  position: relative;
  border: 2px solid var(--text-color);
  padding: 1.5rem;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
}

/* Make some cards span multiple rows/cols for Bento effect - Only on larger screens */
@media (min-width: 768px) {
  .post-card:nth-child(3n+1) {
    grid-column: span 2;
    background: var(--dark-green);
    color: var(--bg-color);
  }
  .post-card:nth-child(3n+1) .card-title a { color: var(--bg-color); }
  .post-card:nth-child(3n+1) .card-meta { color: rgba(255,255,255,0.7); }
}

.post-card:hover {
  transform: translate(-5px, -5px);
  box-shadow: 10px 10px 0 var(--accent-primary);
}

.card-img-link {
  display: block;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid currentColor;
}

.card-img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  filter: grayscale(100%);
  transition: filter 0.3s, transform 0.5s;
}

.post-card:hover .card-img {
  filter: grayscale(0%);
  transform: scale(1.05);
}

.card-meta {
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.card-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.btn-arrow {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-arrow::after {
  content: '→';
  transition: transform 0.3s;
}

.btn-arrow:hover::after {
  transform: translateX(5px);
}

/* ENTRY CONTENT (Single & Page) */
.entry-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
  font-size: 1.15rem;
}

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

.entry-content h2, .entry-content h3, .entry-content h4 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.entry-content ul, .entry-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.entry-content li {
  margin-bottom: 0.5rem;
}

.entry-content blockquote {
  border-left: 4px solid var(--accent-primary);
  padding-left: 2rem;
  margin: 2rem 0;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.4rem;
}

.entry-content img {
  border-radius: 4px;
  margin: 2rem 0;
}

/* PAGINATION */
.page-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 0;
}

.page-nav .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--text-color);
  font-weight: 700;
  transition: all 0.2s;
}

.page-nav .page-numbers.current {
  background: var(--text-color);
  color: var(--bg-color);
}

.page-nav .page-numbers:not(.current):hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* FOOTER */
.site-footer {
  background: var(--text-color);
  color: var(--bg-color);
  padding: 6rem var(--container-pad) 2rem;
  position: relative;
  overflow: hidden;
}

.footer-big-text {
  font-size: clamp(3rem, 12vw, 15rem);
  line-height: 0.8;
  font-family: var(--font-display);
  font-weight: 800;
  color: #333; /* Dark gray on black */
  opacity: 0.3;
  text-align: center;
  margin-bottom: 4rem;
  user-select: none;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 3rem;
}

.footer-links ul {
  list-style: none;
}
.footer-links a {
  font-size: 1.5rem;
  font-family: var(--font-accent);
  font-style: italic;
  display: block;
  margin-bottom: 0.5rem;
}

/* Mobile */
@media (max-width: 768px) {
  .post-card:nth-child(3n+1) {
    grid-column: span 1;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }
  .hero-title .indent {
    margin-left: 0;
  }
}
