/*
Theme Name: TEMP-Portal
Description: Theme für das geschlossene TEMP-Portal. Farben und Abstände sitzen in den Variablen unten — eine Zeile ändern, das ganze Portal folgt.
Version: 1.0
Author: Maja Faber
Text Domain: tp
*/

/* =========================================================
   ТОКЕНЫ
   Всё, что можно захотеть поменять — здесь.
   Синюю ветку крутим, серую не трогаем: она нейтральная.
   ========================================================= */

:root {
    /* Акцент */
    --tp-accent:        #005caa;   /* кнопки, ссылки, иконки */
    --tp-accent-dark:   #004880;   /* hover кнопок */
    --tp-tint:          #eef2f7;   /* фон иконок в плитках */
    --tp-tint-strong:   #dbe4ee;   /* активные чипсы */
    --tp-border-hover:  #9db4cc;   /* бордер плитки на hover */
    --tp-glow:          rgba(0, 92, 170, .18);

    /* Текст */
    --tp-text:          #0f1114;
    --tp-body:          #444;
    --tp-muted:         #6b7280;

    /* Фоны и бордеры */
    --tp-bg:            #ffffff;
    --tp-card-bg:       #f7f8f9;
    --tp-field-bg:      #f6f6f7;
    --tp-border:        #eceef0;
    --tp-border-strong: #e6e7ea;

    /* Формы */
    --tp-radius:        18px;
    --tp-radius-pill:   999px;
    --tp-radius-small:  10px;

    /* Сетка */
    --tp-container:     1100px;
    --tp-gutter:        24px;
    --tp-control-h:     42px;

    /*
      Шрифт.
      Системный стек намеренно: Google Fonts грузить нельзя — по решению
      LG München (2022) подключение с серверов Google без согласия нарушает
      DSGVO. Если Аника захочет фирменный шрифт, кладём .woff2 в
      /fonts/ этой темы и подключаем локально через @font-face.
    */
    --tp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
}


/* =========================================================
   БАЗА
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

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

img { max-width: 100%; height: auto; }

a { color: var(--tp-accent); text-decoration: none; }
a:hover { color: var(--tp-accent-dark); text-decoration: underline; }

h1, h2, h3, h4 {
    color: var(--tp-text);
    line-height: 1.2;
    margin: 0 0 .6em;
}
h1 { font-size: 32px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 26px; font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }

p { margin: 0 0 1.1em; }

/* Видимый фокус с клавиатуры — не убирать */
:focus-visible {
    outline: 3px solid var(--tp-border-hover);
    outline-offset: 2px;
}

.tp-container {
    max-width: var(--tp-container);
    margin: 0 auto;
    padding: 0 var(--tp-gutter);
}

.tp-visuell-versteckt {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.tp-skip-link {
    position: absolute; left: -9999px;
    background: var(--tp-accent); color: #fff;
    padding: 12px 20px; z-index: 100;
}
.tp-skip-link:focus { left: 12px; top: 12px; }


/* =========================================================
   ШАПКА
   ========================================================= */

.tp-topbar {
    border-bottom: 1px solid var(--tp-border);
    background: #fff;
}
.tp-topbar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 84px;
    padding: 12px var(--tp-gutter);
    max-width: var(--tp-container);
    margin: 0 auto;
}

.tp-logo { display: flex; align-items: center; flex-shrink: 0; }
.tp-logo img { max-height: 52px; width: auto; }
.tp-logo-text {
    font-size: 20px; font-weight: 800; color: var(--tp-text);
}
.tp-logo a:hover { text-decoration: none; }

