/* ALPATAI project site — shared stylesheet */

:root {
  --bg: #fafaf8;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #4a483f;
  --accent: #23405f;
  --accent-hover: #16283b;
  --border: #b3ac9a;
  --border-soft: #d6d1c3;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --max-width: 875px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

/* --- language toggle plumbing --- */
[data-lang] { display: none; }
html[data-active-lang="de"] [data-lang="de"] { display: revert; }
html[data-active-lang="en"] [data-lang="en"] { display: revert; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-hover); }

/* --- layout --- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 248, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

header.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}

nav.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

nav.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}
nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--accent);
}

#lang-toggle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--text);
}
#lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

main { padding: 40px 0 20px; }

section { margin-bottom: 48px; }

section h2 {
  font-size: 1.4rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* --- hero --- */
.hero {
  position: relative;
  margin: 8px 0 44px;
  padding: 40px 32px 32px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(44, 74, 110, 0.16), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(44, 74, 110, 0.12), transparent 38%),
    radial-gradient(circle at 55% 95%, rgba(44, 74, 110, 0.10), transparent 45%);
  background-size: 160% 160%;
  background-position: 0% 0%;
  animation: heroDrift 20s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero .tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0;
}

@keyframes heroDrift {
  0%   { background-position: 0% 10%; }
  100% { background-position: 100% 60%; }
}

.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.stat-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.collage-row-wrap {
  position: relative;
  margin: 0 0 44px;
}
.collage-row-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 14px;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--bg) 75%);
  pointer-events: none;
}
.collage-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.collage-row::-webkit-scrollbar {
  height: 7px;
}
.collage-row::-webkit-scrollbar-track {
  background: var(--border-soft);
  border-radius: 4px;
}
.collage-row::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
.collage-row::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}
.collage-tile {
  flex: 0 0 auto;
  width: 130px;
  height: 98px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.collage-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.collage-tile:hover,
.collage-tile.is-active {
  transform: translateY(-3px) scale(1.06);
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(35, 64, 95, 0.18), 0 10px 22px rgba(26, 26, 26, 0.2);
  z-index: 1;
}
@media (max-width: 600px) {
  .collage-tile { width: 108px; height: 81px; }
  .collage-row-wrap::after { width: 32px; }
}

.hero-features-toggle {
  margin-top: 22px;
}
.features-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.features-toggle-btn:hover { color: var(--accent-hover); }
.features-toggle-btn .chevron {
  transition: transform 0.28s ease;
}
.features-toggle-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}
.features-toggle-btn[aria-expanded="true"] .label-show,
.features-toggle-btn:not([aria-expanded="true"]) .label-hide {
  display: none;
}

.hero-features {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  transition: max-height 0.38s ease, opacity 0.3s ease, margin-top 0.38s ease, padding-top 0.38s ease, border-color 0.38s ease;
}
.hero-features.is-open {
  opacity: 1;
  margin-top: 22px;
  padding-top: 22px;
  border-top-color: var(--border);
}
@media (prefers-reduced-motion: reduce) {
  .hero-features { transition: none; }
  .features-toggle-btn .chevron { transition: none; }
}
.feature-group {
  flex: 1 1 140px;
  min-width: 140px;
}
.feature-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.feature-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
}
.feature-tags li {
  padding: 4px 0;
}
.feature-tags li + li {
  border-top: 1px dashed var(--border-soft);
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}

ul.goals { padding-left: 1.2em; }
ul.goals li { margin-bottom: 6px; }

.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}
.team-member {
  min-width: 160px;
  max-width: 200px;
}
.team-member .avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 10px;
  border: 1px solid var(--border-soft);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.team-member:hover .avatar {
  transform: scale(1.06);
  border-color: var(--accent);
}
.team-member .name {
  font-weight: 600;
}
.team-member .affiliation {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.team-member .team-contact {
  font-size: 0.88rem;
  margin-top: 4px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card + .card { margin-top: 14px; }
.card.placeholder {
  color: var(--text-muted);
  font-style: italic;
}
.card:not(.placeholder):hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(26, 26, 26, 0.1);
  border-color: var(--accent);
}

ul.post-list, ul.paper-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.post-list li, ul.paper-list li { margin-bottom: 14px; }

.post-meta, .paper-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 2px 0 8px;
}

.paper-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.paper-abstract {
  margin-top: 10px;
  color: var(--text-muted);
  line-height: 1.6;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin-top: 12px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: #fff; }

.link-muted {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.embed-wrap {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.embed-wrap iframe {
  display: block;
  width: 100%;
  height: 700px;
  border: 0;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
footer.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.92rem;
}

/* --- parliament map --- */
.about-row {
  display: flex;
  align-items: flex-start;
  gap: 36px;
  flex-wrap: wrap;
}
.about-text {
  flex: 1 1 320px;
  min-width: 260px;
}
.about-row .parl-map-wrap {
  flex: 1 1 300px;
  max-width: 380px;
  margin: 4px 0 0;
}

.parl-map-wrap {
  position: relative;
  max-width: 420px;
  margin: 8px auto 0;
}
.parl-map {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.state-path {
  fill: #f1eee3;
  stroke: #8f8a79;
  stroke-width: 1.8;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease;
}
.state-path.is-active {
  fill: #dbe3ea;
  stroke: var(--accent);
}
.parl-dot {
  fill: var(--accent);
  stroke: var(--bg-card);
  stroke-width: 2;
  cursor: pointer;
  transition: r 0.15s ease, fill 0.15s ease;
  outline: none;
}
.parl-dot:hover,
.parl-dot:focus-visible,
.parl-dot.is-active {
  fill: var(--accent-hover);
  r: 9;
}
.parl-dot--bundestag {
  fill: #8a5a2c;
}
.parl-dot--bundestag:hover,
.parl-dot--bundestag:focus-visible,
.parl-dot--bundestag.is-active {
  fill: #6e4620;
}
@keyframes dotPop {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.reveal.is-visible .parl-dot {
  animation: dotPop 0.3s ease-out both;
}
.parl-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: var(--text);
  color: var(--bg);
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  box-shadow: 0 6px 16px rgba(26, 26, 26, 0.18);
}
.parl-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.parl-tooltip-name { font-weight: 600; }
.parl-tooltip-parl {
  opacity: 0.8;
  font-size: 0.78rem;
}
.map-caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
}
@media (prefers-reduced-motion: reduce) {
  .reveal.is-visible .parl-dot { animation: none; }
}

/* --- scroll-reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 600px) {
  header.site-header .wrap { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 1.6rem; }
  .hero { padding: 28px 20px 24px; }
  .hero-stats { gap: 24px; }
  .embed-wrap iframe { height: 480px; }
  .about-row .parl-map-wrap { max-width: 380px; margin: 8px auto 0; flex-basis: 100%; }
}
