/* ------------------------------------------------------------
   LeanVal resAPI / CoAnalyst – Global Styles
   ------------------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Slab:wght@400;600;700&display=swap');

html,
body {
    font-family: var(--typography-font-family-base);
    font-size: var(--typography-body-size);
    line-height: var(--typography-line-height);
    color: var(--neutral-gray-900);
    margin: 0;
    padding: 0;
    background-color: var(--neutral-gray-50);
}

.container {
    max-width: var(--layout-container-max);
    margin: 0 auto;
}

/* -----------------------------------
   Typography
----------------------------------- */
h1,
.h1 {
    font-family: var(--typography-font-family-title);
    font-size: var(--typography-h1-size);
    font-weight: var(--typography-fw-bold);
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
    color: var(--h1-color, var(--palette-blue-500));
}

h2,
.h2 {
    font-family: var(--typography-font-family-base);
    font-size: var(--typography-h2-size);
    font-weight: var(--typography-fw-bold);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
    color: var(--brand-secondary);
}

h3,
.h3 {
    font-family: var(--typography-font-family-base);
    font-size: var(--typography-h3-size);
    font-weight: var(--typography-fw-bold);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
    color: var(--h3-color, var(--brand-primary));
}

h4,
.h4 {
    font-size: var(--typography-h4-size);
    font-weight: var(--typography-fw-semibold);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-xs);
    color: var(--neutral-gray-900);
}

h5,
.h5 {
    font-size: var(--typography-h5-size);
    font-weight: var(--typography-fw-normal);
    margin-top: var(--space-xs);
    margin-bottom: var(--space-xs);
    color: var(--neutral-gray-800);
}

h6,
.h6 {
    font-size: var(--typography-h6-size);
    font-weight: var(--typography-fw-normal);
    margin-top: 0;
    margin-bottom: var(--space-xs);
    color: var(--neutral-gray-700);
}

p {
    font-size: var(--typography-body-size);
    color: var(--neutral-gray-600);
    margin-bottom: var(--space-sm);
    line-height: var(--typography-line-height);
}

/* Bold shortcuts */
.fw-bold {
    font-weight: var(--typography-fw-bold);
}

.fw-normal {
    font-weight: var(--typography-fw-normal);
}

/* -----------------------------------
   Spacing Utilities
----------------------------------- */
.mt-xs {
    margin-top: var(--space-xs);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mt-xxl {
    margin-top: var(--space-xxl);
}

/* -----------------------------------
   Logos & Images
----------------------------------- */
.brand-logo {
    height: auto;
    display: block;
    margin-bottom: var(--space-md);
}

.logo-research {
    width: var(--logo-width-research);
}

.logo-coanalyst {
    width: var(--logo-width-coanalyst);
}

.logo-company {
    width: var(--image-company-logo-width);
    height: var(--image-company-logo-height);
}

/* -----------------------------------
   Tables
----------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table-bordered td {
    border-top: var(--border-thin);
    border-bottom: var(--border-thin);
}

.comment-table td {
    vertical-align: middle;
    padding: var(--space-sm);
    text-align: left;
    /* ursprünglich: center */
}

.comment-table td:first-child {
    font-weight: var(--typography-fw-bold);
    text-align: left;
    white-space: nowrap;
}

/* wenn ich andere Spalten zentrieren will:
.comment-table td:nth-child(2),
.comment-table td:nth-child(n+2) {
    text-align: center;
}
*/
.comment-text {
    white-space: pre-wrap;
}

/* CoAnalyst table */
.table-fixed {
    width: var(--layout-table-width);
    margin: 0 auto;
}

.coanalyst-table td {
    vertical-align: middle;
    border-bottom: var(--border-thin);
    border-top: var(--border-thin);
    padding: var(--space-sm);
    text-align: center;
}

.coanalyst-table td:nth-child(2) {
    text-align: left;
}

/* Column widths via colgroup */
col.w-150 {
    width: 150px;
}

col.w-140 {
    width: 140px;
}

col.w-130 {
    width: 130px;
}

/* -----------------------------------
   Links
----------------------------------- */
a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* -----------------------------------
   Alerts & Helpers
----------------------------------- */
.alert {
    margin-top: var(--space-md);
    border-radius: var(--border-radius);
}

/* -----------------------------------
   Miscellaneous
----------------------------------- */
hr {
    border: none;
    border-top: var(--border-thin);
    margin: var(--space-lg) 0;
}

/* PORTFOLIOS.HTML*/

/* -----------------------------
   Grid (Kachel-Layout)
----------------------------- */
.tiles-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* mobile: einspaltig */
    gap: var(--space-md, 16px);
}

/* ab ~Tablet: 12er Grid */
@media (min-width: 768px) {
    .tiles-grid {
        grid-template-columns: repeat(12, 1fr);
    }
}

/* Spalten-Utilities NUR innerhalb des Grids (präfix t-) */
.tiles-grid>.t-span-12 {
    grid-column: span 12;
}

@media (min-width: 768px) {
    .tiles-grid>.t-span-6 {
        grid-column: span 6;
    }

    .tiles-grid>.t-span-9 {
        grid-column: span 9;
    }

    .tiles-grid>.t-span-8 {
        grid-column: span 8;
    }

    .tiles-grid>.t-span-4 {
        grid-column: span 4;
    }

    .tiles-grid>.t-span-3 {
        grid-column: span 3;
    }

    .tiles-grid>.t-span-12 {
        grid-column: span 12;
    }
}

/* Fallback, falls Grid nicht unterstützt wird */
@supports not (display: grid) {
    .tiles-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .tiles-grid>.tile {
        width: 100%;
    }

    @media (min-width: 768px) {
        .tiles-grid>.tile.span-6 {
            width: 50%;
        }
    }
}

