/*
 * KCTecnologia — All Posts page template
 * Scoped to .kct-posts-page to avoid conflicts with the existing theme.
 */

.kct-posts-page {
    --kct-posts-bg: #101920;
    --kct-posts-panel: #062b3c;
    --kct-posts-panel-dark: #082131;
    --kct-posts-accent: #ffa800;
    --kct-posts-accent-hover: #ffc13d;
    --kct-posts-text: #ffffff;
    --kct-posts-muted: #aab5bd;
    --kct-posts-border: rgba(255, 255, 255, 0.1);
    --kct-posts-container: 1200px;
    position: relative;
    overflow: hidden;
    background: var(--kct-posts-bg);
    color: var(--kct-posts-text);
    font-family: Montserrat, sans-serif;
    isolation: isolate;
}

.kct-posts-page *,
.kct-posts-page *::before,
.kct-posts-page *::after {
    box-sizing: border-box;
}

.kct-posts-container {
    width: min(calc(100% - 48px), var(--kct-posts-container));
    margin-inline: auto;
}

.kct-posts-hero {
    padding: 28px 0 42px;
}

.kct-posts-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #c3ccd2;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.kct-posts-breadcrumbs a {
    color: #c3ccd2;
    text-decoration: none;
    transition: color 180ms ease;
}

.kct-posts-breadcrumbs a:hover {
    color: var(--kct-posts-accent);
}

.kct-posts-breadcrumbs span[aria-hidden="true"] {
    color: rgba(255, 255, 255, 0.4);
}

.kct-posts-hero__panel {
    position: relative;
    display: flex;
    min-height: 230px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--kct-posts-border);
    border-radius: 12px;
    background:
        radial-gradient(circle at 89% 24%, rgba(255, 168, 0, 0.13), transparent 22%),
        linear-gradient(115deg, #073046 0%, var(--kct-posts-panel) 62%, #071f2d 100%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.kct-posts-hero__accent {
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: var(--kct-posts-accent);
}

.kct-posts-hero__content {
    position: relative;
    z-index: 1;
    width: min(760px, 76%);
    padding: 58px 64px;
}

.kct-posts-hero__eyebrow {
    margin: 0 0 18px;
    color: var(--kct-posts-accent);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kct-posts-hero__title {
    max-width: 860px;
    margin: 0;
    color: var(--kct-posts-text);
    font-size: clamp(42px, 6vw, 74px);
    font-weight: 300;
    line-height: 0.98;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.kct-posts-hero__mark {
    position: absolute;
    right: 62px;
    bottom: 52px;
    display: grid;
    width: 126px;
    gap: 12px;
    opacity: 0.95;
    transform: rotate(-10deg);
}

.kct-posts-hero__mark span {
    display: block;
    height: 5px;
    border-radius: 99px;
    background: var(--kct-posts-accent);
}

.kct-posts-hero__mark span:nth-child(2) {
    width: 78%;
    margin-left: auto;
}

.kct-posts-hero__mark span:nth-child(3) {
    width: 54%;
    margin-left: auto;
}

.kct-posts-list {
    position: relative;
    padding: 28px 0 100px;
}

.kct-posts-list::before {
    position: absolute;
    top: 170px;
    left: -180px;
    z-index: -1;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 168, 0, 0.045);
    content: "";
    filter: blur(2px);
    pointer-events: none;
}

.kct-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.kct-posts-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--kct-posts-border);
    border-radius: 12px;
    background: var(--kct-posts-panel-dark);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
    transition:
        border-color 250ms ease,
        box-shadow 250ms ease,
        transform 250ms ease;
}

.kct-posts-card::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: var(--kct-posts-accent);
    content: "";
    transition: width 280ms ease;
}

.kct-posts-card:hover {
    border-color: rgba(255, 168, 0, 0.7);
    box-shadow: 0 28px 65px rgba(0, 0, 0, 0.3);
    transform: translateY(-6px);
}

.kct-posts-card:hover::after {
    right: auto;
    left: 0;
    width: 100%;
}

.kct-posts-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #061b28;
    text-decoration: none;
}

.kct-posts-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.kct-posts-card:hover .kct-posts-card__image {
    transform: scale(1.045);
}

.kct-posts-card__media::after {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(to top, rgba(6, 27, 40, 0.66), transparent);
    content: "";
    pointer-events: none;
}

.kct-posts-card__placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background:
        linear-gradient(145deg, transparent 58%, rgba(255, 168, 0, 0.12)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 22px),
        #072a3b;
}

.kct-posts-card__placeholder span {
    color: rgba(255, 168, 0, 0.72);
    font-size: 46px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.kct-posts-card__media-arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 1;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: rgba(6, 43, 60, 0.86);
    color: #fff;
    opacity: 0;
    transform: translateX(-8px);
    transition:
        background-color 200ms ease,
        opacity 200ms ease,
        transform 200ms ease;
}

.kct-posts-card:hover .kct-posts-card__media-arrow {
    background: var(--kct-posts-accent);
    color: #0d1d27;
    opacity: 1;
    transform: translateX(0);
}

.kct-posts-card__media-arrow svg,
.kct-posts-card__button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.kct-posts-card__content {
    display: flex;
    min-height: 190px;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
}

.kct-posts-card__title {
    margin: 0 0 28px;
    color: var(--kct-posts-text);
    font-size: clamp(20px, 2vw, 25px);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.kct-posts-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 180ms ease;
}

