/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.096em;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s, border-color 0.2s, color 0.2s;
    line-height: 1;
}

/* Base hover lift for ALL buttons (matches the header CTA / variant lift).
   Variant :hover rules below keep their own transform via later source order. */
.btn:hover {
    transform: translateY(-1px);
}

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

/* Sizes */
.btn-sm {
    height: 32px;
    padding: 8px 24px;
    font-size: 10px;
    letter-spacing: 1.04px;
    min-width: 150px;
}

.btn-md {
    height: 42px;
    padding: 12px 32px;
    font-size: 12px;
    letter-spacing: 1.152px;
    min-width: 174px;
}

.btn-lg {
    height: 46px;
    padding: 20px 52px;
    font-size: 14px;
    letter-spacing: 1.36px;
    min-width: 262px;
}

/* Default size = md */
.btn:not(.btn-sm):not(.btn-lg) {
    height: 42px;
    padding: 12px 32px;
    font-size: 12px;
    letter-spacing: 1.152px;
}

/* Variants */
.btn-primary {
    background-color: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.btn-primary:hover {
    background-color: var(--red-dark);
    border-color: var(--red-dark);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-outline-red {
    background-color: transparent;
    color: var(--red);
    border-color: var(--red);
}

.btn-outline-red:hover {
    background-color: var(--red);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-dark {
    background-color: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

.btn-dark:hover {
    background-color: var(--dark-2);
    border-color: var(--dark-2);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-outline-dark {
    background-color: transparent;
    color: var(--black);
    border-color: var(--black);
}

.btn-outline-dark:hover {
    background-color: var(--black);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-ghost {
    background-color: transparent;
    color: var(--black);
    border-color: var(--gray-200);
}

.btn-ghost:hover {
    border-color: var(--black);
    transform: translateY(-1px);
}

/* ─── Badges ──────────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-self: flex-start; /* prevent stretch in flex-column parents */
    align-items: center;
    height: 24px;
    padding: 0 var(--space-sm);
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.096em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1;
}

.badge-red {
    background-color: rgba(225, 27, 34, 0.1);
    border-color: rgba(225, 27, 34, 0.2);
    color: var(--red);
}

.badge-dark {
    background-color: var(--dark-2);
    border-color: var(--border);
    color: var(--white);
}

.badge-green {
    background-color: rgba(13, 177, 75, 0.08);
    border-color: rgba(13, 177, 75, 0.2);
    color: var(--green);
}

.badge-light {
    background-color: var(--off-white);
    border-color: var(--gray-200);
    color: var(--black);
}

/* ─── Eyebrow ─────────────────────────────────────────────────────────────── */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: var(--space-xl);
}

.eyebrow::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--red);
    flex-shrink: 0;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */

.card {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: var(--space-lg);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    border-color: var(--red);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.card-important {
    border-top: 2px solid var(--red);
}

.card-dark {
    background-color: var(--dark-2);
    border-color: var(--border);
}

.card-dark:hover {
    border-color: var(--red);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-padded {
    padding: var(--space-xl);
}

.card__eyebrow {
    margin-bottom: var(--space-sm);
}

.card__title {
    margin-bottom: var(--space-sm);
}

.card__body {
    margin-bottom: var(--space-md);
}

.card__footer {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-200);
}

.card-dark .card__footer {
    border-top-color: var(--border);
}

.card__thumbnail {
    display: block;
    width: 100%;
    overflow: hidden;
}

.card__thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── Form elements ───────────────────────────────────────────────────────── */

.form-input,
input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 var(--space-md);
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--black);
    transition: border-color 0.2s;
    outline: none;
}

textarea {
    height: auto;
    padding: var(--space-md);
    min-height: 120px;
    resize: vertical;
}

.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: var(--red);
}

/* ─── Divider ─────────────────────────────────────────────────────────────── */

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--gray-200);
    margin: var(--space-xl) 0;
}

.divider-dark {
    background-color: var(--border);
}

/* ─── Tag list ────────────────────────────────────────────────────────────── */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    list-style: none;
}

/* ─── Button — missing variants ───────────────────────────────────────────── */

