/* ═══════════════════════════════════════════════════
   MATAM SINGLE — Profile Detail Page
   Uses theme design tokens from main.css
   ═══════════════════════════════════════════════════ */

/* ── PROFILE HEADER ── */
.mtd-profile-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 32px 0 24px;
}

.mtd-profile-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Avatar */
.mtd-avatar {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-alt);
    border: 3px solid var(--border);
    box-shadow: var(--shadow-md);
    position: relative;
}

.mtd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mtd-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-alt);
}

/* Profile text */
.mtd-profile-info {
    flex: 1;
    min-width: 0;
}

.mtd-profile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.mtd-profile-name {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 6px;
}

.mtd-profile-location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.mtd-profile-location svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* Badges */
.mtd-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    line-height: 1.4;
}

.mtd-badge--gender {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border: 1px solid var(--accent-light);
}

.mtd-badge--active {
    background: var(--sage-light);
    color: var(--sage);
    border: 1px solid #bbf7d0;
}

/* Action buttons */
.mtd-profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mtd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

.mtd-btn--primary {
    background: var(--accent);
    color: #fff;
}

.mtd-btn--primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
}

.mtd-btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.mtd-btn--ghost:hover {
    background: var(--bg-alt);
    color: var(--text);
    border-color: var(--text-muted);
}

.mtd-btn--ig {
    background: transparent;
    color: #c13584;
    border: 1px solid #f0c0d8;
}

.mtd-btn--ig:hover {
    background: #fdf0f7;
    border-color: #c13584;
}

/* ── BODY LAYOUT ── */
.mtd-body {
    padding: 32px 0 60px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── SECTION SHARED ── */
.mtd-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.mtd-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mtd-section-title svg {
    color: var(--accent);
}

/* ── ABOUT SECTION (SEO) ── */
.mtd-about { margin-bottom: 8px; }
.mtd-about__text {
    font-size: 1.02rem;
    line-height: 1.9;
    color: var(--text);
    max-width: 72ch;
}

/* ── INFO CARDS GRID ── */
.mtd-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.mtd-info-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}

.mtd-info-card:hover {
    border-color: var(--accent-light);
}

.mtd-info-card__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mtd-info-card__value {
    font-size: 0.975rem;
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
}

/* ── FACILITY TAGS ── */
.mtd-facilities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.mtd-facility-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sage);
    background: var(--sage-light);
    border: 1px solid #bbf7d0;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ── COMPACT SECTION ── */
.mtd-section--compact {
    padding: 16px 20px;
}

.mtd-section--compact .mtd-section-title {
    font-size: 0.88rem;
    margin-bottom: 12px;
}

/* ── CONTACT CHIPS (compact inline) ── */
.mtd-contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mtd-contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}

.mtd-contact-chip:hover {
    border-color: var(--accent-light);
    background: var(--accent-subtle);
    color: var(--accent);
}

.mtd-contact-chip--ig { color: #c13584; }
.mtd-contact-chip--ig:hover { background: #fdf0f7; border-color: #c13584; }
.mtd-contact-chip--yt { color: #ff0000; }
.mtd-contact-chip--yt:hover { background: #fff5f5; border-color: #ff0000; }

/* ── EVENTS ── */
.mtd-events .event-grid {
    gap: 16px;
}

/* ── MAP ── */
.mtd-map-wrap .matam-map {
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 340px;
}

.mtd-map-wrap .matam-map--lg {
    height: 340px;
}

.mtd-directions-btn {
    margin-top: 12px;
}

/* ── DESCRIPTION ── */
.mtd-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
    .mtd-profile-inner {
        gap: 14px;
    }

    .mtd-avatar {
        width: 72px;
        height: 72px;
    }

    .mtd-profile-name {
        font-size: 1.15rem;
    }

    .mtd-profile-actions {
        gap: 6px;
    }

    .mtd-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

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

    .mtd-section {
        padding: 18px 16px;
    }

    .mtd-profile-header {
        padding: 20px 0 18px;
    }

    .mtd-yt-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ═══════════════════════════════════════════════════
   YOUTUBE — Button, Videos, Live
   ═══════════════════════════════════════════════════ */

/* YouTube header button */
.mtd-btn--yt {
    background: transparent;
    color: #ff0000;
    border: 1px solid #ffcccc;
}

.mtd-btn--yt:hover {
    background: #fff5f5;
    border-color: #ff0000;
}

.mtd-btn--yt svg {
    fill: #ff0000;
}

/* ── LIVE BADGE (header) ── */
.mtd-badge--live {
    background: #ff0000;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    animation: mtd-live-glow 2s ease-in-out infinite;
}

@keyframes mtd-live-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
    50%      { box-shadow: 0 0 8px 3px rgba(255, 0, 0, 0.25); }
}

/* ── LIVE DOT (pulsing) ── */
.mtd-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    animation: mtd-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes mtd-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.8); }
}

/* ── LIVE SECTION (embed) ── */
.mtd-yt-live {
    border-color: #ff0000;
    border-width: 2px;
}

.mtd-section-title--live {
    color: #ff0000;
    gap: 8px;
}

.mtd-section-title--live svg {
    color: #ff0000;
}

.mtd-yt-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.mtd-yt-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
}

/* ── YOUTUBE VIDEO GRID ── */
.mtd-yt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.mtd-yt-card {
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.mtd-yt-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mtd-yt-card__thumb {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
}

.mtd-yt-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s var(--ease);
}

.mtd-yt-card:hover .mtd-yt-card__thumb img {
    transform: scale(1.05);
}

.mtd-yt-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.mtd-yt-card:hover .mtd-yt-card__play {
    opacity: 1;
}

.mtd-yt-card__play svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.mtd-yt-card__title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    padding: 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mtd-yt-card__date {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ── YOUTUBE ACTIONS (load more + channel link) ── */
.mtd-yt-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mtd-yt-load-more {
    background: transparent;
    color: #ff0000;
    border: 1px solid #ffcccc;
    cursor: pointer;
}

.mtd-yt-load-more:hover {
    background: #fff5f5;
    border-color: #ff0000;
}

.mtd-yt-load-more:disabled {
    opacity: 0.6;
    cursor: wait;
}

.mtd-yt-channel-link {
    display: inline-flex;
    gap: 6px;
}

/* Fade-in animation for loaded cards */
.mtd-yt-card--fadein {
    animation: mtd-fadein 0.4s ease-out;
}

@keyframes mtd-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
.mtd-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffcccc;
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: mtd-spin 0.6s linear infinite;
}

@keyframes mtd-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
   INSTAGRAM — Profile Embed Section
   ═══════════════════════════════════════════════════ */

.mtd-ig-section {
    overflow: hidden;
}

.mtd-ig-section .mtd-section-title svg {
    color: unset;
}

.mtd-ig-embed-wrap {
    display: flex;
    justify-content: center;
    min-height: 120px;
}

.mtd-ig-embed-wrap .instagram-media {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    border: 1px solid var(--border) !important;
}

.mtd-btn--ig-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    background: transparent;
    color: #c13584;
    border: 1px solid #f0c0d8;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    cursor: pointer;
}

.mtd-btn--ig-more:hover {
    background: #fdf0f7;
    border-color: #c13584;
    color: #c13584;
}

.mtd-ig-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s var(--ease);
    width: 100%;
}
.mtd-ig-fallback:hover {
    border-color: #c13584;
    background: #fdf0f7;
}
.mtd-ig-fallback span {
    font-size: 1.1rem;
    font-weight: 600;
    direction: ltr;
}
.mtd-ig-fallback-hint {
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: #c13584;
}
