/**
 * File: assets/css/frontend/general.css
 * Purpose: Applies General Theme Setup layout, container, content-density, responsive, caption, and print preferences.
 * Scope: Theme-owned generic frontend presentation only; header, footer, blog, pages, and plugin modules remain excluded.
 * Related PHP: src/Frontend/General/GeneralPresentation.php, index.php
 * Related CSS: assets/css/foundation/tokens.css, assets/css/foundation/base.css
 * Related JS: None
 * Package: HyperDAF Pro
 */

:root {
    --hdf-layout-gutter-desktop: var(--hdf-spacing-6);
    --hdf-layout-gutter-tablet: var(--hdf-spacing-5);
    --hdf-layout-gutter-mobile: var(--hdf-spacing-4);
    --hdf-content-card-padding: var(--hdf-spacing-6);
    --hdf-content-list-gap: var(--hdf-spacing-6);
    --hdf-content-block-padding: var(--hdf-spacing-10);
}

body.hdf-surface-white {
    background: var(--hdf-color-surface);
}

body.hdf-surface-subtle {
    background: var(--hdf-color-surface-subtle);
}

body.hdf-layout-contained .hdf-site {
    width: min(
        calc(100% - (2 * var(--hdf-layout-gutter-desktop))),
        var(--hdf-layout-site-max)
    );
    margin-inline: auto;
    background: var(--hdf-color-surface);
    box-shadow: var(--hdf-shadow-sm);
}

.hdf-site-main {
    width: min(
        calc(100% - (2 * var(--hdf-layout-gutter-desktop))),
        var(--hdf-layout-wide)
    );
    padding-block: var(--hdf-content-block-padding);
}

.hdf-content-list {
    gap: var(--hdf-content-list-gap);
}

.hdf-entry,
.hdf-empty-state {
    padding: var(--hdf-content-card-padding);
}

body.hdf-content-density-compact {
    --hdf-content-card-padding: var(--hdf-spacing-5);
    --hdf-content-list-gap: var(--hdf-spacing-4);
    --hdf-content-block-padding: var(--hdf-spacing-8);
}

body.hdf-content-density-relaxed {
    --hdf-content-card-padding: var(--hdf-spacing-8);
    --hdf-content-list-gap: var(--hdf-spacing-8);
    --hdf-content-block-padding: var(--hdf-spacing-12);
}

body.hdf-card-style-flat .hdf-entry,
body.hdf-card-style-flat .hdf-empty-state {
    border-color: transparent;
    background: transparent;
    box-shadow: var(--hdf-shadow-none);
}

body.hdf-card-style-bordered .hdf-entry,
body.hdf-card-style-bordered .hdf-empty-state {
    border-color: var(--hdf-color-border);
    box-shadow: var(--hdf-shadow-none);
}

body.hdf-card-style-elevated .hdf-entry,
body.hdf-card-style-elevated .hdf-empty-state {
    border-color: var(--hdf-color-border);
    box-shadow: var(--hdf-shadow-md);
}

body.hdf-content-links-always .hdf-entry__content a:not(.hdf-read-more),
body.hdf-content-links-always .hdf-empty-state a {
    text-decoration-line: underline;
}

body.hdf-content-links-hover .hdf-entry__content a:not(.hdf-read-more),
body.hdf-content-links-hover .hdf-empty-state a {
    text-decoration-line: none;
}

body.hdf-content-links-hover .hdf-entry__content a:not(.hdf-read-more):hover,
body.hdf-content-links-hover .hdf-entry__content a:not(.hdf-read-more):focus-visible,
body.hdf-content-links-hover .hdf-empty-state a:hover,
body.hdf-content-links-hover .hdf-empty-state a:focus-visible {
    text-decoration-line: underline;
}

.hdf-read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--hdf-spacing-2);
    margin-block-start: var(--hdf-spacing-4);
    color: var(--hdf-color-primary-strong);
    font-weight: var(--hdf-typography-weight-semibold);
    text-decoration: none;
}

.hdf-read-more::after {
    content: "→";
    transition: transform var(--hdf-motion-duration-fast) var(--hdf-motion-easing-standard);
}

.hdf-read-more:hover::after,
.hdf-read-more:focus-visible::after {
    transform: translateX(var(--hdf-spacing-1));
}

.hdf-entry__edit-link {
    margin-block-start: var(--hdf-spacing-5);
    padding-block-start: var(--hdf-spacing-4);
    border-block-start: var(--hdf-border-width-default) solid var(--hdf-color-border);
    color: var(--hdf-color-text-muted);
    font-size: var(--hdf-typography-size-sm);
}

body.hdf-caption-subtle .wp-caption,
body.hdf-caption-subtle figure.wp-block-image:has(figcaption) {
    padding: var(--hdf-spacing-2);
    border: var(--hdf-border-width-default) solid var(--hdf-color-border);
    border-radius: var(--hdf-radius-md);
    background: var(--hdf-color-surface-subtle);
}

.wp-caption-text,
.wp-element-caption,
.wp-block-image figcaption {
    color: var(--hdf-color-text-muted);
    font-size: var(--hdf-typography-size-sm);
    line-height: var(--hdf-typography-line-height-base);
}

body.hdf-protect-horizontal-overflow .hdf-site {
    overflow-x: clip;
}


@media (max-width: 64rem) {
    body.hdf-layout-contained .hdf-site,
    .hdf-site-main {
        width: min(
            calc(100% - (2 * var(--hdf-layout-gutter-tablet))),
            var(--hdf-layout-wide)
        );
    }
}

@media (max-width: 47.99rem) {
    body.hdf-layout-contained .hdf-site,
    .hdf-site-main {
        width: min(
            calc(100% - (2 * var(--hdf-layout-gutter-mobile))),
            var(--hdf-layout-wide)
        );
    }

    body.hdf-mobile-type-compact {
        font-size: 0.9375rem;
    }

    body.hdf-mobile-type-comfortable {
        font-size: 1.0625rem;
    }

    body.hdf-mobile-content-edge .hdf-site-main {
        width: 100%;
    }

    body.hdf-mobile-content-edge .hdf-entry,
    body.hdf-mobile-content-edge .hdf-empty-state {
        border-inline: 0;
        border-radius: var(--hdf-radius-none);
        box-shadow: var(--hdf-shadow-none);
    }

    body.hdf-mobile-media-square .hdf-entry img,
    body.hdf-mobile-media-square .hdf-entry video,
    body.hdf-mobile-media-square .hdf-entry figure {
        border-radius: var(--hdf-radius-none);
    }
}

@media (prefers-reduced-motion: reduce) {

    .hdf-read-more::after {
        transition: none;
    }
}

@media print {
    body.hdf-print-optimized {
        background: var(--hdf-color-surface);
    }

    body.hdf-print-optimized .hdf-entry,
    body.hdf-print-optimized .hdf-empty-state {
        border-color: var(--hdf-color-border);
        box-shadow: var(--hdf-shadow-none);
        break-inside: avoid;
    }

    body.hdf-print-optimized .hdf-read-more,
    body.hdf-print-optimized .hdf-entry__edit-link,
    body.hdf-print-optimized .navigation.pagination {
        display: none;
    }
}