/* Навигация */
.tp-nav { margin-left: auto; }
.tp-nav-liste {
    display: flex; align-items: center; gap: 4px;
    list-style: none; margin: 0; padding: 0;
}
.tp-nav-liste li { position: relative; }
.tp-nav-liste a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--tp-radius-pill);
    font-size: 16px; font-weight: 700;
    color: var(--tp-text);
    transition: all .2s ease;
}
.tp-nav-liste a:hover {
    background: var(--tp-tint);
    color: var(--tp-accent);
    text-decoration: none;
}
.tp-nav-liste .current-menu-item > a,
.tp-nav-liste .current_page_item > a,
.tp-nav-liste .current-menu-parent > a {
    background: var(--tp-tint-strong);
    color: var(--tp-accent-dark);
}

/* Подменю */
.tp-nav-liste .sub-menu {
    display: none;
    position: absolute; left: 0; top: 100%;
    min-width: 230px;
    list-style: none; margin: 0; padding: 8px;
    background: #fff;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-small);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .1);
    z-index: 50;
}
.tp-nav-liste li:hover > .sub-menu,
.tp-nav-liste li:focus-within > .sub-menu { display: block; }
.tp-nav-liste .sub-menu a {
    border-radius: 8px;
    font-weight: 600;
    white-space: normal;
}

/* Блок пользователя */
.tp-user {
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0;
    padding-left: 20px;
    border-left: 1px solid var(--tp-border);
}
.tp-user-name {
    font-size: 15px; font-weight: 700; color: var(--tp-text);
    max-width: 170px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.tp-user-logout {
    font-size: 14px; font-weight: 700; color: var(--tp-muted);
    padding: 8px 14px;
    border: 1px solid var(--tp-border-strong);
    border-radius: var(--tp-radius-pill);
    transition: all .2s ease;
}
.tp-user-logout:hover {
    background: var(--tp-tint);
    border-color: var(--tp-border-hover);
    color: var(--tp-accent);
    text-decoration: none;
}

/* Гамбургер */
.tp-burger {
    display: none;
    margin-left: auto;
    width: 44px; height: 44px;
    padding: 0;
    background: var(--tp-field-bg);
    border: 1px solid var(--tp-border-strong);
    border-radius: var(--tp-radius-small);
    cursor: pointer;
}
.tp-burger span {
    display: block; width: 20px; height: 2px;
    margin: 4px auto;
    background: var(--tp-text);
    transition: all .2s ease;
}
.tp-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.tp-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.tp-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }


/* =========================================================
   HERO
   Текст выводит WordPress поверх картинки — в саму картинку
   ничего не впечатано, иначе на каждый раздел нужен фотошоп.
   ========================================================= */

.tp-hero { position: relative; background: var(--tp-card-bg); }

.tp-hero-img {
    height: 260px;
    background-image: var(--tp-hero-bild);
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
}

.tp-hero-text {
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
    width: 100%;
    max-width: var(--tp-container);
    left: 50%; margin-left: calc(var(--tp-container) / -2);
    padding: 0 var(--tp-gutter);
}
.tp-hero-inner { max-width: 46%; }

.tp-hero-eyebrow {
    margin: 0 0 2px;
    font-size: 26px; font-weight: 400;
    color: var(--tp-muted);
    line-height: 1.2;
}
.tp-hero-title {
    margin: 0;
    font-size: 34px; font-weight: 800;
    color: var(--tp-text);
    line-height: 1.15;
}


/* =========================================================
   КОНТЕНТ
   ========================================================= */

.tp-main { padding: 48px 0 72px; }
.tp-main--vollbreite { padding: 0; }

.tp-inhalt > *:first-child { margin-top: 0; }
.tp-inhalt ul, .tp-inhalt ol { padding-left: 24px; }
.tp-inhalt img { border-radius: var(--tp-radius-small); }

.tp-inhalt table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5em;
    font-size: 16px;
}
.tp-inhalt th {
    text-align: left;
    background: var(--tp-card-bg);
    color: var(--tp-text);
    font-weight: 700;
    padding: 12px 14px;
    border-bottom: 1px solid var(--tp-border-strong);
}
.tp-inhalt td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--tp-border);
    vertical-align: top;
}
.tp-inhalt tr:hover td { background: var(--tp-tint); }


