/* conditions.css - Condition finder and condition pages */

/* 1. A-Z Conditions page: 3D body left, buttons and list right */

.cf-layout {
    display: grid;
    gap: 1.5rem;
    padding-top: 2rem;
    padding-bottom: 1rem;
}

/* 3D body */
.cf-viewer {
    text-align: center;
}
.cf-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 1rem;
    color: #5C6270;
}
/* touch words only on touch screens */
.cf-hint-touch {
    display: none;
}
@media (hover: none) and (pointer: coarse) {
    .cf-hint-mouse {
        display: none;
    }
    .cf-hint-touch {
        display: inline;
    }
}
.cf-hint .icon {
    width: 16px;
    height: 16px;
    color: #2348C9;
}
.cf-body3d {
    position: relative;
    height: 420px;
    margin: 0.5rem 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    touch-action: pan-y;
    transition: border-color 0.2s ease;
}
/* border only shows once a part is picked */
.cf-body3d.has-pick {
    border-color: #1F2A37;
}
/* phones: no box around the body, and no grey flash when it's tapped */
.cf-body3d {
    -webkit-tap-highlight-color: transparent;
}
@media (hover: none), (max-width: 959px) {
    .cf-body3d.has-pick {
        border-color: transparent;
    }
}
.cf-body3d canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}
.cf-body3d canvas:active {
    cursor: grabbing;
}
/* no WebGL: hide the empty box, the buttons still work */
.cf-body3d.is-flat {
    display: none;
}
/* heading and buttons */
.cf-side h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: var(--navy-dark);
}
.cf-lead {
    max-width: 34rem;
    margin: 0.75rem 0 2rem;
    font-family: "Segoe UI", Roboto, "Open Sans", Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #757575;
}
.cf-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 0.55rem;
    margin-bottom: 1.25rem;
    max-width: 560px;
}
.cf-letters {
    margin: 2.25rem 0 2.75rem;
}
.cf-part-btn,
.cf-letter-btn {
    min-height: 38px;
    padding: 0.3rem 0.6rem;
    border: 1px solid #2D5592;
    border-radius: 3px;
    background: #1B3F72;
    color: var(--white);
    font-family: "Segoe UI", Roboto, "Open Sans", Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cf-letter-btn {
    min-width: 32px;
    padding: 0.3rem 0.45rem;
}
.cf-part-btn:hover,
.cf-letter-btn:hover {
    background: #13305A;
}
/* chosen button: white with a blood orange border and text (same colour as the body) */
.cf-part-btn[aria-pressed="true"],
.cf-letter-btn[aria-pressed="true"] {
    border-color: #C2401F;
    background: var(--white);
    color: #C2401F;
}
.cf-showing {
    min-height: 1.4em;
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy-dark);
}

