/* Port of src/components/ui/{SectionTitle,PageHero,CustomSelect,FloatingThemeToggle}.astro styles. */

/* ─── SectionTitle ──────────────────────────────────────────────────────── */
.section-header {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 800px;
}

@media (max-width: 767px) {
  .section-header {
    margin-bottom: 20px;
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .section-header { margin-bottom: 48px; }
}

.align-center {
  align-items: center;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.align-left {
  align-items: flex-start;
  text-align: left;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--primary-hover);
  background: rgba(27, 84, 216, 0.10);
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(27, 84, 216, 0.18);
  display: inline-block;
}

.section-header .section-title {
  font-size: clamp(1.75rem, 2.2vw + 0.75rem, 2.375rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--heading);
  margin: 0;
}

@media (max-width: 767px) {
  .section-header .section-title {
    font-size: clamp(1.5rem, 4.5vw + 0.5rem, 1.85rem);
  }
}

.section-header .section-title .accent { color: var(--primary); }

.section-header .subtitle {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
  margin: 0;
  max-width: 640px;
}

@media (max-width: 767px) {
  .section-header .subtitle {
    font-size: 0.95rem;
    line-height: 1.65;
  }
}

/* ─── PageHero ──────────────────────────────────────────────────────────── */
.page-hero {
  position: relative;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding-top: calc(96px + env(safe-area-inset-top, 0px));
  padding-bottom: 20px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .page-hero {
    padding-top: calc(112px + env(safe-area-inset-top, 0px));
    padding-bottom: 56px;
  }
}

@media (min-width: 1024px) {
  .page-hero {
    padding-top: calc(128px + env(safe-area-inset-top, 0px));
    padding-bottom: 64px;
  }
}

.ph-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

@media (min-width: 768px) {
  .ph-container { gap: 40px; }
}

.ph-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  max-width: 680px;
  width: 100%;
}

@media (min-width: 768px) {
  .ph-content { gap: 10px; }
}

.ph-eyebrow-wrap {
  animation: phRevealUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.05s;
}

.ph-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(27, 84, 216, 0.18);
  padding: 6px 14px;
  border-radius: 9999px;
}

@media (min-width: 768px) {
  .ph-eyebrow-pill { font-size: 12px; }
}

[data-theme='dark'] .ph-eyebrow-pill {
  color: var(--primary);
  background: rgba(75, 138, 245, 0.1);
  border-color: rgba(75, 138, 245, 0.22);
}

.ph-title {
  font-size: clamp(1.75rem, 2.2vw + 0.75rem, 2.375rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--heading);
  margin: 0;
  max-width: 22ch;
  animation: phRevealUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.12s;
}

@media (max-width: 767px) {
  .ph-title { font-size: clamp(1.5rem, 4.5vw + 0.5rem, 1.85rem); }
}

.ph-title .accent { color: var(--primary); }

.ph-subtitle {
  font-size: clamp(0.95rem, 1vw + 0.3rem, 1.1rem);
  line-height: 1.72;
  color: var(--text);
  margin: 0;
  max-width: 56ch;
  animation: phRevealUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.2s;
}

.ph-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  animation: phRevealUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.28s;
}

.ph-badges .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  white-space: nowrap;
}

.ph-badges .hero-badge svg {
  color: var(--primary);
  flex-shrink: 0;
}

.ph-visual {
  display: flex;
  justify-content: center;
  width: 100%;
  animation: phRevealUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.3s;
}

.ph-visual img {
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  object-fit: cover;
}

.ph-visual .hero-visual-card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--heading);
}

@keyframes phRevealUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ph-eyebrow-wrap,
  .ph-title,
  .ph-subtitle,
  .ph-badges,
  .ph-visual {
    animation: none;
  }
}

/* ─── CustomSelect ──────────────────────────────────────────────────────── */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--heading);
  font-size: 15px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-select-trigger:hover { border-color: rgba(27, 84, 216, 0.35); }

.custom-select-trigger:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 84, 216, 0.12);
}

.custom-select.is-open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 84, 216, 0.12);
}

.custom-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-value.is-placeholder { color: var(--muted); }

.custom-select-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.custom-select.is-open .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.custom-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin: 4px 0 0 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.custom-select-menu[hidden] { display: none; }

.custom-select-option {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--heading);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
  background-color: var(--primary-light);
  color: var(--primary-hover);
}

.custom-select-option.is-selected {
  background-color: rgba(27, 84, 216, 0.12);
  color: var(--primary);
  font-weight: 600;
}

/* Visually hide original select but keep accessible */
select.select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* ─── FloatingThemeToggle ───────────────────────────────────────────────── */

.floating-theme-toggle {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 998;
  pointer-events: none;
}

@supports (bottom: env(safe-area-inset-bottom)) {
  .floating-theme-toggle { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 767px) {
  .floating-theme-toggle { display: none; }
}

.floating-theme-toggle .theme-toggle {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  background: var(--card);
  border-color: var(--border);
  color: var(--heading);
  box-shadow: var(--shadow-lg);
}

/* ─── Legal Pages (Impressum / Datenschutz) ────────────────────────────── */
.legal-container {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.legal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

@media (max-width: 640px) {
  .legal-card {
    padding: 20px;
    border-radius: 14px;
  }
}

.legal-card:hover {
  border-color: rgba(27, 84, 216, 0.30);
  box-shadow: var(--shadow-md);
}

.legal-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--primary);
  letter-spacing: -0.015em;
}

.legal-card p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-card a {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.2s ease;
}

.legal-card a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

