/*
 * Legalwrite Page Styles
 * Styles specific to the default page.php template
 */

body.lw-default-page {
  /* Background image moved to .lw-page__bg-elements for scroll fade control */
}

.lw-page__bg-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/page-backgroundelements.svg');
  background-repeat: no-repeat;
  background-position: center -1000px;
  background-attachment: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7; 
}

.lw-page {
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  background: transparent;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  color: #ffffff;
  font-family: 'DM Sans', sans-serif;
}

.lw-page__hero {
  padding: 180px 0 60px;
  position: relative;
  z-index: 4; /* Higher than content section to keep text on top of dots */
}

.lw-page__header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.lw-page__tags {
  color: #FF9216;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 24px;
}

.lw-page__header .lw-page__title {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 8px;
}

.lw-page__meta {
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lw-page__meta-sep {
  opacity: 0.7;
}

.lw-page__meta-dot {
  margin: 0 4px;
}

.lw-page__content-section {
  position: relative;
  z-index: 3;
  padding-bottom: 120px;
}

.lw-page__content-box {
  position: relative;
  z-index: 2; /* Above dots */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px) saturate(1.2);
  -webkit-backdrop-filter: blur(25px) saturate(1.2);
  border-radius: 40px;
  padding: 80px;
  
  /* Multi-layered "Cool" Shadow & Glass Effect - Dark but Minimal */
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.7),             /* Strong, clean dark shadow */
    0 0 0 1px rgba(255, 255, 255, 0.2),         /* Very subtle rim light */
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);   /* Barely there inner edge */
    
  max-width: 1000px;
  margin: 0 auto;
}

/* Dots layer positioned "behind" the content box top edge, extending upwards into hero */
.lw-default-page .homepage__dots-overlay {
  position: absolute;
  top: -600px; /* Pull it up into the hero area */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px; /* Matches content box width */
  height: 680px; /* Covers 600px above and 80px behind the box corners */
  z-index: 1;
  pointer-events: none;
  opacity: 0.15; /* Restoring visibility; global 0.05 is too faint here */
  
  /* Combined mask for upward and side fades */
  mask-image: 
    linear-gradient(to top, 
      rgba(0,0,0,1) 0, 
      rgba(0,0,0,1) 150px, 
      rgba(0,0,0,0) 100%
    ),
    linear-gradient(to right,
      transparent 0,
      black 80px,
      black calc(100% - 80px),
      transparent 100%
    );
  -webkit-mask-image: 
    linear-gradient(to top, 
      rgba(0,0,0,1) 0, 
      rgba(0,0,0,1) 150px, 
      rgba(0,0,0,0) 100%
    ),
    linear-gradient(to right,
      transparent 0,
      black 80px,
      black calc(100% - 80px),
      transparent 100%
    );
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.lw-page__content {
  position: relative;
  z-index: 1;
  font-size: 18px;
  line-height: 1.8;
  color: #334155;
}

.lw-page__content h2,
.lw-page__content h3 {
  color: #0b1331;
  margin: 48px 0 24px;
  font-weight: 700;
}

.lw-page__content h2 { font-size: 32px; }
.lw-page__content h3 { font-size: 24px; }

.lw-page__content p {
  margin-bottom: 24px;
}

.lw-page__content ul,
.lw-page__content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.lw-page__content ul {
  list-style-type: disc !important;
}

.lw-page__content ol {
  list-style-type: decimal !important;
}

.lw-page__content li {
  margin-bottom: 12px;
}

.lw-page__content li:last-child {
  margin-bottom: 0;
}

.lw-page__content strong {
  color: #0b1331;
}

.lw-page__content a {
  color: #3b82f6;
  text-decoration: underline;
  transition: color 0.2s;
}

.lw-page__content a:hover {
  color: #2563eb;
}

/* ==========================================================================
   404 PAGE
   ========================================================================== */
.lw-404__hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 180px 0 120px;
  z-index: 4;
  text-align: center;
}

/* Dots scoped to 404 hero */
.lw-404 .homepage__dots-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  z-index: 1;
  pointer-events: none;
}

.lw-404__hero .container {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Large 404 Number --- */
.lw-404__code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 64px;
  user-select: none;
}

.lw-404__digit {
  font-size: clamp(100px, 18vw, 200px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.25) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lw-404__digit--zero {
  background: linear-gradient(180deg, #FF9216 0%, #C8610D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.lw-404__digit--zero::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(255, 146, 22, 0.2) 0%, transparent 70%);
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}

/* --- Content Box (glassmorphism card) --- */
.lw-404__content-box {
  background: rgba(13, 18, 30, 0.7);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 72px 64px;
  max-width: 640px;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.lw-404__content-box .section-label {
  margin-bottom: 20px;
}

.lw-404 .lw-404__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 16px;
}

.lw-404 .lw-404__text {
  font-size: 17px;
  color: #94a3b8;
  line-height: 1.7;
  margin-bottom: 32px;
}

.lw-404__actions {
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   RESPONSIVE (PAGE ONLY)
   ========================================================================== */
@media (max-width: 768px) {
  .lw-page__hero {
    padding: 140px 0 40px;
  }

  .lw-page__header .lw-page__title {
    font-size: 32px;
  }

  .lw-page__content-box {
    padding: 40px 24px;
    border-radius: 24px;
  }

  /* 404 responsive */
  .lw-404__hero {
    padding: 140px 0 80px;
    min-height: auto;
  }

  .lw-404__code {
    margin-bottom: 32px;
  }

  .lw-404__content-box {
    padding: 36px 24px;
    border-radius: 20px;
  }

  .lw-404__text {
    font-size: 15px;
  }
}
