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

:root {
    --red: #d40000;
    --red-dark: #a90000;
    --ink: #222;
    --muted: #777;
    --paper: #fff;
    --background: #f3f3f3;
    --line: #dedede;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: "Inter", Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   CABECERA
   ========================================================= */

.site-header {
    position: relative;
    min-height: 166px;
    color: #fff;
    background: transparent;
    overflow: hidden;
}

/*
 * Fondo rojo con el borde inferior inclinado
 * a lo largo de toda la cabecera.
 */
.site-header::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: var(--red);

    clip-path: polygon(
        0 0,
        100% 0,
        100% 68%,
        26% 91%,
        0 100%
    );
}

/*
 * Ya no debe existir el pseudoelemento anterior
 * que generaba un recorte aislado a la derecha.
 */
.site-header::after {
    content: none;
}

.site-header__inner {
    position: relative;
    z-index: 1;
    width: min(var(--max-width), calc(100% - 40px));
    min-height: 158px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

/*
 * El panel blanco del logo es recto.
 * La diagonal pertenece al fondo rojo, no al logo.
 */
.site-logo {
    flex: 0 0 220px;
    align-self: flex-start;
    min-height: 158px;
    background: #F6F6F6;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: none;
}


.main-nav {
    flex: 1;
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}


.site-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.main-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.main-nav > a {
    position: relative;
    padding: 8px 22px;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 700;
}

.main-nav > a:not(:last-of-type)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, .75);
    transform: translateY(-50%) rotate(13deg);
}

.main-nav > a:hover,
.main-nav > a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.header-search {
    display: flex;
    margin-left: 22px;
    background: #fff;
    height: 34px;
}

.header-search input {
    border: 0;
    width: 180px;
    min-width: 0;
    padding: 0 10px;
    outline: 0;
}

.header-search button {
    border: 0;
    background: #fff;
    cursor: pointer;
    font-size: 1.1rem;
}

.header-social {
    display: flex;
    gap: 8px;
    margin-left: 14px;
}

.header-social a {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 700;
    transition: transform .18s ease, background-color .18s ease;
}

.header-social a:hover,
.header-social a:focus-visible {
    background: #333;
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
}

/* =========================================================
   PORTADA Y TARJETAS
   ========================================================= */

.page-shell {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 55px auto 65px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 42px;
    align-items: stretch;
}

.note-card {
    position: relative;
    height: 100%;
    min-height: 0;
    background: var(--paper);
    display: flex;
    flex-direction: column;
}

.note-card__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.note-card__link:hover .note-card__title,
.note-card__link:focus-visible .note-card__title {
    color: var(--red);
}

.note-card__image-wrap {
    position: relative;
    flex: 0 0 180px;
    height: 180px;
    overflow: hidden;
    background: #f2f2f2;
}

.note-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.note-card__issue {
    position: absolute;
    top: 0;
    left: 16px;
    z-index: 2;
    min-width: 52px;
    padding: 7px 11px 10px 8px;
    background: var(--red);
    color: #fff;
    text-align: center;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1;
    clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 88%);
}

.note-card__issue small {
    display: block;
    font-size: .6rem;
    margin-bottom: 3px;
}

.note-card__issue--inline {
    position: absolute;
    display: inline-block;
    top: 0;
    left: 16px;
    margin: 0;
}

.note-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px 26px 25px;
}

.note-card__meta,
.note-card__author {
    margin: 0 0 9px;
    color: var(--red);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
}

.note-card__title {
    margin: 0 0 10px;
    font-family: "Noto Serif", Georgia, "Times New Roman", serif;
    font-size: 1.38rem;
    line-height: 1.16;
    transition: color .2s ease;
}

.note-card__author {
    text-transform: none;
}

.note-card__excerpt {
    margin: 0;
    color: #777;
    font-size: .82rem;
    line-height: 1.5;
}

.note-card__excerpt span {
    color: var(--red);
    font-weight: 700;
    white-space: nowrap;
}

