:root {
    --noticias-font-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --noticias-color-primary: #dd1515;
    --noticias-color-primary-dark: #8b0000;
    --noticias-color-heading: #111;
    --noticias-color-text: #333;
    --noticias-color-text-soft: #666;
    --noticias-color-text-muted: #888;
    --noticias-color-surface: #fff;
    --noticias-color-line: #e7e7e7;
    --noticias-shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.08);
    --noticias-shadow-strong: 0 16px 36px rgba(0, 0, 0, 0.16);
}

body.noticias-module-body {
    font-family: var(--noticias-font-base);
    background: linear-gradient(180deg, #fff 0%, #fff 100%);
    color: var(--noticias-color-text);
    overflow-y: scroll;
}

body.noticias-module-body.noticias-modal-open {
    overflow: hidden;
}

.noticias-module-main {
    width: min(90vw, 1680px);
    margin: 0 auto;
    padding: 14px 0 48px;
}

.noticias-hero,
.noticias-card,
.noticias-toolbar,
.noticias-empty,
.noticias-pagination,
.noticias-form-card,
.noticias-modal-panel,
.noticias-admin-grid {
    background: var(--noticias-color-surface);
    border-radius: 16px;
    box-shadow: var(--noticias-shadow-soft);
}

.noticias-hero {
    padding: 16px 22px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 1px solid var(--noticias-color-line);
}

.noticias-hero-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.noticias-hero-copy h1 {
    margin: 0 0 8px;
    color: var(--noticias-color-heading);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
}

.noticias-hero-copy h2 {
    margin: 0 0 6px;
    color: var(--noticias-color-heading);
    font-size: clamp(16px, 1.9vw, 20px);
    font-weight: 800;
}

.noticias-hero-copy p {
    margin: 0;
    max-width: 720px;
    color: var(--noticias-color-text-soft);
    line-height: 1.45;
}

.noticias-hero-head-centered {
    justify-content: center;
}

.noticias-hero-copy-centered {
    width: 100%;
    text-align: center;
}

.noticias-hero-copy-centered p {
    margin: 0 auto;
}

.noticias-hero-actions-left {
    justify-content: flex-start;
    margin-bottom: 10px;
}

.noticias-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.noticias-btn,
.noticias-btn-secondary,
.noticias-btn-danger,
.noticias-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.noticias-btn {
    background: linear-gradient(138deg, var(--noticias-color-primary) 0%, var(--noticias-color-primary-dark) 100%);
    color: #fff;
}

.noticias-btn-secondary {
    background: transparent;
    color: var(--noticias-color-heading);
    border: 1px solid #dddddd;
    border-radius: 8px;
}

.noticias-btn-danger {
    background: #c62828;
    color: #fff;
}

.noticias-btn-ghost {
    background: transparent;
    color: var(--noticias-color-heading);
    border: 1px solid #d8d8d8;
}

.noticias-btn:hover,
.noticias-btn-secondary:hover,
.noticias-btn-danger:hover,
.noticias-btn-ghost:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.noticias-btn-secondary:hover {
    background: var(--noticias-color-primary);
    border-color: var(--noticias-color-primary);
    color: #fff;
}

.noticias-toolbar {
    padding: 10px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.noticias-toolbar-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.noticias-search,
.noticias-select,
.noticias-textarea,
.noticias-input,
.noticias-file-input {
    width: 100%;
    border: 1px solid #d6d6d6;
    border-radius: 14px;
    padding: 8px 12px;
    font: inherit;
    color: var(--noticias-color-text);
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.noticias-search:focus,
.noticias-select:focus,
.noticias-textarea:focus,
.noticias-input:focus,
.noticias-file-input:focus {
    outline: none;
    border-color: var(--noticias-color-primary);
    box-shadow: 0 0 0 4px rgba(221, 21, 21, 0.12);
}

.noticias-search-wrap {
    min-width: 280px;
    flex: 1 1 280px;
    position: relative;
}

.noticias-search-wrap i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--noticias-color-text-muted);
}

.noticias-results-meta {
    color: var(--noticias-color-text-soft);
    font-size: 13px;
}

.noticias-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 18px;
}

.noticias-grid .noticias-card {
    flex: 0 1 calc((100% - 54px) / 4);
    max-width: calc((100% - 54px) / 4);
}

.noticias-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.noticias-admin-grid {
    padding: 20px;
}

