/* ============================================================
   Pablo Bürmann case study (pablo-burmann.html).
   body.sub: tokens, header, footer, cookie banner, hero and buttons
   come from home.css (shell rules scoped to :is(.home, .sub)). This file
   only holds the case-study content: article text and the before/after
   slider. Loaded after styles.css and home.css.
   ============================================================ */

/* One container for gallery and article: 1280px, same side padding as the header and the hero */
.sub :is(.ayd-gallery, .case-article) {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}
@media (max-width: 1024px) {
    .sub :is(.ayd-gallery, .case-article) { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (max-width: 768px) {
    .sub :is(.ayd-gallery, .case-article) { padding-left: 1.2rem; padding-right: 1.2rem; }
}
/* styles.css sets the hero side padding to 2rem / 1.25rem with !important, 8px / 1px off the header and the blocks below it: align it here */
@media (max-width: 1024px) {
    .sub .hero-inner { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}
@media (max-width: 768px) {
    .sub .hero-inner { padding-left: 1.2rem !important; padding-right: 1.2rem !important; }
}

/* ---------- Before / after gallery ---------- */
/* styles.css gives every <section> display:flex, margin-top:120px, padding and a bottom border */
/* The gallery already uses the shell container (1280px, header gutters), so the grid sits outside the narrower text column: 1 / 2 / 3 columns */
.sub .ayd-gallery {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 16px;
    margin-top: 0;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
    border-bottom: 0;
    background: #fff;
    min-height: 0;
}
@media (min-width: 600px) {
    .sub .ayd-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .sub .ayd-gallery { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.sub .ayd-slider { min-width: 0; }
.sub .ayd-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--ink);
    border-radius: 0;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y; /* a horizontal drag moves the slider, a vertical swipe still scrolls the page */
}
.sub .ayd-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    pointer-events: none;
}
.sub .ayd-img--before { z-index: 1; }
.sub .ayd-img--after { z-index: 2; clip-path: inset(0 50% 0 0); }
.sub .ayd-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 3;
    width: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    pointer-events: none;
}
/* Square 44px handle: white with a 1px ink border; ink fill while dragging */
.sub .ayd-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 0;
    transform: translate(-50%, -50%);
    cursor: grab;
    touch-action: pan-y;
}
.sub .ayd-handle:active,
.sub .ayd-container:active .ayd-handle { background: var(--ink); color: #fff; }
.sub .ayd-handle svg { flex: none; width: 20px; height: 10px; pointer-events: none; }
/* One small label per slider, centered at the top: ANTES / DESPUÉS depending on which side of the center the handle is */
.sub .ayd-label {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 4;
    padding: 0.1rem 0.4rem;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 0;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transform: translateX(-50%);
    transition: opacity 150ms ease;
    pointer-events: none;
}
.sub .ayd-label.is-swapping { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .sub .ayd-label { transition: none; }
}
@media (max-width: 480px) {
    .sub .ayd-container { aspect-ratio: 4 / 3; }
}

/* ---------- Article ---------- */
.sub .case-article { padding-bottom: 5rem; }
.sub .case-intro {
    max-width: 75ch;
    margin: 0 0 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--ink);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink);
}
.sub .case-section h2 {
    margin: 0 0 1rem;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: var(--ink);
}
.sub .case-section h3 {
    margin: 2rem 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--ink);
}
.sub .case-section p { max-width: 75ch; margin: 0 0 1rem; font-size: 1.1rem; line-height: 1.65; color: var(--text-secondary); }
.sub .case-section p:last-child { margin-bottom: 0; }
.sub .case-section ul { max-width: 75ch; margin: 0.6rem 0 1rem; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.sub .case-section li { position: relative; padding-left: 1.2rem; font-size: 1.1rem; line-height: 1.55; color: var(--text-secondary); }
.sub .case-section li::before { content: "–"; position: absolute; left: 0; color: var(--accent); }
.sub .case-divider { height: 0; margin: 2.5rem 0; border: 0; border-top: 1px solid var(--ink); background: none; }

/* Text link to Pablo's own site, same look as the shell's .price-link */
.sub .case-link { display: inline-block; padding: 9px 0; margin: -9px 0; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.sub .case-link:hover { color: var(--ink); }
.sub .case-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Closing call to action (flat bordered box; the button is the shell's .btn .btn-accent) */
.sub .case-cta { max-width: 75ch; margin-top: 3rem; padding: 2rem; border: 1px solid var(--ink); background: #fff; }
.sub .case-cta h3 { margin: 0 0 0.6rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); }
.sub .case-cta p { max-width: 60ch; margin: 0 0 1.2rem; font-size: 1.1rem; line-height: 1.55; color: var(--text-secondary); }
/* Primary button plus the shell's .price-link ("Consulta precios") on one wrapping row */
.sub .case-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.sub .case-cta-actions .price-link { align-self: center; }
@media (max-width: 1024px) {
    .sub .case-section h2 { font-size: 1.8rem; }
}
@media (max-width: 480px) {
    .sub .case-section h2 { font-size: 1.6rem; }
    .sub .case-intro { font-size: 1.1rem; }
    .sub .case-cta { padding: 1.5rem; }
}
