/**
 * main.css
 * Custom styles for Verhaltenstierärztliche Praxis Berlin.
 * Loaded after tailwind.css and fonts.css on all pages.
 */

/* ── Base ─────────────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
}

/* ── Sticky header ────────────────────────────────────────────────────── */

#site-header {
  transition: background 0.3s, box-shadow 0.3s;
}

#site-header.scrolled {
  background: rgba(13, 21, 32, 0.97) !important;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

/* ── Nav link underline ───────────────────────────────────────────────── */

.nav-link {
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #437a47;
  transition: width 0.25s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Active-page indicator: persistent forest-300 underline on the current page link. */
.nav-link[aria-current="page"] {
  color: #f1f5f1;
}

.nav-link[aria-current="page"]::after {
  width: 100%;
  background: #8fb691;
}

/* ── Desktop nav dropdown (Praxis ▾) ──────────────────────────────────── */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-dropdown-trigger .chevron {
  width: 0.75rem;
  height: 0.75rem;
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-trigger .chevron {
  transform: rotate(180deg);
}

.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 200px;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  background: #0d1520;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}

/* Hover-bridge: invisible area between trigger and panel so the panel
   does not snap shut while the cursor crosses the gap. */
.nav-dropdown-panel::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.nav-dropdown.is-open .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  color: #d6d3d1;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible {
  color: #f1f5f1;
  background: rgba(67, 122, 71, 0.14);
  outline: none;
}

/* ── Mobile drawer sub-items (indented, muted) ────────────────────────── */

.mobile-sub {
  display: block;
  padding: 0.375rem 0 0.375rem 1rem;
  font-size: 0.75rem;
  color: #a8a29e;
  transition: color 0.15s ease;
}

.mobile-sub:hover {
  color: #e7e5e4;
}

/* ── Language toggle ──────────────────────────────────────────────────── */

.lang-btn.active {
  color: #f1f5f1;
  border-bottom: 2px solid #437a47;
}

/* ── Scroll reveal ────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Custom accent rule ───────────────────────────────────────────────── */

.rule-accent {
  display: block;
  width: 48px;
  height: 2px;
  background: #437a47;
  margin-bottom: 1.25rem;
}

/* ── Hero grain overlay ───────────────────────────────────────────────── */

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* ── Credential badge shimmer ─────────────────────────────────────────── */

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.badge-shimmer {
  background: linear-gradient(90deg, #f1f5f1 25%, #dce9dc 50%, #f1f5f1 75%);
  background-size: 800px 100%;
  animation: shimmer 2.8s infinite linear;
}

/* ── Service card hover lift ──────────────────────────────────────────── */

.service-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(26, 37, 53, 0.14);
}

/* ── Partner card hover lift ──────────────────────────────────────────── */

.partner-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.partner-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(26, 37, 53, 0.10);
}

/* ── Download cards (Patienten section on /downloads) ──────────────────
   Same micro-interaction as the partner cards, kept as its own selector
   so future styling can diverge without affecting the partner page. */

.download-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.download-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(26, 37, 53, 0.10);
}

/* ── Form focus ring ──────────────────────────────────────────────────── */

.form-field:focus {
  outline: none;
  border-color: #437a47;
  box-shadow: 0 0 0 3px rgba(67, 122, 71, 0.18);
}

/* ── Seminar cards (seminars.html) ────────────────────────────────────── */

.seminar-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.seminar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(26, 37, 53, 0.12);
}

.seminar-card .category-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #437a47;            /* forest-500 */
  background: #ecf3ec;       /* forest-50 */
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Cards use <button class="card-cta">; reset native button chrome
   so it inherits the inline-flex link styling without a pill background. */
.seminar-card .card-cta {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.seminar-card .card-cta:focus-visible {
  outline: 2px solid #437a47;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Floating CTA (seminars.html) ─────────────────────────────────────── */

.fab {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.fab.is-ready {
  opacity: 1;
  transform: none;
}

.fab.fab--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.fab:focus-visible {
  outline: 2px solid #f1f5f1;
  outline-offset: 3px;
}

/* Shrink to icon-pill on very small screens so it doesn't cover content. */
@media (max-width: 380px) {
  .fab span,
  .fab > :not(svg) {
    display: none;
  }
  .fab {
    padding: 0.875rem;
  }
}

/* ── Progressive form field (seminars.html) ───────────────────────────── */

.field-progressive {
  display: none;
}

.field-progressive.is-visible {
  display: block;
}

/* ── About page (about.html) ──────────────────────────────────────────── */

/* Body prose for the biography & philosophy sections. Larger and more
   generous than .prose (which is tuned for dense legal text). */
.about-prose p {
  font-size: 1rem;
  color: #475569;            /* slate-600 */
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.about-prose p:last-child {
  margin-bottom: 0;
}

/* Inline figure inside .about-prose. Capped at the photo's native width
   (640 px) so it never upscales. Tight rounded corners + subtle shadow. */
.about-figure {
  margin: 2.5rem auto;
  max-width: 640px;
}

.about-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(26, 37, 53, 0.18);
}

.about-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #64748b;                    /* slate-500 */
  text-align: center;
  font-style: italic;
}

/* Pull-quote treatment for the three quotes in the Philosophie section.
   A left forest accent rail, italic serif voice, attribution underneath. */
.about-quote {
  margin: 2.25rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid #437a47;   /* forest-500 */
}

.about-quote blockquote {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.4;
  color: #1e293b;                    /* slate-800 */
  margin: 0;
}

@media (min-width: 640px) {
  .about-quote blockquote {
    font-size: 1.5rem;
  }
}

.about-quote blockquote::before { content: '\201C'; margin-right: 0.05em; }
.about-quote blockquote::after  { content: '\201D'; margin-left: 0.05em; }

.about-quote figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #437a47;                    /* forest-500 */
}

/* ── Credits page (credits.html) ──────────────────────────────────────── */

/* Each row: thumbnail on the left, metadata on the right.
   Stacks vertically below sm. */
.credits-card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  background: #ffffff;
  border: 1px solid #e7e5e4;       /* stone-200 */
  border-radius: 12px;
  padding: 1rem 1.125rem;
}

@media (min-width: 640px) {
  .credits-card {
    flex-direction: row;
    align-items: center;
    gap: 1.125rem;
  }
}

.credits-thumb {
  display: block;
  width: 100%;
  max-width: 140px;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #f5f5f4;             /* stone-100 */
}

.credits-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

a.credits-thumb {
  transition: transform 0.18s ease;
}

a.credits-thumb:hover {
  transform: scale(1.02);
}

.credits-meta {
  flex: 1;
  min-width: 0;
}

.credits-where {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;                  /* slate-800 */
  margin-bottom: 0.25rem;
}

.credits-author {
  font-size: 0.8125rem;
  color: #475569;                  /* slate-600 */
  margin-bottom: 0.125rem;
}

.credits-license {
  font-size: 0.75rem;
  color: #64748b;                  /* slate-500 */
}

.credits-license a {
  color: #437a47;                  /* forest-500 */
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.credits-license a:hover {
  color: #326137;                  /* forest-700 */
}

/* ── Prose (legal pages) ──────────────────────────────────────────────── */

.prose h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  color: #1e293b;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.prose ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.prose ul li {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.75;
}

.prose a {
  color: #437a47;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: #326137;
}

.prose strong {
  color: #334155;
  font-weight: 600;
}

.prose .divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2rem 0;
}