/* condition list: outlined buttons in two columns */
.cf-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    max-width: 560px;
}
.cf-item {
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: 0.4rem 0.75rem;
    border: 1px solid #1B3F72;
    border-radius: 3px;
    background: var(--white);
    color: #1B3F72;
    font-family: Roboto, "Segoe UI", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.cf-item:hover {
    background: #1B3F72;
    color: var(--white);
}
.cf-item[hidden] {
    display: none;
}
.cf-empty {
    padding: 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 6px;
    text-align: center;
}

/* page numbers */
.cf-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.cf-pages button {
    min-width: 32px;
    padding: 0.3rem 0.5rem;
    border: 0;
    border-radius: 3px;
    background: none;
    color: var(--text-dark, #032137);
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
}
.cf-pages button:hover {
    color: var(--navy);
    text-decoration: underline;
}
.cf-pages button[aria-current="page"] {
    background: var(--navy);
    color: var(--white);
}
.cf-note {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

@media (min-width: 960px) {
    .cf-layout {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
        align-items: start;
    }
    .cf-viewer {
        position: sticky;
        top: 90px;
    }
    .cf-body3d {
        max-width: 550px;
        height: 835px;
        margin: 0.5rem auto;
    }
}

/* 2. Condition page (article) */

.ca-page {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
}
.ca-crumbs {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #5C6270;
}
.ca-crumbs a {
    color: var(--navy);
    text-decoration: none;
}
.ca-crumbs a:hover {
    text-decoration: underline;
}
.ca-crumbs span[aria-hidden] {
    margin: 0 0.25rem;
}
.ca-title {
    margin: 0 0 1.25rem;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    color: var(--navy-dark);
}
.ca-time {
    margin-left: 0.4rem;
    font-size: 0.95rem;
    font-weight: 400;
    color: #5C6270;
    white-space: nowrap;
}
/* wide banner picture: deep blue with soft light facets */
.ca-banner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: clamp(180px, 28vw, 340px);
    overflow: hidden;
    margin-bottom: 2rem;
    border-radius: 6px;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.12) 0 30%, transparent 30% 55%, rgba(255, 255, 255, 0.08) 55% 70%, transparent 70%),
        linear-gradient(60deg, transparent 0 40%, rgba(106, 170, 228, 0.25) 40% 52%, transparent 52%),
        linear-gradient(135deg, #2348C9 0%, #13306F 100%);
    color: var(--white);
}
.ca-banner .icon {
    width: clamp(56px, 8vw, 96px);
    height: clamp(56px, 8vw, 96px);
    stroke-width: 1.4;
}
.ca-banner span {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}
.ca-body {
    max-width: 50rem;
    font-size: 1.05rem;
    line-height: 1.7;
}
.ca-body p {
    margin: 0 0 1rem;
}
.ca-intro {
    font-size: 1.15rem;
    color: var(--navy-dark);
}
/* plain bold subheadings */
.ca-body h2 {
    margin: 1.75rem 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-dark);
}
.ca-body ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}
.ca-body li {
    margin-bottom: 0.35rem;
}
.ca-cta {
    margin-top: 1.75rem !important;
}
.ca-cta a {
    color: var(--navy);
    font-weight: 700;
}
.ca-sources {
    margin-top: 1.5rem;
}
.ca-sources p {
    margin: 0 0 0.6rem;
    color: #5C6270;
}
.ca-sources a {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--navy);
    text-decoration: none;
}
.ca-sources a:hover {
    text-decoration: underline;
}
.ca-disclaimer {
    font-size: 0.85rem;
    color: #5C6270;
}

/* For you cards */
.ca-foryou {
    margin-top: 2.5rem;
}
.ca-foryou h2 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    color: var(--navy-dark);
}
.ca-foryou-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.ca-foryou-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--navy-dark);
    text-decoration: none;
}
.ca-foryou-card strong {
    line-height: 1.3;
}
.ca-foryou-card:hover strong {
    text-decoration: underline;
}
.ca-foryou-card .ca-time {
    margin: 0;
    font-size: 0.85rem;
}
.ca-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    margin-bottom: 0.35rem;
    border-radius: 6px;
    background: linear-gradient(135deg, #2348C9 0%, #13306F 100%);
    color: var(--white);
    transition: transform 0.2s ease;
}
.ca-foryou-card:hover .ca-thumb {
    transform: translateY(-3px);
}
.ca-thumb .icon {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
}
@media (min-width: 900px) {
    .ca-foryou-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* A-Z Conditions as the first block of the Health Hub */
.cf-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    color: #111111;
}
.health-page .cf-layout {
    padding-top: 0;
    padding-bottom: 0;
}

/* condition photo (wide, with the credit under it) */
.ca-photo {
    margin: 0 0 2rem;
}
.ca-photo img {
    display: block;
    width: 100%;
    height: clamp(200px, 30vw, 380px);
    border-radius: 6px;
    object-fit: cover;
}
.ca-photo figcaption {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #757575;
}
.ca-photo figcaption a {
    color: inherit;
}
/* For you cards with a photo */
.ca-thumb-photo {
    width: 100%;
    object-fit: cover;
}
