/*
 * Steuerkanzlei Martin Deppisch – Bütthard
 * Sober, professional layout: white pages, the dark green of the logo,
 * one typeface, large photo with an overlapping text card.
 * Font (self-hosted, OFL): Figtree.
 * Colours meet WCAG AA contrast (BFSG).
 */

@font-face { font-family: "Figtree"; src: url(../fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --white: #ffffff;
  --tint: #f3f5f2;
  --ink: #26302a;
  --text: #3b423d;
  --green: #2f4b37;      /* logo green */
  --green-2: #3d6a45;    /* accent, 6.3:1 on white */
  --green-dark: #243a2b;
  --rule: #dfe3dc;
  --muted: #5b6360;      /* 6.2:1 on white */
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--menu-h, 56px) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--text); font: 400 1.05rem/1.7 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-2); text-underline-offset: .2em; }
a:hover { color: var(--green); }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 3px; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; color: var(--green); margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 2 * clamp(16px, 5vw, 48px)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: .6rem 1rem; }
.skip:focus { left: 8px; }

.kicker { font: 600 .95rem/1.3 var(--sans); color: var(--green-2); margin: 0 0 .5rem; }
.kicker--center, .center { text-align: center; }
.intro { font-size: clamp(1.1rem, 1rem + .3vw, 1.22rem); color: var(--muted); max-width: 46rem; }
.center .intro { margin-inline: auto; }

/* ------------------------------------------------------------ header */
.letterhead { position: sticky; top: calc(-1 * var(--logo-h, 0px)); z-index: 40; text-align: center; padding: 1.6rem 0 0; background: var(--white); }
.letterhead__logo { display: inline-block; }
.letterhead__logo img { width: min(300px, 70vw); margin: 0 auto; }
.menu { display: flex; align-items: center; justify-content: center; background: var(--white); border-bottom: 1px solid var(--rule); margin-top: 1.2rem; transition: box-shadow .2s; }
.menu .menu__brand { display: none; flex: none; padding: 0; border: 0; }
.menu__brand img { height: 40px; width: auto; }
/* scrolled: logo and menu in one compact bar that stays at the top */
.is-stuck .menu { justify-content: space-between; gap: 1.5rem; padding-inline: max(16px, calc((100% - var(--wrap)) / 2)); box-shadow: 0 6px 20px rgb(20 35 25 / .1); }
.is-stuck .menu .menu__brand { display: block; animation: brand-in .25s ease-out; }
.is-stuck .menu ul a { padding-inline: .9rem; }
@keyframes brand-in { from { opacity: 0; transform: translateY(-6px); } }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; }
.menu a { display: block; padding: 1rem 1.2rem; font: 400 1rem/1 var(--sans); color: var(--text); text-decoration: none; border-bottom: 3px solid transparent; }
.menu a:hover, .menu a.is-active { color: var(--green); border-bottom-color: var(--green-2); }
.menu-toggle { display: none; }

