/* ============================================================
   miopinion.css — Página Mi Opinión (nota destacada + grilla de
   opiniones que arma js/miopinion.js). El nombre del archivo tiene
   un typo histórico: no renombrar (lo carga miopinion.html).
   Mobile-first. Valores desde styles/tokens.css.
   Breakpoints: sm 480 · md 768 · lg 1024
   ============================================================ */

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

body {
    background-color: var(--color-bg);
    overflow-x: hidden;
}

/* ============================================================
   HERO: título + foto del autor (la foto aparece desde md)
   ============================================================ */

.main_container {
    width: min(100% - 2 * var(--gutter), var(--container-max));
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-offset-sm);
}

.main_title {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: var(--space-5);
}

.main_title h1 {
    flex: none;
    width: 100%;
    min-width: 0;
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: var(--fs-display);
    font-style: italic;
    line-height: var(--lh-tight);
}

.main_title h1 span,
.main_title div span {
    background: var(--gradient-red);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Foto y nombre del autor: ocultos hasta md */
.main_title div {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    flex-shrink: 0;
}

.main_title div img {
    max-width: 80px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.65));
    z-index: 0;
}

.main_title div h3 {
    margin-top: calc(var(--space-2) * -1);
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: var(--fs-subdisplay);
    font-style: italic;
    line-height: var(--lh-tight);
    white-space: nowrap;
    z-index: var(--z-raised); /* por encima de la foto */
}

/* ============================================================
   NOTA DESTACADA
   Base: imagen arriba, texto abajo. lg: imagen a la izquierda.
   ============================================================ */

.second_wrapper {
    padding-block: var(--space-section);
    background-color: var(--color-bg);
}

.second_container {
    width: min(100% - 2 * var(--gutter), var(--container-max));
    margin-inline: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.last_post {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    background-color: var(--color-bg-black);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.last_post_img {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.last_post_img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: transform 0.5s ease;
}

.last_post_img:hover img {
    transform: scale(1.1);
}

.last_post_info {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-around;
    padding: var(--space-5);
}

.last_post_banners {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.banner_1 {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background-color: var(--color-red);
    border-radius: var(--radius);
}

.banner_1 svg {
    width: 12px;
    height: 12px;
}

.banner_1 p {
    font-family: var(--font-accent);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-wide);
    color: var(--color-text);
}

.banner_2 {
    border-left: 1px solid var(--color-border);
    padding-left: var(--space-4);
}

.banner_2 p {
    font-family: var(--font-accent);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    line-height: var(--lh-snug);
    color: var(--color-text-subtle);
}

.last_post_textbox {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.last_post_textbox h2 {
    margin-bottom: var(--space-4);
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    background: linear-gradient(
        to bottom,
        var(--color-text) 0%,
        #f2f2f2 40%,
        var(--color-text-subtle) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.last_post_textbox .last_post_excerpt {
    margin-bottom: var(--space-4);
    font-family: var(--font-body);
    font-size: var(--fs-lead);
    font-weight: var(--fw-light);
    line-height: var(--lh-body);
    color: var(--color-text-muted);
}

.last_post_author {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.author,
.date {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.author p,
.date p {
    font-family: var(--font-accent);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    line-height: var(--lh-snug);
    color: var(--color-text-muted);
}

.author svg,
.date svg {
    width: 16px;
    height: 16px;
}

/* Botón blanco inclinado ("LEER NOTA COMPLETA" y "MOSTRAR MÁS") */
.post_button {
    display: flex;
}

.post_button a {
    --skew: -14deg;
    width: auto;
    height: 56px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-2); /* angosto para que entre en 360px */
    background: var(--color-text);
    color: var(--color-bg-black);
    font-family: var(--font-display);
    font-size: var(--fs-body);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    text-decoration: none;
    transform: skewX(var(--skew));
    border-radius: 2px;
    box-shadow: 0 12px 24px var(--overlay-soft);
    transition: all 0.25s ease;
}

/* Enderezamos texto e ícono */
.post_button a p,
.post_button a svg {
    transform: skewX(14deg);
}

.post_button a p {
    margin: 0;
    white-space: nowrap;
}

.post_button a svg {
    width: 20px;
    height: 20px;
}

.post_button a:hover {
    filter: brightness(1.08);
    transform: skewX(var(--skew)) translateY(-1px);
}

/* ============================================================
   ÚLTIMAS OPINIONES (cards que arma js/miopinion.js)
   ============================================================ */

.third_wrapper {
    padding-block: var(--space-section);
    background-color: var(--color-bg);
}

.third_container {
    width: min(100% - 2 * var(--gutter), var(--container-max));
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.third_title {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.third_title h2 {
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-style: italic;
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--color-text);
}

.third_title h2 span {
    background: var(--gradient-red);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Grilla: 1 columna · md 2 · lg 3 */
.lastopinions_container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.last_opinion {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.3s ease;
}

.last_opinion:hover {
    border-color: var(--color-red-hover);
}

.last_opinion img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
}

.last_opinion h3 {
    padding: var(--space-4) var(--space-4) var(--space-3);
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    line-height: var(--lh-snug);
    color: var(--color-text);
    transition: color 0.3s ease;
}

.last_opinion:hover h3 {
    color: var(--color-red);
}

/* El texto crece y empuja la fecha al pie de la card */
.last_opinion_text {
    flex-grow: 1;
    padding: 0 var(--space-4) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
    color: var(--color-text-muted);
}

/* Pie con la fecha */
.last_opinion div {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

.last_opinion div h4 {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.last_opinion div svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ============================================================
   sm (≥480px)
   ============================================================ */

@media (min-width: 480px) {
    .post_button a {
        padding: 0 var(--space-5);
    }

    .last_opinion img {
        height: 180px;
    }
}

/* ============================================================
   md (≥768px): aparece la foto del autor; opiniones en 2 columnas
   ============================================================ */

@media (min-width: 768px) {
    .main_title {
        justify-content: space-between;
    }

    .main_title h1 {
        flex: 1 1 auto;
        width: auto;
    }

    .main_title div {
        display: flex;
    }

    .last_post_info {
        padding: var(--space-6) var(--space-5);
    }

    .third_title {
        margin-bottom: var(--space-7);
    }

    .lastopinions_container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    .last_opinion img {
        height: 200px;
    }
}

/* ============================================================
   lg (≥1024px): nota destacada en fila; opiniones en 3 columnas
   ============================================================ */

@media (min-width: 1024px) {
    .main_container {
        padding-top: var(--header-offset);
    }

    .main_title div img {
        max-width: 100px;
    }

    .last_post {
        flex-direction: row;
        align-items: stretch;
        /* Alto mínimo de 500px; si un título largo no entra, la card crece en vez de cortar el botón */
        min-height: 500px;
    }

    .last_post_img {
        position: relative;
        flex: 1 1 55%;
    }

    .last_post_img img {
        position: absolute;
        inset: 0;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    }

    .last_post_info {
        flex: 1 1 45%;
        width: auto;
        padding: var(--space-6);
    }

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