/* ============================================================
   card.css — the Drahenix member business card (landing/card.html and landing/c/<member>.html, at
   drahenix.com/c/<member>)
   Loads variables.css only (no Bootstrap, home.css or landing-page.css), next to the site's own <site-header> and
   <site-footer>. Every class here is prefixed cd-; sizes and colours come from variables.css (section 27, plus the
   container steps of section 26). No shadows, like the rest of the content pages. Behaviour is assets/js/card.js.

   Page outline, in order:
     .cd-band        dark band behind the floating header; the photo straddles its lower edge
     .cd-person      photo, name (Bricolage), role with a pen icon, round contacts, Save contact | Share | My QR
     .cd-company     Drahenix (title + three paragraphs) · Services and apps
     .cd-team        the other members (photo, name, role, each to their card) and Meet the team (/about)
     site-chamber    the Chamber of Commerce block (site-footer.js)
   Below 1024px they stack in that order (tablets: the person column centred, as wide as its row of contacts); from
   1024px the person, the team and the Chamber stack on the left and the company takes the right.
   ============================================================ */

.cd-page {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
    -webkit-font-smoothing: antialiased;
}

.cd-page *,
.cd-page *::before,
.cd-page *::after {
    box-sizing: border-box;
}

:where(.cd-page) img {
    display: block;
    max-width: 100%;
}

:where(.cd-page) :is(h1, h2, p, ul) {
    margin: 0;
}

:where(.cd-main, .cd-qr) ul {
    padding: 0;
    list-style: none;
}

.cd-page [hidden] {
    display: none !important;
}

.cd-page .material-symbols-outlined {
    display: inline-block;
    flex: none;
    width: 1em;
    height: 1em;
    overflow: hidden;   /* the ligature text never shows while the icon font loads */
    font-size: var(--header-icon-size);
    line-height: 1;
}

:where(.cd-main, .cd-notfound, .cd-qr) :is(a, button):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* the site's content width: the same steps as Bootstrap's .container on the other pages (and .lp-container) */
.cd-container {
    width: 100%;
    max-width: var(--lp-container-width);
    margin: 0 auto;
    padding: 0 var(--lp-container-padding);
}

@media (max-width: 575px) { .cd-container { --lp-container-padding: var(--lp-container-padding-sm); } }
@media (min-width: 576px) { .cd-container { --lp-container-width: 540px; } }
@media (min-width: 768px) { .cd-container { --lp-container-width: 720px; } }
@media (min-width: 992px) { .cd-container { --lp-container-width: 960px; } }
@media (min-width: 1200px) { .cd-container { --lp-container-width: 1000px; } }
@media (min-width: 1600px) { .cd-container { --lp-container-width: 1260px; } }

/* ---- the dark band and the two columns ---- */
.cd-band {
    height: var(--cd-band-height);
    background: var(--gray-dark);
}

@media (min-width: 768px) {
    .cd-band {
        height: var(--cd-band-height-md);
    }
}

/* the person, the company copy, the team and the Chamber: 48px between them. The Chamber block brings its own room
   below (before the footer); here it needs none above, and none at the sides (the container has the gutters) */
.cd-grid {
    display: grid;
    grid-template-areas: "person" "company" "team" "chamber";
    gap: var(--space-8);
}

.cd-person { grid-area: person; }
.cd-company { grid-area: company; }
.cd-team { grid-area: team; }
.cd-grid > site-chamber { grid-area: chamber; }

.cd-grid > site-chamber .sc {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}

/* tablets: the person column centred, 400px wide (its four contacts on one row); Save contact and the two buttons
   take that width */
@media (min-width: 768px) and (max-width: 1023px) {
    .cd-person {
        width: min(100%, var(--cd-person-width-md));
        margin-left: auto;
        margin-right: auto;
    }
}

/* from 1024px: two columns; on the left the person, then the team, then the Chamber (48px apart); the company
   spans the right and starts well below the dark band */
@media (min-width: 1024px) {
    .cd-band {
        height: var(--cd-band-height-lg);
    }

    .cd-grid {
        grid-template-columns: var(--cd-person-width) minmax(0, 1fr);
        grid-template-rows: auto auto 1fr;
        grid-template-areas: "person company" "team company" "chamber company";
        gap: var(--space-10);   /* the left column's rows as far apart as the company copy and Services and apps */
        align-items: start;
        padding-bottom: var(--space-12);
    }

    .cd-company {
        padding-top: var(--cd-company-top-lg);
    }

    .cd-grid > site-chamber .sc {
        padding: 0;
    }
}

/* ---- the person ---- */
.cd-person {
    --cd-photo: var(--cd-photo-size);
    text-align: center;
}