.btn-neutral {
    background-color: var(--gray-100);
    color: var(--black);
    border-color: var(--gray-200);
}

.btn-neutral:hover {
    background-color: var(--gray-200);
    border-color: var(--gray-200);
    color: var(--black);
    transform: translateY(-1px);
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* Arrow / icon hover animation */
.btn svg {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover svg {
    transform: translateX(5px);
}

/* Download button — arrow animates downward instead of rightward */
.btn--download:hover svg {
    transform: translateY(3px);
}

/* Accessible focus-visible for all buttons */
.btn:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

/* ─── Button loading state (reusable) ─────────────────────────────────────── */
/* Add `.is-loading` to any `.btn` and include a `.btn-spinner` span inside it.
   The spinner inherits the button's text color (currentColor) and matches the
   text size (1em). Hidden until `.is-loading` so it adds no gap when idle. */
.btn.is-loading {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-spinner {
    display: none;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    box-sizing: border-box;
    flex-shrink: 0;
    animation: btn-spin 0.6s linear infinite;
}

.btn.is-loading .btn-spinner {
    display: inline-block;
}

/* Idle buttons keep the spinner's hover-transform from .btn svg out of play. */
.btn.is-loading svg {
    transform: none;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ─── Surface ─────────────────────────────────────────────────────────────── */

.surface {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: var(--space-lg);
}

.surface-dark {
    background-color: var(--dark-2);
    border-color: var(--border);
    color: var(--white);
}

.surface-blue {
    /* TEMP: white for now — revert to var(--ultra-light-blue) later */
    background-color: var(--white);
    border-color: rgba(0, 120, 180, 0.15);
}

.surface-soft {
    background-color: var(--off-white);
    border-color: var(--gray-200);
}

/* ─── Card sub-elements (unprefixed variants) ─────────────────────────────── */

.card-header {
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    flex: 1;
}

.card-footer {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-200);
}

/* ─── Accordion (native <details>/<summary>, no JS) ──────────────────────── */

.accordion {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background-color: var(--white);
    transition: border-color 0.15s;
}

.accordion:hover {
    border-color: var(--red);
}


.accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--black);
    list-style: none;
    user-select: none;
}

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

.accordion summary h3 {
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

.accordion summary::after {
    content: '+';
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1;
    color: var(--color-black);
    width: 1.25rem;
    text-align: center;
    transition: color 0.15s;
}

.accordion[open] > summary::after {
    content: '−';
    color: var(--red);
}

.accordion__body {
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-200);
}

/* ─── WordPress block compatibility ───────────────────────────────────────── */

/* Map Gutenberg button to design system */
:where(.wp-block-button__link) {
    background-color: var(--red);
    color: var(--white);
    border-radius: var(--radius) !important;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.152px;
    padding: 10px 28px;
    text-decoration: none;
    transition: background var(--transition-base), color var(--transition-base);
}

:where(.wp-block-button__link:hover) {
    background-color: var(--red-dark);
    color: var(--white);
}

:where(.wp-block-button.is-style-outline .wp-block-button__link) {
    background-color: transparent;
    border: 2px solid var(--red);
    color: var(--red);
}

:where(.wp-block-button.is-style-outline .wp-block-button__link:hover) {
    background-color: var(--red);
    color: var(--white);
}

/* ─── Form fields (general purpose) ───────────────────────────────────────── */

/* Wrapper: label + control + optional error message. */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* display:flex above otherwise overrides the [hidden] attribute, so the
   conditional State / StateOfIndia fields would never hide. Honor it. */
.form-field[hidden] {
    display: none;
}

.form-field__label {
    font-family: var(--font-display);
    font-size: var(--fs-caption);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--dark);
}

.form-field__req {
    color: var(--red);
    margin-left: 2px;
}

/* Controls — 44px to match .btn-md scale. */
.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 var(--space-md);
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    color: var(--black);
    transition: border-color var(--transition-base);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-textarea {
    height: auto;
    min-height: 120px;
    padding: var(--space-md);
    resize: vertical;
    line-height: 1.6;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--gray-400); }