/* -----------------------------
   Tiles
----------------------------- */
.tile {
    background: var(--surface, #fff);
    border: var(--border-thin, 1px) solid var(--border-color, #e6e6e6);
    border-radius: var(--radius-lg, 4px);
    /* #ak */
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .06));
    padding: var(--space-md, 16px);
    min-width: 0;
}

.tile-title {
    margin: 0 0 var(--space-sm, 8px);
    font-weight: var(--typography-fw-semibold, 600);
    /*font-size: 1.1rem;*/
}

.tile h3,
.tile .h3 {
    margin-top: 0;
    margin-bottom: var(--space-sm, 8px);
}

.tile h3::after,
.tile .h3::after {
    content: "";
    display: block;
    width: 60px;
    /* Breite der Linie */
    height: 2.5px;
    /* Dicke der Linie */
    background-color: var(--h3-color, var(--neutral-gray-600));
    /* Farbe */
    margin-top: 4px;
    /*border-radius: 2px;*/
    /* optional für runde Enden */
}

.tile-body {
    line-height: 1.5;
}

/* “Prose”-Text (lange Absätze) */
.prose p {
    margin: 0 0 .75em;
}

.prose ul,
.prose ol {
    margin: 0 0 .75em 1.25em;
}

/* Meta-Daten als kompakte Definition List */
.meta-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem .75rem;
}

.meta-list dt {
    font-weight: var(--typography-fw-bold, 700);
}

.meta-list dd {
    margin: 0;
}

@media (min-width: 600px) {
    .meta-list {
        grid-template-columns: 180px 1fr;
    }
}

/* Tabellen innerhalb von Tiles (rein für Daten, nicht Layout) */
.simple-table {
    width: 100%;
    border-collapse: collapse;
}

.simple-table th,
.simple-table td {
    padding: .5rem .6rem;
    border-bottom: var(--border-thin, 1px) solid var(--border-color, #e6e6e6);
    text-align: left;
    /* Standard: linksbündig = bessere Lesbarkeit */
}

/* Tabelle Rendite-Risiko */
.risk-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.9rem;
}

.risk-table th {
    text-align: center;
    font-weight: var(--typography-fw-bold);
    padding-bottom: 4px;
}

.risk-table td {
    padding: 0.2rem 0.5rem !important;
    line-height: 1.1 !important;
}

.risk-table th:nth-child(1),
.risk-table td:nth-child(1) {
    text-align: left;
}

.risk-table th:nth-child(2),
.risk-table td:nth-child(2) {
    background-color: var(--palette-opal-100);
}

.risk-table tr:nth-child(8) {
    font-weight: var(--typography-fw-bold);
}


/* Table LARS */
.portfolio-table-lars {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.9rem;
}

.portfolio-table-lars th:nth-child(1),
.portfolio-table-larstd:nth-child(1) {
    text-align: left;
}

.portfolio-table-lars td {
    vertical-align: middle;
    padding: .35rem .5rem;
}

.lars-cell-two-lines>div:first-child {
    font-weight: 600;
    line-height: 1.1;
}

.lars-cell-two-lines>div+div {
    font-weight: 400;
    line-height: 1.1;
}

.lars-cell-icon {
    height: 14px;
    display: inline-block;
}

/* Factsheet als PDF */
.pdf-fs-thumbnail {
    display: block;
    max-width: 100%;
    max-height: 400px;
    height: auto;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    /* weicher Übergang */
    cursor: pointer;
    /* zeigt Hand-Cursor beim Drüberfahren */
}

.pdf-fs-thumbnail:hover {
    transform: scale(1.05);
    /* leicht vergrößern */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    /* dezenter Schatten */
}

.pdf-fs-thumbnail:active {
    transform: scale(0.98);
    /* kleiner beim Klick */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.svg-pto_logos {
    display: block;
    max-width: 100%;
    max-height: 400px;
    height: auto;
    width: auto;
    object-fit: contain;
    margin: 20 auto;

}

/* Responsive Chart-Container (16:9) */
.chart-box-perf {
    width: 100%;
    aspect-ratio: 16 / 12;
    /*
    height: 480px;
    height: 100%;
    aspect-ratio: 16 / 9;
    */
    /* moderner Weg */
    background: #f5f5f7;
}

.chart-box-area {
    width: 100%;
    aspect-ratio: 16 / 10;
    /*
    height: 480px;
    aspect-ratio: 16 / 9;
    */
    /* moderner Weg */
    background: #f5f5f7;
}

.chart-box-sector {
    width: 100%;
    aspect-ratio: 16 / 12;
    /*
    height: 480px;
    */
    background: #f5f5f7;
}

.chart-box-rendite {
    width: 100%;
    aspect-ratio: 16 / 12;
    /*
    height: 480px;
    */
    background: #f5f5f7;
}

/* Fallback für ältere Browser ohne aspect-ratio */
@supports not (aspect-ratio: 1) {
    .chart-box {
        position: relative;
        padding-top: 56.25%;
    }

    .chart-box>* {
        position: absolute;
        inset: 0;
    }
}

/* Kopfbereich */
.lv-header {
    margin: var(--space-lg, 24px) 0;
}

.lv-title {
    margin: .25rem 0 0;
    padding: 1rem .5rem .5rem .5rem;
}

.lv-subtitle {
    color: #555;
    padding: 1rem .5rem;
}


/* --- Hard mobile force: immer einspaltig unter 768px --- */
@media (max-width: 767px) {
    .tiles-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .tiles-grid>* {
        grid-column: 1 / -1 !important;
        width: auto !important;
        /* falls irgendein width:50% reinfunkt */
        float: none !important;
        /* falls Floats aus Bootstrap o.ä. greifen */
    }
}