.note-card--without-image .note-card__body,
.note-card--no-image .note-card__body {
    padding-top: 62px;
}

/* =========================================================
   RESULTADOS Y PAGINADOR
   ========================================================= */

.results-header {
    margin-bottom: 32px;
}

.results-header p,
.results-header span {
    color: var(--muted);
    margin: 0;
}

.results-header h1 {
    margin: 3px 0 5px;
    font-family: "Noto Serif", Georgia, serif;
}

.empty-state {
    background: #fff;
    padding: 55px;
    text-align: center;
}

.pagination {
    margin: 45px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--red);
    background: #fff;
    color: var(--red);
    text-decoration: none;
    font-size: .82rem;
    transition:
        background-color .2s ease,
        color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.pagination a:hover,
.pagination a:focus-visible {
    background: var(--red);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .13);
}

.pagination .pagination__current,
.pagination .is-current {
    background: var(--red);
    color: #fff;
}

.pagination .pagination__direction {
    min-width: auto;
}

/* =========================================================
   NOTA INDIVIDUAL
   ========================================================= */

.page-shell--article {
    margin-top: 35px;
}

.article {
    background: #fff;
    padding: 0 34px 45px;
}

.article__hero {
    margin: -28px -34px 28px;
    position: relative;
    max-height: 520px;
    overflow: hidden;
}

.article__hero img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
}

.note-card__issue--article {
    position: relative;
    display: inline-block;
    left: 0;
    top: 0;
    margin-bottom: 15px;
}

.article__header {
    margin-bottom: 28px;
}

.article__meta,
.article__author {
    color: var(--red);
    font-size: .78rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.article__header h1 {
    margin: 0 0 10px;
    color: var(--red-dark);
    font-family: "Noto Serif", Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.03;
}

.article__content {
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 1.08rem;
    line-height: 1.75;
}

.article__content h2,
.article__content h3 {
    line-height: 1.2;
    margin-top: 1.8em;
}

.article__content img {
    height: auto;
}

.article__content a {
    color: var(--red-dark);
}

.related-notes {
    margin-top: 34px;
}

.related-notes > h2 {
    color: var(--red-dark);
    font-family: "Noto Serif", Georgia, serif;
}

.related-notes__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.related-card {
    background: #fff;
}

.related-card a {
    display: block;
    text-decoration: none;
}

.related-card img {
    width: 100%;
    aspect-ratio: 16 / 8.5;
    object-fit: cover;
    display: block;
}

.related-card div {
    padding: 15px;
}

.related-card p,
.related-card small {
    margin: 0 0 7px;
    color: var(--red);
    font-size: .62rem;
    font-weight: 700;
}

.related-card h3 {
    margin: 0 0 7px;
    font-family: "Noto Serif", Georgia, serif;
    font-size: 1rem;
    line-height: 1.05;
}

/* =========================================================
   PIE
   ========================================================= */

.site-footer {
    background: #fff;
}

.site-footer__inner {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: .78fr 2.22fr;
    gap: 56px;
    padding: 0 0 50px;
}

.footer-panel {
    position: relative;
    min-width: 0;
    padding-top: 86px;
}

.footer-panel + .footer-panel {
    border-left: 1px solid var(--line);
    padding-left: 56px;
}

.footer-panel h2 {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    display: inline-block;
    min-width: 205px;
    padding: 13px 27px 14px 18px;
    background: var(--red);
    color: #fff;
    font-family: "Noto Serif", Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1;
    clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 86%, 0 100%);
}

.footer-panel p {
    max-width: 320px;
    margin: 0 0 18px;
    font-size: .88rem;
    line-height: 1.38;
}

.footer-paypal {
    display: inline-block;
    margin-top: 18px;
    line-height: 0;
}

.footer-paypal img {
    display: block;
    width: 116px;
    max-width: 100%;
    height: auto;
}

