:root {
    --red-space: #f01821;
    --card-background: #ffffff;
}

* {
    font-family: "inter", sans-serif;
}

body,
h1,
h2,
p,
span {
    margin: 0;
    padding: 0;
}

/********* Navbar **********/
nav {
    background-color: var(--red-space);
    padding: 20px 120px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 88px;
    max-height: 88px;
    box-sizing: border-box;
}

nav div {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: max-content;
    padding: 0px;
    margin: 0px;
    place-items: center;  
    height: 100%;
}

nav div a {
    width: 30px;
    height: 30px;
}

nav div a svg {
    width: 100%;
    height: 100%;
}

main {
    padding: 0px 120px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/********* Buscador **********/
.state-form{
    margin-right: 54px;
}

.search-form {
    display: flex;
    gap: 10px; 
    height: 100%; 
}

.search-input {
    border: 2px solid #FF0000; 
    border-radius: 5px; 
    font-size: 14px; 
    outline: none; 
    box-sizing: border-box; 
    min-width: 400px; 
    max-width: 700px; 
    height: 100%;
    padding: 0 10px;
}

.search-input::placeholder {
    color: #888; }

.search-button {
    background-color: transparent; 
    border: 1px solid #fff; 
    border-radius: 6px;
    cursor: pointer; 
    transition: background-color 0.3s; 
    box-sizing: border-box; 
    height: 100%;
    width: 48px; /* este tamaño va a relación de lo alto que mide el svg del logo*/
    display: flex;
    justify-content: center;
    align-items: center;
}
.search-button:hover {
    background-color: #00000026;
}

.open-search, .close-search{
    background-color: transparent; 
    border: 1px solid #fff; 
    border-radius: 6px;
    cursor: pointer; 
    transition: background-color 0.3s; 
    box-sizing: border-box; 
    height: 100%;
    width: 48px; /* este tamaño va a relación de lo alto que mide el svg del logo*/
    display: none; 
    justify-content: center;
    align-items: center;
}

.search-form-open{
    top: 0 !important;
}

/********* Acerca de **********/

article {
    padding: 102px 0px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
    /* border: 1px solid red; */
}

article span {
    background-color: #efefef;
    border-radius: 50px;
    padding: 11px 28px;
    width: max-content;
    height: max-content;
    font-size: 21px;
    font-weight: 600;
}
article span span {
    margin: 0px;
    padding: 0px;
    color: var(--red-space);
}

article h1 {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
}

article p {
    color: #656565;
    font-size: 21px;
}

article div {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

article div a {
    padding: 6px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
}

article div a svg {
    fill: #00000020;
    width: 100%;
    height: 100%;
}

article div a:hover {
    background-color: var(--red-space);

    svg {
        fill: #ffffff;
    }

    transition: all 0.2s ease-in-out;
}

.s {
    display: none;
}

/********* Lo más reciente **********/

section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    /* max-width: 1200px; */
    max-width: 100%;
    /* border: 1px solid red; */
}

section h2 {
    font-size: 36px;
    font-weight: bold;
}

.card-reciente {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0px 0px 21px rgba(0, 0, 0, 0.21);
    height: 560px;
    max-height: 560px;
    min-height: 560px;
    width: 100%;
}

.card-reciente img {
    width: 100%;
    height: 50%;
    object-fit: cover;
}

.info {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: 0px 0px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 240px;
    max-height: 240px;
    min-height: 240px;
}

.info p {
    font-size: 16px;
    display: -webkit-box;
    -webkit-line-clamp:5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 94px;
    min-height: 94px;
    max-height: 94px;
}

/* TODO: label de la card */
.labels{
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    border-radius: 0px;
    font-size: 14px;
    font-weight: bold;
}

.lables span {
    background-color: var(--red-space);
    color: var(--card-background);
    padding: 6px 21px;
    border-radius: 4px;
}

.reciente-button{
    background-color: var(--red-space);
    border: none;
    padding: 6px 14px;
    width: max-content;
    max-width: max-content;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    border-radius: 6px;
    outline: none;
}

/********* Noticias anteriores **********/
main section:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 40px;
    justify-items: center;
}

.container-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, 382px);
    justify-content: center;
    gap: 18px;
    width: 100%;
}

.card-noticia {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    min-height: 444px;
    box-shadow: 0px 12px 21px rgba(0, 0, 0, 0.21);
    border-radius: 12px 12px 10px 10px;
    overflow: hidden;
}

.card-noticia img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 264px;
    height: 264px;
}

.elemento {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
}

.categorias, .fecha {
    background-color: var(--red-space);
    color: var(--card-background);
    padding: 6px 21px;
    border-radius: 4px;
    max-width: max-content;
    height: max-content;
    font-size: 14px;
    font-weight: bold;
}

