/*
  Cubanoticias21 legibility fix
  Purpose: restore readability and consistent UX across desktop and mobile,
  overriding previous conflicting experimental layers.
*/

:root {
    --ux-bg: #ffffff;
    --ux-text: #111111;
    --ux-muted: #5f5f5f;
    --ux-line: #e5e5e5;
    --ux-soft: #f7f7f7;
    --ux-accent: #c40000;
}

html,
body {
    background: var(--ux-bg) !important;
    color: var(--ux-text) !important;
    color-scheme: light !important;
}

body,
p,
li,
span,
div,
.gh-content,
.gh-card-excerpt,
.gh-pagehead-description,
.gh-about-description,
.gh-topic-count,
.gh-card-meta,
.gh-custom-foot-date,
.gh-custom-foot-brand {
    color: var(--ux-muted) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.gh-card-title,
.gh-article-title,
.gh-pagehead-title,
.gh-about-title,
.gh-topic-name,
.gh-custom-foot-title,
.gh-custom-foot-copy {
    color: var(--ux-text) !important;
}

a,
.gh-content a {
    color: var(--ux-text);
}

.gh-content a {
    color: var(--ux-accent);
}

/* Header: stable and readable */
#gh-head.gh-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 1300;
    background: #fff !important;
    border-bottom: 1px solid var(--ux-line) !important;
}

#gh-head .gh-head-inner {
    width: min(1200px, calc(100% - 2rem));
    min-height: 6.8rem;
    margin: 0 auto;
    padding: 0 1.2rem;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    opacity: 1 !important;
}

/* Neutralize hidden/compact class side effects from previous scripts */
body.is-head-hidden #gh-head,
body.is-head-hidden #gh-head .gh-head-inner,
body.is-head-compact #gh-head .gh-head-inner,
body.is-head-concealing #gh-head .gh-head-inner,
body.is-head-revealing #gh-head .gh-head-inner {
    transform: none !important;
    opacity: 1 !important;
    min-height: 6.8rem !important;
    box-shadow: none !important;
}

#gh-head .gh-head-logo img {
    max-height: 3.8rem;
}

#gh-head .nav a,
#gh-head .gh-head-menu a,
#gh-head .gh-head-link,
#gh-head .gh-head-btn {
    color: var(--ux-text) !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#gh-head .nav .nav-current a {
    color: var(--ux-accent) !important;
    border-bottom-color: var(--ux-accent) !important;
}

.gh-search,
.gh-icon-btn {
    color: var(--ux-text) !important;
}

/* Main readability */
.gh-main {
    padding-top: 7.2rem;
    padding-bottom: 5rem;
}

.gh-wrapper {
    row-gap: 3rem;
}

.gh-wrapper > .gh-section {
    max-width: 760px;
}

.gh-section-title {
    position: relative;
    margin-bottom: 1.6rem;
    padding-left: 1.1rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--ux-text) !important;
}

.gh-section-title::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    content: "";
    background: var(--ux-accent);
}

.gh-section-title::after {
    background-color: var(--ux-line) !important;
}

/* Feed: clean single-column cards for consistent scanning */
.gh-wrapper > .gh-section .gh-feed,
.tag-template .gh-feed,
.author-template .gh-feed,
.gh-featured.gh-feed {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
    padding-top: 0.8rem !important;
}

.gh-card {
    margin: 0;
}

.gh-card + .gh-card {
    margin-top: 0;
}

.gh-card-link {
    display: block;
    padding: 1.3rem;
    background: #fff !important;
    border: 1px solid var(--ux-line) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    transform: none !important;
}

.gh-card-link:hover {
    opacity: 1;
    border-color: #d6d6d6 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
}

.gh-card-image-wrap,
.gh-card-image {
    border-radius: 4px !important;
}

.gh-card-title {
    font-size: clamp(2.05rem, 2.6vw, 2.9rem) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em;
}

.gh-card-excerpt {
    margin-top: 0.95rem;
    font-size: 1.55rem;
    line-height: 1.5;
    color: #2f2f2f !important;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.gh-card-meta {
    margin-top: 1.2rem;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    color: var(--ux-muted) !important;
}

.gh-card-date,
.gh-article-meta a,
.gh-tag-label {
    color: var(--ux-accent) !important;
}

.gh-home-top {
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--ux-line);
}

.gh-home-top .gh-card-link,
.gh-latest .gh-card-link {
    padding: 0 0 2rem;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.gh-home-top .gh-card-title,
.gh-latest .gh-card-title {
    font-size: clamp(3rem, 4.3vw, 5.2rem) !important;
    line-height: 1.03 !important;
}

/* Sidebar cleanup */
.gh-topic-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ux-line);
}

.gh-topic-item:last-child {
    border-bottom: 0;
}

.gh-topic-count {
    border: 1px solid var(--ux-line) !important;
    background: #fff !important;
}

/* Buttons */
.gh-loadmore {
    min-height: 4.7rem;
    margin-top: 1.8rem;
    border: 1px solid var(--ux-text) !important;
    border-radius: 999px;
    color: var(--ux-text) !important;
    background: #fff !important;
}

.gh-loadmore:hover {
    color: #fff !important;
    background: var(--ux-text) !important;
}

/* Footer */
.gh-custom-foot {
    margin-top: 7rem;
    background: var(--ux-soft) !important;
    border-top: 1px solid var(--ux-line) !important;
}

/* Mobile UX */
@media (max-width: 767px) {
    #gh-head.gh-head {
        top: 0 !important;
    }

    #gh-head .gh-head-inner {
        width: 100%;
        min-height: 6rem !important;
        padding: 0 0.85rem;
    }

    #gh-head .gh-head-logo img {
        max-height: 3.2rem;
    }

    #gh-head .gh-head-menu {
        top: 6rem !important;
        right: 0 !important;
        left: 0 !important;
        height: calc(100dvh - 6rem) !important;
        padding: 0.8rem;
        border: 0 !important;
        border-top: 1px solid var(--ux-line) !important;
        border-radius: 0 !important;
        background: #fff !important;
    }

    #gh-head .gh-head-menu .nav {
        gap: 0.5rem;
    }

    #gh-head .gh-head-menu .nav a {
        min-height: 4.8rem;
        padding: 1.2rem;
        font-size: 1.64rem !important;
        line-height: 1.25;
        background: #fff !important;
        border: 1px solid var(--ux-line) !important;
        border-radius: 4px;
        text-transform: none;
    }

    .gh-main {
        padding-top: 6.7rem;
        padding-bottom: 3.8rem;
    }

    .gh-wrapper {
        row-gap: 2.4rem;
    }

    .gh-sidebar {
        margin-top: 1.8rem;
        padding-left: 0;
    }

    .gh-section-title {
        margin-bottom: 1.2rem;
    }

    .gh-feed {
        gap: 0.95rem !important;
        padding-top: 0.7rem !important;
    }

    .gh-card-link {
        padding: 1.12rem;
    }

    .gh-card-title {
        font-size: clamp(1.95rem, 6vw, 2.35rem) !important;
        line-height: 1.16 !important;
    }

    .gh-card-excerpt {
        font-size: 1.44rem;
        line-height: 1.46;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .gh-card-meta {
        font-size: 1.03rem;
        margin-top: 1.05rem;
    }

    .gh-home-top .gh-card-title,
    .gh-latest .gh-card-title {
        font-size: clamp(2.7rem, 8vw, 3.4rem) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #gh-head .gh-head-inner,
    .gh-card-link,
    #gh-head .gh-head-menu {
        transition: none !important;
    }
}