@media (min-width: 1024px) {
    .cd-person {
        --cd-photo: var(--cd-photo-size-lg);
    }
}

.cd-photo {
    width: var(--cd-photo);
    height: var(--cd-photo);
    margin: calc(var(--cd-photo) / -2) auto var(--space-5);
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--surface-alt);
}

.cd-name {
    font-family: var(--font-display);
    font-size: var(--text-display-lg-size);
    line-height: var(--text-display-lg-line);
    font-weight: var(--weight-bold);
    color: var(--ink);
    overflow-wrap: anywhere;
}

.cd-role {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2) !important;
    font-size: var(--text-body-lg-size);
    line-height: var(--text-body-lg-line);
    color: var(--ink-muted);
}

.cd-role .material-symbols-outlined {
    font-size: var(--cd-role-icon-size);
    font-variation-settings: 'FILL' 1;   /* the filled glyph (the font is loaded with FILL 0..1) */
    color: var(--accent);
}

/* round contacts, labelled */
.cd-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4) var(--space-5);
    margin: var(--space-6) 0 !important;
}

.cd-act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    min-width: var(--cd-action-size);
    color: var(--ink);
    text-decoration: none;
}

.cd-act-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--cd-action-size);
    height: var(--cd-action-size);
    border-radius: 50%;
    background: var(--cd-action-tint);
    color: var(--accent);
    font-size: var(--cd-action-icon-size);
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

/* Same weight for all four: the Material icons heavier (wght 700, as the website link on About), WhatsApp's outline
   logo thickened with a stroke of its own colour, next to LinkedIn's solid "in". */
.cd-act-icon .material-symbols-outlined {
    font-size: var(--cd-action-icon-size);
    font-weight: var(--weight-bold);
}

.cd-act-icon .fa-whatsapp {
    -webkit-text-stroke: var(--cd-action-stroke) currentColor;
}

.cd-act-icon .fa-linkedin-in {
    font-size: var(--cd-action-icon-size-solid);
}

.cd-act-label {
    font-size: var(--text-caption-size);
    line-height: var(--text-caption-line);
    font-weight: var(--weight-semibold);
}

@media (hover: hover) {
    .cd-act:hover .cd-act-icon {
        background: var(--accent);
        color: var(--ink-on-accent);
    }
}

/* Save contact (primary, full width), then Share | My QR (stacked when zoomed text leaves no room for two) */
.cd-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr));
    gap: var(--space-3);
}

.cd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: var(--space-2) var(--space-4);
    border: 2px solid var(--accent);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
    font-weight: var(--weight-semibold);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.cd-btn--primary {
    grid-column: 1 / -1;
    background: var(--accent);
    color: var(--ink-on-accent);
}

.cd-btn:focus-visible {
    outline-offset: 3px !important;
}

@media (hover: hover) {
    .cd-btn:hover {
        background: var(--accent);
        color: var(--ink-on-accent);
    }

    .cd-btn--primary:hover {
        background: var(--surface);
        color: var(--accent);
    }
}

.cd-tip {
    margin-top: var(--space-3) !important;
    color: var(--ink-muted);
    font-size: var(--text-body-sm-size);
    line-height: var(--text-body-sm-line);
}

/* ---- the company ---- */
.cd-sec + .cd-sec {
    margin-top: var(--space-8);
}

@media (min-width: 1024px) {
    .cd-sec + .cd-sec {
        margin-top: var(--space-10);
    }
}

/* ---- the team: the other members in one row of four at every width (the photo shrinks if the column is
   narrower than four photos); square photos with rounded corners, as on About; the first name under each ---- */
.cd-team-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
}

.cd-mate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
}

.cd-mate-photo {
    width: min(100%, var(--cd-mate-photo-size));
    aspect-ratio: 1;
    height: auto;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--surface-alt);
}

.cd-mate-name {
    max-width: 100%;
    font-size: var(--text-body-sm-size);
    line-height: var(--text-body-sm-line);
    font-weight: var(--weight-semibold);
    overflow-wrap: anywhere;
}

@media (hover: hover) {
    .cd-mate:hover .cd-mate-name {
        color: var(--accent);
    }
}

@media (min-width: 1024px) {
    .cd-team {
        text-align: center;
    }
}

