/* ═══════════════════════════════════════════════════════════════════════════
   WORKFLOW DETAIL PAGE
   File: workflow-detail.css
   Page: /n8n-resources/<workflow>

   DARK THEME — matches the home page (deep green-black, neon-green accents).
   Shared verbatim across every /n8n-resources workflow detail page.

   Layers
   ─────
   1.  Layout overrides — detail page uses lighter vertical spacing
   2.  Section 1 — Title Block
   3.  Section 2 — Workflow Image
   4.  Section 3 — Button Group
   5.  Section 4 — Description + Requirements
   6.  Section 5 — CTA
   7.  Responsive overrides
   8.  Reduced-motion
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   1. LAYOUT OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tighten the main wrapper — index page has aggressive padding for the card
   grid; detail pages need a gentler rhythm. */
.wf-detail-main {
    padding-top: 7rem;        /* clears fixed 5rem navbar + breathing room */
    padding-bottom: 4rem;
}

/* All workflow-detail sections share the container already defined in
   n8n-resources.css (.n8n-section-container) so we only add per-section
   vertical offsets here. */
.wf-title-section    { padding-top: 2.5rem; padding-bottom: 0; }
.wf-image-section    { padding-top: 2.25rem; padding-bottom: 0; }
.wf-buttons-section  { padding-top: 2rem;    padding-bottom: 0; }
.wf-description-section { padding-top: 3rem; padding-bottom: 0; }
.wf-cta-section      { padding-top: 4rem;    padding-bottom: 5rem; position: relative; }

/* ═══════════════════════════════════════════════════════════════════════════
   1.5 BREADCRUMB & BACK NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
.wf-nav-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-top: 1.5rem;
}

.wf-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-slate-border);
    color: var(--color-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--dur-fast) var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.wf-back-btn:hover {
    background-color: rgba(83, 255, 43, 0.08);
    border-color: rgba(83, 255, 43, 0.35);
    color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(66, 255, 36, 0.12);
    transform: translateX(-3px);
}

.wf-back-btn iconify-icon {
    font-size: 1.1rem;
    transition: transform var(--dur-fast) var(--ease-out);
}
.wf-back-btn:hover iconify-icon {
    transform: translateX(-3px);
}

.wf-breadcrumb-wrap {
    flex: 1;
}

.wf-nav-top .n8n-breadcrumb ol {
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. SECTION 1 — TITLE BLOCK
   ═══════════════════════════════════════════════════════════════════════════ */
.wf-title-inner {
    margin-inline: auto;
    max-width: 44rem;      /* ~700px — keeps long titles readable */
    text-align: center;
}

.wf-title {
    font-family: var(--font-ds);
    font-size: clamp(1.65rem, 4vw + 0.5rem, 3.25rem);
    font-weight: 700;
    line-height: 1.13;
    letter-spacing: -0.02em;
    color: var(--color-navy);
    margin: 0;
    /* Prevent flash of invisible text on slow connections */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle gradient accent on first line — design system §2.2 spirit */
.wf-title em {
    font-style: normal;
    background-image: linear-gradient(to right, #059669, #42ff24, #d0ff00, #059669);
    background-size: 300% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradient-text-flow 8s linear infinite;
}

@supports not (background-clip: text) {
    .wf-title em { color: #42ff24; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   3. SECTION 2 — WORKFLOW IMAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.wf-image-frame {
    width: 100%;
    border-radius: 1.25rem;
    border: 1px solid var(--color-slate-border);
    background-color: var(--color-bg-card);
    padding: 0.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    /* Smooth load-in */
    transition: box-shadow var(--dur-normal) var(--ease-out), border-color var(--dur-normal) var(--ease-out);
}

.wf-image-frame:hover {
    box-shadow: 0 10px 44px rgba(0, 0, 0, 0.5), 0 0 30px -14px rgba(66, 255, 36, 0.5);
    border-color: rgba(83, 255, 43, 0.22);
}

.wf-diagram-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.875rem;
    border: 1px solid var(--color-slate-border);
    object-fit: cover;
}


/* ═══════════════════════════════════════════════════════════════════════════
   4. SECTION 3 — BUTTON GROUP
   ═══════════════════════════════════════════════════════════════════════════ */
.wf-btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-inline: auto;
    width: 100%;
    max-width: 32.5rem;   /* ~520px */
}

/* ── Primary download button — neon-green primary ───────────────────────── */
.wf-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;

    width: 100%;
    height: 3.5rem;        /* 56px */
    border-radius: 0.75rem;
    padding-inline: 1.5rem;

    font-family: var(--font-ds);
    font-size: 1rem;
    font-weight: 700;
    color: #050505;
    text-decoration: none;

    background-color: var(--accent-secondary);
    background-image: linear-gradient(135deg, #53FF2B, #2FFF00);
    box-shadow: 0 10px 24px rgba(47, 255, 0, 0.22);

    transition:
        transform  var(--dur-normal) var(--ease-out),
        box-shadow var(--dur-normal) var(--ease-out);

    cursor: pointer;
}

.wf-btn-download:hover {
    transform: scale(1.02);
    box-shadow: 0 14px 30px rgba(47, 255, 0, 0.34);
}

.wf-btn-download:active {
    transform: scale(0.99);
}

.wf-btn-download:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

.wf-btn-download iconify-icon {
    flex-shrink: 0;
    transition: transform var(--dur-normal) ease;
}

.wf-btn-download:hover iconify-icon {
    transform: translateY(-1px);
}

/* ── Social proof line ──────────────────────────────────────────────────── */
.wf-social-proof {
    padding-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
    text-align: center;
    margin: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   5. SECTION 4 — DESCRIPTION + REQUIREMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
.wf-description-inner {
    margin-inline: auto;
    max-width: 48rem;     /* ~768px — comfortable reading line length */
}

.wf-description-heading {
    font-family: var(--font-ds);
    font-size: clamp(1rem, 1.5vw + 0.625rem, 1.25rem);
    font-weight: 700;
    color: var(--color-navy);
    text-align: center;
    margin: 0 0 1rem;
}

.wf-description-body {
    border-radius: 0.875rem;
    border: 1px solid var(--color-slate-border);
    background-color: rgba(255, 255, 255, 0.02);
    padding: 1.75rem 2rem;
    font-family: var(--font-ds);
    font-size: 0.9375rem;     /* 15px — more readable than 14px at full width */
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.68);
}

.wf-description-body p { margin: 0; }
.wf-description-body .mb-4 { margin-bottom: 1rem; }
.wf-description-body .last\:mb-0:last-child { margin-bottom: 0; }

.wf-description-body strong {
    font-weight: 600;
    color: var(--color-navy);
}

.wf-description-body em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
}

