/* Home Page Styles - DeepWhite Redesign */

/* Hero Section */
.home-intro {
  padding: 3rem 0 2rem; /* Reduced top/bottom padding */
  margin-bottom: 0; /* Remove margin so content sits flush */
  border-bottom: none; /* Ensure no border */
  position: sticky;
  top: var(--home-intro-sticky-top, 0px);
  z-index: 1; /* Keep it lower than content so content scrolls over it */
  max-width: 1200px; /* Limit width to match content */
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: 2.2fr 1fr; /* Match home-scroll-content */
  gap: 0;
  align-items: center;
  /* Ensure it has a background if needed, or transparent to blend */
  background-color: #ffffff; /* Force pure white */
}

/* Wrapper for scrolling content to cover the sticky intro */
.home-scroll-content {
  position: relative;
  z-index: 10;
  background-color: #ffffff; /* Force pure white */
  background-image:
    radial-gradient(120% 60% at 10% 0%, rgba(0,0,0,0.03), transparent 60%),
    radial-gradient(120% 60% at 90% 100%, rgba(0,0,0,0.03), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.01), rgba(0,0,0,0.01) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.01), rgba(0,0,0,0.01) 1px, transparent 1px, transparent 4px);
  padding-top: 2rem;
  /* Newspaper Grid Layout */
  display: grid;
  grid-template-columns: 2.2fr 1fr; /* Main Content | Sidebar */
  gap: 0;
  /* Refined Top Border: Thick top, thin bottom to create "Double" effect manually if needed, or stick to double but thinner */
  border-top: 1px solid var(--color-text-strong);
  margin-top: 2rem;
  max-width: 1200px; /* Limit width for better readability */
  margin-left: auto;
  margin-right: auto;
  /* Shadow for depth when scrolling over sticky intro + Double line effect */
  box-shadow:
    0 -10px 30px rgba(0,0,0,0.05),
    0 -1px 0 0 var(--color-text-strong) inset,
    0 1px 0 rgba(0,0,0,0.04),
    0 0 14px rgba(0,0,0,0.035);
  padding-top: 3px; /* Space between the double lines */
}

/* Add a pseudo-element for the second line of the "double border" style */
.home-scroll-content::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-text-strong);
    display: block;
}

/* Subtle crop marks for newspaper feel (non-text) */
body.home-page .home-scroll-content::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    pointer-events: none;
    background:
      linear-gradient(var(--color-border), var(--color-border)) top left,
      linear-gradient(var(--color-border), var(--color-border)) top left,
      linear-gradient(var(--color-border), var(--color-border)) top right,
      linear-gradient(var(--color-border), var(--color-border)) top right,
      linear-gradient(var(--color-border), var(--color-border)) bottom left,
      linear-gradient(var(--color-border), var(--color-border)) bottom left,
      linear-gradient(var(--color-border), var(--color-border)) bottom right,
      linear-gradient(var(--color-border), var(--color-border)) bottom right;
    background-size:
      18px 1px, 1px 18px,
      18px 1px, 1px 18px,
      18px 1px, 1px 18px,
      18px 1px, 1px 18px;
    background-position:
      top left, top left,
      top right, top right,
      bottom left, bottom left,
      bottom right, bottom right;
    background-repeat: no-repeat;
    opacity: 0.55;
}

.home-intro-content {
  position: relative;
  z-index: 2; /* Ensure text is above canvas interaction layer if they overlap */
  padding-right: 3rem; /* Match home-scroll-content left column padding */
  margin-left: 0;
  opacity: var(--home-intro-opacity, 1);
  transition: opacity 0.2s linear;
}

.home-intro-visual {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px; /* Minimum height for the visual area */
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2rem; /* Match home-scroll-content right column padding */
}

#home-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto; /* Allow mouse interaction */
}

/* Update responsive text styles */
.home-intro h1 {
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem 0; /* Reduced margin */
  color: var(--color-text-strong);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .home-intro {
    grid-template-columns: 1fr; /* Stack on mobile */
    padding: 3rem 0;
  }
  
  .home-intro-visual {
    display: none; /* Optional: Hide animation on mobile to save battery/space */
  }
}


.home-intro .intro-role {
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  color: var(--color-meta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem; /* Reduced margin */
  display: block;
}

.home-intro .intro-desc {
  font-size: 1.4rem;
  max-width: 38ch;
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 1.5rem; /* Reduced margin */
  font-weight: 400;
}

.home-intro .intro-status {
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  color: var(--color-meta);
  padding: 1.5rem 0 0 0;
  background-color: transparent;
  display: block;
  max-width: none;
  white-space: nowrap;
}

/* Home Updated Meta (near hero) */
.home-updated-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  color: var(--color-meta);
}
.home-updated-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-border);
  flex: 0 0 auto;
}
.home-updated-meta .label {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Newspaper Layout Items */

/* 1. Recommended Reading (Left Column) */
.home-scroll-content > .home-section:nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1 / 3; /* Spans full height of sidebar */
  padding-right: 3rem; /* More whitespace */
  border-right: 1px solid var(--color-border);
  margin-bottom: 4rem; /* Bottom spacing */
  padding-top: 2rem;
}

/* 2. Special Collections (Top Right) */
.home-scroll-content > .home-section:nth-child(2) {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  padding-left: 2rem;
  padding-bottom: 2rem;
  padding-top: 2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

/* 3. Latest Updates (Bottom Right) */
.home-scroll-content > .home-section:nth-child(3) {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  padding-left: 2rem;
  padding-top: 2rem;
  margin-bottom: 4rem;
}

/* Section Headers - Newspaper Style */
body.home-page {
  counter-reset: none; /* Disable counters */
}

.home-section h2 {
  font-family: var(--font-family-sans); /* Use Sans for headers to contrast with Serif body */
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-strong);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 4px solid var(--color-text-strong); /* Thick bold line */
  display: block; /* Reset flex */
  text-align: left;
}

