/* ============================================================
   Block: medical-affairs  (capability accordion)
   Shared visual language for both medical-affairs and commercial
   accordion blocks — selectors are scoped to .caprow so both can
   reuse this look without conflicting.
   ============================================================ */

.medical-affairs-section {
    padding: 75px 0;
    background-color: var(--wp--preset--color--background, #fff);
    color: var(--wp--preset--color--foreground);
}

.medical-affairs-section .caprows-inner {
    position: relative;
}

.cap-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--wp--preset--color--secondary) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
}

.cap-eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--wp--preset--color--secondary);
    flex-shrink: 0;
    display: none;
}

.cap-heading {
    margin: 0 0 14px;
    color: var(--wp--preset--color--foreground);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.01em;
    max-width: 960px;
}

.cap-heading-accent {
    color: var(--wp--preset--color--primary);
}

.cap-sub {
    margin: 15px 0 36px !important;
    max-width: 820px;
    color: var(--wp--preset--color--foreground);
    font-size: 18px !important;
    line-height: 1.5 !important;
}

/* Expand-all / Collapse-all toolbar — small text buttons right-
   aligned above the row stack. Matches the dev-handoff structure
   (data-target + data-action on each button). */
.cap-controls {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    margin: 0 0 14px;
}

.cap-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--wp--preset--color--primary);
    padding: 9px 18px;
    border-radius: 999px;
    color: var(--wp--preset--color--primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    line-height: 1;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

@media (min-width: 992px) {
    .cap-control-btn:hover {
    background-color: var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
    outline: none;
    box-shadow: 0 6px 18px -8px rgba(16, 157, 219, 0.55);
}
}

.cap-control-btn:active {
    transform: translateY(1px);
}

/* Pill-button icon: circle-arrow SVG mask, sized inline next to the
   label. `background-color: currentColor` so it inherits whatever
   color the button text is — primary blue resting, white on hover. */
.cap-control-btn-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
    transition: transform 0.2s ease;
}

/* Rotate the SVG for the appropriate verb: down arrow for expand,
   up arrow for collapse. */
.cap-control-btn[data-action="expand"]   .cap-control-btn-icon { transform: rotate(90deg); }
.cap-control-btn[data-action="collapse"] .cap-control-btn-icon { transform: rotate(-90deg); }

@media (max-width: 600px) {
    .cap-controls { justify-content: flex-start; gap: 14px; }
}

.caprows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.caprow {
    /* border: 1px solid var(--wp--preset--color--grey, #efefef); */
    border: 1px solid #9a9595;
    border-radius: 12px;
    background-color: var(--wp--preset--color--background);
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.caprow[open] {
    box-shadow: 0 12px 32px -22px rgba(0, 30, 80, 0.25);
    border-color: var(--wp--preset--color--primary);
}

.caprow > summary {
    list-style: none;
    cursor: pointer;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 30px;
    transition: background-color 0.2s ease;
}

/* .caprow > summary:hover {
    background-color: rgba(16, 157, 219, 0.04);
} */

.caprow > summary::-webkit-details-marker { display: none; }

.caprow-icon {
    flex-shrink: 0;
    width: 75px;
    height: 51px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wp--preset--color--secondary);   /* pink — drives inline-SVG currentColor */
    /* background-color: rgba(17, 158, 219, 0.1); */
    border-radius: 10px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* .caprow[open] .caprow-icon {
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
} */

/* Inlined uploaded SVG icons. The SVG fills the icon tile with a
   touch of internal padding. Strokes use currentColor so they
   pick up .caprow-icon's color (pink at rest, white when open). */
.caprow-icon svg {
    width: 75px;
    height: 75px;
    display: block;
}

.caprow-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.caprow-title {
        font-size: 18px;
    font-weight: 700;
    color: black;
    line-height: 1.3;
}

.caprow-sub {
   font-size: 14px;
    color: var(--wp--preset--color--foreground);
    /* opacity: 0.7; */
    line-height: 1.4;
}

/* Circle-arrow indicator on each accordion row.
   - viewBox is padded ('-4 -4 72 72') so the outer stroke has 4px of
     breathing room and never gets clipped at the box edge.
   - Longhand mask-* properties used so mask-size: contain is explicit
     across browsers.
   - Resting state: rotate(90deg) → arrow points DOWN (closed = "open me").
   - [open] state:  rotate(-90deg) → arrow points UP   (open  = "close me").
   The 180° flip animates over 0.3s. */
.caprow-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: var(--wp--preset--color--primary);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 72 72' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 72 72' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    -webkit-mask-repeat:   no-repeat;
            mask-repeat:   no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size:     contain;
            mask-size:     contain;
    transition: transform 0.3s ease;
    transform: rotate(90deg); /* closed: point DOWN */
}

.caprow[open] .caprow-arrow {
    transform: rotate(-90deg); /* open: point UP */
}

/* Drawer animation is driven by blocks/medical-affairs/view.js — the
   script animates max-height + opacity around the native <details>
   toggle. We just need overflow:hidden here so the drawer clips
   cleanly during the slide. */
.caprow-detail {
    overflow: hidden;
    /* Initial state for the closed row; view.js then takes over. */
}

.caprow-detail {
    padding: 0 33px 0 33px;
    background-color: rgba(17, 158, 219, 0.1);
    border-top: 1px solid var(--wp--preset--color--grey, #efefef);
}

.caprow-detail-intro {
    margin: 0 0 22px;
    color: var(--wp--preset--color--foreground);
    font-size: 18px;
    line-height: 1.5;
    padding-top: 33px;
}

.caprow-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-bottom: 33px;
}

.caprow-detail-block {
    background-color: var(--wp--preset--color--background);
    border: 1px solid var(--wp--preset--color--grey, #efefef);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 14px 32px -12px rgba(5, 22, 60, 0.40), inset 0 1px 0 0 rgba(255, 255, 255, 0.55), inset 1px 0 0 0 rgba(255, 255, 255, 0.30), inset -1px 0 0 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 0 rgba(255, 255, 255, 0.10);
    border-top: 8px solid #d02db0;
}

.dlabel {
   display: inline-block;
    margin: 0 0 13px;
    color: black;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
}

.caprow-detail-block p {
    margin: 0;
    color: var(--wp--preset--color--foreground);
    font-size: 16px;
    line-height: 1.5;
}

.medical-affairs-section.alignfull,
.wp-block-pixacore-medical-affairs.alignfull {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

@media (max-width: 900px) {
    .caprow-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .medical-affairs-section { padding: 64px 0; }
    .caprow > summary { padding: 16px 16px; gap: 12px; }
    .caprow-icon { width: 60px; height: 32px; border-radius: 8px; }
    .caprow-title { font-size: 15px; }
    .caprow-detail { padding: 4px 16px 18px; }
}
