/* ============================================================
   single-teil1_referenz.php — Case Study Template Styles
   ============================================================ */

/* ── HERO ─────────────────────────────────────────────────── */
.ref-hero {
    position: relative;
    padding-top: calc(var(--wp--custom--header-height, 100px) + clamp(24px, 3vh, 48px));
    background-color: var(--wp--preset--color--surface, #F5F4EF);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.ref-hero__content {
    position: relative;
    z-index: 2;
    color: var(--wp--preset--color--text-main, #111);
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: clamp(32px, 5vh, 64px);
}

.ref-hero__top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: clamp(24px, 4vh, 32px);
    flex-wrap: wrap;
}

.ref-hero__cats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ref-cat-tag {
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--xs);
    color: var(--wp--preset--color--text-muted, #555);
    background: transparent;
    padding: 0;
} 

.ref-hero__title {
    font-family: var(--wp--preset--font-family--heading);
    font-size: var(--wp--preset--font-size--3xl);
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--wp--preset--color--text-main, #111);
    max-width: 800px;
    margin-bottom: 32px;
}

.ref-hero__links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.ref-link-btn {
    font-family: 'Inter', sans-serif;
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 24px;
    border-radius: 40px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #111;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.ref-link-btn:hover {
    background: var(--wp--preset--color--accent, #FC490B);
}

.ref-link-btn--ghost {
    background: transparent;
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.ref-link-btn--ghost:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ── HERO SHOWCASE ───────────────────────────────────────── */
.ref-hero__showcase {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(16px, 3vw, 40px);
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
    padding: 0 var(--layout-padding, 40px);
    box-sizing: border-box;
}

.ref-hero__showcase--both {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.12));
}

/* Device Frame — consistent border via custom property */
.ref-hero__showcase-item {
    --frame-w: 8px;
    --showcase-radius: clamp(6px, 1vw, 12px);
    background: rgba(0, 0, 0, 0.15);
    padding: var(--frame-w) var(--frame-w) 0;
    border-radius: var(--showcase-radius) var(--showcase-radius) 0 0;
    position: relative;
}

.ref-hero__showcase-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top;
    border-radius: calc(var(--showcase-radius) - var(--frame-w)) calc(var(--showcase-radius) - var(--frame-w)) 0 0;
}

/* CLS prevention: reserve height before image loads */
.ref-hero__showcase-landscape img {
    aspect-ratio: 16 / 10;
}

/* ── Strict 4:1 flex ratio (WP.org pattern) ── */
.ref-hero__showcase-landscape {
    flex: 4;
    min-width: 0;
    z-index: 1;
}

.ref-hero__showcase-mobile {
    flex: 1;
    min-width: 0;
    z-index: 2;
    aspect-ratio: 10 / 18;
    max-height: 100%;
    overflow: hidden;
    align-self: flex-end;
}

/* ── Breakpoints ── */

@media (max-width: 768px) {
    .ref-hero__showcase {
        gap: 0;
        max-width: 600px;
    }
    .ref-hero__showcase-landscape {
        flex: 4;
        flex-shrink: 0;
    }
    .ref-hero__showcase-mobile {
        flex: 1.2;
        flex-shrink: 0;
        margin-left: -15%;
    }
}

@media (max-width: 480px) {
    .ref-hero__showcase {
        padding: 0 var(--layout-padding, 20px);
        max-width: 100%;
    }

    .ref-hero__showcase-mobile {
        flex: 1.4;
        margin-left: -20%;
    }
}


/* ── BASELINE ─────────────────────────────────────────────── */
.ref-baseline {
    padding-block: clamp(48px, 8vw, 96px);
    border-bottom: 1px solid var(--wp--preset--color--surface, #EAEAE6);
}

.ref-baseline__grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: clamp(32px, 6vw, 80px);
    align-items: start;
}