.cd-team-more {
    display: inline-block;
    margin-top: var(--space-5);
    color: var(--accent);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cd-h2 {
    margin-bottom: var(--space-4) !important;
    font-family: var(--font-display);
    font-size: var(--text-display-md-size);
    line-height: var(--text-display-md-line);
    font-weight: var(--weight-bold);
    color: var(--accent);
}

.cd-text {
    font-size: var(--text-body-lg-size);
    line-height: var(--text-body-lg-line);
    color: var(--ink-muted);
}

.cd-text + .cd-text {
    margin-top: var(--space-4) !important;
}

.cd-text--strong {
    color: var(--ink);
    font-weight: var(--weight-semibold);
}

.cd-more > .cd-text:first-child {
    margin-top: var(--space-4) !important;
}

/* "Read more" (phones only): an unstyled button, blue underlined text; the rest of the copy shows from 768px */
.cd-more-toggle {
    display: none;
    margin-top: var(--space-2);
    padding: var(--space-1) 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: var(--text-body-lg-size);
    line-height: var(--text-body-lg-line);
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 767px) {
    .cd-more-toggle {
        display: inline-block;
    }

    .cd-more:not(.is-open) {
        display: none;
    }
}

/* services and apps: bordered, rounded cards in a grid, each one a link with a chevron and a hover tint.
   Business and Wallet one per row (icon | text | chevron); the other four in two columns with the icon on
   top (icon ... chevron, then the text). Same title and description sizes in both. */
.cd-apps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-3) !important;
}

.cd-apps--wide {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0 !important;
}

.cd-apps li {
    display: flex;
}

.cd-app {
    display: grid;
    grid-template-areas: "icon go" "body body";
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    align-content: start;  /* a taller neighbour stretches the card, not the gap above its title */
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: background-color 0.3s ease-in-out;
}

.cd-apps--wide .cd-app {
    grid-template-areas: "icon body go";
    grid-template-columns: var(--cd-app-icon-size-wide) minmax(0, 1fr) auto;
    column-gap: var(--space-4);
}

.cd-app-icon {
    grid-area: icon;
    width: var(--cd-app-icon-size);
    height: var(--cd-app-icon-size);
    border-radius: var(--radius-md);
    object-fit: cover;
}

.cd-apps--wide .cd-app-icon {
    width: var(--cd-app-icon-size-wide);
    height: var(--cd-app-icon-size-wide);
}

.cd-app-body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

/* The chevron sits in the card's top-right corner, level with the top of the app icon. Optical, not just
   measured: chevron_right's drawing fills x 8-15.4 and y 6-18 of its 24px box, so the negative margins cancel
   the empty 6px above it and 8px to its right. */
.cd-app-go {
    grid-area: go;
    margin: -0.25em -0.35em 0 0;
    color: var(--ink-muted);
    transition: color 0.3s ease-in-out;
}

/* the blue tile of Business and Wallet, like the apps' own icons: the glyph centred, no border */
.cd-app-icon--tile,
.cd-app-icon--coin {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cd-app-icon--tile {
    background: var(--accent);
}

.cd-app-icon--tile img {
    width: var(--cd-app-glyph-size);
    height: var(--cd-app-glyph-size);
}

/* Drahenix Points: the 3D coin on the header's dark */
.cd-app-icon--coin {
    background: var(--gray-dark);
}

.cd-app-icon--coin img {
    width: var(--cd-app-coin-size);
    height: var(--cd-app-coin-size);
}

/* Lunaria's icon is white: a 1px grey outline keeps its edge on the white card */
.cd-app-icon--outline {
    border: 1px solid var(--border);
}

.cd-app-name {
    font-family: var(--font-display);
    font-size: var(--text-display-sm-size);
    line-height: var(--text-display-sm-line);
    font-weight: var(--weight-bold);
    overflow-wrap: anywhere;
}

.cd-app-desc {
    color: var(--ink-muted);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
}

@media (hover: hover) {
    .cd-app:hover {
        background: var(--cd-card-hover);
    }

    .cd-app:hover .cd-app-go {
        color: var(--accent);
    }
}

/* Business: one bordered card holding two things side by side in the markup, never nested: the link to /m (the
   usual app row, without its own border, its hover tint inside the card's corners) and the sign-up offer.
   Phones: all centred, the offer ("Get 30 days for $0."), the button across the card (48px tall), the line under it.
   From 768px: under a thin rule (the card's border), one row: the offer and the line on the left, the button on the
   right as wide as its text (44px, --target-min) and centred on the text; when the row runs out of room the button
   wraps under the text, at the left. */
.cd-app-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.cd-app-card > .cd-app {
    border: 0;
    border-radius: 0;
}

.cd-app-cta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    padding: 0 var(--space-4) var(--space-4);
    text-align: center;
}

/* phones: the offer's two lines join the column, so the button can sit between them */
.cd-app-offer {
    display: contents;
}

.cd-app-cta .cd-btn {
    order: 1;
    width: 100%;
    text-align: center;
}

.cd-app-note {
    order: 2;
}

.cd-app-offer-title,
.cd-app-note {
    margin: 0 !important;
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
}

.cd-app-offer-title {
    color: var(--ink);
    font-weight: var(--weight-semibold);
}

