/* ===== TRIANON – AZ ELVESZETT ORSZÁG ===== */

:root {
  --bg:           #0C0608;
  --surface:      #160B10;
  --surface2:     #1E0F16;
  --border:       rgba(255, 220, 200, 0.08);
  --border-hover: rgba(255, 220, 200, 0.16);
  --accent:       #C41E3A;
  --accent-glow:  rgba(196, 30, 58, 0.22);
  --gold:         #D4A017;
  --gold-muted:   rgba(212, 160, 23, 0.18);
  --text:         #EDE0D4;
  --muted:        rgba(237, 224, 212, 0.48);
  --green:        #2D6A4F;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── BACK BUTTON ── */
.back {
  position: fixed;
  top: 1.25rem;
  left: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.back:hover { color: var(--text); }
.back svg { opacity: 0.7; }
.back:hover svg { opacity: 1; }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 1.5rem 3rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 55%, rgba(196,30,58,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 85%, rgba(212,160,23,0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* Hero map — CSS mask silhouette using real SVG */
.hero-map-wrap {
  position: relative;
  width: min(420px, 62vw);
  margin-bottom: 1.75rem;
  animation:
    heroMapIn 1s cubic-bezier(.16,1,.3,1) both,
    mapGlow   4s ease-in-out 1s infinite alternate;
}

/* Kétlayeres overlay: Nagymagyarország (kármin) + Trianon (arany) */
.hero-maps {
  position: relative;
  width: 100%;
  aspect-ratio: 1.58; /* Greater Hungary viewBox AR */
  overflow: visible;  /* drop-shadow nem vágódik le */
}

/* ── Nagymagyarország: halvány kármin alap ── */
.hero-nagy {
  position: absolute;
  inset: 0;
  background: rgba(196, 30, 58, 0.38);
  -webkit-mask-image: url('../img/nagy-magyarorszag-terkep.svg');
          mask-image: url('../img/nagy-magyarorszag-terkep.svg');
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

/* ── Trianoni Mo.: arany, geográfiai pozícióban ──
   Nagymagyarország bounding boxán belüli helyzet:
   lon (13.35→26.57°K): left=20.9%, width=51.4%
   lat (44.32→49.62°É): top=19.4%, height=53.6%
   Referenciakép alapján finomhangolva.
*/
.hero-tria {
  position: absolute;
  left:   15%;
  top:    16.5%;
  width:  50%;
  height: 52%;
  background: rgba(212, 160, 23, 0.88);
  -webkit-mask-image: url('../img/magyarorszag-terkep-1949-1956.svg');
          mask-image: url('../img/magyarorszag-terkep-1949-1956.svg');
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

@keyframes heroMapIn {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes mapGlow {
  from { filter: drop-shadow(0 0 28px rgba(196,30,58,0.2)); }
  to   { filter: drop-shadow(0 0 55px rgba(196,30,58,0.45)); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero-text {
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-muted);
  border-radius: 50px;
  padding: 0.35rem 1rem;
  margin-bottom: 1.2rem;
  background: rgba(212,160,23,0.06);
  animation: fade-up 0.8s cubic-bezier(.16,1,.3,1) 0.45s both;
}

.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.6rem;
  animation: fade-up 0.9s cubic-bezier(.16,1,.3,1) 0.55s both;
}
.hero-title .red { color: var(--accent); }

.hero-date {
  font-size: clamp(0.88rem, 2.2vw, 1rem);
  color: var(--muted);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
  margin-bottom: 2rem;
  animation: fade-up 0.9s cubic-bezier(.16,1,.3,1) 0.7s both;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--muted);
  animation: fade-in 1s ease 1.3s both;
}
.hero-scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%,100% { opacity: 0.3; transform: scaleY(0.7); }
  50%      { opacity: 1;   transform: scaleY(1); }
}

/* ── SECTIONS COMMON ── */
section {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.section-label-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.section-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
}
.section-title span { color: var(--accent); font-style: italic; }

/* ── TIMELINE ── */
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  position: relative;
}
.timeline-grid::before {
  content: '';
  position: absolute;
  top: 2.2rem;
  left: calc(16.66% + 0.5rem);
  right: calc(16.66% + 0.5rem);
  height: 1px;
  background: linear-gradient(to right, var(--accent), var(--gold), var(--accent));
  opacity: 0.35;
}

.tl-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: border-color 0.25s, transform 0.25s;
}
.tl-item.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.25s, box-shadow 0.25s;
}
.tl-item:nth-child(2).visible { transition-delay: 0.12s; }
.tl-item:nth-child(3).visible { transition-delay: 0.24s; }
.tl-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 1.2rem;
  box-shadow: 0 0 12px var(--accent-glow);
}
.tl-item:nth-child(2) .tl-dot { background: var(--gold); box-shadow: 0 0 12px var(--gold-muted); }
.tl-item:nth-child(3) .tl-dot { background: var(--accent); box-shadow: 0 0 18px rgba(196,30,58,0.55); }

.tl-date {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.tl-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  line-height: 1.25;
}
.tl-body {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── STATS ── */
.stats-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.stats-grid {
  display: grid;
  /* 3. kártya (325 000 km²) szélesebb, 4. (7) szűkebb — font egységes marad */
  grid-template-columns: 1fr 1fr 1.5fr 0.8fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}
.stat-item {
  background: var(--surface);
  padding: 2rem 1.5rem;
  opacity: 0;
  transform: translateY(16px);
}
.stat-item.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stat-item:nth-child(2).visible { transition-delay: 0.1s; }
.stat-item:nth-child(3).visible { transition-delay: 0.2s; }
.stat-item:nth-child(4).visible { transition-delay: 0.3s; }

.stat-number {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}
.stat-number.gold { color: var(--gold); }
.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── MAP COMPARISON ── */
.compare-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.compare-intro {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 3rem;
  margin-top: -1.25rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  align-items: end;
}

.compare-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Wrapper anchors the map to bottom of cell */
.compare-map-wrap {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 180px;
}

/* Base silhouette using CSS mask — shape only, no flag */
.compare-map {
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
  transition: filter 0.3s;
  /* Initial state for scroll animation */
  opacity: 0;
  transform: translateY(40px) scale(0.94);
}

.compare-map.map-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.3s ease;
}

.compare-item:nth-child(1) .compare-map.map-visible { transition-delay: 0s; }
.compare-item:nth-child(2) .compare-map.map-visible { transition-delay: 0.18s; }
.compare-item:nth-child(3) .compare-map.map-visible { transition-delay: 0.36s; }

/* Greater Hungary — reference size (100%) */
.compare-map.nagy {
  width: 100%;
  aspect-ratio: 1.58; /* viewBox 252.798 / 159.987 */
  background: radial-gradient(ellipse 80% 80% at 52% 50%,
    rgba(196, 30, 58, 0.65),
    rgba(196, 30, 58, 0.3) 60%,
    rgba(196, 30, 58, 0.08)
  );
  -webkit-mask-image: url('../img/nagy-magyarorszag-terkep.svg');
  mask-image: url('../img/nagy-magyarorszag-terkep.svg');
  filter: drop-shadow(0 4px 20px rgba(196,30,58,0.25));
}

/* Vienna Awards — sqrt(172000/325000) ≈ 72.7% */
.compare-map.becsi {
  width: 72.7%;
  aspect-ratio: 1.83; /* viewBox 292.929 / 159.987 */
  background: radial-gradient(ellipse 80% 80% at 52% 50%,
    rgba(212, 160, 23, 0.65),
    rgba(212, 160, 23, 0.3) 60%,
    rgba(212, 160, 23, 0.08)
  );
  -webkit-mask-image: url('../img/magyarorszag-terkep-1941-1945.svg');
  mask-image: url('../img/magyarorszag-terkep-1941-1945.svg');
  filter: drop-shadow(0 4px 20px rgba(212,160,23,0.2));
}

/* Trianon Hungary — sqrt(93028/325000) ≈ 53.5% */
.compare-map.trianon {
  width: 53.5%;
  aspect-ratio: 1.64; /* viewBox 262.353 / 159.987 */
  background: radial-gradient(ellipse 80% 80% at 52% 50%,
    rgba(45, 106, 79, 0.75),
    rgba(45, 106, 79, 0.35) 60%,
    rgba(45, 106, 79, 0.08)
  );
  -webkit-mask-image: url('../img/magyarorszag-terkep-1949-1956.svg');
  mask-image: url('../img/magyarorszag-terkep-1949-1956.svg');
  filter: drop-shadow(0 4px 20px rgba(45,106,79,0.2));
}

.compare-map:hover {
  filter: drop-shadow(0 4px 28px rgba(255,255,255,0.15)) brightness(1.15);
}

.compare-label {
  text-align: center;
  width: 100%;
}
.compare-era {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.compare-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 0.3rem;
}
.compare-area {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.compare-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.compare-badge.ref  { background: rgba(196,30,58,0.15);  color: #e07080; border: 1px solid rgba(196,30,58,0.3); }
.compare-badge.part { background: rgba(212,160,23,0.15); color: #d4a848; border: 1px solid rgba(212,160,23,0.3); }
.compare-badge.loss { background: rgba(45,106,79,0.15);  color: #5db88a; border: 1px solid rgba(45,106,79,0.3); }

/* ── CITIES ── */
.cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.city-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1rem;
  transition: border-color 0.25s, transform 0.25s;
  opacity: 0;
  transform: translateY(14px);
}
.city-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.25s, box-shadow 0.25s;
}
.city-card:nth-child(2).visible { transition-delay: 0.06s; }
.city-card:nth-child(3).visible { transition-delay: 0.12s; }
.city-card:nth-child(4).visible { transition-delay: 0.18s; }
.city-card:nth-child(5).visible { transition-delay: 0.24s; }
.city-card:nth-child(6).visible { transition-delay: 0.30s; }
.city-card:nth-child(7).visible { transition-delay: 0.36s; }
.city-card:nth-child(8).visible { transition-delay: 0.42s; }
.city-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(196,30,58,0.1);
}

.city-flag { font-size: 1.4rem; margin-bottom: 0.5rem; }
.city-hungarian {
  font-family: 'Instrument Serif', serif;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.city-arrow {
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0.2rem 0;
}
.city-modern {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.city-modern em { font-style: normal; color: var(--text); font-weight: 500; }

/* ── QUIZ ── */
.quiz-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem 1.5rem 6rem;
}
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}
.quiz-progress-bar {
  height: 3px;
  background: var(--border);
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent), var(--gold));
  transition: width 0.4s ease;
}
.quiz-body { padding: 2rem 2rem 1.5rem; }
.quiz-counter {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.quiz-question {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 1.75rem;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.quiz-opt {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Inter', sans-serif;
}
.quiz-opt:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: rgba(255,220,200,0.04);
  transform: translateX(3px);
}
.quiz-opt .opt-letter {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
  color: var(--muted);
}
.quiz-opt.correct { border-color: #2D6A4F; background: rgba(45,106,79,0.12); }
.quiz-opt.correct .opt-letter { background: #2D6A4F; color: #fff; }
.quiz-opt.wrong { border-color: rgba(196,30,58,0.6); background: rgba(196,30,58,0.08); }
.quiz-opt.wrong .opt-letter { background: var(--accent); color: #fff; }
.quiz-opt:disabled { cursor: default; }

.quiz-feedback {
  font-size: 0.83rem;
  min-height: 1.2em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.quiz-feedback.correct-msg { color: #4CAF8A; }
.quiz-feedback.wrong-msg   { color: #E06070; }

.quiz-next {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: none;
}
.quiz-next:hover { background: #a31830; transform: translateY(-1px); }
.quiz-next.show { display: block; }

.quiz-result { padding: 2.5rem 2rem; text-align: center; display: none; }
.quiz-result.show { display: block; }
.quiz-result-score {
  font-family: 'Instrument Serif', serif;
  font-size: 4rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.quiz-result-out-of { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.quiz-result-msg { font-size: 1rem; color: var(--text); margin-bottom: 2rem; line-height: 1.5; }
.quiz-restart {
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 0.75rem 1.75rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.quiz-restart:hover { background: rgba(255,220,200,0.04); border-color: var(--muted); }

/* ── FOOTER ── */
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--text); }

/* ── FADE-IN UTILITY ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .timeline-grid { grid-template-columns: 1fr; gap: 1rem; }
  .timeline-grid::before { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quiz-body { padding: 1.5rem; }
  .compare-grid { grid-template-columns: 1fr; gap: 3rem; }
  .compare-map-wrap { min-height: auto; }
  .compare-map.nagy,
  .compare-map.becsi,
  .compare-map.trianon { width: 80%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cities-grid { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 4rem; }
}
