/* Event Schedule Grid. Font intentionally inherited from theme body. */

/* Stage colors — the single place to change them. Names are fixed in PHP.
   Reference design uses one pink accent for all stages; differentiate here if needed. */
.esg-stage--stage_1 { --stage-color: #36B5FF; } /* Guru talk */
.esg-stage--stage_2 { --stage-color: #6B86FF; } /* Platform Sharing */
.esg-stage--stage_3 { --stage-color: #956BFF; } /* E-commerce Lab */
.esg-stage--all     { --stage-color: #C66BFF; } /* Full-width sessions */

.esg-schedule {
    --esg-time-col: 78px;
    --esg-row-h: 24px;
    --esg-gap: 10px;
    --esg-accent: #ec4899;
    --esg-avatar-ring: #a855f7;
    --esg-border: #f5cfe2;
    box-sizing: border-box;
    width: 100%;
}

.esg-schedule *,
.esg-schedule *::before,
.esg-schedule *::after {
    box-sizing: border-box;
}

/* Date pill with calendar icon, centered above the grid. */
.esg-schedule__datewrap {
    text-align: center;
    margin: 0 0 1.25rem;
}

.esg-schedule__date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.esg-cal-icon {
    color: #16a34a;
    flex-shrink: 0;
}

/* Horizontal scroll wrapper doubles as the bordered container. */
.esg-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--esg-border);
    border-radius: 18px;
    padding: 12px 12px 12px 0;
    background: #fff;
}

.esg-grid {
    --esg-cols: 3;
    --esg-col-min: 200px;
    display: grid;
    grid-template-columns: var(--esg-time-col) repeat(var(--esg-cols), minmax(var(--esg-col-min), 1fr));
    /* Tracks grow to fit content so cards are as tall as their content.
       Labels and cards stay aligned because they share the same grid lines. */
    grid-template-rows: auto repeat(var(--esg-rows), minmax(var(--esg-row-h), auto));
    gap: var(--esg-gap);
    min-width: calc(var(--esg-time-col) + var(--esg-cols) * (var(--esg-col-min) + var(--esg-gap)));
    position: relative;
}

.esg-schedule--single .esg-grid {
    --esg-col-min: 300px;
}

/* Horizontal time dividers, drawn behind cards. */
.esg-line {
    grid-column: 1 / -1;
    align-self: start;
    height: 0;
    border-top: 1px solid var(--esg-border);
    pointer-events: none;
    z-index: 0;
}

/* Stage header pills. */
.esg-stage-head {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    background: var(--stage-color);
    text-align: center;
    /* box-shadow: 0 4px 10px color-mix(in srgb, var(--stage-color) 35%, transparent); */
}

.esg-corner {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
    background: #fff;
}

/* One solid, full-height sticky strip behind the whole time column. */
.esg-timecol {
    grid-column: 1;
    grid-row: 1 / -1;
    position: sticky;
    left: 0;
    z-index: 2; /* above lines and cards, below the labels/headers */
    background: #fff;
}

/* Time column: pink, sticky left. */
.esg-time {
    grid-column: 1;
    position: sticky;
    left: 0;
    z-index: 3; /* sits on the solid .esg-timecol strip */
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--esg-accent);
    transform: translateY(-0.55em);
    white-space: nowrap;
}

/* Booked card — centered layout, gradient fill + gradient border (border-box). */
.esg-card {
    position: relative;
    z-index: 1; /* sit above the horizontal time lines */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(236, 245, 255, .92)) padding-box,
        linear-gradient(135deg, #ff7be5, #c28cff, #8fd7ff, #8ef7e8, #ff7be5) border-box;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    /* box-shadow:
        0 8px 30px rgba(120, 160, 255, .08),
        0 0 18px rgba(255, 180, 240, .18); */
}

#main .esg-card__avatars {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

#main .esg-card__avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--esg-avatar-ring);
    margin-left: -12px;
    background: #fff;
}

#main .esg-card__avatar:first-child {
    margin-left: 0;
}

.esg-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.esg-card__topic {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.3;
    font-weight: 700;
    color: #2f2f2f;
}

.esg-card__time {
    font-size: 0.82rem;
    color: #555;
}

.esg-card__speaker {
    font-size: 0.86rem;
    font-weight: 700;
    color: #2f2f2f;
}

.esg-card__company {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Plain: full-width text only, no frame (registration etc.). */
.esg-plain {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    color: #2f2f2f;
    padding: 0.5rem;
}

/* N/A: faint placeholder. */
.esg-na {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.35);
    font-size: 0.8rem;
}

/* [speakers_grid_new] — gradient card with profile photo filling it. */
.esg-sg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* mobile */
    gap: 20px;
}

@media (min-width: 768px) {
    .esg-sg-grid { grid-template-columns: repeat(4, 1fr); } /* tablet */
}

@media (min-width: 1024px) {
    .esg-sg-grid { grid-template-columns: repeat(8, 1fr); } /* desktop */
}

.esg-sg-card {
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(236, 245, 255, .92)) padding-box,
        linear-gradient(135deg, #ff7be5, #c28cff, #8fd7ff, #8ef7e8, #ff7be5) border-box;
    box-shadow:
        0 8px 30px rgba(120, 160, 255, .08),
        0 0 18px rgba(255, 180, 240, .18);
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.esg-sg-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

/* [speakers_grid_new] modal content. */
#main .esg-sg-modal-photo {
    display: block;
    width: 130px;
    height: 130px;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--esg-avatar-ring, #a855f7);
    background: #fff;
}

.esg-sg-modal-name {
    margin: 0 0 1.1rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: #5b21b6;
}

.esg-sg-modal-sessions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

/* Single purple card holding the whole session (title + meta). */
.esg-sg-session {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    color: #fff;
}

.esg-sg-session__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.esg-sg-session__title .esg-ic {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    color: #fff;
}

.esg-sg-session__name {
    font-weight: 700;
    line-height: 1.3;
}

/* Meta row inside the purple card. */
.esg-sg-session__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, .15);
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 400;
}

.esg-sg-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.esg-sg-meta-item .esg-ic {
    color: #fff;
    flex-shrink: 0;
}

/* Speaker name under the photo card. */
.esg-sg-name {
    margin-top: 0.6rem;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    color: #2f2f2f;
}

/* Popup. */
.esg-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.esg-popup[hidden] {
    display: none;
}

.esg-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.esg-popup__box {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: calc(100% - 2rem);
    max-height: 85vh;
    overflow-y: auto;
    border: 2px solid transparent;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(236, 245, 255, .96)) padding-box,
        linear-gradient(135deg, #ff7be5, #c28cff, #8fd7ff, #8ef7e8, #ff7be5) border-box;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, .25),
        0 0 18px rgba(255, 180, 240, .2);
    padding: 1.75rem;
    text-align: center;
}

.esg-popup__close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}

.esg-popup__close:hover {
    opacity: 1;
}

.esg-popup__img-wrap {
    text-align: center;
    margin-bottom: 1rem;
}

.esg-popup__img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--esg-avatar-ring);
    background: #fff;
}

.esg-popup__img[src=""] {
    display: none;
}

.esg-popup__topic {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.esg-popup__meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: #555;
}

.esg-popup__meta span:empty {
    display: none;
}