/* =========================================================
   КОМПОНЕНТЫ (их будут использовать модули)
   ========================================================= */

/* --- Кнопки --- */
.tp-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 15px 34px;
    border: 1px solid var(--tp-accent);
    border-radius: var(--tp-radius-pill);
    background: var(--tp-accent);
    color: #fff !important;
    font-size: 16px; font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
}
.tp-btn:hover {
    background: var(--tp-accent-dark);
    border-color: var(--tp-accent-dark);
    text-decoration: none;
}
.tp-btn--outline {
    background: #fff;
    color: var(--tp-accent) !important;
}
.tp-btn--outline:hover {
    background: var(--tp-tint);
    color: var(--tp-accent-dark) !important;
}
.tp-btn--klein { padding: 10px 20px; font-size: 15px; }

/* --- Плитки-разделы --- */
/*
  Плитки: фиксированная ширина колонки + justify-content:center.
  С minmax(...,1fr) три плитки растягивались бы на всю ширину и
  прижимались влево — а в макете они компактные и по центру.
*/
.tp-kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fit, 240px);
    gap: 24px;
    justify-content: center;
}
.tp-kachel {
    display: flex; flex-direction: column;
    align-items: center; text-align: center;
    gap: 16px;
    padding: 32px 24px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    background: var(--tp-card-bg);
    transition: all .25s ease;
}
.tp-kachel:hover {
    background: var(--tp-card-bg);
    border-color: var(--tp-border-hover);
    box-shadow: 0 8px 30px var(--tp-glow);
    text-decoration: none;
}
.tp-kachel-icon {
    display: flex; align-items: center; justify-content: center;
    width: 88px; height: 88px;
    border-radius: 50%;
    background: var(--tp-tint);
    transition: all .25s ease;
}
.tp-kachel:hover .tp-kachel-icon {
    box-shadow: 0 0 20px var(--tp-glow);
    transform: scale(1.05);
}
.tp-kachel-icon svg {
    width: 42px; height: 42px;
    stroke: var(--tp-accent); fill: none; stroke-width: 2;
}
.tp-kachel h3 { margin: 0; font-size: 18px; font-weight: 700; }
.tp-kachel p  { margin: 0; font-size: 14px; color: var(--tp-muted); }

/* --- Карточки материалов --- */
.tp-karte {
    display: flex; gap: 20px;
    padding: 20px;
    background: var(--tp-card-bg);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    margin-bottom: 16px;
    transition: all .25s ease;
}
.tp-karte:hover {
    border-color: var(--tp-border-hover);
    box-shadow: 0 8px 30px var(--tp-glow);
}
.tp-karte-bild {
    flex: 0 0 160px;
    border-radius: var(--tp-radius-small);
    overflow: hidden;
    background: #fff;
}
.tp-karte-body { flex: 1 1 auto; min-width: 0; }
.tp-karte h3 { margin: 0 0 6px; font-size: 18px; }
.tp-karte p  { margin: 0 0 10px; font-size: 15px; color: var(--tp-muted); }
.tp-karte-meta { font-size: 14px; color: var(--tp-muted); }
.tp-karte-aktion { flex: 0 0 auto; display: flex; align-items: flex-start; }

/* --- Чипсы-фильтры --- */
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-chip {
    display: inline-flex; align-items: center;
    height: var(--tp-control-h);
    padding: 0 1rem;
    border: 1px solid var(--tp-border-strong);
    border-radius: var(--tp-radius-pill);
    background: var(--tp-field-bg);
    color: #2a2e35;
    font-size: 16px; font-weight: 700;
    transition: all .2s ease;
}
.tp-chip:hover {
    background: var(--tp-tint);
    border-color: var(--tp-border-hover);
    text-decoration: none;
}
.tp-chip.aktiv {
    background: var(--tp-tint-strong);
    border-color: var(--tp-border-hover);
    color: var(--tp-accent-dark);
}

