/*
 * Provider profile parts.
 *
 * Divi owns page layout, spacing and typography scale. These rules only cover
 * what the builder cannot express: the circular video mask, aspect-ratio boxes,
 * and the card grids. Colors come from custom properties so the theme can
 * override them without touching this file.
 */

.pf-part {
    --pf-accent: #2a407a;
    --pf-border: #e6e9ef;
    --pf-muted: #666;

    /* CTA button */
    --pf-cta-bg: #4067aa;
    --pf-cta-border: #002f87;
    --pf-cta-text: #fff;
}

/*
 * public.css spaces the profile's sections with a fixed 80px top margin, which
 * the old single-shortcode template needs because its sections run together in
 * one block. As parts, each one sits in its own Divi row and that row owns the
 * spacing, so the section must not add any of its own.
 */
.pf-part.pf-locations-new,
.pf-part.pf-certifications-section,
.pf-part.pf-videos-section,
.pf-part.pf-podcasts-section,
.pf-part.pf-articles-section {
    margin-top: 0;
}

/* ---------- Intro video ---------- */

.pf-intro-video-frame {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #f2f4f8;
}

.pf-intro-video--round .pf-intro-video-frame {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    max-width: 420px;
    margin-inline: auto;
}

.pf-intro-video-el {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

/* Non-round embeds keep a 16:9 box. */
.pf-intro-video:not(.pf-intro-video--round) .pf-intro-video-frame {
    aspect-ratio: 16 / 9;
}

/* The whole circle is the mute toggle, so it reads as clickable. */
.pf-intro-video-frame:has(video) {
    cursor: pointer;
}

/* Full-bleed click target that sits over the muted video. */
.pf-intro-video-unmute {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    appearance: none;
}

.pf-intro-video-unmute:focus-visible {
    outline: 3px solid var(--pf-accent);
    outline-offset: 2px;
}

/*
 * The overlay stays in place after unmuting, because clicking again re-mutes.
 * It is transparent, so the video is unobstructed either way.
 */

.pf-intro-video-caption {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: var(--pf-muted);
}

/*
 * The caption names the action the next click performs, so it swaps rather
 * than disappearing once the video is unmuted.
 */
.pf-intro-video-frame.is-unmuted + .pf-intro-video-caption .pf-caption-muted,
.pf-intro-video-frame:not(.is-unmuted) + .pf-intro-video-caption .pf-caption-unmuted {
    display: none;
}

.pf-provider-photo--round img {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    max-width: 420px;
    display: block;
    margin-inline: auto;
}

/* ---------- CTA ---------- */

.pf-part.pf-provider-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/*
 * Pill button. The label and phone number are separate spans so they can be
 * styled apart, but they read as one sentence, so the gap between them is a
 * word space rather than a layout gap.
 */
.pf-part.pf-provider-cta .pf-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    flex-wrap: wrap;

    padding: 0.85em 1.2em;
    border: 2px solid var(--pf-cta-border);
    border-radius: 999px;
    background: var(--pf-cta-bg);

    color: var(--pf-cta-text);
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
    font-size: 1rem;
    margin: 0;

    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Beat theme link rules, which often set their own colour on a:hover. */
.pf-part.pf-provider-cta .pf-cta-btn:hover,
.pf-part.pf-provider-cta .pf-cta-btn:focus,
.pf-part.pf-provider-cta .pf-cta-btn:active,
.pf-part.pf-provider-cta .pf-cta-btn:visited {
    color: var(--pf-cta-text);
    text-decoration: none;
}

.pf-part.pf-provider-cta .pf-cta-btn:hover,
.pf-part.pf-provider-cta .pf-cta-btn:focus {
    background: var(--pf-cta-border);
}

.pf-part.pf-provider-cta .pf-cta-btn:focus-visible {
    outline: 3px solid var(--pf-cta-bg);
    outline-offset: 3px;
}

/* The number should not break away from the label on a narrow column. */
.pf-part.pf-provider-cta .pf-cta-phone {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .pf-part.pf-provider-cta .pf-cta-btn {
        width: 100%;
        padding-inline: 1.2em;
    }
}

/* ---------- Card grids ---------- */

.pf-articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.pf-article-card {
    border: 1px solid var(--pf-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}



/* ---------- Video cards ---------- */

/*
 * Scoped like the other parts: public.css lays these out as a flex row with a
 * 280px minimum and an #f4f8ff fill, which would fight the grid.
 *
 * The player sits at the top of the card with the title and description
 * centred beneath it, as in the approved design.
 */
.pf-part.pf-videos-section .pf-videos-list {
    display: grid;
    grid-template-columns: repeat(var(--pf-video-columns, 2), minmax(0, 1fr));
    gap: 28px;
}

.pf-part.pf-videos-section .pf-video-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    gap: 0;
    padding: 14px 14px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--pf-video-card-bg, #f7faff);
    box-shadow: 0 2px 10px rgba(16, 32, 64, 0.10);
    overflow: hidden;
}

.pf-part.pf-videos-section .pf-video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

.pf-part.pf-videos-section .pf-video-embed iframe,
.pf-part.pf-videos-section .pf-video-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.pf-part.pf-videos-section .pf-video-info {
    padding: 18px 12px 0;
    text-align: center;
}

.pf-part.pf-videos-section .pf-video-title {
    color: var(--pf-video-title-color, #2a5cab);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.3;
    margin-bottom: 12px;
}

.pf-part.pf-videos-section .pf-video-meta {
    color: var(--pf-video-text-color, #4a4a4a);
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 0;
}

.pf-part.pf-videos-section .pf-video-watch {
    display: inline-block;
    margin-top: 12px;
    color: var(--pf-video-link-color, #2a5cab);
    font-weight: 700;
    text-decoration: none;
}

.pf-part.pf-videos-section .pf-video-watch:hover {
    color: var(--pf-video-link-color, #2a5cab);
    text-decoration: underline;
}

@media (max-width: 700px) {
    .pf-part.pf-videos-section .pf-videos-list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Podcast cards ---------- */

/*
 * Scoped like the other parts: public.css paints these cards #f4f8ff and makes
 * them full width (flex: 1 1 100%), which would override the grid.
 *
 * Each card is a plain shadowed box around the DoctorPodcasting widget. That
 * widget renders its own iframe and owns everything inside it, so nothing here
 * styles its contents - the box only provides the frame and the row layout.
 */
.pf-part.pf-podcasts-section .pf-podcasts-list {
    display: grid;
    grid-template-columns: repeat(var(--pf-podcast-columns, 3), minmax(0, 1fr));
    gap: 24px;
}

.pf-part.pf-podcasts-section .pf-podcast-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(16, 32, 64, 0.10);
    overflow: hidden;
}

/* The widget sizes its own iframe; keep it inside the card on narrow columns. */
.pf-part.pf-podcasts-section .pf-podcast-card iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
}

/*
 * The widget card spans the row: its iframe lays out its own episode list, so
 * boxing it into one grid column would squeeze that layout.
 */
.pf-part.pf-podcasts-section .pf-podcast-card--widget {
    grid-column: 1 / -1;
}

/* Cards built from the podcasts table, for when that data exists. */
.pf-part.pf-podcasts-section .pf-podcast-info {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pf-part.pf-podcasts-section .pf-podcast-title {
    color: var(--pf-podcast-title-color, #2a5cab);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--pf-podcast-divider, #7a7a7a);
}

.pf-part.pf-podcasts-section .pf-podcast-title a {
    color: inherit;
    text-decoration: none;
}

.pf-part.pf-podcasts-section .pf-podcast-title a:hover {
    text-decoration: underline;
}

.pf-part.pf-podcasts-section .pf-podcast-meta,
.pf-part.pf-podcasts-section .pf-podcast-date {
    color: var(--pf-podcast-text-color, #4a4a4a);
    line-height: 1.6;
    margin-bottom: 10px;
}

.pf-part.pf-podcasts-section .pf-podcast-play {
    display: inline-block;
    margin-top: auto;
    color: var(--pf-podcast-link-color, #2a5cab);
    font-weight: 700;
    text-decoration: none;
}

.pf-part.pf-podcasts-section .pf-podcast-play:hover {
    text-decoration: underline;
}

/*
 * Hidden by provider-parts.js when the widget renders no episodes.
 *
 * Matched on the marker class alone, and with !important, so the section is
 * hidden regardless of what the page builder wrapped it in or what else claims
 * a display value for it. The script also sets display inline as a belt-and-
 * braces fallback for the case where this stylesheet did not load.
 */
.pf-is-empty {
    display: none !important;
}

@media (max-width: 900px) {
    .pf-part.pf-podcasts-section .pf-podcasts-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .pf-part.pf-podcasts-section .pf-podcasts-list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Location cards ---------- */

/*
 * Same card treatment as the credential grid, centred: image, name, address
 * block, then the directions link.
 *
 * These selectors are scoped under .pf-part because public.css styles the same
 * class names for the original profile template - including a left-aligned card
 * and `.pf-location-address p { margin: ... !important }`. The extra class
 * raises specificity so this layout wins wherever the shortcode is used, while
 * the old template keeps its own styling untouched.
 */
.pf-part.pf-locations-new .pf-locations-wrap {
    display: grid;
    grid-template-columns: repeat(var(--pf-location-columns, 3), minmax(0, 1fr));
    gap: 32px;
}

.pf-part.pf-locations-new .pf-location-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0; /* public.css sets min-width: 320px, which breaks the grid */
    padding: 32px 28px 36px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(16, 32, 64, 0.10);
    gap: 0;
}

.pf-part.pf-locations-new .pf-location-icon {
    margin-bottom: 20px;
    line-height: 0;
}

.pf-part.pf-locations-new .pf-location-icon img {
    width: auto;
    height: auto;
    max-width: var(--pf-location-icon-size, 56px);
    max-height: var(--pf-location-icon-size, 56px);
    object-fit: contain;
    display: block;
    background: none;
    border-radius: 0;
}

.pf-part.pf-locations-new .pf-location-card h3 {
    color: var(--pf-location-name-color, #4a4a4a);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 18px;
}

.pf-part.pf-locations-new .pf-location-address {
    color: var(--pf-location-text-color, #4a4a4a);
    line-height: 1.9;
    margin-bottom: 16px;
}

/*
 * Themes commonly give paragraphs a bottom padding, and public.css sets a
 * bottom margin with !important. The address lines are a single block, so both
 * are cleared here and the line-height above does the spacing.
 */
.pf-part.pf-locations-new .pf-location-address p {
    margin: 0 !important;
    padding: 0;
}

/* The phone is a tel: link but should read as part of the address block. */
.pf-part.pf-locations-new .pf-location-address a {
    color: inherit;
    text-decoration: none;
}

.pf-part.pf-locations-new .pf-location-address a:hover {
    text-decoration: underline;
}

/* Push the link to the bottom so cards in a row align. */
.pf-part.pf-locations-new .pf-location-directions {
    display: inline-block;
    margin-top: auto;
    color: var(--pf-location-link-color, #4a4a4a);
    font-weight: 700;
    text-decoration: none;
}

.pf-part.pf-locations-new .pf-location-directions:hover {
    color: var(--pf-location-link-color, #4a4a4a);
    text-decoration: underline;
}

@media (max-width: 900px) {
    .pf-part.pf-locations-new .pf-locations-wrap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .pf-part.pf-locations-new .pf-locations-wrap {
        grid-template-columns: 1fr;
    }
}

/* ---------- Credential cards ---------- */

/*
 * Fixed column count rather than auto-fit: the design calls for three across,
 * and auto-fit would reflow to four on a wide screen. Cards wrap onto further
 * rows, so a provider with more than three credentials keeps all of them.
 */
.pf-part.pf-certifications-section .pf-certifications-grid {
    display: grid;
    grid-template-columns: repeat(var(--pf-cert-columns, 3), minmax(0, 1fr));
    gap: 24px;
}

.pf-part.pf-certifications-section .pf-cert-card {
    display: flex;
    flex-direction: column;
    padding: 28px 28px 32px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(16, 32, 64, 0.10);
}

.pf-part.pf-certifications-section .pf-cert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--pf-cert-icon-bg, #d9d9d9);
    color: var(--pf-cert-icon-color, #2a5cab);
}

.pf-part.pf-certifications-section .pf-cert-icon svg {
    width: 34px;
    height: 34px;
    display: block;
}

/* Rule under the title, as in the design. */
.pf-part.pf-certifications-section .pf-cert-title {
    color: var(--pf-cert-title-color, #2a5cab);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--pf-cert-divider, #7a7a7a);
}

.pf-part.pf-certifications-section .pf-cert-value {
    color: var(--pf-cert-value-color, #4a4a4a);
    line-height: 1.55;
}

@media (max-width: 900px) {
    .pf-part.pf-certifications-section .pf-certifications-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .pf-part.pf-certifications-section .pf-certifications-grid {
        grid-template-columns: 1fr;
    }
}

.pf-video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.pf-video-embed iframe,
.pf-video-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.pf-article-info {
    padding: 15px;
}

.pf-article-img img {
    width: 100%;
    height: var(--pf-article-img-height, 200px);
    object-fit: cover;
    display: block;
}

.pf-article-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.pf-article-meta {
    color: var(--pf-muted);
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* Location cards style their own link; see the location block above. */
.pf-article-read,
.pf-video-watch {
    display: inline-block;
    color: var(--pf-accent);
    font-weight: 600;
    text-decoration: none;
}

.pf-article-read:hover,
.pf-video-watch:hover {
    text-decoration: underline;
}

.pf-provider-missing {
    padding: 12px 16px;
    border-left: 4px solid #d63638;
    background: #fcf0f1;
    color: #8a1f21;
}

/* Screen-reader-only text, in case the theme does not define it. */
.pf-part .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
