/*
 * Policy Analyzer Template Styles
 * Prefix: .pa-
 * Enqueued: only on templates/policy-analyzer.php
 *
 * Font scale: html { font-size: 62.5% } → 1rem = 10px, 1.6rem = 16px
 * All rem values below are relative to that 10px base.
 */

/* ── LOCAL TOKEN OVERRIDES ──────────────────────────────────────────── */
.pa-nav,
.pa-hero,
.pa-form,
.pa-faq {
    --pa-blue:      #3D69DF;
    --pa-blue-pale: rgba(61, 105, 223, 0.1);
    --pa-cream:     #F5F0EB;
    --pa-dark:      #00002E;
    --pa-mid:       #555555;
    --pa-border:    #d8d2c8;
    --pa-white:     #ffffff;
    --pa-off-white: #fafaf8;
}

/* ── TEMPLATE-LEVEL HEADER SUPPRESSION ─────────────────────────────── */
/* body class auto-added by WP when templates/policy-analyzer.php active */
.page-template-templates-policy-analyzer-php .header-section,
.page-template-templates-policy-analyzer-php .site_mobile_header_wrapper {
    display: none !important;
}
.page-template-templates-policy-analyzer-php .main_content_wrapper {
    padding-top: 0 !important;
    margin-top:  0 !important;
}

/* ── PA NAV ─────────────────────────────────────────────────────────── */
.pa-nav {
    background:      var(--pa-cream);
    padding:         0 6.4rem;
    height:          6.8rem;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    border-bottom:   1px solid var(--pa-border);
    position:        relative;
    z-index:         10;
}
.pa-nav__logo {
    display:         flex;
    align-items:     center;
    gap:             1rem;
    text-decoration: none;
    color:           var(--pa-dark);
    font-family:     'Hedvig Letters Serif', serif;
    font-size:       1.8rem;
    font-weight:     700;
}
.pa-nav__logo-img {
    height:  3.2rem;
    width:   auto;
    display: block;
}
.pa-nav__links {
    display:     flex;
    align-items: center;
    gap:         0.4rem;
}
.pa-nav__link {
    padding:         0.7rem 1.4rem;
    color:           rgba(0, 0, 46, 0.70);
    text-decoration: none;
    font-size:       1.5rem;
    font-weight:     500;
    border-radius:   4px;
    transition:      color 0.15s;
}
.pa-nav__link:hover { color: var(--pa-dark); }
.pa-nav__tag {
    margin-left: 0.8rem;
}

/* ── HERO ───────────────────────────────────────────────────────────── */
.pa-hero {
    background:
        radial-gradient(ellipse 75% 90% at 66% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 100%),
        var(--pa-cream);
    padding: 3.6rem 6.6rem 6.6rem;
    position: relative;
    overflow: hidden;
}

.pa-hero__wrapper {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 3.2rem;
    align-items: center;
    min-height: 62rem;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.pa-hero__left {
    display: flex;
    flex-direction: column;
}

.pa-hero__eyebrow {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pa-blue);
    margin-bottom: 2.4rem;
}

.pa-hero__heading {
    font-family: 'Hedvig Letters Serif', serif;
    font-size: clamp(3.2rem, 5vw, 5.2rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--pa-dark);
    margin: 0 0 0.4rem 0;
}

.pa-hero__heading-highlight {
    display: block;
    font-family: 'Hedvig Letters Serif', serif;
    font-size: clamp(3.2rem, 5vw, 5.2rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--pa-blue);
    margin-bottom: 0.4rem;
}

.pa-hero__sub {
    font-size: 1.6rem;
    line-height: 1.8;
    color: var(--pa-mid);
    max-width: 44rem;
    margin-top: 2.8rem;
    margin-bottom: 0;
}

.pa-hero__cta {
    margin-top: 3.2rem;
    align-self: flex-start;
}

/* Full-height particle canvas: positioned relative to .pa-hero (the section),
 * so H = section height (wrapper + top/bottom padding) instead of just the
 * grid-row height.  z-index:0 keeps it below .pa-hero__wrapper (z-index:1). */
.pa-hero__canvas {
    position:       absolute;
    top:            0;
    right:          200px;
    bottom:         0;
    width:          600px;
    z-index:        0;
}