/* --- Поиск --- */
.tp-suche {
    display: flex; align-items: center;
    height: var(--tp-control-h);
    border: 1px solid var(--tp-border-strong);
    border-radius: var(--tp-radius-pill);
    background: var(--tp-field-bg);
    overflow: hidden;
    padding: 0 4px 0 18px;
    transition: all .2s ease;
}
.tp-suche:focus-within {
    border-color: var(--tp-border-hover);
    background: #fff;
}
.tp-suche input[type="search"] {
    flex: 1 1 auto; min-width: 140px;
    border: none; background: transparent; outline: none;
    font: inherit; font-size: 15px; color: var(--tp-text);
    height: 100%; padding: 0;
}
.tp-suche button {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0;
    padding: 0;
    border: none; border-radius: 50%;
    background: var(--tp-accent); color: #fff;
    cursor: pointer;
    transition: background .2s ease;
}
.tp-suche button:hover { background: var(--tp-accent-dark); }
.tp-suche button svg { width: 18px; height: 18px; }

/* --- Панель управления лентами --- */
.tp-controls {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; flex-wrap: wrap;
    margin: 12px 0 24px;
}
.tp-controls-rechts { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Хлебные крошки (пригодятся для дерева) --- */
.tp-breadcrumb {
    font-size: 14px; color: var(--tp-muted);
    margin: 0 0 18px;
}
.tp-breadcrumb a { font-weight: 600; }
.tp-breadcrumb span { margin: 0 6px; opacity: .5; }

/* --- Сообщения --- */
.tp-hinweis {
    padding: 14px 18px;
    border-radius: var(--tp-radius-small);
    margin: 0 0 18px;
    font-size: 15px;
}
.tp-hinweis--info { background: var(--tp-tint); color: var(--tp-accent-dark); }
.tp-hinweis--ok   { background: #ecfdf5; color: #065f46; }
.tp-hinweis--fehler { background: #fef2f2; color: #991b1b; }


/* =========================================================
   ФОРМА ВХОДА  (шорткод [tp_login] из tp-core)
   ========================================================= */

.tp-login-box {
    max-width: 440px;
    margin: 0 auto;
    padding: 36px;
    background: #fff;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .06);
}
.tp-login-box label {
    display: block;
    margin: 0 0 6px;
    font-size: 15px; font-weight: 700; color: var(--tp-text);
}
.tp-login-box .login-username,
.tp-login-box .login-password { margin: 0 0 16px; }

.tp-login-box input[type="text"],
.tp-login-box input[type="email"],
.tp-login-box input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--tp-border-strong);
    border-radius: var(--tp-radius-small);
    background: var(--tp-field-bg);
    font: inherit; font-size: 16px;
    transition: all .2s ease;
}
.tp-login-box input:focus {
    border-color: var(--tp-border-hover);
    background: #fff;
    outline: none;
}
.tp-login-box .login-remember {
    margin: 0 0 20px;
    font-size: 15px; color: var(--tp-muted);
}
.tp-login-box .login-remember label { display: inline; font-weight: 400; }
.tp-login-box .login-submit input[type="submit"] {
    width: 100%;
    padding: 15px 24px;
    border: 1px solid var(--tp-accent);
    border-radius: var(--tp-radius-pill);
    background: var(--tp-accent);
    color: #fff;
    font: inherit; font-size: 16px; font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
}
.tp-login-box .login-submit input[type="submit"]:hover {
    background: var(--tp-accent-dark);
    border-color: var(--tp-accent-dark);
}
.tp-login-hilfe {
    margin: 18px 0 0;
    text-align: center;
    font-size: 15px;
}
.tp-login-ok {
    padding: 12px 16px;
    margin: 0 0 20px;
    background: #ecfdf5;
    color: #065f46;
    border-radius: var(--tp-radius-small);
    font-size: 15px;
    line-height: 1.5;
}
.tp-login-fehler {
    padding: 12px 16px;
    margin: 0 0 20px;
    background: #fef2f2;
    color: #991b1b;
    border-radius: var(--tp-radius-small);
    font-size: 15px;
}


/* =========================================================
   ПОДВАЛ
   ========================================================= */

.tp-footer {
    margin-top: 64px;
    padding: 36px 0;
    border-top: 1px solid var(--tp-border);
    background: var(--tp-card-bg);
}
.tp-footer-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
    font-size: 15px; color: var(--tp-muted);
}
.tp-footer-menu {
    display: flex; gap: 20px; flex-wrap: wrap;
    list-style: none; margin: 0; padding: 0;
}
.tp-footer-menu a { color: var(--tp-muted); font-weight: 600; }
.tp-footer-menu a:hover { color: var(--tp-accent); }


