/* ═══════════════════════════════════════════════════════════
   PM Talleres & Tutoriales — Frontend Styles
   Reads from PM Design System CSS custom properties
   ═══════════════════════════════════════════════════════════ */

/* --- Design System token fallbacks --- */
:root {
    --pmt-primary: var(--pm-primary, #d4553a);
    --pmt-primary-light: var(--pm-primary-light, #e8a090);
    --pmt-primary-dark: var(--pm-primary-dark, #b5412d);
    --pmt-secondary: var(--pm-secondary, #2c5545);
    --pmt-accent: var(--pm-accent, #d4a853);
    --pmt-bg: var(--pm-background, #fdf8f4);
    --pmt-surface: var(--pm-surface, #ffffff);
    --pmt-blush: var(--pm-blush, #fef0eb);
    --pmt-ink: var(--pm-ink, #2d2926);
    --pmt-ink-soft: var(--pm-ink-soft, #5c5552);
    --pmt-ink-muted: var(--pm-ink-muted, #9b9490);
    --pmt-border: var(--pm-border, #e8e0da);
    --pmt-radius: var(--pm-radius, 12px);
    --pmt-radius-lg: var(--pm-radius-lg, 18px);
    --pmt-font-heading: var(--pm-font-heading, 'Playfair Display', serif);
    --pmt-font-body: var(--pm-font-body, 'DM Sans', sans-serif);
}

/* --- Base --- */
.pmt-archive,
.pmt-single {
    font-family: var(--pmt-font-body);
    color: var(--pmt-ink);
    background: var(--pmt-bg);
    -webkit-font-smoothing: antialiased;
}

.pmt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ═══════════════════════════════════════════════════════
   ARCHIVE PAGE — /talleres/
   ═══════════════════════════════════════════════════════ */

/* Hero */
.pmt-hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: var(--pmt-blush);
}

.pmt-hero__title {
    font-family: var(--pmt-font-heading);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    color: var(--pmt-ink);
    margin: 0 0 16px;
}

.pmt-hero__subtitle {
    font-size: clamp(15px, 2.5vw, 18px);
    color: var(--pmt-ink-soft);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filters */
.pmt-filters {
    padding: 24px 0;
    background: var(--pmt-bg);
}

.pmt-filters__bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.pmt-filter-btn {
    padding: 8px 20px;
    border: 1.5px solid var(--pmt-border);
    border-radius: 100px;
    background: var(--pmt-surface);
    color: var(--pmt-ink-soft);
    font-family: var(--pmt-font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pmt-filter-btn:hover {
    border-color: var(--pmt-primary);
    color: var(--pmt-primary);
}

.pmt-filter-btn--active {
    background: var(--pmt-primary);
    border-color: var(--pmt-primary);
    color: white;
}

/* Grid */
.pmt-grid-section {
    padding: 10px 0 60px;
}

.pmt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Card */
.pmt-card {
    display: flex;
    flex-direction: column;
    background: var(--pmt-surface);
    border-radius: var(--pmt-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--pmt-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pmt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.pmt-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--pmt-blush);
}

.pmt-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pmt-card:hover .pmt-card__img {
    transform: scale(1.04);
}

.pmt-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.pmt-card:hover .pmt-card__play {
    opacity: 1;
}

.pmt-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--pmt-blush);
}

.pmt-card__body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.pmt-card__meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pmt-card__difficulty,
.pmt-card__duration {
    font-size: 12px;
    color: var(--pmt-ink-muted);
    font-weight: 500;
}

.pmt-card__title {
    font-family: var(--pmt-font-heading);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--pmt-ink);
}

.pmt-card__excerpt {
    font-size: 14px;
    color: var(--pmt-ink-soft);
    line-height: 1.5;
    margin: 0;
}

.pmt-card__kit-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--pmt-primary);
    background: var(--pmt-blush);
    padding: 4px 10px;
    border-radius: 100px;
    margin-top: auto;
    align-self: flex-start;
}

/* Empty state */
.pmt-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--pmt-ink-muted);
}

/* ═══════════════════════════════════════════════════════
   SINGLE TUTORIAL PAGE
   ═══════════════════════════════════════════════════════ */

/* Breadcrumb */
.pmt-breadcrumb {
    padding: 16px 0;
    background: var(--pmt-bg);
}

.pmt-breadcrumb a {
    color: var(--pmt-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.pmt-breadcrumb a:hover {
    opacity: 0.7;
}

/* Video */
.pmt-single__hero {
    padding: 0 0 32px;
    background: var(--pmt-bg);
}

.pmt-video-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.pmt-video-container {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--pmt-radius-lg);
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.pmt-video-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pmt-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.pmt-video-play:hover {
    transform: scale(1.1);
}

.pmt-video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Cover image (when no video) */
.pmt-cover-wrap {
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--pmt-radius-lg);
    overflow: hidden;
}

.pmt-cover-img {
    width: 100%;
    height: auto;
    display: block;
}

.pmt-content-grid--full {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.pmt-content-grid--full .pmt-sidebar {
    max-width: 400px;
}

/* Content grid */
.pmt-single__content {
    padding: 0 0 60px;
}

.pmt-content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

/* Main content */
.pmt-single__header {
    margin-bottom: 24px;
}

.pmt-single__badges {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.pmt-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.pmt-badge--green { background: #ecfdf5; color: #065f46; }
.pmt-badge--yellow { background: #fefce8; color: #854d0e; }
.pmt-badge--red { background: #fef2f2; color: #991b1b; }
.pmt-badge--neutral { background: #f5f5f5; color: #555; }

.pmt-single__title {
    font-family: var(--pmt-font-heading);
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
    color: var(--pmt-ink);
    margin: 0;
    line-height: 1.25;
}

/* Prose styling for editor content */
.pmt-prose {
    font-size: 16px;
    line-height: 1.75;
    color: var(--pmt-ink-soft);
}

.pmt-prose h2 {
    font-family: var(--pmt-font-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--pmt-ink);
    margin: 32px 0 12px;
}

.pmt-prose h3 {
    font-family: var(--pmt-font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--pmt-ink);
    margin: 24px 0 8px;
}

.pmt-prose p {
    margin: 0 0 16px;
}

.pmt-prose ul, .pmt-prose ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.pmt-prose li {
    margin-bottom: 6px;
}

.pmt-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--pmt-radius);
    margin: 16px 0;
}

.pmt-prose a {
    color: var(--pmt-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Sidebar */
.pmt-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pmt-sidebar__heading {
    font-family: var(--pmt-font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--pmt-ink);
    margin: 0 0 16px;
}

.pmt-sidebar__products {
    background: var(--pmt-surface);
    border: 1px solid var(--pmt-border);
    border-radius: var(--pmt-radius);
    padding: 24px;
}

.pmt-product-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pmt-product-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 14px;
    background: var(--pmt-blush);
    border-radius: var(--pmt-radius);
    transition: box-shadow 0.2s;
}

.pmt-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.pmt-product-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

.pmt-product-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pmt-product-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pmt-ink);
    margin: 0;
    line-height: 1.3;
}

.pmt-product-card__price {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pmt-price-old {
    font-size: 13px;
    color: var(--pmt-ink-muted);
    text-decoration: line-through;
}

.pmt-price-current {
    font-size: 16px;
    font-weight: 700;
    color: var(--pmt-primary);
}

.pmt-sale-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--pmt-primary);
    padding: 2px 8px;
    border-radius: 100px;
    align-self: flex-start;
}

.pmt-product-card__cta {
    font-size: 13px;
    font-weight: 600;
    color: var(--pmt-primary);
}

/* Share */
.pmt-sidebar__share {
    background: var(--pmt-surface);
    border: 1px solid var(--pmt-border);
    border-radius: var(--pmt-radius);
    padding: 24px;
}

.pmt-share-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pmt-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: var(--pmt-font-body);
    transition: opacity 0.2s;
}

.pmt-share-btn:hover { opacity: 0.85; }
.pmt-share-btn--whatsapp { background: #25D366; color: white; }
.pmt-share-btn--facebook { background: #1877F2; color: white; }
.pmt-share-btn--copy { background: var(--pmt-blush); color: var(--pmt-ink); }

/* Related */
.pmt-related {
    padding: 40px 0 60px;
    background: var(--pmt-blush);
}

.pmt-related__title {
    font-family: var(--pmt-font-heading);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 30px;
}

.pmt-related__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.pmt-card--small .pmt-card__title {
    font-size: 15px;
}

.pmt-card--small .pmt-card__body {
    padding: 12px 14px 16px;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .pmt-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pmt-content-grid {
        grid-template-columns: 1fr;
    }
    .pmt-sidebar {
        position: static;
    }
    .pmt-related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .pmt-grid {
        grid-template-columns: 1fr;
    }
    .pmt-hero {
        padding: 40px 16px 30px;
    }
    .pmt-filters__bar {
        gap: 6px;
    }
    .pmt-filter-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    .pmt-card__body {
        padding: 12px 16px 16px;
    }
    .pmt-related__grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .pmt-card--small .pmt-card__title {
        font-size: 13px;
    }
    .pmt-content-grid {
        gap: 24px;
    }
    .pmt-sidebar__products,
    .pmt-sidebar__share {
        padding: 18px;
    }
}

/* ═══════════════════════════════════════════════════════
   ASTRA / WOOCOMMERCE OVERRIDES
   ═══════════════════════════════════════════════════════ */

/* Remove Astra's default page title and sidebars */
.pmt-archive .entry-header,
.pmt-single .entry-header,
.pmt-archive #secondary,
.pmt-single #secondary {
    display: none !important;
}

/* Full width */
.pmt-archive .ast-container,
.pmt-single .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
}

.pmt-archive #primary,
.pmt-single #primary {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide Elementor stuff if lingering */
.pmt-single .elementor-widget-container,
.pmt-single .elementor-section {
    display: none !important;
}
