/* =============================================================
   EXPERTISE SECTION — Dr. Vipin Mathur Portfolio
   FIX: Badge no longer overflows image on mobile/tablet
   ============================================================= */

/* ── Section wrapper ─────────────────────────────────────────── */
.expertise-section {
    position: relative;
    background-color: var(--color-bg);
    padding: var(--section-pad-y) var(--section-pad-x);
    overflow: hidden;
}

/* ── Inner container ─────────────────────────────────────────── */
.expertise-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Top row: image + content ────────────────────────────────── */
.expertise-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 80px;
}

/* ── LEFT — image block ──────────────────────────────────────── */
.expertise-image-wrap {
    position: relative;
    /* KEY FIX: enough bottom+right padding so the badge
       never gets clipped or overflows the section edge    */
    padding-bottom: 48px;
    padding-right: 48px;
}

.expertise-image-frame {
    width: 100%;
    aspect-ratio: 4 / 3.6;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-stone-light);
}

.expertise-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* ── Badge ───────────────────────────────────────────────────── */
.expertise-image-badge {
    position: absolute;
    /* Sits at bottom-right of the padded wrap, fully visible */
    bottom: 0;
    right: 0;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--color-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    border: 5px solid var(--color-bg);
    transition: transform 0.4s ease;
    text-decoration: none !important;
    z-index: 2;
}

.expertise-image-badge:hover {
    animation: waveBlob 2.5s infinite ease-in-out,
               floatY   3s   infinite ease-in-out;
    transform: scale(1.05);
}

@keyframes waveBlob {
    0%   { border-radius: 50%; }
    25%  { border-radius: 55% 45% 60% 40% / 45% 60% 40% 55%; }
    50%  { border-radius: 60% 40% 50% 50% / 50% 45% 55% 50%; }
    75%  { border-radius: 45% 55% 40% 60% / 55% 40% 60% 45%; }
    100% { border-radius: 50%; }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0)    scale(1.05); }
    50%       { transform: translateY(-6px) scale(1.05); }
}

.expertise-image-badge__num {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-fg-alt);
    line-height: 1;
}

.expertise-image-badge__label {
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-fg-alt);
    opacity: 0.85;
    text-align: center;
    line-height: 1.3;
    padding: 12px;
}

/* ── RIGHT — content block ───────────────────────────────────── */
.expertise-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Eyebrow */
.expertise-eyebrow {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-rose);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.expertise-eyebrow::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    background: var(--color-rose);
    opacity: 0.6;
    flex-shrink: 0;
}

/* Heading */
.expertise-heading {
    font-family: var(--font-serif);
    font-size: clamp(30px, 3vw, 52px);
    font-weight: 800;
    line-height: 1.12;
    color: var(--color-fg);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.expertise-heading__regular { font-style: normal;  font-weight: 800; }
.expertise-heading__italic  { font-style: italic;  font-weight: 800; }
.expertise-heading__underline { display: inline; padding-bottom: 2px; }

/* Rule */
.expertise-rule {
    width: 56px;
    height: 2px;
    background: var(--color-stone);
    margin: 20px 0 24px;
    opacity: 0.45;
}

/* Body */
.expertise-body {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.85;
    color: var(--color-fg);
    margin-bottom: 32px;
}

/* CTA */
.expertise-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-fg);
    background: transparent;
    border: 1.5px solid var(--color-fg);
    padding: 13px 28px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}

.expertise-cta svg { transition: transform var(--transition); }

.expertise-cta:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-fg-alt);
}

.expertise-cta:hover svg { transform: translateX(3px); }


/* =============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================= */

/* ── 1100px ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .expertise-section { padding: 80px 40px; }
    .expertise-row     { gap: 56px; }
}

/* ── 860px: stack to single column ───────────────────────────── */
@media (max-width: 860px) {
    .expertise-section { padding: 72px 32px; }

    .expertise-row {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .expertise-image-wrap {
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
        /* Keep padding so badge stays inside on tablet */
        padding-bottom: 44px;
        padding-right: 44px;
    }

    /* Scale badge down slightly for tablet */
    .expertise-image-badge {
        width: 120px;
        height: 120px;
    }

    .expertise-image-badge__num  { font-size: 1.9rem; }
    .expertise-image-badge__label{ font-size: 0.58rem; padding: 10px; }

    .expertise-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── 640px: large phone ───────────────────────────────────────── */
@media (max-width: 640px) {
    .expertise-section { padding: 60px 24px; }

    .expertise-image-wrap {
        /* Smaller badge → less padding needed */
        padding-bottom: 38px;
        padding-right: 38px;
    }

    .expertise-image-badge {
        width: 100px;
        height: 100px;
        border-width: 4px;
    }

    .expertise-image-badge__num   { font-size: 1.6rem; }
    .expertise-image-badge__label { font-size: 0.52rem; padding: 8px; letter-spacing: 0.08em; }

    .expertise-heading { font-size: clamp(26px, 6vw, 38px); }
    .expertise-body    { font-size: 16px; line-height: 1.8; }

    .expertise-cta {
        width: 100%;
        justify-content: center;
        padding: 13px 20px;
    }

    .expertise-stats { grid-template-columns: repeat(2, 1fr); }
    .expertise-stat  { padding: 28px 16px 24px; }
}

/* ── 480px: standard phone ────────────────────────────────────── */
@media (max-width: 480px) {
    .expertise-section { padding: 48px 20px; }

    .expertise-image-wrap {
        padding-bottom: 32px;
        padding-right: 32px;
    }

    .expertise-image-badge {
        width: 84px;
        height: 84px;
        border-width: 3px;
    }

    .expertise-image-badge__num   { font-size: 1.35rem; }
    .expertise-image-badge__label { font-size: 0.47rem; padding: 6px; letter-spacing: 0.06em; }

    .expertise-heading { font-size: clamp(24px, 7vw, 34px); }
    .expertise-body    { font-size: 15px; }
}

/* ── 360px: very small phones ─────────────────────────────────── */
@media (max-width: 360px) {
    .expertise-section { padding: 40px 16px; }

    .expertise-image-wrap {
        padding-bottom: 28px;
        padding-right: 28px;
    }

    .expertise-image-badge {
        width: 72px;
        height: 72px;
        border-width: 3px;
    }

    .expertise-image-badge__num   { font-size: 1.1rem; }
    .expertise-image-badge__label { font-size: 0.42rem; padding: 4px; }

    .expertise-stats { grid-template-columns: 1fr 1fr; }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .expertise-image-badge:hover {
        animation: none;
        transform: none;
    }

    .expertise-cta svg { transition: none; }
}