.noticias-card {
    overflow: hidden;
    border: 1px solid var(--noticias-color-line);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.noticias-card-image {
    width: 100%;
    height: 270px;
    object-fit: cover;
    object-position: top center;
    background: #f4f4f4;
    cursor: pointer;
}

.noticias-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 20px 18px 10px;
    flex: 1 1 auto;
}

.noticias-card-title {
    margin: 0;
    color: var(--noticias-color-heading);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 800;
}

.noticias-card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    font-size: 13px;
    color: var(--noticias-color-text-muted);
}

.noticias-card-excerpt {
    color: var(--noticias-color-text);
    line-height: 1.7;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    overflow: hidden;
    width: 100%;
}

.noticias-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
}

.noticias-badge-active {
    background: #e7f6ea;
    color: #1d6b33;
}

.noticias-badge-inactive {
    background: #f5f5f5;
    color: #666;
}

.noticias-card-footer,
.noticias-card-actions,
.noticias-votes {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.noticias-card-footer {
    width: 100%;
    margin-top: auto;
    padding-top: 6px;
    align-items: center;
    justify-content: space-between;
}

.noticias-card-actions {
    flex: 0 0 auto;
}

.noticias-votes {
    justify-content: flex-start;
    gap: 16px;
    min-width: 0;
}

.noticias-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    border: none;
    background: none;
    color: #555;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.noticias-vote-btn i {
    font-size: 13px;
    line-height: 1;
}

.noticias-vote-btn[data-vote="favor"] {
    color: #2f7d32;
}

.noticias-vote-btn[data-vote="contra"] {
    color: #c62828;
}

.noticias-vote-btn.is-active {
    color: var(--noticias-color-primary);
}

.noticias-vote-btn.is-active[data-vote="favor"] {
    color: #1f8f3a;
}

.noticias-vote-btn.is-active[data-vote="contra"] {
    color: #b71c1c;
}

.noticias-read-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    color: #111;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.noticias-read-link:hover {
    color: var(--noticias-color-primary-dark);
}

.noticias-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--noticias-color-text-muted);
}

.noticias-empty i {
    display: block;
    margin-bottom: 12px;
    font-size: 42px;
    color: var(--noticias-color-primary);
}

.noticias-pagination {
    margin-top: 24px;
    padding: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.noticias-page-info {
    color: var(--noticias-color-text-soft);
    font-size: 14px;
    font-weight: 700;
}

.noticias-message {
    display: none;
    margin-bottom: 18px;
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 700;
}

.noticias-message.is-success {
    display: block;
    background: #e8f5e9;
    color: #256029;
}

.noticias-message.is-error {
    display: block;
    background: #fdecec;
    color: #8f1d1d;
}

.noticias-form-card {
    padding: 24px;
    border: 1px solid var(--noticias-color-line);
}

body[data-page="create-news"] .noticias-form-card {
    width: min(60vw, 1000px);
    margin: 0 auto;
}

.noticias-form-grid {
    display: grid;
    gap: 18px;
}

.noticias-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--noticias-color-heading);
}

.noticias-field small {
    display: block;
    margin-top: 6px;
    color: var(--noticias-color-text-muted);
}

.noticias-textarea {
    min-height: 180px;
    resize: vertical;
}

.noticias-char-count {
    margin-top: 8px;
    font-size: 12px;
    text-align: right;
    color: var(--noticias-color-text-muted);
}

.noticias-preview-grid,
.noticias-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.noticias-preview-item {
    position: relative;
}

.noticias-preview-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--noticias-color-line);
    background: #f6f6f6;
}

.noticias-preview-strip {
    display: flex !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    width: 100%;
    min-height: 112px;
    gap: 10px;
    padding-top: 0;
}

.noticias-preview-strip .noticias-preview-item {
    flex: 0 1 150px;
    max-width: 150px;
    align-self: flex-start !important;
    margin-top: 0;
}

.noticias-preview-strip .noticias-preview-item img {
    height: 118px;
    border-radius: 16px;
    object-fit: cover;
    object-position: top center;
}

.noticias-preview-strip .noticias-preview-remove {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
}

.noticias-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    cursor: pointer;
}

.noticias-modal,
.noticias-photo-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30000;
    background: rgba(0, 0, 0, 0.78);
    padding: 24px;
}

