/* Global reset */
html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global font */
* {
    font-family: 'Montserrat', 'M PLUS Rounded 1c', sans-serif;
}

/* Menu Component */
.menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.menu-light {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.menu-dark {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.menu-left {
    display: flex;
    align-items: center;
}

.logo {
    display: block;
}

.logo img {
    height: 30px;
    width: auto;
}

.menu-dark .logo img {
    filter: invert(1);
}

.menu-brand {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
}

.menu-dark .menu-brand {
    color: #9ca3af;
}

.menu-right {
    display: flex;
    align-items: center;
}

.menu-items {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.menu-items a {
    text-decoration: none;
    color: #374151;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s;
}

.menu-dark .menu-items a {
    color: #e5e7eb;
}

.menu-items a:hover {
    color: #111827;
}

.menu-dark .menu-items a:hover {
    color: #ffffff;
}

.menu-items a.active {
    color: #2563eb;
    font-weight: 600;
}

.menu-dark .menu-items a.active {
    color: #60a5fa;
}

/* Instagram icon placeholder */
.instagram-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #374151;
    transition: color 0.2s;
}

.menu-dark .instagram-icon {
    color: #e5e7eb;
}

.instagram-icon:hover {
    color: #e1306c;
}

/* Main content container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Theme body */
body.theme-dark {
    background: #000000;
    color: #e5e7eb;
}

body.theme-light {
    background: #ffffff;
    color: #111827;
}

/* Posts grid */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Post card: imagen protagonista, pie sutil */
.post-card {
    transition: transform 0.2s;
}

.post-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-card img {
    display: block;
    width: 100%;
    height: auto;
}

.post-card-caption {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.75rem 0.25rem 0;
    flex-wrap: wrap;
}

.post-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #c2c7cf;
    line-height: 1.4;
}

.theme-dark .post-card-title {
    color: #cfd4dc;
}

.post-card-ref {
    font-size: 0.9rem;
    font-weight: 700;
    color: #a6a9ad;
}

.theme-dark .post-card-ref {
    color: #a6a9ad;
}

.post-card-ref-num {
    font-size: 1.05rem;
}

/* Post detail: título + ref en línea, imagen, navegación */
.post-detail {
    max-width: 800px;
    margin: 2rem auto 0;
    text-align: left;
}

footer {
    margin-top: 3rem;
}

footer .menu {
    border-top: 1px solid #e9ecef;
    border-bottom: none;
}

footer .menu.menu-dark {
    border-top-color: #333;
}

.post-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 800px;
}

.post-head h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #6b7280;
}

.theme-dark .post-head h1 {
    color: #8b91a0;
}

.post-ref {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.theme-dark .post-ref {
    color: #e5e7eb;
}

.post-featured {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 2rem;
}

.post-detail .content {
    margin: 0 auto;
    max-width: 800px;
}

.post-detail .content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
}

.post-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.post-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: transparent;
    color: #374151;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.theme-dark .post-nav-link {
    border-color: #4b5563;
    color: #e5e7eb;
}

.post-nav-link:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.post-nav-link.is-disabled {
    color: #c2c7cf;
    cursor: default;
    pointer-events: none;
}

.theme-dark .post-nav-link.is-disabled {
    color: #4b5563;
}

.post-share {
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: transparent;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.theme-dark .post-share {
    border-color: #4b5563;
    color: #e5e7eb;
}

.post-share:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* Error 404 */
.error-page {
    max-width: 800px;
    margin: 4rem auto;
    text-align: center;
}

.error-code {
    font-size: 4rem;
    font-weight: 800;
    margin: 0;
}

.error-message {
    color: #6b7280;
    margin: 0.5rem 0 2rem;
}

.theme-dark .error-message {
    color: #9ca3af;
}

.error-home {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.error-home:hover {
    background: #1d4ed8;
}

/* Páginas legales */
.legal {
    max-width: 800px;
    margin: 2rem auto 0;
}

.legal h2 {
    margin-top: 2rem;
    font-size: 1.1rem;
}

.legal h3 {
    margin-top: 1.5rem;
    font-size: 1rem;
}

.legal p {
    line-height: 1.6;
    text-align: justify;
}

.legal a {
    color: #2563eb;
}

.legal-list {
    line-height: 1.6;
    padding-left: 1.25rem;
}

/* Load more button */
#load-more {
    display: block;
    margin: 2rem auto;
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

#load-more:hover {
    background: #1d4ed8;
}
