/* =========================================================
   AT-Lab Modules — Frontend Styles v1.7.0
   ========================================================= */

/* =========================================================
   HIDE DIVI'S OWN HEADER + DEFAULT FOOTER EVERYWHERE
   (the black "Designed by Elegant Themes" footer)
   ========================================================= */
#main-header,
#top-header,
.et-fixed-header,
#main-footer,
body .et_pb_section.et_pb_section_first {
    display: none !important;
}

/* Anchor jumps land below the fixed header */
html {
    scroll-padding-top: 120px;
}

/* Text for screen readers / search engines only */
.atlab-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =========================================================
   FULL SITE HEADER
   ========================================================= */
#atlab-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    border-bottom: 1px solid #eee;
    transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
}

/* Sticky state — triggered by JS on scroll */
#atlab-header.atlab-header--sticky {
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}

.atlab-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 32px;
    transition: padding 0.25s ease;
}

#atlab-header.atlab-header--sticky .atlab-header__inner {
    padding: 10px 32px;
}

/* ---------- Logo ---------- */
.atlab-header__logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

/* Full logo (default) */
.atlab-header__logo--full {
    height: 56px;
    width: auto;
    display: block;
    transition: opacity 0.2s, height 0.25s;
}

/* Sticky logo (compact — AT|LAB without tagline) */
.atlab-header__logo--sticky {
    height: 36px;
    width: auto;
    display: none;
    transition: opacity 0.2s, height 0.25s;
}

/* Swap logos on sticky */
#atlab-header.atlab-header--sticky .atlab-header__logo--full {
    display: none;
}
#atlab-header.atlab-header--sticky .atlab-header__logo--sticky {
    display: block;
}

/* ---------- Desktop nav ---------- */
.atlab-header__nav {
    display: flex;
    align-items: center;
    gap: 36px;
}

.atlab-header__nav-link {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.15s;
    white-space: nowrap;
}
.atlab-header__nav-link:hover {
    color: #c0392b;
}

/* ---------- Hamburger (mobile) ---------- */
.atlab-header__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.atlab-header__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: background 0.15s;
}
.atlab-header__burger:hover span {
    background: #c0392b;
}

/* ---------- Mobile nav drawer ---------- */
.atlab-header__mobile-nav {
    display: none;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 12px 0;
}
.atlab-header__mobile-nav--open {
    display: flex;
}
.atlab-header__mobile-nav .atlab-header__nav-link {
    padding: 12px 32px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}

/* Push page content below the header */
body {
    padding-top: 92px !important;
}
#atlab-header.atlab-header--sticky ~ * body,
body.admin-bar {
    padding-top: 124px !important;
}

/* Admin bar offsets */
body.admin-bar #atlab-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar #atlab-header {
        top: 46px;
    }
}

/* Mobile responsive header */
@media (max-width: 768px) {
    .atlab-header__nav {
        display: none;
    }
    .atlab-header__burger {
        display: flex;
    }
    .atlab-header__inner {
        padding: 14px 20px;
    }
    .atlab-header__logo--full {
        height: 42px;
    }
    body {
        padding-top: 72px !important;
    }
}

/* =========================================================
   MODULE LIST WRAPPER
   ========================================================= */
.atlab-modules-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 0 auto;
    max-width: 1100px;
    padding: 0 0 40px;
}

/* =========================================================
   MODULE CARD
   ========================================================= */
.atlab-card {
    display: flex;
    flex-direction: row;
    gap: 40px;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 32px;
    align-items: flex-start;
}

.atlab-card__left {
    flex: 0 0 260px;
    max-width: 260px;
}

.atlab-card__image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    object-fit: cover;
}

.atlab-card__image--placeholder {
    height: 180px;
    background: #ddd;
    border-radius: 4px;
}

.atlab-card__right {
    flex: 1;
    min-width: 0;
}

.atlab-card__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d6a2d;
    margin: 0 0 12px;
    line-height: 1.25;
}