/* Custom select caret (inline SVG, no glow). */
.form-select {
    padding-right: var(--space-2xl);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23636466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    cursor: pointer;
}

/* Focus — border only, no box-shadow glow. */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--red);
    box-shadow: none;
}

/* Error state. */
.form-field--error .form-input,
.form-field--error .form-select,
.form-field--error .form-textarea {
    border-color: var(--red);
}

.form-field__error {
    font-size: var(--fs-caption);
    color: var(--red);
    line-height: 1.4;
}

/* Checkbox — sharp 2px aesthetic, consistent with the rest of the system. */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.form-check__input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.form-check__input:checked {
    background-color: var(--red);
    border-color: var(--red);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 5 8.7l4.5-5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.form-check__input:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

.form-check__label {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.5;
    color: var(--color-black);
    cursor: pointer;
}

.form-check__label a { color: var(--red); }

/* Success state — replaces the form on a successful submission. */
.form-success {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
}

.form-success__text {
    font-size: var(--fs-body);
    line-height: 1.65;
    color: var(--color-black);
    margin: 0;
}

/* ─── Video Play Button — "Dark Glass" ────────────────────────────────────────
   Imported from the INDEX 2026 "Prota — Video Play Button" design file,
   variation 02 / Dark Glass. Self-contained and namespaced (.prota-play*) so
   the generic design-file markup can't collide with theme CSS, and the hover
   state (JS-driven in the source) is reproduced here with :hover / :focus-visible.
   Resting : glass face + red triangle, pulsing glow + radiating ring.
   Active  : fills brand red, triangle turns white, ring tightens & brightens.
   NOTE: the glass/blur/shadow/ring values below come verbatim from the design
   file — they have no existing token. --red (#E11B22 = rgb(225,27,34)) and
   --radius (2px) are mapped to tokens.
   ──────────────────────────────────────────────────────────────────────────── */
@keyframes pp-glow {
    0%, 100% { box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 0 0   rgba(225,27,34,.5); }
    50%      { box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 0 13px rgba(225,27,34,0); }
}
@keyframes pp-ring {
    0%   { transform: scale(1);    opacity: .55; }
    100% { transform: scale(2.05); opacity: 0;   }
}

.prota-play {
    --pp-w: 94px;
    --pp-h: 66px;
    --pp-icon: 30px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Radiating ring — sits behind the glass face, matches its footprint */
.prota-play__ring {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    border: 2px solid rgba(225,27,34,.6);   /* = var(--red) @ 60% */
    pointer-events: none;
    animation: pp-ring 3s ease-out infinite;
}

/* The glass face — the visible button block */
.prota-play__face {
    position: relative;
    width: var(--pp-w);
    height: var(--pp-h);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(18,18,20,.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background .25s ease, transform .25s ease,
                box-shadow .25s ease, border-color .25s ease;
    animation: pp-glow 2.8s ease-in-out infinite;
}

.prota-play__icon {
    width: var(--pp-icon);
    height: auto;
    margin-left: 5px;          /* optical centering of the triangle */
    display: block;
    overflow: visible;
}
.prota-play__icon path {
    fill: var(--white);
    transition: fill .25s ease;
}

/* Active state — hover or keyboard focus */
.prota-play:hover .prota-play__face,
.prota-play:focus-visible .prota-play__face {
    background: var(--red);
    border-color: var(--red);
    transform: scale(1.1);
    box-shadow: 0 18px 44px rgba(0,0,0,.6), 0 0 0 6px rgba(225,27,34,.22);
    animation: none;
}
.prota-play:hover .prota-play__ring,
.prota-play:focus-visible .prota-play__ring {
    border-color: rgba(225,27,34,.9);
    animation-duration: 1.6s;
}
.prota-play:hover .prota-play__icon path,
.prota-play:focus-visible .prota-play__icon path {
    fill: var(--white);
}

.prota-play:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
    border-radius: var(--radius);
}

@media (max-width: 640px) {
    .prota-play { --pp-w: 74px; --pp-h: 52px; --pp-icon: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .prota-play__face { animation: none; }
    .prota-play__ring { display: none; }
}
