/* ============================================================
   WRITEUP PAGES — Maester's scrolls theme
============================================================ */

/* ── Writeup Article ── */
.writeup-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 80px 32px 60px;
  min-height: 100vh;
}

.writeup-article {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(201,162,39,0.12);
  border-radius: 2px;
  padding: 48px 44px;
}

.writeup-header {
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(201,162,39,0.1);
  padding-bottom: 28px;
}

.writeup-back {
  display: inline-block;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 13px;
  color: rgba(201,162,39,0.5);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.writeup-back:hover { color: #c9a227; }

.writeup-title {
  font-family: 'GameOfThrones', serif;
  font-size: clamp(18px, 3vw, 28px);
  letter-spacing: 3px;
  color: #c9a227;
  text-shadow: 0 0 30px rgba(201,162,39,0.2);
  margin-bottom: 16px;
  font-weight: normal;
}

.writeup-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-tag {
  font-family: 'GameOfThrones', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(200,184,154,0.6);
  padding: 4px 12px;
  border: 1px solid rgba(201,162,39,0.15);
  border-radius: 1px;
}

/* ── Content Prose ── */
.writeup-content h2 {
  font-family: 'GameOfThrones', serif;
  font-size: 16px;
  letter-spacing: 3px;
  color: #c9a227;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201,162,39,0.08);
  font-weight: normal;
}

.writeup-content h3 {
  font-family: 'GameOfThrones', serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(201,162,39,0.75);
  margin: 28px 0 12px;
  font-weight: normal;
}

.writeup-content p {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 15px;
  line-height: 1.85;
  color: rgba(200,184,154,0.7);
  margin-bottom: 16px;
}

.writeup-content a {
  color: #c9a227;
  text-decoration: none;
  border-bottom: 1px solid rgba(201,162,39,0.3);
  transition: border-color 0.2s;
}
.writeup-content a:hover {
  border-bottom-color: #c9a227;
}

.writeup-content strong {
  color: rgba(200,184,154,0.9);
}

.writeup-content em {
  color: rgba(200,184,154,0.6);
  font-style: italic;
}

.writeup-content code {
  font-family: 'Iosevka', 'Courier New', monospace;
  font-size: 13px;
  background: rgba(201,162,39,0.06);
  border: 1px solid rgba(201,162,39,0.1);
  padding: 2px 6px;
  border-radius: 2px;
  color: #d4c9a8;
}

.writeup-content pre {
  margin: 16px 0;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(201,162,39,0.08);
  border-left: 3px solid rgba(201,162,39,0.3);
  border-radius: 2px;
  padding: 20px 24px;
  overflow-x: auto;
}

.writeup-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #d4c9a8;
}

.writeup-content ul, .writeup-content ol {
  margin: 12px 0 16px 24px;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 15px;
  line-height: 1.85;
  color: rgba(200,184,154,0.7);
}

.writeup-content li {
  margin-bottom: 6px;
}

.writeup-content li code {
  font-size: 12px;
}

.writeup-content blockquote {
  margin: 16px 0;
  padding: 12px 24px;
  border-left: 3px solid rgba(201,162,39,0.3);
  background: rgba(201,162,39,0.03);
  font-style: italic;
  color: rgba(200,184,154,0.6);
}

.writeup-content img {
  max-width: 100%;
  border: 1px solid rgba(201,162,39,0.1);
  border-radius: 2px;
  margin: 12px 0;
}

/* ── Tables ── */
.writeup-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 14px;
}

.writeup-content th {
  font-family: 'GameOfThrones', serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: #c9a227;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(201,162,39,0.2);
  background: rgba(201,162,39,0.04);
}

.writeup-content td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(201,162,39,0.06);
  color: rgba(200,184,154,0.6);
}

.writeup-content tr:hover td {
  background: rgba(201,162,39,0.03);
}

/* ============================================================
   WRITEUPS INDEX — Scroll Gallery
============================================================ */
.writeups-hero {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 32px 60px;
  text-align: center;
}

.writeups-hero h1 {
  font-family: 'GameOfThrones', serif;
  font-size: clamp(20px, 3.5vw, 32px);
  letter-spacing: 5px;
  color: #c9a227;
  text-shadow: 0 0 40px rgba(201,162,39,0.3);
  margin-bottom: 12px;
}

.writeups-hero p {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 15px;
  color: rgba(200,184,154,0.5);
  font-style: italic;
}

/* ── Scroll Container ── */
.scroll-gallery {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 32px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 40px;
  justify-items: center;
}

/* ── Individual Scroll ── */
.ctf-scroll {
  position: relative;
  width: 220px;
  height: 280px;
  cursor: pointer;
  perspective: 800px;
  text-decoration: none;
  display: block;
}

