/* ==========================================================================
   COMPONENTS
   Reusable UI pieces that can appear on any page.
   ========================================================================== */

/* --- Icon --------------------------------------------------------------- */
.icon {
    flex: none;
    width: 1.125em;
    height: 1.125em;
}

/* --- Label: small spaced capitals above headlines --------------------------- */
.label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.label--on-dark {
    color: var(--color-on-inverse-muted);
}

/* --- Button ------------------------------------------------------------------
   Pills. One rule for the colours:
     .btn--donate   orange — reserved for donating, so it always stands out
     .btn--primary  ink    — the main action of a section (send, request …)
     .btn--outline  ink outline — the secondary action next to another button
     .btn--light    cream  — main action on dark panels                        */
.btn {
    --btn-bg: transparent;
    --btn-fg: var(--color-text);
    --btn-border: var(--color-text);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 3rem;
    padding: 0.75rem 1.5rem;
    border: 1.5px solid var(--btn-border);
    border-radius: var(--radius-pill);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: var(--tracking-label);
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease,
                color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn .icon {
    transition: transform var(--duration-fast) ease;
}

.btn:hover .icon {
    transform: translateX(0.2rem);
}

.btn--donate {
    --btn-bg: var(--color-accent);
    --btn-border: var(--color-accent);
    --btn-fg: var(--ink);
}

.btn--donate:hover {
    --btn-bg: var(--color-accent-hover);
    --btn-border: var(--color-accent-hover);
}

.btn--primary {
    --btn-bg: var(--ink);
    --btn-border: var(--ink);
    --btn-fg: var(--cream);
}

.btn--primary:hover {
    --btn-bg: var(--ink-soft);
    --btn-border: var(--ink-soft);
}

.btn--outline:hover {
    --btn-bg: var(--ink);
    --btn-fg: var(--cream);
}

.btn--light {
    --btn-bg: var(--cream);
    --btn-border: var(--cream);
    --btn-fg: var(--ink);
}

.btn--light:hover {
    --btn-bg: var(--white);
    --btn-border: var(--white);
}

.btn--lg {
    min-height: 3.5rem;
    padding-inline: 1.875rem;
    font-size: 0.875rem;
}

.btn--sm {
    min-height: 2.5rem;
    padding: 0.5rem 1.125rem;
}

.btn--block {
    width: 100%;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* --- Round icon button ---------------------------------------------------- */
.icon-btn {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1.5px solid var(--color-text);
    border-radius: 50%;
    color: var(--color-text);
    transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.icon-btn:hover {
    background: var(--ink);
    color: var(--cream);
}

.icon-btn .icon {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-btn--sm {
    width: 2.25rem;
    height: 2.25rem;
}

.icon-btn--sm .icon {
    width: 1rem;
    height: 1rem;
}

/* --- Inline text link ------------------------------------------------------ */
.text-link,
.prose a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
}

.prose a {
    display: inline;
}

.text-link:hover,
.prose a:hover {
    color: var(--color-accent-text);
}

/* --- Photo credit: small caption on a photo -------------------------------- */
.photo-credit {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    background: rgba(18, 18, 18, 0.55);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.5;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* --- Project card (home page) ------------------------------------------------
   White card, photo on top. The title link stretches over the whole card. */
.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.project-card__media {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: calc(var(--radius-lg) - 0.5rem);
    background: var(--mist);
}

.project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.project-card:hover .project-card__media img {
    transform: scale(1.04);
}

.project-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 0.875rem 0.875rem;
}

.project-card__title {
    font-size: var(--text-display-sm);
}

.project-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.project-card__link:focus-visible {
    outline: none;
}

.project-card:has(.project-card__link:focus-visible) {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.project-card__text {
    font-size: var(--text-small);
    color: var(--color-text-muted);
}

.project-card__more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
}

.project-card:hover .icon-btn {
    background: var(--ink);
    color: var(--cream);
}

/* --- Call to action (end of project pages) ---------------------------------- */
.cta {
    padding-block: var(--space-section);
    text-align: center;
}

.cta__inner {
    display: grid;
    justify-items: center;
    max-width: 48rem;
}

.cta__title {
    font-size: var(--text-display-lg);
}

.cta__text {
    max-width: 44ch;
    margin: 1.25rem 0 2rem;
    font-size: var(--text-lead);
    color: var(--color-text-muted);
}

/* --- Donation teaser: white text on a blurred photo -------------------------- */
.donate-band {
    padding-bottom: var(--space-section);
}

.donate-band__inner {
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    gap: 1.25rem;
    overflow: hidden;
    padding: clamp(3.5rem, 2rem + 6vw, 7.5rem) clamp(1.25rem, 0.5rem + 4vw, 5rem);
    border-radius: var(--radius-lg);
    background: var(--ink) var(--photo) center / cover no-repeat;
    color: var(--color-on-inverse);
    text-align: center;
}

.donate-band__inner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.5), rgba(18, 18, 18, 0.72));
}

.donate-band__inner .accent,
.donate-stage__inner .accent,
.event .accent {
    color: var(--color-accent);  /* the bright orange reads well on dark: 5.4:1 */
}

.donate-band__title {
    max-width: 16ch;
    font-size: var(--text-display-lg);
}

.donate-band__text {
    max-width: 44ch;
    margin-bottom: 0.75rem;
    font-size: var(--text-lead);
    color: var(--color-on-inverse-muted);
}

/* --- Form fields ------------------------------------------------------------- */
.form {
    display: grid;
    gap: 1.5rem;
}

.form__row {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 600px) {
    .form__row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

.field {
    display: grid;
    gap: 0.5rem;
}

.field__label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.field__control {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.875rem 1.125rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-field);
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.field__control::placeholder {
    color: #6e6e69;
    opacity: 1;
}

.field__control:hover {
    border-color: var(--color-line-strong);
}

.field__control:focus {
    border-color: var(--ink);
    outline: none;
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.14);
}

textarea.field__control {
    min-height: 10rem;
    resize: vertical;
}

/* Spam trap: off-screen for people, still filled in by bots. */
.form__honeypot {
    position: absolute;
    left: -9999px;
}

/* --- Chips: radio buttons as pills (e.g. the subject of the contact form) ----- */
.chips .field__label {
    display: block;
    margin-bottom: 0.75rem;
}

.chips__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    position: relative;
    display: inline-flex;
}

.chip input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.chip__text {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 1.125rem;
    border: 1.5px solid var(--color-line-strong);
    border-radius: var(--radius-pill);
    background: var(--white);
    font-size: var(--text-small);
    font-weight: 600;
    line-height: 1.3;
    transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.chip:hover .chip__text {
    border-color: var(--ink);
}

.chip input:checked + .chip__text {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--cream);
}

.chip input:focus-visible + .chip__text {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* --- Alert ----------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-small);
}

.alert .icon {
    margin-top: 0.15em;
}

.alert--success {
    background: var(--green-tint);
    color: var(--color-success);
}

.alert--error {
    background: var(--red-tint);
    color: var(--color-error);
}

/* --- Copy button (bank details) -------------------------------------------- */
.copy-btn {
    flex: none;
    min-height: 2.25rem;
    padding: 0.375rem 0.875rem;
    border: 1.5px solid var(--color-line-strong);
    border-radius: var(--radius-pill);
    background: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.copy-btn:hover {
    border-color: var(--ink);
}

.copy-btn.is-copied {
    border-color: var(--color-success);
    background: var(--green-tint);
    color: var(--color-success);
}