/* =========================================================
   404 / ПУСТО
   ========================================================= */

.tp-leer {
    max-width: 620px; margin: 0 auto;
    text-align: center; padding: 40px 0;
}
.tp-leer-code {
    font-size: 82px; font-weight: 800; line-height: 1;
    color: var(--tp-accent);
    margin: 0 0 12px;
    letter-spacing: -2px;
}
.tp-leer p { color: var(--tp-muted); }


/* =========================================================
   МОБИЛЬНОЕ
   Ломаем на 900px: раньше меню ещё влезает, позже уже давится.
   ========================================================= */

@media (max-width: 900px) {

    .tp-burger { display: block; }

    .tp-nav {
        display: none;
        order: 10;
        width: 100%;
        margin: 0;
        padding: 8px 0 4px;
        border-top: 1px solid var(--tp-border);
    }
    .tp-nav.offen { display: block; }

    .tp-topbar-inner { flex-wrap: wrap; gap: 12px; min-height: 68px; }

    .tp-nav-liste { flex-direction: column; align-items: stretch; gap: 2px; }
    .tp-nav-liste a { padding: 13px 16px; border-radius: var(--tp-radius-small); }

    .tp-nav-liste .sub-menu {
        display: block;
        position: static;
        border: none; box-shadow: none; padding: 0 0 0 16px;
        min-width: 0;
    }

    .tp-user {
        order: 5;
        margin-left: auto;
        padding-left: 0;
        border-left: none;
    }
    .tp-user-name { display: none; }

    /* Hero: картинка сверху, текст под ней — иначе заголовок лезет на лицо */
    .tp-hero-img { height: 150px; }
    .tp-hero-text {
        position: static;
        transform: none;
        left: auto; margin-left: 0;
        max-width: none;
        padding: 22px var(--tp-gutter) 4px;
    }
    .tp-hero-inner { max-width: none; }
    .tp-hero-eyebrow { font-size: 18px; }
    .tp-hero-title { font-size: 26px; }

    .tp-main { padding: 32px 0 56px; }

    h1 { font-size: 26px; }
    h2 { font-size: 21px; }
    body { font-size: 16px; }

    .tp-controls { flex-direction: column; }
    .tp-controls-rechts { width: 100%; }
    .tp-suche { flex: 1 1 100%; }

    .tp-chip, .tp-suche { height: 36px; font-size: 14px; }

    .tp-karte { flex-direction: column; gap: 14px; }
    .tp-karte-bild { flex: 0 0 auto; max-width: 200px; }

    .tp-kacheln { grid-template-columns: repeat(auto-fit, minmax(0, 200px)); }
    .tp-kachel { padding: 24px 16px; }
    .tp-kachel-icon { width: 72px; height: 72px; }
    .tp-kachel-icon svg { width: 34px; height: 34px; }

    .tp-login-box { padding: 26px 20px; }

    .tp-footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    :root { --tp-gutter: 16px; }
    .tp-kacheln { grid-template-columns: repeat(2, minmax(0, 160px)); gap: 12px; }
    .tp-leer-code { font-size: 62px; }
}


/* Уважаем настройку "меньше движения" */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
