/* Página principal — estilo blog */

.blog-page {
    min-height: 100vh;
    background: #f3f4f6;
    padding-bottom: 3rem;
}

.blog-masthead {
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    color: #fff;
    padding: 2rem 1.25rem 2.5rem;
    text-align: center;
}

.blog-masthead-inner {
    max-width: 640px;
    margin: 0 auto;
}

.blog-masthead-label {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
}

.blog-masthead h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.6rem, 4.5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.blog-masthead-desc {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.9;
}

.blog-masthead-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
}

.blog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    background: #fff;
    color: #0f172a;
}

.blog-btn-primary {
    background: #fbbf24;
    color: #0f172a;
    border-color: #fbbf24;
}

.blog-btn-primary:hover {
    background: #f59e0b;
    border-color: #f59e0b;
}

.blog-btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.blog-masthead .blog-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Fuera del encabezado oscuro, botones legibles sobre fondo claro */
.anuncios-gestion-page .blog-btn-secondary,
.anuncios-form-page .blog-btn-secondary {
    background: #fff;
    color: #1e40af;
    border-color: #1e40af;
}

.anuncios-gestion-page .blog-btn-secondary:hover,
.anuncios-form-page .blog-btn-secondary:hover {
    background: #eff6ff;
}

.blog-main {
    padding: 2rem 1rem 1rem;
}

.blog-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    max-width: 680px;
    margin: 0 auto 2rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.blog-search label {
    flex: 1;
    min-width: 180px;
    margin: 0;
    font-weight: 600;
    font-size: 0.88rem;
}

