/* ==============================
   LexAcademia Posts — Estilos
   (Estilo visual Semana 1)
   ============================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- Page --- */
body {
    background: #0f1923;
    color: #fff;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding: 2rem;
}
a { color: #e74c3c; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Top Nav --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #16213e;
    border-bottom: 2px solid #e74c3c;
    padding: 1rem 2rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}
.topbar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.topbar-brand .lex { color: #fff; }
.topbar-brand .acad { color: #e74c3c; }
.topbar-nav { display: flex; gap: 1rem; }
.topbar-nav a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    transition: all 0.2s;
}
.topbar-nav a.active, .topbar-nav a:hover {
    color: #fff;
    background: rgba(231,76,60,0.2);
    text-decoration: none;
}
.week-tab {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #aaa;
    transition: all 0.2s;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.week-tab:hover, .week-tab.active {
    background: rgba(231,76,60,0.2);
    color: #fff;
    text-decoration: none;
}

/* --- Container --- */
.container {
    max-width: 1400px;
    margin: 5rem auto 0;
    padding-top: 1rem;
}

/* --- Page Header --- */
.page-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e74c3c, #8e44ad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}
.page-subtitle { color: #aaa; font-size: 0.95rem; margin-bottom: 2rem; }
.week-panel[hidden] { display: none; }

/* --- Filters --- */
.filters-panel {
    background: #16213e;
    border: 1px solid #1e3050;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
}
.filters-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
    gap: 0.9rem;
    align-items: end;
}
.filters-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}
.filters-form label span {
    color: #aaa;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.filters-form select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #263b5f;
    border-radius: 8px;
    background: #0f1923;
    color: #fff;
    font: inherit;
    padding: 0.55rem 0.75rem;
}
.filters-form select:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.18);
}
.btn-filter {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}
.btn-filter:hover {
    background: #ff6255;
    text-decoration: none;
}
.btn-filter--ghost {
    background: transparent;
    color: #e74c3c;
}
.btn-filter--ghost:hover {
    background: rgba(231,76,60,0.14);
}
.empty-state {
    background: #16213e;
    border: 1px dashed #263b5f;
    border-radius: 12px;
    padding: 2rem;
    color: #aaa;
}
.empty-state h1 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