/* Left: Meta */
.ref-baseline__meta {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ref-meta-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ref-meta-group--logo {
    margin-bottom: 8px;
}

.ref-meta-group--spaced {
    margin-top: 12px;
}

.ref-meta-logo {
    height: 32px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    /* Da Baseline oft weiss/hellgrau ist, brauchen wir kein Invert ausser im dark mode */
}

.ref-meta-label {
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--text-muted, #888);
}

.ref-meta-value {
    font-family: var(--wp--preset--font-family--heading, 'Space Grotesk', sans-serif);
    font-size: var(--wp--preset--font-size--base);
    font-weight: 500;
    color: var(--wp--preset--color--text-main, #111);
}

.ref-social-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ref-social-pill {
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 99px;
    background: var(--wp--preset--color--surface, #F0F0EC);
    color: var(--wp--preset--color--text-main, #111);
    text-decoration: none;
    transition: background 0.2s ease;
}

.ref-social-pill:hover {
    background: var(--wp--preset--color--accent, #FC490B);
    color: #fff;
}

/* Right: Metrics Grid */
.ref-baseline__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    background: transparent;
}

.ref-metric-cell {
    background: #F8F8F6;
    padding: clamp(16px, 3vw, 24px); /* Reduziert von clamp(24px, 4vw, 40px) */
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* Leichter Drop-shadow requested */
    border-radius: 12px;
}

.ref-metric-val {
    font-family: var(--wp--preset--font-family--heading, 'Space Grotesk', sans-serif);
    font-size: var(--wp--preset--font-size--2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--wp--preset--color--text-main, #111);
}

/* Right Container Wrapper */
.ref-baseline__details {
    display: flex;
    flex-direction: column;
    gap: clamp(48px, 6vw, 80px);
}

.ref-baseline__quote {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid var(--wp--preset--color--accent);
}

.ref-quote-text {
    font-size: var(--wp--preset--font-size--lg);
    line-height: 1.4;
    font-weight: 500;
    color: var(--wp--preset--color--text-main, #111);
    margin-bottom: 24px;
    font-style: italic;
}

.ref-quote-author {
    font-size: var(--wp--preset--font-size--base);
    font-weight: 600;
    color: var(--wp--preset--color--text-muted, #777);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ref-metric-label {
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wp--preset--color--text-muted, #555);
}

/* ── INNERCONTENT ─────────────────────────────────────────── */
/* ref-content is a full-width wrapper (NO .contain class).
   Custom blocks (product-dossier, etc.) manage their own .container.
   Raw WP elements (p, h2, ul...) get containment via CSS below.
   This matches the service-page approach: no double padding. */
.ref-content {
    padding-block: clamp(64px, 10vw, 128px);
}

/* Raw WP elements that have no own .container wrapper:
   contain them to match the header alignment */
.ref-content > p,
.ref-content > h2,
.ref-content > h3,
.ref-content > h4,
.ref-content > h5,
.ref-content > h6,
.ref-content > ul,
.ref-content > ol,
.ref-content > blockquote,
.ref-content > hr,
.ref-content > .wp-block-paragraph,
.ref-content > .wp-block-heading,
.ref-content > .wp-block-list,
.ref-content > .wp-block-quote,
.ref-content > .wp-block-separator,
.ref-content > .wp-block-image:not(.alignfull):not(.alignwide) {
    max-width: var(--layout-max-width);
    margin-inline: auto;
    padding-inline: var(--layout-padding);
}

/* Referenz content heading scale */
.ref-content h2 {
    font-size: var(--wp--preset--font-size--xl);
}

/* Constrain all content images to readable width */
.ref-content img {
    max-width: 700px;
    margin-inline: auto;
    display: block;
}

/* ── NEXT-PROJECT Footer ──────────────────────────────────── */
.ref-next-wrap {
    padding-bottom: clamp(64px, 10vw, 128px); /* spacing below loop */
}

/* ── NEXT-PROJECT: Split-Card Layout ──────────────────────── */

.ref-next-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: start;          /* ← compact, no dead space */
    text-decoration: none;
    color: inherit;
}

@media (min-width: 768px) {
    .ref-next-card {
        grid-template-columns: 1.2fr 1fr;
    }
}

/* ── Visual (Device Frame) ── */

.ref-next-card__visual {
    width: 100%;
    max-width: 560px;
}

.ref-next-card__frame {
    background: #a7a7a6;
    padding: clamp(8px, 1.5vw, 14px);
    padding-bottom: 0;
    border-radius: clamp(12px, 2vw, 20px) clamp(12px, 2vw, 20px) 0 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ref-next-card:hover .ref-next-card__frame {
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.14);
    transform: translateY(-3px);
}

.ref-next-card__frame img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: none;
}

.ref-next-card__frame--empty {
    background: #a7a7a6;
}

.ref-next-card__placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #1a1a1a;
}

/* ── Meta (Right Column) ── */

.ref-next-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 8px;
}

.ref-next-card__eyebrow {
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--text-muted, #888);
    margin-bottom: 12px;
}

.ref-next-card__title {
    font-family: var(--wp--preset--font-family--heading, 'Space Grotesk', sans-serif);
    font-size: var(--wp--preset--font-size--2xl);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--wp--preset--color--text-main, #111);
    margin: 0 0 8px;
}

.ref-next-card__service {
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--preset--color--text-muted, #888);
    margin-bottom: 24px;
}

/* ── Metrics ── */

.ref-next-card__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0;
    border-top: 1px solid var(--wp--preset--color--surface, #EAEAE6);
    padding-top: 20px;
    margin-bottom: 24px;
}

.ref-next-card__metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-block: 8px;
}

.ref-next-card__metric-val {
    font-family: var(--wp--preset--font-family--heading, 'Space Grotesk', sans-serif);
    font-size: var(--wp--preset--font-size--xl);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--wp--preset--color--text-main, #111);
    line-height: 1.1;
}

.ref-next-card__metric-label {
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wp--preset--color--text-muted, #888);
}

/* ── CTA ── */

.ref-next-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wp--preset--color--text-muted, #888);
    transition: color 0.3s ease;
}

.ref-next-card__cta svg {
    transition: transform 0.3s ease;
}

.ref-next-card:hover .ref-next-card__cta {
    color: var(--wp--preset--color--accent, #FC490B);
}

.ref-next-card:hover .ref-next-card__cta svg {
    transform: translateX(4px);
}

/* ── SLIDER NAV (shared rfp-* nav component) ─────────────── */
.ref-next-wrap .rfp-slider__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 2vw, 24px);
    margin-top: clamp(24px, 4vw, 40px);
    padding: 0 100px; /* Compensate for parent negative margin */
}

