/* Änderungsprotokoll: 2026-07-28 | parent-agent | @skill-css-rules, @skill-change-provenance | Home Grid-Shell Desktop, Mobile Inhaltshoehe */

/* Mobile First: Inhaltshoehe, Footer direkt unter Demo */
html body .base-layout-main-container:has(.home-mac-app) {
    display: flex;
    flex-direction: column;
    min-height: auto;
    height: auto;
}

html body .base-layout-content-area:has(.home-mac-app) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    padding: 0;
    margin: 0;
    background-color: var(--color-surface);
    box-sizing: border-box;
}

.home-mac-app {
    font-family: var(--font-family-primary);
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    background-color: var(--color-surface);
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.home-mac-body {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    background-color: var(--color-surface);
}

.home-mac-message-list {
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
    background-color: var(--color-list-bg);
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    overflow: visible;
    box-sizing: border-box;
}

.home-mac-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 14px 10px 16px;
    background-color: var(--color-list-bg);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: 2;
}

.home-mac-list-title {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-headline);
    letter-spacing: var(--letter-spacing-tight);
}

.home-mac-list-count {
    min-width: 1.15rem;
    padding: 0 6px;
    border-radius: var(--radius-badge);
    background-color: var(--color-text-muted);
    color: var(--color-text-inverse);
    font-size: 0.625rem;
    font-weight: var(--font-weight-semibold);
    text-align: center;
    line-height: 1.5;
}

.home-mac-message-row {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px 14px 10px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--color-border-subtle);
    background-color: transparent;
    transition: background-color var(--transition-normal);
    box-sizing: border-box;
}

.home-mac-message-row:hover {
    background-color: var(--color-surface-hover);
}

.home-mac-message-row-unread .home-mac-message-sender {
    font-weight: var(--font-weight-semibold);
}

.home-mac-message-row-unread .home-mac-message-subject {
    font-weight: var(--font-weight-semibold);
    color: var(--color-headline);
}

.home-mac-message-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 1px;
}