.atlab-card__factsheet {
    display: inline-block;
    color: #2d6a2d;
    text-decoration: underline;
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.atlab-card__factsheet:hover { color: #1a4a1a; }

.atlab-card__meta {
    margin: 0 0 24px;
    padding: 0;
}

.atlab-card__meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 6px;
    font-size: 0.93rem;
    line-height: 1.5;
    color: #222;
}

.atlab-card__meta-row dt {
    font-weight: 700;
    white-space: nowrap;
}

.atlab-card__meta-row dd {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.atlab-card__meta-row--date dd {
    font-weight: 700;
    font-size: 1rem;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.atlab-card__btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-top: 4px;
}

.atlab-card__btn--readmore {
    color: #c0392b;
    border: 2px solid #c0392b;
    background: transparent;
}
.atlab-card__btn--readmore:hover {
    background: #c0392b;
    color: #fff;
}

.atlab-detail__btn--anmeldung {
    color: #c0392b;
    border: 2px solid #c0392b;
    background: transparent;
    display: inline-block;
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-top: 8px;
}
.atlab-detail__btn--anmeldung:hover {
    background: #c0392b;
    color: #fff;
}

.atlab-no-modules {
    font-size: 1rem;
    color: #666;
    padding: 20px 0;
}

/* =========================================================
   DETAIL PAGE
   ========================================================= */
.atlab-detail {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

.atlab-detail__inner {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 32px;
    margin-bottom: 48px;
}

.atlab-detail__image-col {
    flex: 0 0 300px;
    max-width: 300px;
}

.atlab-detail__image-col img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.atlab-detail__content-col {
    flex: 1;
}

.atlab-detail__meta {
    margin: 0 0 24px;
    padding: 0;
}

.atlab-detail__title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #2d6a2d;
    margin: 0 0 12px;
    line-height: 1.25;
}

.atlab-detail__factsheet {
    display: inline-block;
    color: #2d6a2d;
    text-decoration: underline;
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.atlab-detail__factsheet:hover { color: #1a4a1a; }

/* Extra chapter */
.atlab-detail__extra {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid #ddd;
}

.atlab-detail__extra-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d6a2d;
    margin: 0 0 24px;
    line-height: 1.25;
}

.atlab-detail__extra-content h2,
.atlab-detail__extra-content h3 {
    padding-top: 32px !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}
.atlab-detail__extra-content h2:first-child,
.atlab-detail__extra-content h3:first-child {
    padding-top: 0 !important;
}

.atlab-detail__extra-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
}
.atlab-detail__extra-content p {
    margin-bottom: 16px !important;
    margin-top: 0 !important;
}

/* Force proper bullet + numbered list display — Divi resets these */
.atlab-detail__extra-content ul,
.atlab-detail__extra-content ol {
    margin: 0 0 16px 0 !important;
    padding-left: 24px !important;
}
.atlab-detail__extra-content ul {
    list-style-type: disc !important;
}
.atlab-detail__extra-content ol {
    list-style-type: decimal !important;
}
.atlab-detail__extra-content li {
    display: list-item !important;
    margin-bottom: 6px !important;
    line-height: 1.6 !important;
}
.atlab-detail__extra-content ul ul,
.atlab-detail__extra-content ol ol {
    margin-top: 6px !important;
    margin-bottom: 0 !important;
}
/* Empty line before a new paragraph after a list */
.atlab-detail__extra-content ul + p,
.atlab-detail__extra-content ol + p {
    margin-top: 16px !important;
}

.atlab-detail__extra-cta {
    margin-top: 28px;
}

/* =========================================================
   TOP BAR: back link + print/PDF buttons
   ========================================================= */
.atlab-detail__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.atlab-detail__back {
    display: inline-block;
    color: #2d6a2d;
    font-size: 0.9rem;
    text-decoration: none;
}
.atlab-detail__back:hover { text-decoration: underline; }

.atlab-detail__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.atlab-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid #555;
    background: transparent;
    color: #333;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.atlab-action-btn:hover {
    background: #555;
    color: #fff;
}
.atlab-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================
   PRINT STYLES
   On module pages the print sheet (#atlab-print-sheet) is added
   only while printing; everything else is hidden.
   ========================================================= */
#atlab-print-sheet { display: none; }

@media print {
    #atlab-header,
    #wpadminbar,
    .atlab-mail-modal { display: none !important; }

    body,
    body.admin-bar,
    body.atlab-printing {
        padding-top: 0 !important;
    }

    body.atlab-printing > *:not(#atlab-print-sheet) { display: none !important; }
    body.atlab-printing #atlab-print-sheet { display: block !important; }
}

/* =========================================================
   PDF BLOCK INNER STYLES (used both in print + clone)
   ========================================================= */
.atlab-pdf-inner {
    font-family: Arial, sans-serif;
    font-size: 11pt;
    color: #000;
    line-height: 1.5;
    padding: 0;
}

.atlab-pdf-inner h1 {
    font-size: 20pt;
    color: #2d6a2d;
    margin: 0 0 8px;
}

.atlab-pdf-date {
    font-size: 13pt;
    margin-bottom: 20px;
}

.atlab-pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    table-layout: fixed;
}

.atlab-pdf-table th,
.atlab-pdf-table td {
    text-align: left;
    vertical-align: top;
    padding: 6px 10px;
    border-bottom: 1px solid #ddd;
    font-size: 10.5pt;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.atlab-pdf-table th {
    font-weight: 700;
    width: 35%;
}

.atlab-pdf-extra {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid #ccc;
    font-size: 10.5pt;
    line-height: 1.6;
}

.atlab-pdf-anmeldung {
    margin-top: 18px;
    font-size: 10pt;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .atlab-card {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    .atlab-card__left {
        flex: unset;
        max-width: 100%;
    }
    .atlab-detail__inner {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    .atlab-detail__image-col {
        flex: unset;
        max-width: 100%;
    }
}

/* =========================================================
   CONTROLS BAR — filter + sort side by side
   ========================================================= */
.atlab-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto 32px;
}

.atlab-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    max-width: none;
}

.atlab-filter-btn {
    padding: 9px 20px;
    border-radius: 4px;
    border: 2px solid #ccc;
    background: transparent;
    color: #333;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

/* "Alle" button active state */
.atlab-filter-btn.active[data-filter="all"] {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Colored filter buttons — use CSS custom property set inline */
.atlab-filter-btn[data-filter="nachhaltigkeit"]:hover,
.atlab-filter-btn[data-filter="nachhaltigkeit"].active {
    background: var(--kf-color);
    color: #fff;
    border-color: var(--kf-color);
}
.atlab-filter-btn[data-filter="digitalisierung"]:hover,
.atlab-filter-btn[data-filter="digitalisierung"].active {
    background: var(--kf-color);
    color: #fff;
    border-color: var(--kf-color);
}
.atlab-filter-btn[data-filter="dekarbonisierung"]:hover,
.atlab-filter-btn[data-filter="dekarbonisierung"].active {
    background: var(--kf-color);
    color: #fff;
    border-color: var(--kf-color);
}
.atlab-filter-btn[data-filter="trendthemen"]:hover,
.atlab-filter-btn[data-filter="trendthemen"].active {
    background: var(--kf-color);
    color: #fff;
    border-color: var(--kf-color);
}

@media (max-width: 768px) {
    .atlab-filter-bar {
        gap: 8px;
    }
    .atlab-filter-btn {
        font-size: 0.82rem;
        padding: 8px 14px;
    }
}

/* Sort dropdown */
.atlab-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.atlab-sort-bar label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.atlab-sort-bar select {
    padding: 8px 14px;
    border-radius: 4px;
    border: 2px solid #ccc;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

@media (max-width: 768px) {
    .atlab-controls-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   MODULE PREVIEW WIDGET — [atlab_modules_preview]
   Compact 3-card grid for homepage use.
   ========================================================= */
.atlab-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto 32px;
}

.atlab-preview-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.atlab-preview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.atlab-preview-card__image-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #ddd;
}

.atlab-preview-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.atlab-preview-card__image--placeholder {
    width: 100%;
    height: 100%;
    background: #ddd;
}

.atlab-preview-card__body {
    padding: 16px 4px 4px;
}

.atlab-preview-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
}

.atlab-preview-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.atlab-preview-card__date {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}

.atlab-preview-card__arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.15s;
}
.atlab-preview-card:hover .atlab-preview-card__arrow {
    background: #999;
}

.atlab-preview-cta {
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}

.atlab-preview-cta__btn {
    display: inline-block;
    padding: 12px 32px;
    color: #c0392b;
    border: 2px solid #c0392b;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.atlab-preview-cta__btn:hover {
    background: #c0392b;
    color: #fff;
}

@media (max-width: 900px) {
    .atlab-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   "IN PLANUNG" MODULES (no date yet)
   ========================================================= */
.atlab-card--planned .atlab-card__meta-row--date dd {
    color: #666;
    font-style: italic;
}

/* =========================================================
   REGISTRATION: hint under the button + email chooser
   ========================================================= */
.atlab-detail__mail-hint {
    margin: 12px 0 0;
    font-size: 0.9rem;
    color: #555;
}
.atlab-detail__mail-hint a {
    color: #c0392b;
    text-decoration: underline;
}

/* =========================================================
   REGISTRATION FORM (#anmeldung)
   ========================================================= */
.atlab-reg {
    margin-top: 48px;
    padding: 32px;
    background: #f0f0f0;
    border-radius: 4px;
    scroll-margin-top: 120px;
}

.atlab-reg--external,
.atlab-reg--closed {
    background: transparent;
    padding: 0;
}

.atlab-reg__title {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #2d6a2d !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    line-height: 1.25 !important;
}

.atlab-reg__intro {
    margin: 0 0 24px !important;
    padding: 0 !important;
    font-size: 0.95rem;
    color: #444;
    max-width: 720px;
}

.atlab-reg__closed {
    color: #555;
    font-style: italic;
}

/* honeypot: hidden from people, visible to bots */
.atlab-reg__hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.atlab-reg__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}

.atlab-reg__field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.atlab-reg__field--full {
    grid-column: 1 / -1;
}

.atlab-reg__field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
}

.atlab-reg__field input[type="text"],
.atlab-reg__field input[type="email"],
.atlab-reg__field input[type="tel"],
.atlab-reg__field input[type="number"],
.atlab-reg__field textarea {
    width: 100% !important;
    box-sizing: border-box;
    padding: 11px 12px !important;
    border: 1px solid #c8c8c8 !important;
    border-radius: 3px !important;
    background: #fff !important;
    color: #222 !important;
    font-family: inherit;
    font-size: 1rem !important;
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.atlab-reg__field textarea {
    min-height: 110px;
    resize: vertical;
}

.atlab-reg__field input:focus,
.atlab-reg__field textarea:focus {
    outline: none;
    border-color: #2d6a2d !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 45, 0.18);
}

.atlab-reg__field--invalid input,
.atlab-reg__field--invalid textarea {
    border-color: #c0392b !important;
}

.atlab-reg__error {
    min-height: 0;
    margin-top: 4px;
    font-size: 0.82rem;
    color: #c0392b;
}
.atlab-reg__error:empty { display: none; }

/* consent checkbox */
.atlab-reg__check {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    font-size: 0.88rem !important;
    line-height: 1.5;
    color: #333 !important;
    cursor: pointer;
}
.atlab-reg__check input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 2px 0 0 !important;
    accent-color: #2d6a2d;
}
.atlab-reg__check a {
    color: #2d6a2d;
    text-decoration: underline;
}

.atlab-reg__status {
    margin: 18px 0 0;
    font-size: 0.92rem;
}
.atlab-reg__status:empty { display: none; }
.atlab-reg__status--error {
    padding: 10px 14px;
    border-left: 4px solid #c0392b;
    background: #fbeaea;
    color: #8a2a1f;
}

.atlab-reg__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 22px;
}

.atlab-reg__submit {
    display: inline-block;
    padding: 12px 30px;
    border: 2px solid #c0392b;
    border-radius: 3px;
    background: #c0392b;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.atlab-reg__submit:hover { background: #a5301f; border-color: #a5301f; }
.atlab-reg__submit:disabled { opacity: 0.6; cursor: wait; }

.atlab-reg__required {
    font-size: 0.82rem;
    color: #666;
}

.atlab-reg__success {
    padding: 18px 20px;
    border-left: 4px solid #2d6a2d;
    background: #eaf4ea;
    color: #1f4d1f;
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
}

.atlab-reg .atlab-detail__mail-hint {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .atlab-reg { padding: 20px; }
    .atlab-reg__grid { grid-template-columns: 1fr; }
}