/* ── Requirements row ───────────────────────────────────────────────────── */
.wf-requirements {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 1.5rem;
}

.wf-req-label {
    font-family: var(--font-ds);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.wf-req-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wf-req-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--color-slate-border);
    background-color: rgba(255, 255, 255, 0.03);
    font-family: var(--font-ds);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-navy);
    white-space: nowrap;
}

.wf-req-chip iconify-icon {
    color: var(--accent-secondary);
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   6. SECTION 5 — CTA
   ═══════════════════════════════════════════════════════════════════════════ */

/* Ambient glow blob — decorative */
.wf-cta-glow {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    margin-inline: auto;
    max-width: 28rem;
    opacity: 0.5;
    /* blur handled with filter so it degrades gracefully */
    filter: blur(72px);
    border-radius: 9999px;
    background: radial-gradient(
        ellipse at center,
        rgba(66, 255, 36, 0.20) 0%,
        rgba(83, 255, 43, 0.10) 50%,
        transparent 100%
    );
}

.wf-cta-inner {
    position: relative;
    z-index: 1;
    margin-inline: auto;
    max-width: 40rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.wf-cta-eyebrow {
    font-family: var(--font-ds);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin: 0;
}

.wf-cta-heading {
    font-family: var(--font-ds);
    font-size: clamp(1.2rem, 2.5vw + 0.5rem, 1.875rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--color-white, #fff);
    margin: 0;
}

.wf-cta-sub {
    font-family: var(--font-ds);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.58);
    margin: 0;
    max-width: 34rem;
}

/* Reuse the shared ds-btn-primary (already neon-green on dark) — size tweaks. */
.wf-cta-btn {
    margin-top: 0.75rem;
    height: 3.5rem;        /* 56px */
    padding-inline: 2.5rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
}

/* Arrow nudge on hover */
.wf-cta-btn iconify-icon {
    transition: transform var(--dur-normal) ease;
}
.wf-cta-btn:hover iconify-icon {
    transform: translateX(4px);
}


/* ═══════════════════════════════════════════════════════════════════════════
   7. RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 639px) {
    .wf-detail-main {
        padding-top: 5.5rem;
    }

    .wf-title-section { padding-top: 1.5rem; }

    .wf-description-body {
        padding: 1.25rem 1.25rem;
        font-size: 0.875rem;
    }

    .wf-requirements {
        flex-direction: column;
        align-items: flex-start;
    }

    .wf-cta-section {
        padding-bottom: 3.5rem;
    }
}

@media (max-width: 767px) {
    .wf-btn-group {
        max-width: 100%;
    }

    .wf-cta-btn {
        width: 100%;
        max-width: 20rem;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .wf-description-body {
        padding: 2rem 2.5rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   8. REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .wf-btn-download,
    .wf-image-frame,
    .wf-title em {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .wf-btn-download:hover {
        transform: none !important;
    }
}
