/* ==========================================================================
   Landing Pages -- Design System CSS
   Replicates the Astro site's design tokens and component styles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Primary -- Northern Spain palette */
  --verde-bosque:  #1a4a3a;   /* CTAs, links                */
  --verde-hover:   #2d6a4f;   /* Hover states               */
  --dorado:        #d4a574;   /* Accents, highlights         */
  --dorado-suave:  #f5e6d3;   /* Badge backgrounds           */

  /* Neutrals -- Stone & graphite */
  --piedra:        #f8f6f3;   /* General background          */
  --piedra-media:  #e8e4de;   /* Borders                     */
  --grafito:       #2d2d2d;   /* Headings                    */
  --texto:         #444444;   /* Body text                   */
}

/* --------------------------------------------------------------------------
   2. Font Faces
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/nuFiD-vYSZviVYUb_rj3ij__anPXDTzYgA.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/nwpStKy2OAdR1K-IwhWudF-R3w8aZQ.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   3. Global Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--piedra);
  color: var(--texto);
  font-family: 'Source Sans 3', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* --------------------------------------------------------------------------
   4. Container
   -------------------------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   5. Header (fallback when shell is not loaded)
   -------------------------------------------------------------------------- */
.landing-header-fallback {
  position: sticky;
  top: 0;
  background: rgba(248, 246, 243, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid var(--piedra-media);
  height: 70px;
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */
.landing-hero {
  background: linear-gradient(135deg, #44403c 0%, #1a4a3a 60%, #1e3d59 100%);
  padding: 4rem 1.5rem;
  text-align: center;
  color: #fff;
}

.landing-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.hero-stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 1.1rem;
  opacity: 0.9;
}

.stat-sep {
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   6b. Summary Box (featured snippets optimization)
   -------------------------------------------------------------------------- */
.landing-summary {
  background: #f8f6f3;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border: 1px solid var(--piedra-media);
}

.landing-summary h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  color: var(--grafito);
  margin: 0 0 0.75rem;
}

.landing-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-summary li {
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--texto);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.landing-summary .stat-value {
  font-weight: 700;
  color: var(--verde-bosque);
}

/* --------------------------------------------------------------------------
   7. Intro Section
   -------------------------------------------------------------------------- */
.landing-intro {
  max-width: 800px;
  margin: 2rem auto;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--texto);
}

/* --------------------------------------------------------------------------
   8. Grid Section
   -------------------------------------------------------------------------- */
.landing-grid-section {
  padding: 2rem 0;
}

.landing-grid-section h2 {
  font-family: 'Playfair Display', serif;
  color: var(--grafito);
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   9. Responsive Grid
   Breakpoints: 1 col < 640, 2 cols 640-899, 3 cols 900-1199, 4 cols 1200+
   -------------------------------------------------------------------------- */
.landing-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .landing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .landing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .landing-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --------------------------------------------------------------------------
   10. Card (.card-compact)
   -------------------------------------------------------------------------- */
.card-compact {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s;
}

.card-compact:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Card image */
.card-compact .card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card-compact .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* SVG placeholder when no image is available */
.card-compact .card-placeholder {
  width: 100%;
  height: 100%;
}

.card-compact .card-placeholder svg {
  width: 100%;
  height: 100%;
}

/* Card body */
.card-compact .card-body {
  padding: 1rem;
}

.card-compact h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--grafito);
  margin: 0 0 0.3rem;
}

.card-compact .card-meta {
  font-size: 0.85rem;
  color: #888;
}

.card-compact .card-snippet {
  font-size: 0.9rem;
  color: var(--texto);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   11. Hub Grid
   -------------------------------------------------------------------------- */
.hub-grid {
  display: grid;
  gap: 1.5rem;
  padding: 3rem 0;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .hub-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   12. Hub Card
   -------------------------------------------------------------------------- */
.hub-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  text-decoration: none;
  color: var(--grafito);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s;
  border: 2px solid transparent;
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--dorado);
}

.hub-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

.hub-card .hub-count {
  font-size: 1rem;
  color: var(--dorado);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   13. Article
   -------------------------------------------------------------------------- */
.landing-article {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  margin: 2rem 0;
  line-height: 1.8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.landing-article h2,
.landing-article h3 {
  font-family: 'Playfair Display', serif;
  color: var(--grafito);
}

.landing-article h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.landing-article h2:first-child {
  margin-top: 0;
}

.landing-article h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
}

.landing-article a {
  color: var(--verde-bosque);
}

.landing-article a:hover {
  color: var(--verde-hover);
}

/* --------------------------------------------------------------------------
   14. Cross-links
   -------------------------------------------------------------------------- */
.landing-crosslinks {
  padding: 2rem 0 3rem;
}

.crosslink-block {
  margin-bottom: 2rem;
}

.crosslink-block h3 {
  font-family: 'Playfair Display', serif;
  color: var(--grafito);
  margin-bottom: 1rem;
}

.crosslink-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--piedra-media);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--texto);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--dorado);
  background: var(--dorado-suave);
}

.tag-count {
  background: var(--piedra);
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  color: #888;
}

/* --------------------------------------------------------------------------
   15. Footer (fallback when shell is not loaded)
   -------------------------------------------------------------------------- */
.landing-footer-fallback {
  background: var(--grafito);
  color: #ccc;
  padding: 3rem 1.5rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   16. Mobile Responsive (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Smaller hero on mobile */
  .landing-hero {
    padding: 2.5rem 1rem;
  }

  .landing-hero h1 {
    font-size: 1.6rem;
  }

  /* Summary box: stack items vertically on mobile */
  .landing-summary {
    padding: 1.25rem 1.25rem;
  }

  .landing-summary ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Card switches to horizontal row layout on mobile */
  .card-compact {
    display: flex;
  }

  .card-compact .card-img {
    width: 120px;
    min-width: 120px;
    aspect-ratio: auto;
    height: 120px;
  }

  .card-compact .card-body {
    flex: 1;
  }
}
