.postales {
    position: relative;
    margin-top: 2rem;
    padding: 50px 0 40px;
    background:
        radial-gradient(ellipse 45% 70% at 30% 55%, rgba(242, 122, 16, 0.1), transparent 70%),
        linear-gradient(180deg, transparent, rgba(30, 10, 36, 0.55) 20%, rgba(30, 10, 36, 0.55) 80%, transparent);
}

.postales__encabezado {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 0 80px;
}

.postales__antetitulo {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #ffb21f;
}

.postales__titulo {
    margin: 0;
    font-family: "Sancreek", "Montserrat", serif;
    font-size: clamp(30px, 3vw, 44px);
    font-weight: 400;
    line-height: 1.1;
    color: #fff;
}

.postales__navegacion {
    display: flex;
    gap: 10px;
}

.postales__flecha {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid rgba(255, 178, 31, 0.7);
    border-radius: 50%;
    background: rgba(30, 10, 36, 0.6);
    color: #ffb21f;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.postales__flecha svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.postales__flecha:hover:not(:disabled) {
    background: #ffb21f;
    color: #1e0a24;
}

.postales__flecha:disabled {
    opacity: 0.3;
    cursor: default;
}

.postales__carril {
    display: flex;
    gap: 34px;
    padding: 34px 80px 40px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 80px;
    scrollbar-width: none;
}

.postales__carril::-webkit-scrollbar {
    display: none;
}

.postal {
    flex: 0 0 auto;
    width: 400px;
    aspect-ratio: 3 / 2;
    scroll-snap-align: start;
    perspective: 1400px;
    transform: rotate(var(--giro));
    transition: transform 0.35s ease;
}

.postal:hover,
.postal--volteada,
.postal:focus-within {
    z-index: 2;
    transform: rotate(0deg) translateY(-6px);
}

.postal__giro {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.postal--volteada .postal__giro {
    transform: rotateY(180deg);
}

.postal__frente,
.postal__reverso {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 6px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.55), 0 2px 5px rgba(0, 0, 0, 0.4);
}

.postal__frente {
    border: 9px solid #f6ecd8;
    background: #1e0a24;
    transform: rotateY(0deg);
    transition: visibility 0s linear 0.3s;
}

.postal--volteada .postal__frente {
    visibility: hidden;
}

.postal__foto {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.1) brightness(0.95) blur(4px);
    transform: scale(1.12);
}

.postal__tinte {
    position: absolute;
    inset: 0;
    background: var(--color);
    mix-blend-mode: multiply;
    opacity: 0.9;
}

.postal__frente::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(20, 5, 25, 0.55) 100%),
        linear-gradient(180deg, transparent 25%, rgba(20, 5, 25, 0.5) 55%, rgba(20, 5, 25, 0.8));
    pointer-events: none;
}

.postal__saludo,
.postal__lugar,
.postal__estado {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    margin: 0;
    text-align: center;
    pointer-events: none;
}