.home-mac-message-sender {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.home-mac-message-date {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.home-mac-message-subject {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-mac-message-preview {
    font-size: var(--font-size-xs);
    line-height: 1.35;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.home-mac-reading-pane {
    flex: 0 0 auto;
    min-width: 0;
    overflow: visible;
    background-color: var(--color-surface);
    padding: 18px 16px 24px;
}

.home-mac-reading-article {
    display: none;
    max-width: 42rem;
}

.home-mac-reading-article:target {
    display: block;
}

.home-mac-reading-pane:not(:has(.home-mac-reading-article:target)) .home-mac-reading-article-default {
    display: block;
}

.home-mac-body:not(:has(.home-mac-reading-article:target)) #home-mac-message-hero,
.home-mac-body:has(#home-mac-reading-hero:target) #home-mac-message-hero,
.home-mac-body:has(#home-mac-reading-feature-1:target) #home-mac-message-feature-1,
.home-mac-body:has(#home-mac-reading-feature-2:target) #home-mac-message-feature-2,
.home-mac-body:has(#home-mac-reading-feature-3:target) #home-mac-message-feature-3 {
    background-color: var(--color-selection);
}

.home-mac-body:not(:has(.home-mac-reading-article:target)) #home-mac-message-hero .home-mac-message-sender,
.home-mac-body:not(:has(.home-mac-reading-article:target)) #home-mac-message-hero .home-mac-message-subject,
.home-mac-body:has(#home-mac-reading-hero:target) #home-mac-message-hero .home-mac-message-sender,
.home-mac-body:has(#home-mac-reading-hero:target) #home-mac-message-hero .home-mac-message-subject,
.home-mac-body:has(#home-mac-reading-feature-1:target) #home-mac-message-feature-1 .home-mac-message-sender,
.home-mac-body:has(#home-mac-reading-feature-1:target) #home-mac-message-feature-1 .home-mac-message-subject,
.home-mac-body:has(#home-mac-reading-feature-2:target) #home-mac-message-feature-2 .home-mac-message-sender,
.home-mac-body:has(#home-mac-reading-feature-2:target) #home-mac-message-feature-2 .home-mac-message-subject,
.home-mac-body:has(#home-mac-reading-feature-3:target) #home-mac-message-feature-3 .home-mac-message-sender,
.home-mac-body:has(#home-mac-reading-feature-3:target) #home-mac-message-feature-3 .home-mac-message-subject {
    color: var(--color-selection-text);
}

.home-mac-body:not(:has(.home-mac-reading-article:target)) #home-mac-message-hero .home-mac-message-date,
.home-mac-body:not(:has(.home-mac-reading-article:target)) #home-mac-message-hero .home-mac-message-preview,
.home-mac-body:has(#home-mac-reading-hero:target) #home-mac-message-hero .home-mac-message-date,
.home-mac-body:has(#home-mac-reading-hero:target) #home-mac-message-hero .home-mac-message-preview,
.home-mac-body:has(#home-mac-reading-feature-1:target) #home-mac-message-feature-1 .home-mac-message-date,
.home-mac-body:has(#home-mac-reading-feature-1:target) #home-mac-message-feature-1 .home-mac-message-preview,
.home-mac-body:has(#home-mac-reading-feature-2:target) #home-mac-message-feature-2 .home-mac-message-date,
.home-mac-body:has(#home-mac-reading-feature-2:target) #home-mac-message-feature-2 .home-mac-message-preview,
.home-mac-body:has(#home-mac-reading-feature-3:target) #home-mac-message-feature-3 .home-mac-message-date,
.home-mac-body:has(#home-mac-reading-feature-3:target) #home-mac-message-feature-3 .home-mac-message-preview {
    color: var(--color-selection-muted);
}

.home-mac-body:not(:has(.home-mac-reading-article:target)) #home-mac-message-hero:hover,
.home-mac-body:has(#home-mac-reading-hero:target) #home-mac-message-hero:hover,
.home-mac-body:has(#home-mac-reading-feature-1:target) #home-mac-message-feature-1:hover,
.home-mac-body:has(#home-mac-reading-feature-2:target) #home-mac-message-feature-2:hover,
.home-mac-body:has(#home-mac-reading-feature-3:target) #home-mac-message-feature-3:hover {
    background-color: var(--color-selection);
}

.home-mac-reading-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border-subtle);
}

.home-mac-reading-title {
    margin: 0 0 12px;
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-headline);
    letter-spacing: var(--letter-spacing-tight);
    line-height: 1.3;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.home-mac-reading-meta {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.home-mac-reading-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.55rem;
}

.home-mac-reading-meta-label {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-normal);
}

.home-mac-reading-meta-value {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.home-mac-reading-meta-sep {
    display: none;
}

.home-mac-reading-body {
    margin: 0 0 18px;
    font-size: var(--font-size-base);
    line-height: 1.55;
    color: var(--color-text);
}

.home-mac-reading-hint {
    display: none;
}

.home-mac-reading-visual {
    margin: 0 0 20px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 150px;
    background-color: var(--color-list-bg);
}

.home-mac-reading-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.home-mac-reading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
}

.home-mac-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 16px;
    border-radius: var(--radius-control);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color var(--transition-normal);
}

.home-mac-button-primary {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
}

.home-mac-button-primary:hover {
    background-color: var(--color-primary-hover);
}

.home-mac-button-text {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    text-decoration: none;
}

.home-mac-button-text:hover {
    opacity: 0.85;
}

.home-mac-message-subject {
    white-space: normal;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Desktop: Grid-Shell ohne Totflaeche — explizite Rows gegen Whitespace-Grid-Items */
@media (min-width: 1024px) {
    html body .base-layout-main-container:has(.home-mac-app) {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr) auto auto;
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    html body .base-layout-main-container:has(.home-mac-app) > .base-layout-header {
        grid-row: 1;
        grid-column: 1;
        position: relative;
    }

    html body .base-layout-main-container:has(.home-mac-app) > .base-messages-container {
        grid-row: 2;
        grid-column: 1;
    }

    html body .base-layout-main-container:has(.home-mac-app) > .base-layout-content-area {
        grid-row: 3;
        grid-column: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-self: stretch;
        justify-self: stretch;
    }

    html body .base-layout-main-container:has(.home-mac-app) > .base-footer {
        grid-row: 4;
        grid-column: 1;
    }

    html body .base-layout-main-container:has(.home-mac-app) > #cookie-consent-layout-spacer {
        grid-row: 5;
        grid-column: 1;
    }

    .home-mac-app {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .home-mac-body {
        flex: 1 1 auto;
        flex-direction: row;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .home-mac-message-list {
        flex: 0 0 360px;
        width: 360px;
        max-width: 360px;
        height: 100%;
        min-height: 0;
        align-self: stretch;
        border-right: 1px solid var(--color-border);
        border-bottom: none;
        overflow-y: auto;
    }

    .home-mac-message-subject {
        white-space: nowrap;
        display: block;
        -webkit-line-clamp: unset;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .home-mac-reading-pane {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 28px 40px 36px;
    }

    .home-mac-reading-title {
        font-size: 1.625rem;
        line-height: 1.25;
    }

    .home-mac-reading-visual {
        max-width: 22rem;
        max-height: 140px;
    }
}