/* ------------------------------------------------------------ quick contact (always visible) */
.quick { position: fixed; z-index: 45; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.quick__btn { display: flex; align-items: center; gap: .9rem; height: 52px; padding: 0 1.1rem 0 15px; background: var(--green); color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgb(20 35 25 / .18); transform: translateX(calc(100% - 52px)); transition: transform .25s ease, background-color .2s; }
.quick__btn svg { width: 22px; height: 22px; flex: none; }
.quick__btn small { display: block; font-weight: 400; font-size: .85rem; opacity: .9; }
.quick__btn > span { line-height: 1.2; }
.quick__btn:hover, .quick__btn:focus-visible { transform: none; background: var(--green-dark); color: #fff; }
.quick__btn:focus-visible { outline: 3px solid var(--green-2); outline-offset: 2px; }

/* ------------------------------------------------------------ hero: photo + overlapping card */
.hero { background: var(--white); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.hero__photo { height: clamp(260px, 52vh, 560px); overflow: hidden; border-bottom: 4px solid var(--green); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 45%; }
.hero__card { position: relative; margin-top: clamp(-9rem, -12vh, -3rem); background: var(--white); box-shadow: 0 12px 40px rgb(20 35 25 / .14); }
.hero__text { padding: clamp(1.8rem, 5vw, 3.4rem) clamp(1.4rem, 6vw, 5rem) clamp(1.6rem, 4vw, 2.6rem); }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); margin-bottom: .2rem; }
.hero__sub { font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); font-weight: 500; color: var(--green-2); margin-bottom: 1.4rem; }
.hero__text > p:not(.hero__sub) { max-width: 52rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.btn { display: inline-flex; align-items: center; gap: .55rem; padding: .8rem 1.4rem; font: 600 .98rem/1 var(--sans); text-decoration: none; border: 1.5px solid var(--green); border-radius: 2px; transition: background .2s, color .2s; }
.btn svg { width: 18px; height: 18px; }
.btn--solid { background: var(--green); color: #fff; }
.btn--solid:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn--line { color: var(--green); background: transparent; }
.btn--line:hover { background: var(--green); color: #fff; }

.hero__tiles { background: var(--tint); padding: clamp(1rem, 3vw, 1.8rem) clamp(1rem, 6vw, 5rem); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.7rem, 2vw, 1.4rem); }
.tiles a { display: block; color: var(--green); text-decoration: none; font-weight: 600; background: var(--white); border: 1px solid var(--rule); transition: border-color .2s, box-shadow .2s; }
.tiles img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.tiles span { display: flex; justify-content: space-between; align-items: center; padding: .65rem .9rem; font-size: 1.02rem; }
.tiles span::after { content: "›"; font-size: 1.4rem; line-height: 1; color: var(--green-2); }
.tiles a:hover, .tiles a:focus-visible { border-color: var(--green-2); box-shadow: 0 6px 18px rgb(20 35 25 / .1); }

/* ------------------------------------------------------------ welcome */
.welcome { background: var(--tint); padding: clamp(3rem, 6vw, 4.5rem) 0; }
.welcome__grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.welcome figure { margin: 0; }
.welcome img { width: 220px; height: 275px; object-fit: cover; }
.welcome figcaption { margin-top: .8rem; font-size: .95rem; color: var(--muted); }
.welcome blockquote { margin: 0; font-size: clamp(1.2rem, 1rem + .7vw, 1.55rem); line-height: 1.55; color: var(--ink); padding-left: 1.4rem; border-left: 4px solid var(--green-2); }
.welcome .facts { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin-top: 1.6rem; font-weight: 500; color: var(--green); }
.welcome .facts span::before { content: "✓"; color: var(--green-2); margin-right: .5rem; }

/* ------------------------------------------------------------ sections */
.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section--tint { background: var(--tint); }
.head { margin-bottom: clamp(2rem, 4vw, 3rem); }

/* Services */
.register { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.8rem); }
.register__col { background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--green); padding: 1.6rem 1.6rem 1rem; }
.register__col p { color: var(--muted); }
.register ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.register li { padding: .55rem 0; border-top: 1px solid var(--rule); hyphens: auto; overflow-wrap: break-word; }