.postal__saludo {
    top: 38%;
    font-family: "Caveat", cursive;
    font-size: 27px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.postal__lugar {
    top: 49%;
    padding: 0 12px;
    font-family: "Sancreek", "Montserrat", serif;
    font-size: var(--tamano-lugar);
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    color: #fff8ea;
    text-shadow: 3px 3px 0 #1e0a24, 0 0 22px rgba(0, 0, 0, 0.55);
}

.postal__estado {
    bottom: 14px;
    left: 50%;
    right: auto;
    padding: 4px 14px 3px;
    background: #fff8ea;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    white-space: nowrap;
    color: color-mix(in srgb, var(--color) 80%, #000);
    transform: translateX(-50%) rotate(-2deg);
    clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
}

.postal__voltear {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.postal__voltear:focus-visible {
    outline: 2px solid #ffb21f;
    outline-offset: -4px;
}

.postal__reverso {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    grid-template-columns: 1.55fr 1fr;
    gap: 14px;
    padding: 16px 16px 14px 18px;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, 0.6), transparent 60%),
        linear-gradient(135deg, #f8efdc, #ecdcbc);
    color: #3a1d40;
    transform: rotateY(180deg);
}

.postal__mensaje {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding-right: 14px;
    border-right: 1.5px solid rgba(58, 29, 64, 0.25);
}

.postal__capitulo {
    margin: 0;
    font-family: "Sancreek", "Montserrat", serif;
    font-size: 18px;
    line-height: 1.15;
    color: var(--color);
}

.postal__resumen {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-family: "Caveat", cursive;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.05;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.postal__ver {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    margin-top: auto;
    padding: 7px 15px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f27a10, #ffb21f);
    font-size: 13px;
    font-weight: 700;
    color: #1e0a24;
    text-decoration: none;
    white-space: nowrap;
}

.postal__ver:hover {
    color: #1e0a24;
    filter: brightness(1.08);
}

.postal__duracion {
    font-weight: 500;
    opacity: 0.75;
}

.postal__destino {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

.postal__timbre {
    position: absolute;
    top: 0;
    right: 0;
    width: 64px;
    height: 77px;
    padding: 4px;
    background: #fffaf0;
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
    transform: rotate(3deg);
    -webkit-mask:
        radial-gradient(circle 2.6px, transparent 96%, #000) -3.5px -3.5px / 7px 7px round,
        linear-gradient(#000 0 0) content-box;
    mask:
        radial-gradient(circle 2.6px, transparent 96%, #000) -3.5px -3.5px / 7px 7px round,
        linear-gradient(#000 0 0) content-box;
}

.postal__estampa {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 6px 4px 3px;
    background: color-mix(in srgb, var(--color) 18%, #fffaf0);
    outline: 1px solid color-mix(in srgb, var(--color) 55%, transparent);
    outline-offset: -2px;
}

.postal__motivo {
    width: 40px;
    height: 40px;
    color: var(--color);
}

.postal__pais {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color);
}

.postal__matasellos {
    position: absolute;
    top: 24px;
    right: 30px;
    width: 124px;
    height: 75px;
    overflow: visible;
    fill: none;
    stroke: rgba(40, 20, 50, 0.6);
    stroke-width: 1.6;
    transform: rotate(-12deg);
    mix-blend-mode: multiply;
}

.postal__matasellos text {
    fill: rgba(40, 20, 50, 0.65);
    stroke: none;
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
}

.postal__matasellos-arco {
    font-size: 8px;
    letter-spacing: 0.08em;
}

.postal__matasellos-dia {
    font-size: 14px;
}

.postal__matasellos-mes {
    font-size: 7px;
    letter-spacing: 0.1em;
}

.postal__renglon {
    overflow: hidden;
    padding: 0 2px 1px;
    border-bottom: 1px solid rgba(58, 29, 64, 0.35);
    font-family: "Caveat", cursive;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #2457c5;
}

@media (hover: hover) {
    .postal:hover .postal__giro {
        transform: rotateY(180deg);
    }

    .postal:hover .postal__frente {
        visibility: hidden;
        pointer-events: none;
    }
}

.postal--volteada .postal__frente {
    pointer-events: none;
}

@media (max-width: 767px) {
    .postales__encabezado {
        padding: 0 20px;
    }

    .postales__navegacion {
        display: none;
    }

    .postales__carril {
        gap: 22px;
        padding: 26px 20px 30px;
        scroll-padding: 0 20px;
    }

    .postal {
        width: min(340px, 86vw);
        font-size: 0.9em;
    }

    .postal__lugar {
        font-size: calc(var(--tamano-lugar) * 0.85);
    }

    .postal__reverso {
        gap: 10px;
        padding: 12px 12px 10px 14px;
    }

    .postal__resumen {
        font-size: 20px;
        -webkit-line-clamp: 4;
    }

    .postal__timbre {
        width: 52px;
        height: 62px;
    }

    .postal__motivo {
        width: 30px;
        height: 30px;
    }

    .postal__matasellos {
        right: 22px;
        width: 100px;
        height: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .postal,
    .postal__giro {
        transition: none;
    }
}