.blog-search input {
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Feed de entradas */
.blog-feed {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.blog-post {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.blog-post-featured {
    border-color: #fcd34d;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.12);
}

.blog-post-header {
    margin-bottom: 1rem;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.blog-post-meta time {
    font-size: 0.82rem;
    color: #94a3b8;
}

.blog-post-badge {
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
}

.blog-post-title {
    margin: 0;
    font-size: clamp(1.35rem, 3.5vw, 1.65rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.blog-post-author {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e40af;
}

/* Imagen a tamaño natural — se ve completa al entrar, sin clic */
.blog-post-media {
    margin: 0 0 1.25rem;
    padding: 0;
}

.blog-post-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.blog-post-missing {
    margin: 0 0 1.25rem;
    padding: 1rem 1.15rem;
    background: #fef3c7;
    border: 1px dashed #f59e0b;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #92400e;
}

.blog-post-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-post-header-main {
    flex: 1 1 12rem;
    min-width: 0;
}

.blog-post-edit-btn {
    flex-shrink: 0;
    font-size: 0.82rem;
    padding: 0.45rem 0.85rem;
    white-space: nowrap;
}

.blog-post-reupload-btn {
    margin-top: 0.75rem;
    display: inline-block;
    font-size: 0.88rem;
}

.blog-post-badge-realizado {
    background: #e2e8f0;
    color: #475569;
}

.blog-post-badge-tipo-banderazo {
    background: #dbeafe;
    color: #1e40af;
}

.blog-post-badge-tipo-caravana {
    background: #ffedd5;
    color: #c2410c;
}

.blog-tipo-filtros {
    display: block;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.blog-tipo-filtros-label {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.blog-tipo-filtros-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.blog-tipo-filtros a.blog-tipo-btn {
    text-decoration: none !important;
}

.blog-tipo-filtros a.blog-tipo-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.blog-tipo-icon {
    font-size: 1rem;
    line-height: 1;
}

.blog-tipo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.15rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
}

.blog-tipo-btn-todos:not(.is-active) {
    background: #fff;
    color: #475569;
    border-color: #e2e8f0;
}

.blog-tipo-btn-todos.is-active {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.blog-tipo-btn-banderazo:not(.is-active) {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.blog-tipo-btn-banderazo.is-active {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.blog-tipo-btn-caravana:not(.is-active) {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.blog-tipo-btn-caravana.is-active {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.blog-post-realizado {
    opacity: 0.88;
    border-color: #e2e8f0;
}

.blog-post-realizado .blog-post-title {
    color: #64748b;
}

.blog-section-title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.blog-section-title-done {
    margin-top: 2.25rem;
    color: #64748b;
}

.blog-feed-done {
    opacity: 0.95;
}

.blog-post-missing p {
    margin: 0;
}

.blog-post-missing code {
    font-size: 0.82rem;
}

.blog-post-actions {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid #f1f5f9;
}

.blog-post-edit-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e40af;
    text-decoration: none;
}

.blog-post-edit-link:hover {
    text-decoration: underline;
}

.anuncios-reupload-hint {
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.anuncios-preview {
    margin: 0 0 1rem;
    max-width: 320px;
}

.anuncios-preview img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.anuncios-current-img {
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
}

.blog-post-video {
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
}

.blog-post-video video {
    display: block;
    width: 100%;
    height: auto;
}

.blog-post-content {
    color: #374151;
    font-size: 1.02rem;
    line-height: 1.7;
}

.blog-post-footer {
    margin-top: 1.15rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.88rem;
    color: #6b7280;
}

.blog-empty {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    padding: 2.5rem;
}

.blog-empty p {
    margin-bottom: 1rem;
    color: #6b7280;
}

.blog-site-foot {
    text-align: center;
    padding: 1.5rem 1rem 0;
}

.blog-site-foot a {
    color: #1e40af;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.92rem;
}

.blog-site-foot a:hover {
    text-decoration: underline;
}

/* Formulario subir anuncio */
.anuncios-form-page {
    padding: 2rem 0 3rem;
}

.anuncios-form-top h1 {
    margin: 0.25rem 0;
}

.anuncios-form label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
}

.anuncios-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.anuncios-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.anuncios-upload-box:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.anuncios-upload-label {
    display: block;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.anuncios-upload-hint {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.anuncios-upload-box input[type="file"] {
    width: 100%;
    font-size: 0.85rem;
}

.anuncios-form-municipio select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 2px solid #86efac;
    border-radius: 10px;
    background: #f0fdf4;
    font-size: 1rem;
}

.anuncios-form-municipio select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.anuncios-form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    font-weight: 400;
    color: #64748b;
}

.anuncios-form-note {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0 0 1rem;
}

.anuncios-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.anuncios-check input {
    width: auto;
    margin-top: 0.2rem;
}

/* Compatibilidad con clases del formulario */
.anuncios-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    background: #1e40af;
    color: #fff;
}

.anuncios-btn-primary {
    background: #fbbf24;
    color: #0f172a;
}

.anuncios-btn-outline {
    background: transparent;
    color: #1e40af;
    border-color: #1e40af;
}

.anuncios-gestion-page {
    padding-bottom: 2rem;
}

.anuncios-gestion-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.anuncios-gestion-top h1 {
    margin: 0 0 0.35rem;
}

.anuncios-gestion-top p {
    margin: 0;
    color: #64748b;
    max-width: 36rem;
}

.anuncios-gestion-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.anuncios-gestion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    border: 2px solid transparent;
    white-space: nowrap;
}

.anuncios-gestion-btn-primary {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
}

.anuncios-gestion-btn-primary:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
}

.anuncios-gestion-btn-outline {
    background: #fff;
    color: #475569;
    border-color: #cbd5e1;
}

.anuncios-gestion-btn-outline:hover {
    background: #f8fafc;
    color: #1e40af;
    border-color: #93c5fd;
}

.anuncios-gestion-search {
    margin-bottom: 1rem;
}

.anuncios-gestion-table-wrap {
    overflow-x: auto;
    padding: 0;
}

.anuncios-gestion-empty {
    padding: 1.25rem;
    margin: 0;
}

.anuncios-gestion-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.anuncios-gestion-table th,
.anuncios-gestion-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.anuncios-gestion-table th {
    background: #f8fafc;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.anuncios-gestion-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 700;
    vertical-align: middle;
}

.anuncios-gestion-ok {
    color: #15803d;
    font-weight: 600;
}

.anuncios-gestion-warn {
    color: #b45309;
    font-weight: 600;
}

.anuncios-gestion-muted {
    color: #94a3b8;
}

.anuncios-gestion-actions {
    white-space: nowrap;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.anuncios-delete-form {
    display: inline;
    margin: 0;
}

.anuncios-btn-delete {
    display: inline-block;
    padding: 8px 14px;
    border: 2px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 700;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}

.anuncios-btn-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.anuncios-delete-form-block {
    display: block;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.anuncios-btn-delete-block {
    width: 100%;
    padding: 12px 14px;
}

@media (max-width: 640px) {
    .blog-post {
        padding: 1.35rem 1.1rem 1.15rem;
    }

    .anuncios-upload-grid {
        grid-template-columns: 1fr;
    }
}