/* Focus areas: tabs */
.tabs { display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--white); border: 1px solid var(--rule); }
.tabs__list { display: flex; flex-direction: column; border-right: 1px solid var(--rule); background: var(--white); }
.tabs__btn { appearance: none; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: left; padding: 1.2rem 1.4rem; cursor: pointer; display: grid; grid-template-columns: 30px 1fr; gap: .8rem; align-items: center; font: 600 1rem/1.3 var(--sans); color: var(--text); transition: background .2s; }
.tabs__btn svg { width: 26px; height: 26px; color: var(--green-2); }
.tabs__btn small { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.tabs__btn:hover { background: var(--tint); }
.tabs__btn[aria-selected="true"] { background: var(--tint); color: var(--green); box-shadow: inset 4px 0 0 var(--green-2); }
.tabs__panel[hidden] { display: none; }
.tabs__img { width: 100%; height: clamp(160px, 22vw, 260px); object-fit: cover; }
@media (min-width: 961px) { .tabs__img { height: var(--tablist-h, 260px); } }
.tabs__body { padding: clamp(1.6rem, 4vw, 2.4rem); }
.tabs__panel h3 { font-size: 1.7rem; }
.tabs__panel .badge { display: inline-block; margin-bottom: .8rem; font: 600 .8rem/1 var(--sans); color: var(--green-2); background: var(--tint); border: 1px solid var(--rule); padding: .4rem .6rem; }
.tabs__panel ul { list-style: none; padding: 0; margin: 1.2rem 0 0; columns: 2 15rem; column-gap: 2.4rem; }
.tabs__panel li { break-inside: avoid; padding: .3rem 0 .3rem 1.3rem; position: relative; }
.tabs__panel li::before { content: ""; position: absolute; left: 0; top: .85rem; width: 6px; height: 6px; background: var(--green-2); }
.tabs__extra { margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }

/* About: career milestones */

/* Careers */
.careers { background: var(--green); color: #e9eee8; padding: clamp(3.5rem, 7vw, 5rem) 0; }
.careers__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.careers h2 { color: #fff; font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.careers .kicker { color: #cfe0cc; }
.careers p { margin: 0; }
.careers__list { list-style: none; margin: 0; padding: 0; }
.careers__list a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgb(255 255 255 / .35); color: #fff; text-decoration: none; font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem); }
.careers__list a::after { content: "›"; font-size: 1.8rem; line-height: 1; }
.careers__list a:hover { color: #cfe0cc; }

/* Service */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.linklist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.linklist a { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem .2rem; border-bottom: 1px solid var(--rule); text-decoration: none; font-weight: 500; }
.linklist a::after { content: "›"; font-size: 1.3rem; line-height: 1.2; }

/* Directions */
.route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.route ol { counter-reset: s; list-style: none; padding: 0; margin: 1.6rem 0 0; }
.route li { counter-increment: s; position: relative; padding: 0 0 1.2rem 3rem; }
.route li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 600; font-size: .95rem; }
.mapbook { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mapbook figure { margin: 0; background: var(--white); padding: .6rem; border: 1px solid var(--rule); }
.mapbook figcaption { font-size: .92rem; color: var(--muted); text-align: center; margin-top: .4rem; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.card { background: var(--tint); border-top: 4px solid var(--green); padding: clamp(1.6rem, 4vw, 2.4rem); }
.card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .8rem 1.4rem; }
.card dt { font-weight: 600; color: var(--muted); }
.card dd { margin: 0; font-size: 1.15rem; font-weight: 500; color: var(--green); }
.card dd a { text-decoration: none; }

/* Footer */
.foot { background: var(--green-dark); color: #d6ddd4; padding: 2.4rem 0; font-size: .92rem; }
.foot__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; }
.foot a { color: #fff; text-decoration: none; }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; min-width: 0; }
.foot a:hover { text-decoration: underline; }
.foot__social { display: flex; gap: .7rem; }
.foot__social:empty { display: none; }
.foot .foot__icon { margin: 0; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid rgb(255 255 255 / .45); border-radius: 50%; }
.foot__icon svg { width: 20px; height: 20px; }
.foot__icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.foot .foot__icon:hover { background: rgb(255 255 255 / .12); }

/* Legal pages */
.page-title { text-align: center; padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem); background: var(--tint); margin-bottom: 2.5rem; }
.page-title h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); margin: 0; }
.legal { max-width: 46rem; margin-inline: auto; padding-bottom: 5rem; }
.legal--wide { max-width: 60rem; }
.legal h2 { font-size: 1.5rem; margin-top: 2.4rem; }
.legal h3 { font-size: 1.2rem; margin-top: 1.6rem; }
.legal ul, .legal ol { padding-left: 1.3rem; }
.legal .stand { color: var(--muted); font-size: .9rem; margin-top: 3rem; }

/* Image credits */
.credits { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1rem 0 2rem; }
.credits td { padding: .9rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.credits td:first-child { width: 160px; padding-left: 0; }
.credits img { width: 140px; height: 94px; object-fit: cover; background: var(--white); }
.credits img.contain { object-fit: contain; }
.credits .muted { color: var(--muted); font-size: .88rem; }

/* Lightbox */
a.zoom { display: block; cursor: zoom-in; position: relative; }
a.zoom::after { content: "⤢"; position: absolute; right: .5rem; bottom: .5rem; width: 34px; height: 34px; display: grid; place-items: center; background: rgb(47 75 55 / .85); color: #fff; font-size: 1.1rem; border-radius: 50%; opacity: 0; transition: opacity .2s; }
a.zoom:hover::after, a.zoom:focus-visible::after { opacity: 1; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 1000px); max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgb(20 30 24 / .85); }
.lightbox img { max-width: 100%; max-height: 74vh; width: auto; margin: 0 auto; background: var(--white); padding: 8px; }
.lightbox__caption { margin: .8rem auto 0; width: fit-content; max-width: 100%; padding: .35rem .8rem; text-align: center; color: #fff; background: var(--green-dark); font-size: 1rem; }
.lightbox__close { position: absolute; top: -1rem; right: -1rem; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--white); color: var(--green); font: 600 1.5rem/1 var(--sans); cursor: pointer; box-shadow: 0 4px 14px rgb(0 0 0 / .3); }
.lightbox__close:hover { background: var(--tint); }
.lightbox__nav { display: flex; justify-content: center; gap: .8rem; margin-top: .9rem; }
.lightbox__nav button { appearance: none; border: 1.5px solid #fff; background: transparent; color: #fff; padding: .6rem 1.1rem; font: 600 .9rem/1 var(--sans); cursor: pointer; transition: background .2s, color .2s; }
.lightbox__nav button:hover, .lightbox__nav button:focus-visible { background: #fff; color: var(--green); }
.lightbox__nav button[hidden] { display: none; }

/* ------------------------------------------------------------ responsive */
@media (min-width: 761px) { .welcome blockquote { text-align: justify; -webkit-hyphens: auto; hyphens: auto; } }
@media (max-width: 960px) {
  .register { grid-template-columns: minmax(0, 1fr); }
  .tabs { grid-template-columns: 1fr; }
  .tabs__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 0; border-bottom: 1px solid var(--rule); }
  .tabs__btn { min-width: 0; border-bottom: 1px solid var(--rule); grid-template-columns: 24px minmax(0, 1fr); padding: 1rem; }
  .tabs__btn:nth-child(odd) { border-right: 1px solid var(--rule); }
  .tabs__btn:nth-last-child(-n+2) { border-bottom: 0; }
  .tabs__btn small { display: none; }
  .tabs__btn[aria-selected="true"] { box-shadow: inset 0 -4px 0 var(--green-2); }
  .duo, .route, .contact, .careers__grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .tabs__btn { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: .35rem; padding: .8rem .4rem; font-size: .95rem; }
  .tabs__btn svg { width: 24px; height: 24px; }
}
/* burger menu: below this the stuck bar (small logo + menu) no longer fits in one line */
@media (max-width: 880px) {
  .menu-toggle { display: flex; width: 100%; justify-content: center; gap: .7rem; align-items: center; padding: .9rem; background: none; border: 0; font: 600 1rem/1 var(--sans); color: var(--green); cursor: pointer; }
  .menu-toggle span { width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  .js .menu ul { display: none; flex-direction: column; text-align: center; padding-bottom: .6rem; }
  .js .menu.is-open ul { display: flex; }
  .menu { flex-wrap: wrap; }
  .menu ul { flex-basis: 100%; }
  .is-stuck .menu { gap: 0; }
  .is-stuck .menu-toggle { width: auto; padding-inline: .4rem; }
  .is-stuck .menu__brand img { height: 34px; }
}
@media (max-width: 760px) {
  /* quick contact as a bar at the bottom of the screen */
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .quick { top: auto; bottom: 0; left: 0; transform: none; flex-direction: row; gap: 0; padding-bottom: env(safe-area-inset-bottom); background: var(--green); box-shadow: 0 -4px 16px rgb(20 35 25 / .15); }
  .quick__btn { flex: 1; min-width: 0; justify-content: center; gap: .5rem; height: 56px; padding: 0 .5rem; transform: none; box-shadow: none; }
  .quick__btn + .quick__btn { border-left: 1px solid rgb(255 255 255 / .22); }
  .quick__btn small, .quick__more, .quick__btn--social { display: none; }
  .hero__photo { height: 220px; }
  .hero__card { margin-top: 0; width: 100%; box-shadow: none; }
  .hero__text { padding: 1.6rem 16px; }
  .hero__tiles { padding: 1rem 16px; }
  .welcome__grid { grid-template-columns: 1fr; }
    .credits, .credits tbody, .credits tr, .credits td { display: block; }
  .credits tr { border-bottom: 1px solid var(--rule); padding: .8rem 0; }
  .credits td { border: 0; padding: .2rem 0; }
}
@media (max-width: 480px) {
  .mapbook { grid-template-columns: 1fr; }
  .card dl { grid-template-columns: 1fr; gap: .1rem; }
  .card dd { margin-bottom: .7rem; }
  .foot nav { gap: .5rem 1.2rem; }
  .lightbox__close { top: .5rem; right: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .menu, .actions, .menu-toggle, .hero__photo, .hero__tiles, .quick { display: none !important; }
  .letterhead { position: static; }
  .careers, .foot { background: #fff; color: #000; }
  .hero__card { margin: 0; box-shadow: none; }
}

/* Text for screen readers only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Heilberufe: show the lower part with the sharp chest piece of the stethoscope */
#panel-heilberufe .tabs__img { object-position: 50% 70%; }