.ref-next-wrap .rfp-nav-arrow {
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(0, 0, 0, 0.4);
    transition: color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.ref-next-wrap .rfp-nav-arrow:hover {
    color: var(--wp--preset--color--base, #1a1a1a);
    border-color: rgba(0, 0, 0, 0.2);
}

.ref-next-wrap .rfp-nav-arrow--prev svg {
    transform: rotate(180deg);
}

.ref-next-wrap .rfp-nav-arrow svg {
    width: 20px;
    height: 20px;
}

.ref-next-wrap .rfp-slider__dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ref-next-wrap .rfp-dot {
    width: 12px;
    height: 12px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.12);
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Invisible 48×48 touch target (a11y) */
.ref-next-wrap .rfp-dot::after {
    content: '';
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
}

.ref-next-wrap .rfp-dot.is-active {
    width: 100px;
    background: rgba(0, 0, 0, 0.08);
}

.ref-next-wrap .rfp-dot__fill {
    position: absolute;
    inset: 0;
    background: var(--wp--preset--color--accent, #fc490b);
    transform-origin: left center;
    transform: scaleX(0);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .ref-baseline__grid {
        grid-template-columns: 1fr;
    }

    .ref-baseline__metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1400px) {
    .ref-hero__showcase-mobile {
        max-width: 250px;
    }
}
