/* ============================================================
   Doctors Category Grid — Dala3ni Premium Styles
   ============================================================ */

/* Google Fonts loaded via wp_enqueue_style in plugin */

/* ── Section ─────────────────────────────────────────────── */
.dcg-section {
    position: relative;
    padding: clamp(3.5rem, 8vw, 7rem) 0;
    background: var(--dcg-section-bg, #F7FAFA);
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Background Decorations ──────────────────────────────── */
.dcg-bg-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.dcg-bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.04;
    background: var(--dcg-accent, #2A7F8B);
}

.dcg-bg-circle--1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -150px;
}

.dcg-bg-circle--2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -100px;
}

.dcg-bg-line {
    position: absolute;
    background: var(--dcg-accent, #2A7F8B);
    opacity: 0.06;
}

.dcg-bg-line--1 {
    width: 1px;
    height: 100%;
    left: 20%;
    top: 0;
}

.dcg-bg-line--2 {
    width: 1px;
    height: 100%;
    right: 25%;
    top: 0;
}

/* ── Section Header ──────────────────────────────────────── */
.dcg-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    position: relative;
    z-index: 1;
    /* Always visible — GSAP animates from hidden state */
    opacity: 1 !important;
    visibility: visible !important;
}

.dcg-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--dcg-accent, #2A7F8B);
    margin-bottom: 1rem;
}

.dcg-subtitle__line {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--dcg-accent, #2A7F8B);
    border-radius: 2px;
    opacity: 0.5;
}

.dcg-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 400;
    font-style: normal;
    line-height: 1.15;
    color: var(--dcg-title-color, #0F2137);
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

.dcg-description {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--dcg-text-color, #5A6B7E);
    margin: 0;
}

/* ── Grid ────────────────────────────────────────────────── */
.dcg-grid {
    display: grid;
    gap: 28px;
    position: relative;
    z-index: 1;
}

.dcg-grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.dcg-grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dcg-grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Card ────────────────────────────────────────────────── */
.dcg-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* GSAP adds this class before animating */
.dcg-card.dcg-will-animate {
    opacity: 0;
    transform: translateY(40px);
}

.dcg-card.dcg-visible {
    opacity: 1;
    transform: translateY(0);
}

.dcg-card__inner {
    background: var(--dcg-card-bg, #FFFFFF);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 1px 2px rgba(15, 33, 55, 0.04),
        0 4px 12px rgba(15, 33, 55, 0.04),
        0 0 0 1px rgba(15, 33, 55, 0.03);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.dcg-card__inner:hover {
    transform: translateY(-8px);
    box-shadow:
        0 4px 8px rgba(15, 33, 55, 0.04),
        0 12px 32px rgba(15, 33, 55, 0.08),
        0 0 0 1px rgba(15, 33, 55, 0.04);
}

/* ── Card Image ──────────────────────────────────────────── */
.dcg-card__image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 3.4;
}

.dcg-card__image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.dcg-card__inner:hover .dcg-card__image {
    transform: scale(1.05);
}

.dcg-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--dcg-accent) 8%, transparent),
        color-mix(in srgb, var(--dcg-accent) 15%, transparent)
    );
    color: var(--dcg-accent, #2A7F8B);
}

.dcg-card__image--placeholder svg {
    width: 48%;
    height: 48%;
    opacity: 0.35;
}

.dcg-card__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 33, 55, 0.55) 0%,
        rgba(15, 33, 55, 0) 50%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.dcg-card__inner:hover .dcg-card__image-overlay {
    opacity: 1;
}

/* ── Hover Action (Book Button on Image) ─────────────────── */
.dcg-card__hover-action {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.dcg-card__inner:hover .dcg-card__hover-action {
    transform: translateY(0);
    opacity: 1;
}

.dcg-btn--book {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--dcg-accent-dark, #1D5F68);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.dcg-btn--book:hover {
    background: var(--dcg-accent, #2A7F8B);
    color: #fff;
    transform: scale(1.04);
}

.dcg-btn--book svg {
    flex-shrink: 0;
}

/* ── Card Content ────────────────────────────────────────── */
.dcg-card__content {
    padding: 24px 24px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dcg-card__name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.3;
    color: var(--dcg-title-color, #0F2137);
}

.dcg-card__name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dcg-card__name a:hover {
    color: var(--dcg-accent, #2A7F8B);
}

.dcg-card__specialty {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dcg-accent, #2A7F8B);
    margin-bottom: 12px;
    line-height: 1.5;
}

.dcg-card__desc {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--dcg-text-color, #5A6B7E);
    margin: 0 0 auto;
    padding-bottom: 16px;
}

/* ── Card Footer ─────────────────────────────────────────── */
.dcg-card__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(15, 33, 55, 0.06);
    margin-top: auto;
}

.dcg-btn--profile {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dcg-text-color, #5A6B7E);
    text-decoration: none;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.dcg-btn--profile:hover {
    color: var(--dcg-accent, #2A7F8B);
    gap: 10px;
}

.dcg-btn--profile svg {
    transition: transform 0.3s ease;
}

.dcg-btn--profile:hover svg {
    transform: translateX(3px);
}

.dcg-btn--cta {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 8px 18px;
    background: var(--dcg-accent, #2A7F8B);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    letter-spacing: 0.02em;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.dcg-btn--cta:hover {
    background: var(--dcg-accent-dark, #1D5F68);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--dcg-accent) 30%, transparent);
}

/* ── Empty State ─────────────────────────────────────────── */
.dcg-empty {
    text-align: center;
    color: var(--dcg-text-color, #5A6B7E);
    font-size: 1rem;
    padding: 3rem 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .dcg-grid--cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dcg-grid--cols-3,
    .dcg-grid--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .dcg-grid {
        gap: 20px;
    }

    .dcg-card__content {
        padding: 18px 18px 22px;
    }

    .dcg-card__name {
        font-size: 1.05rem;
    }

    .dcg-bg-line {
        display: none;
    }
}

@media (max-width: 540px) {
    .dcg-grid--cols-2,
    .dcg-grid--cols-3,
    .dcg-grid--cols-4 {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .dcg-card__image-wrap {
        aspect-ratio: 3 / 3;
    }

    .dcg-card__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .dcg-btn--cta {
        margin-left: 0;
        justify-content: center;
        padding: 10px 18px;
    }
}

/* ── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .dcg-card {
        opacity: 1;
        transform: none;
    }

    .dcg-card__inner,
    .dcg-card__inner:hover {
        transition: none;
        transform: none;
    }

    .dcg-card__image,
    .dcg-card__inner:hover .dcg-card__image {
        transition: none;
        transform: none;
    }

    .dcg-card__hover-action {
        opacity: 1;
        transform: none;
    }

    .dcg-card__image-overlay {
        opacity: 0.3;
    }
}