/* --- Posts List (index) --- */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.post-list-item {
    background: #16213e;
    border: 1px solid #1e3050;
    border-radius: 12px;
    padding: 1.5rem;
    overflow: hidden;
}
.post-list-item__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.post-list-item__heading {
    min-width: 0;
}
.post-list-item__date {
    font-size: 0.8rem;
    color: #e74c3c;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}
.post-list-item h2 {
    color: #fff;
    font-size: 1.45rem;
    line-height: 1.25;
    margin-bottom: 0.35rem;
}
.post-list-item p {
    color: #aaa;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 820px;
}
.post-list-item__link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(231,76,60,0.12);
    border: 1px solid rgba(231,76,60,0.45);
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 700;
}
.post-list-item__link:hover {
    background: rgba(231,76,60,0.22);
    text-decoration: none;
}
.post-list-item__meta {
    margin: 0 0 1rem;
}
.post-list-item__slides {
    margin-top: 0.5rem;
}
.post-list-item__empty {
    color: #777;
    background: #0f1923;
    border: 1px dashed #263b5f;
    border-radius: 10px;
    padding: 1rem;
}
.day-card__platforms { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.day-card__platform {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(231,76,60,0.1);
    color: #aaa;
}
.day-card__platform i { margin-right: 4px; }

/* --- Platform Section --- */
.platform-section {
    background: #16213e;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    overflow: hidden;
}
.platform-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}
.platform-header i { font-size: 1.5rem; color: #e74c3c; }
.platform-header h2 { font-size: 1.2rem; font-weight: 700; color: #fff; }
.platform-header .badge {
    background: rgba(231,76,60,0.2);
    color: #e74c3c;
    border-radius: 20px;
    padding: 0.2rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Slides Row --- */
.slides-row {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #e74c3c #16213e;
    scroll-snap-type: x proximity;
}
.slides-row::-webkit-scrollbar { height: 6px; }
.slides-row::-webkit-scrollbar-track { background: #16213e; border-radius: 3px; }
.slides-row::-webkit-scrollbar-thumb { background: #e74c3c; border-radius: 3px; }

.slide-wrapper {
    flex: 0 0 auto;
    text-align: center;
    scroll-snap-align: start;
}
.slide-wrapper h3 {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* ==============================
   INSTAGRAM SLIDES (4:5 ratio)
   ============================== */
.ig-slide {
    width: 540px;
    max-width: 100%;
    height: 675px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.5);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* --- Dark Variant --- */
.ig-slide--dark {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 40%, #34495e 100%);
    color: #ffffff;
}

/* --- Light Variant --- */
.ig-slide--light {
    background: #ffffff;
    color: #333333;
}

/* --- Accent Variant (purple) --- */
.ig-slide--accent {
    background: linear-gradient(135deg, #6c3483, #8e44ad, #a569bd);
    color: #ffffff;
}

/* --- Red Variant --- */
.ig-slide--red {
    background: linear-gradient(135deg, #c0392b, #e74c3c, #ff6b6b);
    color: #ffffff;
}

/* --- Slide Inner --- */
.ig-slide__inner {
    width: 100%;
    height: 100%;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.ig-slide__inner--top { justify-content: flex-start; padding-top: 64px; }

/* --- Background Icon --- */
.ig-slide__bg-icon {
    position: absolute;
    font-size: 220px;
    opacity: 0.06;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}
.ig-slide--light .ig-slide__bg-icon { opacity: 0.04; color: #2c3e50; }

/* --- Slide Number --- */
.ig-slide__num {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.5;
    z-index: 2;
}

/* --- Brand --- */
.ig-slide__brand {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    z-index: 2;
    opacity: 0.6;
}
.ig-slide__brand .lex { color: #e74c3c; }
.ig-slide--light .ig-slide__brand .lex { color: #e74c3c; }
.ig-slide--light .ig-slide__brand { color: #999; }

/* --- Title Large (gancho/cierre) --- */
.ig-slide__title-lg {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

/* --- Subtitle --- */
.ig-slide__subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1.5;
}

/* --- Content Slide Elements --- */
.ig-slide__left-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(180deg, #8e44ad, #e74c3c);
    z-index: 2;
}

.ig-slide__icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
    background: rgba(142, 68, 173, 0.12);
    color: #8e44ad;
}
.ig-slide__icon-circle--red {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}
.ig-slide__icon-circle--green {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
}

.ig-slide__title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
}

.ig-slide__divider {
    width: 56px;
    height: 3px;
    background: linear-gradient(90deg, #e74c3c, #8e44ad);
    margin-bottom: 16px;
    border-radius: 2px;
}

.ig-slide__text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #555;
}

.ig-slide__highlight {
    background: rgba(231, 76, 60, 0.08);
    border-left: 3px solid #e74c3c;
    padding: 10px 14px;
    margin-top: 14px;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c0392b;
}

.ig-slide__list {
    list-style: none;
    margin-top: 8px;
}
.ig-slide__list li {
    padding: 6px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.ig-slide__list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #8e44ad;
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
}

/* --- CTA on dark slides --- */
.ig-slide__cta {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background: #e74c3c;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 50px;
}

/* ==============================
   REEL PREVIEW (9:16)
   ============================== */
.reel-slide {
    width: 304px;
    max-width: 100%;
    height: 540px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.5);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}
.reel-slide--dark {
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    color: white;
}
.reel-slide--red {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: white;
}
.reel-slide__inner {
    width: 100%;
    height: 100%;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}
.reel-slide__bg-icon {
    position: absolute;
    font-size: 160px;
    opacity: 0.06;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}
.reel-slide__title {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 12px;
}
.reel-slide__text {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.5;
}
.reel-slide__brand {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.5;
    z-index: 2;
}
.reel-slide__brand .lex { color: #e74c3c; }

/* ==============================
   THREAD POSTS (tema oscuro)
   ============================== */
.threads-container {
    display: flex;
    flex-direction: column;
}
.th-wrapper { position: relative; }
.th-post {
    background: #0f1923;
    border: 1px solid #1e3050;
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 0.3rem;
}
.th-post__header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}
.th-post__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c, #8e44ad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: #fff;
}
.th-post__handle {
    font-weight: 700;
    font-size: 0.9rem;
    color: #e74c3c;
}
.th-post__num {
    margin-left: auto;
    font-size: 0.75rem;
    color: #555;
}
.th-post__body {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #ccc;
    white-space: pre-wrap;
}
.th-connector {
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, #e74c3c, #8e44ad);
    margin: 0 0 0.3rem 19px;
}

/* ==============================
   CAPTION & HASHTAGS
   ============================== */
.caption-block {
    background: #0f1923;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-top: 1.5rem;
}
.caption-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #e74c3c;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.7rem;
}
.caption-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #ccc;
    white-space: pre-wrap;
}
.hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.hashtags span {
    background: rgba(142,68,173,0.15);
    color: #8e44ad;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* ==============================
   BUTTONS
   ============================== */
.btn-dl {
    display: inline-block;
    margin-top: 0.7rem;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}
.btn-dl:hover {
    background: linear-gradient(135deg, #ff6b6b, #e74c3c);
    box-shadow: 0 4px 15px rgba(231,76,60,0.4);
}
.btn-dl i { margin-right: 0.3rem; }

.btn-dl-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.6rem 1.5rem;
    background: rgba(231,76,60,0.15);
    color: #e74c3c;
    border: 1.5px solid #e74c3c;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}
.btn-dl-all:hover { background: rgba(231,76,60,0.3); }

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.5rem 1.2rem;
    background: rgba(142,68,173,0.2);
    color: #8e44ad;
    border: 1.5px solid #8e44ad;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}
.btn-copy:hover { background: rgba(142,68,173,0.35); }
.btn-copy.copied {
    background: rgba(46,204,113,0.2);
    color: #2ecc71;
    border-color: #2ecc71;
}

/* ==============================
   BACK LINK
   ============================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: gap 0.2s;
}
.back-link:hover { gap: 0.7rem; text-decoration: none; }

/* ==============================
   CANVAS (para slides tipo semana 1)
   ============================== */
canvas {
    width: 270px;
    height: 337px;
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.5);
    display: block;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 700px) {
    body { padding: 1rem; }
    .topbar {
        align-items: flex-start;
        gap: 0.8rem;
        padding: 0.9rem 1rem;
        flex-direction: column;
    }
    .topbar-nav {
        width: 100%;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.1rem;
    }
    .week-tab { flex: 0 0 auto; }
    .container { margin-top: 7rem; }
    .container { padding-top: 0.5rem; }
    .filters-form {
        grid-template-columns: 1fr;
    }
    .btn-filter { width: 100%; }
    .post-list-item { padding: 1rem; }
    .post-list-item__header {
        flex-direction: column;
        gap: 0.9rem;
    }
    .post-list-item h2 { font-size: 1.18rem; }
    .post-list-item__link { width: 100%; justify-content: center; }
    .slides-row { gap: 1rem; }
    .slide-wrapper { width: min(76vw, 290px); }
    .ig-slide {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
    }
    .ig-slide__inner { padding: 28px; }
    .ig-slide__title-lg { font-size: 1.6rem; }
    .ig-slide__title { font-size: 1.1rem; }
    .ig-slide__text { font-size: 0.8rem; }
    .th-post { width: 100%; }
    .reel-slide {
        width: min(52vw, 200px);
        height: auto;
        aspect-ratio: 9 / 16;
    }
    .platform-section { padding: 1.2rem; }
    canvas {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
    }
}