/* Grid spacer — occupies the 520-px right column so .pa-hero__left stays at
 * its natural 1fr width when the particle canvas is the absolute overlay.
 * pointer-events:none lets mouse events fall through to .pa-hero__canvas below. */
.pa-hero__visual-spacer {
    pointer-events: none;
}

/* Image-variant illustration column (image visual type only) */
.pa-hero__visual {
    display:         flex;
    align-items:     center;
    justify-content: center;
    position:        relative;
    align-self:      stretch;
    min-height:      52rem;
}

/* Custom image — fills the same visual container as the canvas */
.pa-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    display: block;
}

/* ── SECTION DIVIDER ────────────────────────────────────────────────── */
.pa-divider {
    height: 1px;
    background: var(--pa-border);
}

/* ── FORM SECTION ───────────────────────────────────────────────────── */
.pa-form {
    background: var(--pa-white);
    padding: 8.8rem 6.4rem 10rem;
}

.pa-form__inner {
    max-width: 640px;
    margin: 0 auto;
}

.pa-form__header {
    margin-bottom: 4.8rem;
}

.pa-form__eyebrow {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pa-blue);
    margin-bottom: 1.4rem;
}

.pa-form__heading {
    font-family: 'Hedvig Letters Serif', serif;
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    font-weight: 700;
    color: var(--pa-dark);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 1.2rem 0;
}

.pa-form__sub {
    font-size: 1.5rem;
    color: var(--pa-mid);
    line-height: 1.7;
    margin: 0;
}

.pa-form__card {
    background: var(--pa-white);
    border: 1px solid var(--pa-border);
    border-radius: 8px;
    padding: 4.4rem 4.8rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.pa-form__disclaimer {
    font-size: 1.1rem;
    color: #999999;
    text-align: center;
    margin-top: 0.6rem;
    line-height: 1.6;
}

/* ── CF7 OVERRIDES (scoped to .pa-form__card) ───────────────────────── */
.pa-form__card .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

/* CF7 wraps each field in a <p> by default — normalise spacing */
.pa-form__card .wpcf7-form > p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Labels rendered by CF7 */
.pa-form__card .wpcf7-form label {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pa-mid);
    display: block;
    margin-bottom: 0.4rem;
}

/* Text & email inputs */
.pa-form__card .wpcf7-form input[type="text"],
.pa-form__card .wpcf7-form input[type="email"] {
    width: 100%;
    padding: 1.4rem 1.6rem;
    border: 1.5px solid var(--pa-border);
    border-radius: 5px;
    font-size: 1.5rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--pa-dark);
    background: var(--pa-off-white);
    transition: border-color 0.15s, background 0.15s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.pa-form__card .wpcf7-form input[type="text"]:focus,
.pa-form__card .wpcf7-form input[type="email"]:focus {
    border-color: var(--pa-blue);
    background: var(--pa-white);
}

.pa-form__card .wpcf7-form input[type="text"]::placeholder,
.pa-form__card .wpcf7-form input[type="email"]::placeholder {
    color: #bbbbbb;
}

/* Select / dropdown */
.pa-form__card .wpcf7-form select {
    width: 100%;
    padding: 1.4rem 1.6rem;
    border: 1.5px solid var(--pa-border);
    border-radius: 5px;
    font-size: 1.5rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--pa-dark);
    background-color: var(--pa-off-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.6rem center;
    transition: border-color 0.15s, background-color 0.15s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
}

.pa-form__card .wpcf7-form select:focus {
    border-color: var(--pa-blue);
    background-color: var(--pa-white);
}

/* Submit button */
.pa-form__card .wpcf7-form input[type="submit"] {
    width: 100%;
    box-sizing: border-box; /* prevents padding from adding to 100% width */
    background: var(--pa-blue);
    color: var(--pa-white);
    padding: 1.6rem 2.4rem;
    border-radius: 5px;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    border: none;
    cursor: pointer;
    letter-spacing: 0.01em;
    margin-top: 0.8rem;
    transition: background 0.15s;
    display: block;
    text-align: center;
    white-space: normal;   /* allow text to wrap on narrow screens */
    word-break: break-word;
}