/* Remove Swiss style elements */
.home-section h2::before,
.home-section h2::after {
  content: none;
  display: none;
}

/* Post Grid (Recommended Reading) - Newspaper Style */
.post-list {
  display: flex;
  flex-direction: column; /* Stack them like articles */
  gap: 3rem; /* More breathing room */
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  display: flex;
  flex-direction: column;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.post-item:last-child {
  border-bottom: none;
}

/* Date moved above title as a "Dateline" */
.post-meta {
  font-family: var(--font-family-mono);
  font-size: 0.7rem;
  color: var(--color-meta);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-meta::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--color-text-strong);
}

.post-title {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 2.2rem; /* Larger headlines */
  line-height: 1.1;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.post-title a {
  color: var(--color-text-strong);
  text-decoration: none;
  border-bottom: none; /* Ensure no border */
  background-image: none; /* Ensure no background gradients */
}

.post-title a:hover {
  text-decoration: none;
  border-bottom: none;
  color: var(--color-text-subtle); /* Simple color change on hover */
}

/* Make the whole card clickable overlay */
.post-title a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.post-excerpt {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  /* text-align: justify; Removed justify as it can cause weird gaps on web */
  max-width: 65ch; /* Optimal reading length */
}

/* First article styling (Lead Story) */
.post-item:first-child .post-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}
.post-item:first-child .post-excerpt {
    font-size: 1.25rem;
    line-height: 1.5;
}


/* Special Collections - Sidebar Style */
.special-archive-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.special-item {
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  background-color: transparent; /* Clean look */
  transition: background-color 0.2s ease;
}

.special-item:hover {
    background-color: #fcfbf9; /* Subtle warm hover */
}

.special-item h3 {
  font-family: var(--font-family-sans);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.special-item h3 a {
  color: var(--color-text-strong);
  text-decoration: none;
  border-bottom: none;
}

.special-item h3 a:hover {
  border-bottom: none;
  color: var(--color-text-subtle);
}

.special-item p {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 0.95rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
  font-style: italic;
}

.special-item-footer {
  margin-top: 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-text-strong);
  border-top: 1px solid var(--color-border);
  padding-top: 0.5rem;
  display: inline-block;
}

/* Latest Updates - Sidebar List */
.post-list.simple-list {
  display: flex;
  flex-direction: column;
  gap: 0; /* Tight spacing for list */
  border-top: 1px solid var(--color-border);
}

.post-item.simple-item {
  display: block; /* Reset flex */
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
  position: static;
}

.post-item.simple-item .post-date {
  display: block;
  font-family: var(--font-family-mono);
  font-size: 0.7rem;
  color: var(--color-meta);
  margin-bottom: 0.25rem;
}

.post-item.simple-item .post-title {
  font-size: 1.1rem;
  font-weight: 500;
  font-family: Georgia, 'Times New Roman', Times, serif; /* Serif for headlines */
  line-height: 1.3;
}

.post-item.simple-item .post-title a {
  border-bottom: none;
  text-decoration: none;
  color: var(--color-text-strong);
}

.post-item.simple-item .post-title a:hover {
  border-bottom: none;
  color: var(--color-text-subtle);
}

/* Disable clickable overlay for sidebar items */
.post-item.simple-item .post-title a::after {
  content: none;
}


/* Pagination */
.pagination-nav {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-text-strong);
  display: flex;
  justify-content: center;
}
.pagination-links {
    font-family: var(--font-family-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
}

/* Footer Meta */
.home-footer-meta {
  grid-column: 1 / -1; /* Span full width */
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 4px double var(--color-text-strong);
  text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .home-scroll-content {
    grid-template-columns: 1fr;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
  }
  
  .home-scroll-content::before {
      display: none;
  }
  
  .home-scroll-content > .home-section:nth-child(1),
  .home-scroll-content > .home-section:nth-child(2),
  .home-scroll-content > .home-section:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
    padding: 0;
    border: none;
    margin-bottom: 3rem;
  }
  
  .home-section h2 {
    font-size: 1rem;
    border-bottom: 2px solid var(--color-text-strong);
  }
  
  .post-list {
     gap: 2rem;
  }
  
  .post-title {
     font-size: 1.8rem;
  }
  
  .post-item:first-child .post-title {
      font-size: 2.2rem;
  }
}

@media (min-width: 901px) {
  .home-intro-content {
    --home-scroll-width: min(1200px, 100vw);
    --home-intro-width: min(1400px, 100vw);
    margin-left: max(0px, calc((100vw - var(--home-scroll-width)) / 2 - (100vw - var(--home-intro-width)) / 2 + 20px));
  }
}

@media (max-width: 600px) {
  .home-scroll-content > .home-section:nth-child(1) {
    padding-left: 20px;
    padding-right: 20px;
  }

  .home-scroll-content > .home-section:nth-child(1) .post-list {
    gap: 1.5rem;
  }

  .home-scroll-content > .home-section:nth-child(1) .post-item {
    padding-bottom: 2rem;
  }

  .home-scroll-content > .home-section:nth-child(1) .post-meta {
    font-size: 0.65rem;
    gap: 0.4rem;
  }

  .home-scroll-content > .home-section:nth-child(1) .post-title {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .home-scroll-content > .home-section:nth-child(1) .post-item:first-child .post-title {
    font-size: 1.9rem;
  }

  .home-scroll-content > .home-section:nth-child(1) .post-excerpt {
    font-size: 1rem;
    max-width: none;
  }
}