.card-noticia div:nth-child(2) h2 {
    font-size: 32px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    min-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-noticia div:nth-child(2) p {
    font-size: 18px;
    overflow: hidden;
    height: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.ver-noticia-container{
    width: 100%;
}

.ver-noticia{
    padding: 10px 60px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    background-color: var(--red-space);
    outline: none;
    color: #ffffff;
    width: 100%;
    cursor: pointer;
}

/* * Footer */
footer{
    display: flex;
    flex-direction: row;
    padding: 121px 120px 30px 120px;
    justify-content: space-between;
    place-items: center;
    font-size:14px;
    font-weight: 400px;
}

footer div{
    display: flex;
    flex-direction: row;
    gap: 4px;
}

footer a{
    color: #000000;
    text-decoration: none;
}

@media screen and (width <= 1218px) {
    nav {
        padding: 20px 80px;
    }

    main {
        padding: 0px 80px;
    }
}

@media screen and (width <= 1124px) {
    nav {
        padding: 20px 40px;
    }

    main {
        padding: 0px 40px;
    }

    main section h2 {
        font-size: 26px;
    }

    .card-reciente{
        max-height: none;
        min-height: none;
        height: max-content;
    }

    .card-reciente img {
        height: 260px;
    }

    .info {
        height: 100%;
        max-height: 100%;
        min-height: 100%;
    }
}

@media screen and (width <= 1050px) {
    .state-form {
        margin-right: 20px;
    }
}

@media screen and (width <= 1018px) {
    .s {
        display: block;
    }

    .logo {
        display: none;
    }
}

@media screen and (width <= 850px) {
    article {
        gap: 20px;
    }

    article h1 {
        font-size: 38px;
    }

    article span {
        font-size: 18px;
    }

    article p {
        font-size: 18px;
    }

    main section:first-child div div:nth-child(2) p{
        -webkit-line-clamp:6;
        line-clamp: 6;
    }

    main section:nth-child(2) button{
        font-size: 16px;    
    }
}

@media screen and (width <= 805px) {
    .state-form{
        position: absolute;
        background-color: #00000050;
        border-radius: 12px;
        backdrop-filter: blur(6px);
        --webkit-backdrop-filter: blur(6px);
        height: max-content;
        width: max-content;
        margin-top: 10px;
        margin-right: auto;
        margin-left: auto;
        z-index: 2;
        padding: 10px;
        top: -100px;
        right: 0;
        left: 0;
        transition: all 0.3s;
    }

    .search-input, .search-button, .close-search{
        height: 48px;
    }

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

    .search-button, .close-search{
        background-color: var(--red-space);
    }

    .open-search, .close-search{
        display: flex;
    }
}

@media screen and (width <= 622px) {
    main section:first-child div div:nth-child(2) {
        height: 45%;
        max-height: 45%;
        min-height: 45%;
        padding: 20px;
    }

    main section:first-child div div:nth-child(2) p{
        height: 40%;
        min-height: 40%;
        max-height: 40%;
        font-size: 14px;

    }

    .card-noticia div:nth-child(2) p{
        font-size: 14px;
    }

    .card-noticia div:first-child span{
        font-size: 12px;
    }
    
}

@media screen and (width <= 585px) {
    /* .s {
        display: block;
    }

    .logo {
        display: none;
    } */

    nav div a {
        width: 24px;
        height: 24px;
    }

    nav div{
        gap: 10px;
    }
    article h1 {
        font-size: 28px;
    }

    article div {
        gap: 10px;
    }

    article div a {
        width: 30px;
        height: 30px;
    }

    main section h2 {
        font-size: 18px;
    }

    .card-noticia div:nth-child(2) h2 {
        font-size: 26px;
        min-height: 30px;
    }
}

@media screen and (width <= 566px) {
    .search-input{
        min-width: 320px;
    }
}

@media screen and (width <= 478px) {
    .search-input{
        min-width: 280px;
    }
}

@media screen and (width <= 448px) {
    nav{
        padding: 20px;
    }

    .search-input{
        min-width: 240px;
    }


    .container-cards {
        grid-template-columns: repeat(auto-fill, 100%);
    }

    article {
        padding: 71px 20px;
    }

    article h1 {
        font-size: 22px;
        text-align: center;
    }

    article p {
        text-align: center;
        font-size: 16px;
    }

    article span {
        font-size: 16px;
    }

    main section:first-child div div:nth-child(2) {
        padding: 20px;
        border-radius: 0px 0px 10px 10px;
    }

    footer{
        padding: 121px 20px 30px 20px;

    }
}

@media screen and (width <= 408px) {
    .card-noticia div:nth-child(2) p {
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .search-input{
        min-width: 200px;
    }
}

@media screen and (width <= 376px) {
    .content div:first-child{
        flex-direction: column;
    }
}

@media screen and (width <= 360px) {
    .search-input{
        min-width: 160px;
    }
}

@media screen and (width <= 352px) {
    .search-input{
        width: 20px;
    }
    
}

.categoria-contenedor {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-direction: row;
    flex-wrap: wrap;
}

.categoria-boton {
    background-color: #f01821; 
    color: #f0eded; 
    border: 2px solid #d31414; 
    border-radius: 5px; 
    padding: 10px 20px; 
    font-size: 16px; 
    cursor: pointer; 
    transition: background-color 0.3s, color 0.3s; 
}

.categoria-boton:hover {
    background-color: #e72626; 
    color: #998b8b; 
}