.pa-form__card .wpcf7-form input[type="submit"]:hover {
    background: #5580e8;
}

/* CF7 validation messages */
.pa-form__card .wpcf7-not-valid-tip {
    font-size: 1.2rem;
    color: #c0392b;
    margin-top: 0.4rem;
    display: block;
}

/*
 * CF7 always renders .wpcf7-response-output in the DOM even when empty.
 * Its default stylesheet gives it margin: 2em 0.5em 1em — that creates a large
 * invisible gap above the disclaimer. Override to zero when hidden/empty,
 * and keep sensible margin only when an actual message is shown.
 */
.pa-form__card .wpcf7-response-output {
    font-size: 1.3rem;
    border-radius: 4px;
    padding: 1rem 1.4rem;
    margin: 0.8rem 0 0;  /* top only — no bottom margin pushing disclaimer down */
}

.pa-form__card .wpcf7-form .wpcf7-response-output:empty,
.pa-form__card .wpcf7-form .wpcf7-display-none {
    display: none;
    margin: 0;
    padding: 0;
}

/* ── FAQ SECTION ─────────────────────────────────────────────────────── */
.pa-faq {
    background: var(--pa-cream);
    padding: 6.4rem 6.4rem 8rem;
}

.pa-faq__inner {
    max-width: 900px;
    margin: 0 auto;
}

.pa-faq__heading {
    font-family: 'Hedvig Letters Serif', serif;
    font-size: clamp(2.8rem, 4vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--pa-dark);
    text-align: center;
    margin-bottom: 4rem;
}

.pa-faq__list {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.pa-faq__item {
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(30, 58, 95, 0.08);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.pa-faq__item:hover {
    border-color: rgba(30, 58, 95, 0.15);
}

.pa-faq__item[open] {
    border-color: rgba(30, 58, 95, 0.18);
}

.pa-faq__question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.6rem;
    padding: 2.4rem;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--pa-dark);
    cursor: pointer;
    list-style: none;
}

.pa-faq__question::-webkit-details-marker {
    display: none;
}

.pa-faq__icon {
    flex-shrink: 0;
    font-size: 2rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
    line-height: 1;
}

details[open] .pa-faq__icon {
    transform: rotate(45deg);
}

.pa-faq__answer {
    padding: 0 2.4rem 2.4rem;
    font-size: 1.5rem;
    color: #475569;
    line-height: 1.7;
}

.pa-faq__answer p {
    margin: 0;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pa-nav { padding: 0 2.4rem; }
    .pa-nav__link { display: none; }
    .pa-nav__tag  { margin-left: 0; }

    .pa-hero {
        padding: 3rem 3.2rem 3rem;
    }

    .pa-hero__wrapper {
        grid-template-columns: 1fr;
        gap: 0;
        min-height: auto;
    }

    /* Hide canvas illustration and grid spacer on mobile */
    .pa-hero__canvas,
    .pa-hero__visual,
    .pa-hero__visual-spacer {
        display: none;
    }

    .pa-form {
        padding: 6rem 2.4rem 7.2rem;
    }

    .pa-faq {
        padding: 4.8rem 2.4rem 6rem;
    }

    .pa-form__header {
        margin-bottom: 2.8rem;
    }

    .pa-form__card {
        padding: 3.2rem 2.4rem;
    }
}

@media (max-width: 480px) {
    .pa-hero {
        padding: 3rem 2rem 4rem;
    }

    .pa-form {
        padding: 4.8rem 2rem 6rem;
    }

    .pa-form__inner {
        max-width: 100%;
    }

    /* Tighter card padding on iPhone SE and similar */
    .pa-form__card {
        padding: 2.8rem 1.6rem;
    }

    /* Reduce field gap and header gap on small screens */
    .pa-form__header {
        margin-bottom: 2.4rem;
    }

    .pa-form__card .wpcf7-form {
        gap: 1.4rem;
    }

    /* Slightly smaller submit button on narrow screens */
    .pa-form__card .wpcf7-form input[type="submit"] {
        font-size: 1.4rem;
        padding: 1.4rem 1.6rem;
        margin-top: 0;        /* gap already provides spacing — no double gap */
        letter-spacing: 0;    /* recover ~4px per character to help text fit on one line */
    }
}
