:root {
    --blue-dark: #06354e;
    --blue: #087fae;
    --cyan: #12afd0;
    --text: #152033;
    --muted: #64748b;
    --border: #dbe5ec;
    --surface: #ffffff;
    --background: #f3f7f9;
    --green: #087f5b;
    --orange: #d97706;
    --red: #b42318;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(12, 52, 75, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--background);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.public-container {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    background: rgba(4, 52, 77, 0.96);
    backdrop-filter: blur(14px);
}

.header-content {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-symbol {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 23px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.72);
}

.header-link {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 750;
}

.public-hero {
    padding: clamp(50px, 8vw, 88px) 0;
    color: white;
    background:
        radial-gradient(
            circle at 82% 20%,
            rgba(18, 175, 208, 0.42),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #042d43,
            #075b7a
        );
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
    align-items: center;
    gap: 40px;
}

.hero-label,
.section-heading span,
.public-help span {
    color: #76e4f7;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.public-hero h1 {
    max-width: 760px;
    margin: 12px 0 18px;
    font-size: clamp(38px, 7vw, 66px);
    line-height: 1.02;
}

.public-hero p {
    max-width: 710px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.65;
}

.hero-help {
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.09);
}

.hero-help strong,
.hero-help span {
    display: block;
}

.hero-help strong {
    margin-bottom: 7px;
    font-size: 20px;
}

.hero-help span {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.5;
}

.urgent-notice {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    margin-top: -23px;
    padding: 18px 20px;
    border: 1px solid #fed7aa;
    border-radius: 15px;
    color: #7c2d12;
    background: #fff7ed;
    box-shadow: var(--shadow);
}

.urgent-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    font-size: 22px;
    font-weight: 900;
    background: var(--orange);
}

.urgent-notice strong,
.urgent-notice a {
    display: block;
}

.urgent-notice a {
    margin-top: 3px;
    font-weight: 750;
    text-decoration: underline;
}

.search-section {
    padding: 38px 0 22px;
}

.public-search {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.public-search label {
    display: block;
    margin-bottom: 9px;
    font-weight: 850;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.search-row input {
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

.search-row input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(18, 175, 208, 0.13);
}

.search-row button,
.read-button,
.download-button,
.help-button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    color: white;
    font-weight: 850;
    cursor: pointer;
    background: var(--blue);
}

.public-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding-top: 18px;
}

.public-filters a {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #475569;
    font-weight: 750;
    background: white;
}

.public-filters a.active {
    border-color: var(--blue);
    color: white;
    background: var(--blue);
}

.featured-card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    margin-top: 12px;
    overflow: hidden;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow);
}

.featured-image {
    min-height: 430px;
}

.featured-image img,
.publication-image img,
.detail-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 32px;
    font-weight: 900;
    background:
        linear-gradient(
            135deg,
            var(--blue-dark),
            var(--cyan)
        );
}

.image-placeholder.small {
    min-height: 210px;
    font-size: 21px;
}

.featured-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: clamp(30px, 5vw, 58px);
}

.publication-type {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.publication-type.aviso {
    color: #9a3412;
    background: #ffedd5;
}

.publication-type.noticia {
    color: #075985;
    background: #e0f2fe;
}

.featured-content h2 {
    margin: 16px 0 12px;
    font-size: clamp(28px, 4vw, 43px);
    line-height: 1.12;
}

.featured-content p {
    margin: 0 0 25px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.publications-section {
    padding: 55px 0 70px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 7px 0 0;
    font-size: clamp(29px, 4vw, 40px);
}

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

.publication-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 12px 32px rgba(12, 52, 75, 0.07);
}

.publication-image {
    height: 220px;
    display: block;
    overflow: hidden;
}

.publication-image img {
    transition: transform 0.35s ease;
}

.publication-card:hover .publication-image img {
    transform: scale(1.035);
}

.publication-content {
    padding: 21px;
}

.publication-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.publication-meta time {
    color: var(--muted);
    font-size: 12px;
}

.publication-content h3 {
    margin: 15px 0 10px;
    font-size: 21px;
    line-height: 1.3;
}

.publication-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.card-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--blue);
    font-weight: 850;
}

.public-empty {
    grid-column: 1 / -1;
    padding: 50px 20px;
    border: 1px dashed #b8c6d0;
    border-radius: var(--radius);
    text-align: center;
    background: white;
}

.public-empty strong {
    font-size: 21px;
}

.public-empty p {
    color: var(--muted);
}

.public-help {
    padding: 55px 0;
    color: white;
    background: var(--blue-dark);
}

.public-help .public-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.public-help h2 {
    margin: 7px 0;
    font-size: clamp(29px, 4vw, 42px);
}

.public-help p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}

.help-button {
    background: var(--cyan);
}

.public-footer {
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.7);
    background: #032536;
}

.public-footer strong,
.public-footer span {
    display: block;
}

.public-footer span {
    margin-top: 5px;
    font-size: 13px;
}

.detail-main {
    padding: 45px 0 70px;
}

.detail-article {
    overflow: hidden;
    border-radius: 23px;
    background: white;
    box-shadow: var(--shadow);
}

.detail-header {
    padding: clamp(28px, 6vw, 65px);
}

.detail-header h1 {
    max-width: 930px;
    margin: 20px 0 16px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.08;
}

.detail-summary {
    max-width: 850px;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.65;
}

.detail-meta {
    margin-top: 20px;
    color: var(--muted);
    font-size: 13px;
}

.urgent-label {
    display: inline-flex;
    margin-left: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    color: white;
    font-size: 11px;
    font-weight: 850;
    background: var(--red);
}

.detail-image {
    height: min(58vw, 600px);
    margin: 0;
}

.detail-content {
    max-width: 850px;
    margin-inline: auto;
    padding: 50px 24px 25px;
    font-size: 18px;
    line-height: 1.8;
}

.detail-actions {
    max-width: 850px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-inline: auto;
    padding: 15px 24px 55px;
}

.print-button {
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-weight: 850;
    cursor: pointer;
    background: white;
}

.related-section {
    padding-top: 38px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.related-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: white;
}

.related-card span,
.related-card strong {
    display: block;
}

.related-card span {
    margin-bottom: 7px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

@media (max-width: 850px) {
    .hero-grid,
    .featured-card {
        grid-template-columns: 1fr;
    }

    .featured-image {
        min-height: 300px;
    }

    .publications-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-help .public-container {
        align-items: flex-start;
        flex-direction: column;
    }

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

@media (max-width: 580px) {
    .public-container {
        width: min(100% - 22px, 1180px);
    }

    .header-link {
        display: none;
    }

    .public-hero {
        padding: 48px 0 65px;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .publications-grid {
        grid-template-columns: 1fr;
    }

    .publication-image {
        height: 210px;
    }

    .detail-header {
        padding: 27px 20px;
    }

    .detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-actions a,
    .detail-actions button {
        width: 100%;
    }
}

@media print {
    .public-header,
    .public-footer,
    .related-section,
    .detail-actions {
        display: none !important;
    }

    body {
        background: white;
    }

    .detail-main {
        padding: 0;
    }

    .detail-article {
        box-shadow: none;
    }
}