.noticias-modal.is-open,
.noticias-photo-viewer.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.noticias-modal-panel {
    width: min(940px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    position: relative;
}

.noticias-modal-header {
    padding: 18px 22px;
    background: linear-gradient(135deg, #fafafa 0%, #ededed 100%);
    color: var(--noticias-color-heading);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #dddddd;
    position: sticky;
    top: 0;
    z-index: 5;
}

.noticias-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.noticias-modal-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--noticias-color-heading);
    font-size: 28px;
    cursor: pointer;
}

.noticias-modal-body {
    padding: 22px;
}

.noticias-detail-image,
.noticias-gallery-grid img,
.noticias-admin-current-image {
    width: 100%;
    border-radius: 14px;
    background: #f5f5f5;
    object-fit: contain;
    object-position: top center;
    cursor: zoom-in;
}

.noticias-detail-image {
    max-height: 360px;
    margin-bottom: 18px;
}

.noticias-gallery-grid img {
    height: 160px;
    object-fit: cover;
    object-position: top center;
}

.noticias-admin-current-image {
    max-width: 260px;
    max-height: 180px;
}

.noticias-photo-panel {
    position: relative;
    width: min(1180px, 100%);
    min-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
}

.noticias-photo-title {
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(20, 20, 20, 0.82);
    color: #fff;
    font-weight: 700;
    max-width: min(720px, calc(100vw - 40px));
    text-align: center;
}

.noticias-photo-image {
    max-width: min(94vw, 1180px);
    max-height: calc(100vh - 180px);
    object-fit: contain;
    object-position: top center;
    transform-origin: center center;
    transition: transform 0.18s ease;
    cursor: zoom-in;
}

.noticias-photo-image.is-zoomed {
    cursor: move;
}

.noticias-zoom-controls {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.82);
    z-index: 3;
}

.noticias-zoom-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

.noticias-zoom-label {
    min-width: 52px;
    text-align: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.noticias-side-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 0 !important;
    background: transparent !important;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    padding-left: 3px;
    padding-right: 3px;
    box-sizing: border-box;
    box-shadow: none !important;
    outline: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.noticias-side-nav:hover,
.noticias-side-nav:focus,
.noticias-side-nav:focus-visible,
.noticias-side-nav:active {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.noticias-side-nav.is-visible {
    display: inline-flex;
}

.noticias-side-nav-prev {
    left: 18px;
}

.noticias-side-nav-next {
    right: 18px;
}

.noticias-keyboard-hint {
    margin-top: 4px;
    color: var(--noticias-color-text-muted);
    font-size: 12px;
    text-align: center;
}

.noticias-admin-layout {
    display: grid;
    gap: 20px;
}

.noticias-confirm-copy {
    color: var(--noticias-color-text);
    line-height: 1.7;
}

@media (max-width: 900px) {
    .noticias-module-main {
        width: calc(100vw - 20px);
        padding-top: 20px;
    }

    .noticias-grid .noticias-card {
        flex-basis: calc((100% - 18px) / 2);
        max-width: calc((100% - 18px) / 2);
    }

    .noticias-hero,
    .noticias-toolbar,
    .noticias-form-card,
    .noticias-admin-grid,
    .noticias-pagination {
        border-radius: 14px;
    }

    .noticias-hero,
    .noticias-form-card,
    .noticias-admin-grid {
        padding: 18px;
    }

    body[data-page="create-news"] .noticias-form-card {
        width: 100%;
    }

    .noticias-modal,
    .noticias-photo-viewer {
        padding: 10px;
    }

    .noticias-modal-body {
        padding: 18px;
    }

    .noticias-photo-title {
        max-width: calc(100vw - 20px);
        font-size: 14px;
    }

    .noticias-side-nav {
        width: 42px;
        height: 42px;
        font-size: 24px;
    }

    .noticias-side-nav-prev {
        left: 10px;
    }

    .noticias-side-nav-next {
        right: 10px;
    }

    .noticias-zoom-controls {
        bottom: 10px;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .noticias-grid .noticias-card {
        flex-basis: calc((100% - 36px) / 3);
        max-width: calc((100% - 36px) / 3);
    }
}

@media (max-width: 640px) {
    .noticias-grid .noticias-card {
        flex-basis: 100%;
        max-width: 100%;
    }

    .noticias-hero-copy h2 {
        font-size: 16px;
    }

    .noticias-card-title {
        font-size: 15px;
    }

    .noticias-card-footer {
        gap: 12px;
    }

    .noticias-votes {
        gap: 12px;
    }

    .noticias-vote-btn {
        font-size: 13px;
    }

    .noticias-read-link {
        font-size: 11px;
    }
}