/* ============================================================
   Red Liquid Style System — Updated Light Theme (1200px Width)
   ============================================================ */

:root {
  --rl-primary: #d40000;
  --rl-primary-soft: #ff4d4d;
  --rl-surface: #ffffff;
  --rl-surface-light: #f7f7f7;
  --rl-text: #000000;
  --rl-text-muted: #444444;
  --rl-edge: rgba(212,0,0,0.25);
  --rl-edge-strong: rgba(212,0,0,0.45);

  --rl-motion-fast: 150ms;
  --rl-motion-med: 260ms;
  --rl-motion-slow: 420ms;
  --rl-easing: cubic-bezier(.22,.61,.36,1);

  --rl-radius: 12px;
  --rl-radius-large: 18px;
  --rl-shadow-soft: 0 6px 24px rgba(212,0,0,0.18);
  --rl-shadow-gloss: 0 4px 14px rgba(212,0,0,0.26);

  --rl-space-1: 0.5rem;
  --rl-space-2: 1rem;
  --rl-space-3: 1.5rem;
  --rl-space-4: 2rem;
  --rl-space-5: 3rem;

  --rl-max-width: 1200px;
}

/* ============================================================
   Base Layout + Motion Wash
   ============================================================ */

html, body {
  margin: 0;
  padding: 0;
  background: var(--rl-surface);
  color: var(--rl-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 80% 20%, rgba(212,0,0,.08), transparent 60%),
    linear-gradient(120deg, rgba(212,0,0,.03), rgba(212,0,0,.01));
  animation: rl-wash 24s ease-in-out infinite alternate;
  opacity: .35;
}

@keyframes rl-wash {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-2%,0) scale(1.02); }
}

/* ============================================================
   Forced paragraph justification
   ============================================================ */

article p,
section p,
main p,
p {
  text-align: justify !important;
  text-justify: inter-word !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
  hyphens: auto !important;
}

/* ============================================================
   Layout Containers
   ============================================================ */

.rl-main {
  display: flex;
  justify-content: center;
  padding: var(--rl-space-4) var(--rl-space-2);
}

.rl-article {
  width: 100%;
  max-width: var(--rl-max-width);
  margin: 0 auto;
}

/* ============================================================
   NAVIGATION — Perfect 1200px Alignment
   ============================================================ */

.rl-nav {
  width: 100%;
  background: var(--rl-surface);
  border-bottom: 2px solid var(--rl-primary);
  padding: var(--rl-space-2) 0;
}

.rl-nav-container {
  max-width: var(--rl-max-width);
  margin: 0 auto;
  width: 100%;
}

.rl-nav-container ul {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: calc(var(--rl-max-width) - var(--rl-space-3));
  margin: 0 auto;
  padding: 0 var(--rl-space-2);
  list-style: none;
}

.rl-nav a {
  color: var(--rl-primary);
  text-decoration: none;
  font-weight: 600;
  padding-bottom: var(--rl-space-1);
  border-bottom: 3px solid transparent;
  position: relative;
  transition:
    border-color var(--rl-motion-med) var(--rl-easing),
    color var(--rl-motion-med) var(--rl-easing);
}

/* ============================================================
   RED FOG HOVER EFFECT
   ============================================================ */

.rl-nav a::before {
  content:"";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212,0,0,0.30) 0%, rgba(212,0,0,0.00) 70%);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  transition:
    opacity var(--rl-motion-med) var(--rl-easing),
    width var(--rl-motion-slow) var(--rl-easing),
    height var(--rl-motion-slow) var(--rl-easing);
}

.rl-nav a:hover::before {
  opacity: 1;
  width: 180%;
  height: 260%;
}

.rl-nav a:hover {
  border-bottom-color: var(--rl-primary);
  color: var(--rl-primary);
}

.rl-nav a.rl-active {
  border-bottom-color: var(--rl-primary);
  color: var(--rl-primary);
}

@media (max-width: 700px) {
  .rl-nav-container ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--rl-space-2);
  }
}

/* ============================================================
   Headings
   ============================================================ */

/* Center ALL headings site-wide */
h1, h2, h3, h4, h5, h6 {
  text-align: center;
}

.rl-h1 {
  font-size: 2rem;
  color: var(--rl-primary);
  margin-top: var(--rl-space-2);
  margin-bottom: var(--rl-space-3);
}

.rl-dek {
  margin-bottom: var(--rl-space-3);
  color: var(--rl-text-muted);
}

/* ============================================================
   Images (Hero / Figure) — forced 1200x500 display + extra bottom space
   ============================================================ */

.rl-figure {
  margin: var(--rl-space-3) 0 2.8rem; /* slightly more space below the image */
  text-align: center;
}

.rl-figure img {
  width: 100%;
  max-width: 1200px;   /* match content width */
  height: 500px;       /* fixed height on every page */
  display: block;
  margin: 0 auto;
  border-radius: var(--rl-radius-large);
  box-shadow: var(--rl-shadow-gloss);
  border: 1px solid var(--rl-primary);
  object-fit: cover;   /* crop to 1200x500 instead of stretching */
}

/* ============================================================
   MARINE ANCHOR DIVIDER (RED, TIGHTER SPACING)
   ============================================================ */

section.rl-section {
  margin-top: var(--rl-space-1);
  margin-bottom: var(--rl-space-3);
  padding: var(--rl-space-2) 0 var(--rl-space-2);
  position: relative;
}

/* Horizontal red line */
section.rl-section::before {
  content:"";
  position:absolute;
  top:-6px;
  left:0;
  width:100%;
  height:1px;
  background: var(--rl-primary);
}

/* Centered red anchor */
section.rl-section::after {
  content:"⚓";
  position:absolute;
  top:-22px;
  left:50%;
  transform: translateX(-50%);
  font-size:22px;
  font-weight:800;
  color:var(--rl-primary);
  background: var(--rl-surface);
  padding:0 var(--rl-space-1);
}

/* ============================================================
   Reading Progress Bar
   ============================================================ */

.rl-progress {
  position: fixed;
  top:0;
  left:0;
  height:3px;
  width:0%;
  background: linear-gradient(90deg, var(--rl-primary), transparent);
  z-index:9998;
  transition: width var(--rl-motion-fast) linear;
}

/* ============================================================
   Red underline links
   ============================================================ */

.rl-link {
  color: var(--rl-primary);
  text-decoration:none;
  position:relative;
}

.rl-link::after {
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-2px;
  height:2px;
  background:linear-gradient(90deg, var(--rl-primary), transparent);
  transform:scaleX(0);
  transform-origin:left;
  transition:transform var(--rl-motion-med) var(--rl-easing);
}

.rl-link:hover::after {
  transform:scaleX(1);
}

/* ============================================================
   Cards
   ============================================================ */

.rl-card {
  border: 1px solid var(--rl-primary);
  border-radius: var(--rl-radius);
  padding: var(--rl-space-2);
  transition:
    transform var(--rl-motion-fast) var(--rl-easing),
    box-shadow var(--rl-motion-fast) var(--rl-easing),
    border-color var(--rl-motion-fast) var(--rl-easing);
}

.rl-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rl-shadow-gloss);
  border-color: var(--rl-primary-soft);
}

/* ============================================================
   Footer
   ============================================================ */

.rl-footer {
  text-align: center;
  padding: var(--rl-space-4) 0;
  color: var(--rl-primary);
  border-top: 1px solid var(--rl-edge);
}

/* ============================================================
   Responsive Typography
   ============================================================ */

@media (max-width: 700px) {
  .rl-h1 {
    font-size: 1.7rem;
  }
}