.cd-app-note {
    color: var(--ink-muted);
}

@media (min-width: 768px) {
    .cd-app-cta {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3) var(--space-4);
        padding-top: var(--space-4);
        border-top: 1px solid var(--border);
        text-align: left;
    }

    /* the text takes the room left of the button, down to 16rem; below that the button wraps under it */
    .cd-app-offer {
        display: block;
        flex: 1 1 16rem;
        min-width: 0;
    }

    .cd-app-cta .cd-btn {
        flex: none;
        width: auto;
        min-height: var(--target-min);
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* one column for the small apps when the screen (or the zoomed text) leaves too little room for two */
@media (max-width: 359px) {
    .cd-apps {
        grid-template-columns: minmax(0, 1fr);
    }

    /* and Business and Wallet stack like the others: icon on top, text below */
    .cd-apps--wide .cd-app {
        grid-template-areas: "icon go" "body body";
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

/* ---- My QR dialog ---- */
.cd-qr {
    width: min(calc(100vw - 2 * var(--space-4)), 360px);
    max-height: calc(100dvh - 2 * var(--space-4));
    padding: var(--space-6);
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    text-align: center;
}

.cd-qr::backdrop {
    background: var(--cd-backdrop);
}

.cd-qr-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--cd-qr-close-size);
    height: var(--cd-qr-close-size);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

@media (hover: hover) {
    .cd-qr-close:hover {
        background: var(--surface-alt);
    }
}

.cd-qr-photo {
    width: var(--cd-qr-photo-size);
    height: var(--cd-qr-photo-size);
    margin: 0 auto var(--space-3);
    border-radius: var(--radius-md);
    object-fit: cover;
}

.cd-qr-name {
    font-family: var(--font-display);
    font-size: var(--text-display-sm-size);
    line-height: var(--text-display-sm-line);
    font-weight: var(--weight-bold);
}

.cd-qr-role {
    margin-top: var(--space-1) !important;
    color: var(--ink-muted);
    font-size: var(--text-body-sm-size);
    line-height: var(--text-body-sm-line);
}

.cd-qr-code {
    margin: var(--space-4) 0 var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--white);
}

.cd-qr-code svg {
    display: block;
    width: 100%;
    height: auto;
}

.cd-qr-hint {
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
    font-weight: var(--weight-semibold);
}

.cd-qr-url {
    margin-top: var(--space-1) !important;
    color: var(--ink-muted);
    font-size: var(--text-body-sm-size);
    line-height: var(--text-body-sm-line);
    overflow-wrap: anywhere;
}

/* the Drahenix logo in blue: logo.svg (white) as a mask filled with --accent */
.cd-qr-logo {
    display: block;
    width: var(--cd-qr-logo-width);
    aspect-ratio: 185 / 30;
    margin: var(--space-4) auto 0;
    background: var(--accent);
    -webkit-mask: url("/assets/images/logo/logo.svg?v=b46eb6972b") center / contain no-repeat;
    mask: url("/assets/images/logo/logo.svg?v=b46eb6972b") center / contain no-repeat;
}

/* Download, then Share image below it at the same full width (Share image only where the browser can share files);
   each label on one line, icon and text together. Under 360px (a small phone, or 200 % text) a label may wrap
   rather than overflow the dialog. */
.cd-qr-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

@media (min-width: 360px) {
    .cd-qr-actions .cd-btn {
        white-space: nowrap;
    }
}

/* ---- "Link copied" toast, not found, no JavaScript ---- */
.cd-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--header-tabbar-height) + var(--space-4) + env(safe-area-inset-bottom));
    z-index: 950;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--gray-dark);
    color: var(--white);
    font-size: var(--text-body-sm-size);
    opacity: 0;
    transform: translate(-50%, 16px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}

.cd-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
    .cd-toast,
    .cd-act-icon,
    .cd-btn {
        transition: none;
    }
}

.cd-notfound {
    padding: calc(var(--cd-band-height) + var(--space-8)) 0 var(--space-12);
    text-align: center;
}

.cd-notfound h1 {
    margin-bottom: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-display-md-size);
    line-height: var(--text-display-md-line);
    font-weight: var(--weight-bold);
}

.cd-notfound p {
    margin-bottom: var(--space-6);
    color: var(--ink-muted);
}

.cd-noscript {
    padding: calc(var(--cd-band-height) + var(--space-8)) var(--space-5) var(--space-8);
    text-align: center;
}

/* the floating header needs a dark ground behind it on the not-found and no-JavaScript states too */
.cd-notfound,
.cd-noscript {
    background: linear-gradient(var(--gray-dark) var(--cd-band-height), var(--surface) var(--cd-band-height));
}