.kct-posts-card__title a:hover {
    color: var(--kct-posts-accent);
}

.kct-posts-card__button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    padding: 13px 20px;
    border: 1px solid var(--kct-posts-accent);
    border-radius: 8px;
    background: var(--kct-posts-accent);
    color: #10202a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.045em;
    text-decoration: none;
    text-transform: uppercase;
    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.kct-posts-card__button:hover {
    border-color: var(--kct-posts-accent-hover);
    background: var(--kct-posts-accent-hover);
    box-shadow: 0 10px 26px rgba(255, 168, 0, 0.18);
    color: #10202a;
    transform: translateY(-2px);
}

.kct-posts-card__button svg {
    transition: transform 180ms ease;
}

.kct-posts-card__button:hover svg {
    transform: translateX(3px);
}

.kct-posts-page a:focus-visible {
    outline: 3px solid var(--kct-posts-accent-hover);
    outline-offset: 4px;
}

.kct-posts-pagination {
    margin-top: 56px;
}

.kct-posts-pagination .page-numbers {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kct-posts-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.kct-posts-pagination li {
    margin: 0;
}

.kct-posts-pagination a.page-numbers,
.kct-posts-pagination span.page-numbers {
    display: grid;
    min-width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--kct-posts-border);
    border-radius: 8px;
    background: var(--kct-posts-panel-dark);
    color: var(--kct-posts-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.kct-posts-pagination a.page-numbers:hover,
.kct-posts-pagination span.page-numbers.current {
    border-color: var(--kct-posts-accent);
    background: var(--kct-posts-accent);
    color: #10202a;
    transform: translateY(-2px);
}

.kct-posts-pagination span.page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: var(--kct-posts-muted);
}

.kct-posts-empty {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 32px;
    border: 1px solid var(--kct-posts-border);
    border-radius: 12px;
    background: var(--kct-posts-panel-dark);
    text-align: center;
}

.kct-posts-empty__mark {
    display: inline-grid;
    width: 74px;
    height: 74px;
    margin-bottom: 24px;
    place-items: center;
    border: 1px solid rgba(255, 168, 0, 0.5);
    border-radius: 10px;
    color: var(--kct-posts-accent);
    font-size: 24px;
    font-weight: 600;
}

.kct-posts-empty h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 30px;
    font-weight: 400;
}

.kct-posts-empty p {
    margin: 0;
    color: var(--kct-posts-muted);
    font-size: 16px;
}

.kct-posts-ready .kct-posts-card {
    opacity: 0;
    transform: translateY(24px);
}

.kct-posts-ready .kct-posts-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        border-color 250ms ease,
        box-shadow 250ms ease,
        opacity 520ms ease,
        transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.kct-posts-ready .kct-posts-card.is-visible:hover {
    transform: translateY(-6px);
}

@media (max-width: 1024px) {
    .kct-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kct-posts-hero__content {
        width: 84%;
        padding: 52px 48px;
    }

    .kct-posts-hero__mark {
        right: 38px;
        width: 96px;
    }
}

@media (max-width: 767px) {
    .kct-posts-container {
        width: min(calc(100% - 32px), var(--kct-posts-container));
    }

    .kct-posts-hero {
        padding: 20px 0 26px;
    }

    .kct-posts-breadcrumbs {
        gap: 8px;
        margin-bottom: 14px;
        font-size: 10px;
    }

    .kct-posts-hero__panel {
        min-height: 254px;
    }

    .kct-posts-hero__accent {
        width: 5px;
    }

    .kct-posts-hero__content {
        width: 100%;
        padding: 42px 28px 70px;
    }

    .kct-posts-hero__eyebrow {
        margin-bottom: 14px;
        font-size: 11px;
    }

    .kct-posts-hero__title {
        font-size: clamp(34px, 12vw, 50px);
        line-height: 1.02;
    }

    .kct-posts-hero__mark {
        right: 24px;
        bottom: 26px;
        width: 68px;
        gap: 7px;
    }

    .kct-posts-hero__mark span {
        height: 3px;
    }

    .kct-posts-list {
        padding: 20px 0 72px;
    }

    .kct-posts-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .kct-posts-card__content {
        min-height: 170px;
        padding: 24px;
    }

    .kct-posts-card__title {
        margin-bottom: 24px;
        font-size: 21px;
    }

    .kct-posts-card__media-arrow {
        display: none;
    }

    .kct-posts-card__button {
        width: 100%;
    }

    .kct-posts-pagination {
        margin-top: 40px;
    }

    .kct-posts-pagination a.page-numbers,
    .kct-posts-pagination span.page-numbers {
        min-width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kct-posts-page *,
    .kct-posts-page *::before,
    .kct-posts-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .kct-posts-ready .kct-posts-card,
    .kct-posts-ready .kct-posts-card.is-visible,
    .kct-posts-ready .kct-posts-card.is-visible:hover {
        opacity: 1;
        transform: none;
    }
}

@media print {
    .kct-posts-page {
        background: #fff;
        color: #111;
    }

    .kct-posts-hero__panel,
    .kct-posts-card {
        break-inside: avoid;
        border: 1px solid #bbb;
        background: #fff;
        box-shadow: none;
    }

    .kct-posts-hero__title,
    .kct-posts-card__title,
    .kct-posts-card__title a {
        color: #111;
    }

    .kct-posts-card__button,
    .kct-posts-pagination {
        display: none;
    }
}