.contact-form__fields {
    display: grid;
    grid-template-columns: 1fr 1.08fr;
    gap: 38px;
    align-items: start;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    border: 1px solid #bdbdbd;
    background: #fff;
    padding: 11px 12px;
    font: inherit;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    margin-bottom: 14px;
}

.contact-form textarea {
    min-height: 104px;
    resize: vertical;
}

.contact-form__subscribe {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 2px;
    font-size: .8rem;
}

.contact-form__subscribe input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.contact-form__submit {
    float: right;
    border: 0;
    background: var(--red);
    color: #fff;
    padding: 10px 30px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.contact-form__submit:hover,
.contact-form__submit:focus-visible {
    background: var(--red-dark);
    transform: translateY(-1px);
}

.form-message {
    margin-bottom: 16px;
    padding: 12px 14px;
}

.form-message--success {
    background: #e7f5e7;
    color: #1f641f;
}

.form-message--error {
    background: #fde8e8;
    color: #8b0000;
}

.footer-colorbar {
    height: 18px;
    display: grid;
    grid-template-columns: 1.2fr .1fr .8fr .9fr .9fr;
}

.footer-colorbar span:nth-child(1) {
    background: #111;
}

.footer-colorbar span:nth-child(2) {
    background: #7dc523;
}

.footer-colorbar span:nth-child(3) {
    background: #48b7ca;
}

.footer-colorbar span:nth-child(4) {
    background: #b5a6c9;
}

.footer-colorbar span:nth-child(5) {
    background: #ffc900;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {
    .site-header__inner {
        gap: 20px;
    }

    .main-nav > a {
        padding-inline: 12px;
        font-size: .8rem;
    }

    .header-search {
        margin-left: 12px;
    }

    .header-search input {
        width: 130px;
    }

    .notes-grid {
        gap: 25px;
    }

    .related-notes__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-footer__inner {
        grid-template-columns: .9fr 2fr;
        gap: 38px;
    }

    .footer-panel + .footer-panel {
        padding-left: 38px;
    }
}

@media (max-width: 760px) {

    .site-header__inner {
        width: calc(100% - 24px);
        min-height: 74px;
        justify-content: space-between;
    }

    .site-logo {
        width: 112px;
    }

    .nav-toggle {
        display: block;
        width: 44px;
        height: 40px;
        border: 1px solid rgba(255, 255, 255, .7);
        background: transparent;
        padding: 8px;
    }

    .nav-toggle span:not(.sr-only) {
        display: block;
        height: 2px;
        background: #fff;
        margin: 5px 0;
    }

    .main-nav {
        display: none;
        position: absolute;
        z-index: 20;
        top: 74px;
        left: 0;
        right: 0;
        background: var(--red);
        padding: 18px 20px 25px;
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav--open {
        display: flex;
    }

    .main-nav > a {
        border: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .35);
        padding: 12px 0;
    }

    .main-nav > a::after {
        display: none;
    }

    .header-search {
        margin: 16px 0 0;
        clip-path: none;
    }

    .header-search input {
        width: 100%;
    }

    .header-social {
        margin: 15px 0 0;
    }

    .page-shell {
        width: calc(100% - 28px);
        margin-top: 30px;
    }

    .notes-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .note-card {
        min-height: 0;
    }

    .note-card__title {
        font-size: 1.55rem;
    }

    .article {
        padding: 22px 20px 35px;
    }

    .article__hero {
        margin: -22px -20px 24px;
    }

    .article__content {
        font-size: 1rem;
    }

    .related-notes__grid {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        width: calc(100% - 28px);
        grid-template-columns: 1fr;
        gap: 28px;
        padding-bottom: 34px;
    }

    .footer-panel {
        padding-top: 76px;
    }

    .footer-panel + .footer-panel {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-left: 0;
        padding-top: 88px;
    }

    .contact-form__fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-form__submit {
        float: none;
        width: 100%;
    }
}
