/*
Theme Name: TechSis
Theme URI: https://techsis.ch
Author: TechSis
Description: Schlankes Einzweck-Theme für die TechSis-Website. Eine Startseite, drei Rechtsseiten, ein Kontaktformular. Kein Baukasten, keine Fremd-Plugins.
Version: 3.11.0
Requires PHP: 8.0
Text Domain: techsis
*/

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
  /* Eingabefelder dürfen die Rasterspalte nicht sprengen */
  #kontakt form label, #kontakt form > * { min-width: 0; }
  #kontakt form input, #kontakt form textarea, #kontakt form select { width: 100%; min-width: 0; max-width: 100%; }

body { margin: 0; overflow-x: hidden; background: #FBFAF8; color: #33283A; font-family: Outfit, 'Noto Sans Thai', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: #D2617E; text-decoration: none; }
a:hover { color: #33283A; }
input, textarea, select, button { font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; }

/* Umbruch: Thai kennt keine Wortabstände, lange Adressen brauchen Bruchstellen */
p, span, a, h1, h2, h3, h4, li { overflow-wrap: break-word; }
/* Thai-Schrift auf jeder Seite — die Datei lädt nur, wenn thailändische Zeichen vorkommen */
[lang="th"] { font-family: 'Noto Sans Thai', Outfit, system-ui, sans-serif; overflow-wrap: anywhere; word-break: break-word; line-height: 1.7; }
[style*="IBM Plex Mono"] { font-family: 'IBM Plex Mono', 'Noto Sans Thai', monospace !important; }

/* Zustände, die im Markup nicht als style-Attribut möglich sind */
.tx-cta:hover { background: #33283A !important; color: #FFFFFF !important; }
.tx-ghost:hover { box-shadow: inset 0 0 0 1px #33283A !important; color: #33283A !important; }
.tx-arrow:hover { color: #FFFFFF !important; }
.tx-dl-light:hover { background: #E9A98C !important; color: #33283A !important; }
.tx-dl-dark:hover, .tx-web:hover { background: rgba(255,255,255,0.22) !important; color: #FFFFFF !important; }
.tx-tel:hover { background: rgba(255,255,255,0.18) !important; color: #FFFFFF !important; }
.tx-close:hover { background: #33283A !important; color: #FFFFFF !important; }
.tx-submit:hover { background: #33283A !important; }
.tx-legal-link:hover { color: #D2617E !important; }
.tx-field:focus { box-shadow: inset 0 0 0 2px #D2617E !important; }
header a:hover, footer a:hover { color: #D2617E; }

/* Sichtbarkeit der Rechtstexte steuert JavaScript */
.tx-hidden { display: none !important; }
.tx-chip[aria-pressed="true"] { background: #33283A !important; color: #FFFFFF !important; }
.tx-tab[aria-selected="true"] { background: #33283A !important; color: #FFFFFF !important; }

/* Fliesstext der Rechtsseiten, gesetzt aus dem WordPress-Editor */
.tx-legal-body h2, .tx-legal-body h3 { margin: 28px 0 8px; font-size: 18px; font-weight: 500; }
.tx-legal-body p, .tx-legal-body li { margin: 0 0 10px; font-size: 15px; line-height: 1.7; color: #55504A; max-width: 780px; text-wrap: pretty; }
.tx-legal-body ul { padding-left: 20px; }
.tx-legal-body :first-child { margin-top: 0; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

section { scroll-margin-top: 76px; }

@media (pointer: coarse) {
  header nav a, footer button, #kontakt form button, #fernhilfe a, #bereiche a,
  .tx-tuer, .tx-chip, .tx-tab, #techsis-rechner button { min-height: 44px; }
  footer button { display: inline-flex; align-items: center; }
  #kontakt form label div button { min-height: 44px; }
}

.tx-tuer:hover { filter: brightness(0.95); }

@media (max-width: 1100px) {
  #top, #fernhilfe > div, #sprachen > div, #ablauf > div, #kontakt > div { grid-template-columns: 1fr !important; }
  #bereiche > div > div:last-child { grid-template-columns: 1fr !important; }
  #top { gap: 40px !important; }
  #fernhilfe > div, #sprachen > div, #ablauf > div, #kontakt > div { gap: 40px !important; }
  #kontakt form { grid-template-columns: 1fr !important; }
  #kontakt form label, #kontakt form > div, #kontakt form fieldset { grid-column: auto !important; }
  #ablauf > div > div:first-child { order: 2; }
  #top > div:last-child { height: 420px !important; }
  /* Zweispaltige Blöcke im Sprachdienst und in der Kostenschätzung */
  #kosten > div:last-child, #kosten div[style*="grid-template-columns"],
  #bereiche div[style*="minmax(0, 1fr) minmax(0, 1fr)"], #bereiche div[style*="minmax(0px, 1fr) minmax(0px, 1fr)"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 900px) {
  section, footer { padding-left: 32px !important; padding-right: 32px !important; }
  #top { padding-top: 64px !important; padding-bottom: 72px !important; }
  #top h1 { font-size: 46px !important; }
  #start h1, #sprachen h1 { font-size: 40px !important; }
  h2 { font-size: 34px !important; }
  #leistungen, #fernhilfe, #sprachen, #bereiche, #ablauf, #kontakt, #rechtliches { padding-top: 72px !important; padding-bottom: 72px !important; }
  #bereiche > div { gap: 52px !important; }
}

@media (max-width: 620px) {
  header { flex-wrap: wrap; padding: 12px 20px 10px !important; gap: 10px !important; }
  footer button { min-height: 44px; display: inline-flex; align-items: center; }
  #kontakt form label div button { min-height: 44px; }
  #fernhilfe a, #top a { min-height: 44px; }
  section, footer { padding-left: 20px !important; padding-right: 20px !important; }
  #top { padding-top: 48px !important; padding-bottom: 56px !important; }
  #top h1 { font-size: 38px !important; }
  h2 { font-size: 30px !important; }
  #leistungen, #fernhilfe, #sprachen, #bereiche, #ablauf, #kontakt, #rechtliches { padding-top: 56px !important; padding-bottom: 56px !important; }
  #start { padding: 48px 20px 56px !important; gap: 32px !important; }
  #start a.tx-tuer { padding: 28px !important; min-height: 0 !important; }
  #start h2 { font-size: 26px !important; }
  #sprachen h1 { font-size: 32px !important; }
  #bereiche > div { gap: 44px !important; }
  #bereiche h2 { font-size: 26px !important; }
  #top > div:last-child { height: 300px !important; }
  #top > div:last-child > div:last-child { left: 0 !important; bottom: 16px !important; }
  #ablauf > div > div:first-child { height: 260px !important; }
  #kontakt form, #fernhilfe > div > div:last-child, #sprachen > div > div:last-child { padding: 24px !important; }
  #bereiche > div > div:last-child > div { padding: 24px !important; }
  #akkreditiert { padding: 18px 20px !important; }
  #sprachen a, #bereiche a { overflow-wrap: anywhere; }
  #start h1, #sprachen h1 { font-size: 32px !important; }
  #rechtliches > div > div { padding: 28px 22px !important; }
  #rechtliches > div > div:first-child { padding: 0 !important; flex-wrap: wrap; }
  #rechtliches h2 { font-size: 26px !important; }
  #kontakt form input, #kontakt form textarea { font-size: 16px !important; }
  #fernhilfe a[href*="rustdesk"] { flex: 1 1 auto; justify-content: center; }
  /* iOS zoomt bei Feldern unter 16 px in die Seite hinein */
  #techsis-rechner input, #techsis-rechner select, #techsis-rechner textarea { font-size: 16px !important; }
  /* LINE-Zeile darf umbrechen, sonst schiebt der QR-Block über den Rand */
  #bereiche div[style*="align-items: center"][style*="gap: 18px"] { flex-wrap: wrap; }
  #bereiche div[style*="align-items: center"][style*="gap: 18px"] > * { min-width: 0; }
  #techsis-rechner { padding: 20px !important; }
  #techsis-rechner > div { gap: 18px !important; }
}

@media (max-width: 400px) {
  #top h1 { font-size: 32px !important; }
  #start h1, #sprachen h1 { font-size: 28px !important; }
  #bereiche > div > div:last-child > div { padding: 24px !important; }
  #sprachen > div > div:last-child { padding: 24px !important; }
  #top p { font-size: 17px !important; }
  h2 { font-size: 26px !important; }
  #top a[href="#kontakt"], #top a[href="#leistungen"] { flex: 1 1 100%; justify-content: center; text-align: center; }
  footer > div > div:first-child { gap: 28px !important; }
  #top > div:first-child > div:first-child { padding: 7px 12px !important; }
  #top > div:first-child > div:first-child span:last-child { font-size: 10px !important; letter-spacing: 0.05em !important; }
  #start .tx-tuer { padding: 24px !important; }
  #start h2 { font-size: 24px !important; }
  #akkreditiert { padding: 16px 18px !important; }
}

/* Kostenschätzung: auf schmalen Geräten einspaltig */
@media (max-width: 900px) {
  #techsis-rechner { grid-template-columns: minmax(0, 1fr) !important; padding: 22px !important; }
}
@media (max-width: 700px) {
  #kosten { padding-left: 20px !important; padding-right: 20px !important; }
}

/* ── Menü für schmale Geräte ─────────────────────────────────── */
.tx-burger { display: none; }
.tx-burger-bars { display: flex; flex-direction: column; gap: 4px; }
.tx-burger-bars span { display: block; width: 20px; height: 3px; border-radius: 2px; background: #33283A; transition: transform 0.18s ease, opacity 0.18s ease; }
.tx-burger-bars span:nth-child(2) { width: 14px; background: #D2617E; }

@media (max-width: 1000px) {
  header { flex-wrap: wrap; }
  .tx-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: auto;
    border: 0; border-radius: 999px; background: #F3EDE9; cursor: pointer; padding: 0;
  }
  header.tx-offen .tx-burger-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  header.tx-offen .tx-burger-bars span:nth-child(2) { opacity: 0; }
  header.tx-offen .tx-burger-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  header nav.tx-nav {
    display: none !important; width: 100%;
    flex-direction: column; align-items: stretch !important;
    gap: 2px !important; padding: 6px 0 4px;
    border-top: 1px solid #EDE9E4; margin-top: 4px;
    max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain;
  }
  header.tx-offen nav.tx-nav { display: flex !important; }
  header nav.tx-nav a {
    min-height: 48px; display: flex; align-items: center;
    padding: 0 2px !important; font-size: 16px !important;
  }
  header nav.tx-nav a.tx-cta { justify-content: center; margin-top: 8px; padding: 0 18px !important; }
  header nav.tx-nav .tx-sprachwahl { align-self: flex-start; order: 0 !important; margin-top: 8px; }
}

/* ── Feinschliff für schmale Geräte ──────────────────────────── */
@media (max-width: 620px) {
  /* Kartenraster: eine Spalte, damit 270–280px-Minima nichts sprengen */
  #leistungen div[style*="auto-fit"], #bereiche div[style*="auto-fit"],
  #ablauf div[style*="auto-fit"], #rechtliches div[style*="auto-fit"] { grid-template-columns: minmax(0, 1fr) !important; }
  #leistungen > div > div:last-child > div { min-height: 0 !important; padding: 24px !important; }
  /* Freistehende Bildunterschrift darf nicht über den Rand ragen */
  #top > div:last-child > div:last-child,
  #ablauf > div > div:first-child > div:last-child { left: 12px !important; right: 12px !important; }
  /* Lange Adressen, Mailadressen und Telefonnummern */
  footer a, footer span, .tx-legal-body { overflow-wrap: anywhere; }
  .tx-legal-body p, .tx-legal-body li { font-size: 15px !important; }
  /* Sticky-Kopf ist schmaler — Sprungziele passend setzen */
  section { scroll-margin-top: 68px; }
  #kosten, #preise { scroll-margin-top: 68px !important; }
  #preise > div > div:last-child a { width: 100%; justify-content: center; }
  #techsis-rechner button { width: 100%; justify-content: center; }
}

@media (max-width: 400px) {
  #leistungen > div > div:last-child > div, #bereiche > div > div:last-child > div { padding: 22px !important; }
  header { padding-left: 16px !important; padding-right: 16px !important; }
  section, footer { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ── Thai-Fassung des Sprachdienstes ────────────────────────── */
body.tx-lang-th { font-family: 'Noto Sans Thai', Outfit, system-ui, sans-serif; }
body.tx-lang-th p, body.tx-lang-th span, body.tx-lang-th a,
body.tx-lang-th li, body.tx-lang-th label, body.tx-lang-th button { line-height: 1.75; }
body.tx-lang-th h1, body.tx-lang-th h2, body.tx-lang-th h3 { line-height: 1.45 !important; letter-spacing: 0 !important; }
/* Thailändisch hat keine Kapitälchen — gesperrte Grossbuchstaben zerfallen sonst */
body.tx-lang-th [style*="letter-spacing: 0.1"], body.tx-lang-th [style*="letter-spacing: 0.08"] { letter-spacing: 0.02em !important; }
.tx-sprachwahl a[aria-current="true"] { background: #33283A !important; color: #FFFFFF !important; }
.tx-sprachwahl a:hover { color: #33283A; }
@media (max-width: 620px) {
  header .tx-sprachwahl { order: 0; }
}

/* ── Bedienung ohne Maus ────────────────────────────────────── */
/* Unsichtbar, bis er den Fokus hat — nie im Logo-Bereich sichtbar */
.tx-skip:focus {
  position: fixed !important;
  left: 12px !important; top: 12px !important;
  width: auto !important; height: auto !important;
  margin: 0 !important; padding: 12px 20px !important;
  overflow: visible !important; clip: auto !important; clip-path: none !important;
  z-index: 100;
  border-radius: 999px;
  background: #33283A; color: #FFFFFF; font-size: 15px; font-weight: 500;
}
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #D2617E;
  outline-offset: 3px;
  border-radius: 4px;
}
#tx-inhalt:focus { outline: none; }