.scroll-body {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* The scroll parchment */
.scroll-parchment {
  position: absolute;
  inset: 30px 0;
  background: linear-gradient(
    180deg,
    #2a2015 0%,
    #1e1810 15%,
    #1a1409 50%,
    #1e1810 85%,
    #2a2015 100%
  );
  border: 1px solid rgba(201,162,39,0.15);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  z-index: 1;
}

/* Top and bottom scroll rods */
.scroll-rod {
  position: absolute;
  left: -6px;
  right: -6px;
  height: 24px;
  background: linear-gradient(
    180deg,
    #4a3a20 0%,
    #6a5530 30%,
    #8a7040 50%,
    #6a5530 70%,
    #4a3a20 100%
  );
  border-radius: 12px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.scroll-rod::before,
.scroll-rod::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #c9a227 30%, #8a6a10 100%);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(201,162,39,0.3);
}

.scroll-rod::before { left: -4px; }
.scroll-rod::after { right: -4px; }

.scroll-rod-top { top: 18px; }
.scroll-rod-bottom { bottom: 18px; }

/* Scroll text content */
.scroll-ctf-name {
  font-family: 'GameOfThrones', serif;
  font-size: 14px;
  letter-spacing: 3px;
  color: #c9a227;
  margin-bottom: 8px;
  text-shadow: 0 0 15px rgba(201,162,39,0.3);
}

.scroll-ctf-year {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 13px;
  color: rgba(200,184,154,0.5);
  font-style: italic;
  margin-bottom: 4px;
}

.scroll-ctf-count {
  font-family: 'GameOfThrones', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(201,162,39,0.4);
}

/* ── Hover: scroll unfurls ── */
.scroll-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 5;
  pointer-events: none;
}

.scroll-view-btn {
  font-family: 'GameOfThrones', serif;
  font-size: 12px;
  letter-spacing: 4px;
  color: #c9a227;
  padding: 10px 28px;
  border: 1px solid rgba(201,162,39,0.5);
  background: rgba(10,8,4,0.85);
  backdrop-filter: blur(4px);
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(201,162,39,0.4);
  box-shadow: 0 0 20px rgba(201,162,39,0.15);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.4s ease;
}

.ctf-scroll:hover .scroll-body {
  transform: scaleY(1.08);
}

.ctf-scroll:hover .scroll-parchment {
  border-color: rgba(201,162,39,0.35);
  box-shadow: 0 0 30px rgba(201,162,39,0.08);
}

.ctf-scroll:hover .scroll-overlay {
  opacity: 1;
}

.ctf-scroll:hover .scroll-view-btn {
  transform: scale(1);
  box-shadow: 0 0 30px rgba(201,162,39,0.25);
}

.ctf-scroll:hover .scroll-rod {
  box-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 0 8px rgba(201,162,39,0.15);
}

/* ============================================================
   EHAX26 INDEX — Challenge List
============================================================ */
.ehax-hero {
  min-height: 35vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 32px 40px;
  text-align: center;
}

.ehax-hero h1 {
  font-family: 'GameOfThrones', serif;
  font-size: clamp(18px, 3vw, 28px);
  letter-spacing: 4px;
  color: #c9a227;
  text-shadow: 0 0 30px rgba(201,162,39,0.3);
  margin-bottom: 8px;
}

.ehax-hero p {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 14px;
  color: rgba(200,184,154,0.45);
  font-style: italic;
}

.challenge-grid {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 32px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.challenge-card {
  display: block;
  text-decoration: none;
  padding: 24px 28px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(201,162,39,0.1);
  border-radius: 2px;
  transition: all 0.3s;
  position: relative;
}

.challenge-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 2px; height: 0;
  background: #c9a227;
  transition: height 0.3s;
}

.challenge-card:hover {
  border-color: rgba(201,162,39,0.3);
  background: rgba(255,255,255,0.04);
}

.challenge-card:hover::before { height: 100%; }

.challenge-card-cat {
  font-family: 'GameOfThrones', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(201,162,39,0.45);
  margin-bottom: 8px;
  display: block;
}

.challenge-card-name {
  font-family: 'GameOfThrones', serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: rgba(200,184,154,0.8);
  margin-bottom: 8px;
  display: block;
}

.challenge-card-pts {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 13px;
  color: rgba(201,162,39,0.5);
  font-style: italic;
  display: block;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .writeup-article {
    padding: 28px 20px;
  }
  .scroll-gallery {
    grid-template-columns: 1fr;
    padding: 20px 16px 60px;
  }
  .challenge-grid {
    grid-template-columns: 1fr;
  }
}
