:root {
    --bg: #e3e3e3;
    --text: #111;
    --card: #f5f5f5;
    --hero-card-bg: #ffffff;
    --hero-card-text: #111;
    --sidebar-bg: #f0f0f0;
    --sidebar-text: #111;
    --sidebar-item: #e0e0e0;
    --sidebar-inicio: #bbbbbb;
    --accent: #b8860b;
    --border: rgba(255,255,255,0.08);
}

body.dark {
    --bg: #272727;
    --text: #fff;
    --card: #272727;
    --hero-card-bg: #1c1c1c;
    --hero-card-text: #fff;
    --sidebar-bg: #1a1a1a;
    --sidebar-text: #fff;
    --sidebar-item: #2a2a2a;
    --sidebar-inicio: #3e3e3e;
    --border: rgba(255,255,255,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    transition: background 0.3s, color 0.3s;
    overflow-y: auto;
}

#content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
}

main {
    background: var(--hero-card-bg);
    color: var(--hero-card-text);
    border-radius: 24px 24px 0 0;
    margin-top: -20px;
    position: relative;
    z-index: 5;
    padding: 28px 24px 80px;
    flex: 1;
}

body.no-hero main {
    border-radius: 24px 24px 0 0;
    margin-top: -20px;
    padding-top: 80px;
    flex: 1;
}

/* ── HERO ── */
.hero {
    position: relative;
    width: 100%;
    height: 56vw;
    max-height: 460px;
    min-height: 220px;
    overflow: hidden;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    display: block;
    transition: opacity 0.6s ease;
}

.hero-card {
    background: var(--hero-card-bg);
    color: var(--hero-card-text);
    border-radius: 24px 24px 0 0;
    margin-top: -20px;
    position: relative;
    z-index: 5;
    padding: 28px 24px 32px;
}

.hero-card h1 { color: var(--hero-card-text); }

/* ── NAVBAR ── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: none;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 1000;
    background: transparent;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background: var(--bg);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgb(0, 0, 0);
}

.navbar-brand img {
    margin-top: 12px;
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.navbar-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 0 12px;
    gap: 8px;
}

.navbar-search input {
    border: none;
    outline: none;
    width: 100%;
    padding: 8px 0;
    font-size: 0.95rem;
    background: transparent;
    color: #111;
}

.navbar-search .navbar-btn {
    background: transparent;
    border: none;
    outline: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.navbar-menu-btn {
    color: var(--sidebar-text);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

/* ── SEARCH BOX (móvil) ── */
.search-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    transform: translateY(-100%);
    transition: transform 0.35s ease;
    z-index: 3000;
}

.search-box.active { transform: translateY(0); }

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border-radius: 16px;
    padding: 8px 12px;
}

.search-bar input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
}

.search-bar .icon-btn {
    background: transparent;
    padding: 6px;
    color: var(--text);
    flex-shrink: 0;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    margin-left: 20px;
}

/* ── TOPBAR MÓVIL ── */
.hero-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    z-index: 100;
}

.hero-topbar .brand {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

body.no-hero .hero-topbar {
    position: relative;
    background: var(--bg);
}

body.no-hero .hero-topbar .brand {
    color: var(--text);
    text-shadow: none;
}


.brand img {
    display: flex;
    margin-top: 12px;
    width: 50px;
    margin-right: 10px;
}

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100%;
    background: var(--sidebar-bg);
    transition: left 0.3s ease;
    padding: 28px 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar.active { left: 0; }

.sidebar h3 {
    color: var(--sidebar-text);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.45;
}

.sidebar a {
    display: block;
    padding: 14px 16px;
    background: var(--sidebar-item);
    border-radius: 10px;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar a:hover, .sidebar a.active {
    background: var(--sidebar-inicio);
}

.sidebar-theme-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sidebar-item);
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--sidebar-text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.sidebar-theme-btn:hover { background: var(--bg); }

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--bg);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--sidebar-item);
    border-radius: 10px;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.95rem;
}

.sidebar-logout {
    display: none;
    margin-top: 10px;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    background: #ff3b3b;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    z-index: 1900;
}

#overlay.active { display: block; }

/* ── POSTS ── */
.post-container { min-height: 50vh; }

.post-card {
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    color: var(--sidebar-text);
    max-width: 850px;
    margin: 20px auto;
}

.post-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 25px;
    flex: 1.2;
    display: flex;
    flex-direction: column;
}

.user-meta {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.user-name {
    font-weight: bold;
    font-size: 1rem;
}

.post-tag {
    background-color: #3474d4;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #fff;
    align-self: flex-start;
}

.post-title {
    font-size: 1.8rem;
    margin: 15px 0 5px 0;
}

.post-date {
    color: #888;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 15px;
}

.post-description {
    color: var(--sidebar-text);
    line-height: 1.5;
    margin-bottom: 20px;
}

.post-action {
    background: #3474d4;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
    margin-left: auto;
}

body.dark .post-action {
    background: #3474d4;
    color: #fff;
}

.post-action:hover { opacity: 0.8; }

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.post-reaction {
    margin-top: auto;
    display: flex;
}

/* ── FIRE REACTION ── */
.fire-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}

.fire-btn.active { color: #ff6b00; }

.fire-icon {
    width: 22px;
    height: 22px;
}

.fire-main {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: 0.2s;
}

.fire-core {
    fill: transparent;
    transition: 0.2s;
}

.fire-btn.active .fire-main {
    fill: #ff6b00;
    stroke: #ff6b00;
}

.fire-btn.active .fire-core { fill: #ffd166; }

.fire-btn.active .fire-icon {
    animation: pop 0.35s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.fire-count {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* ── COMMENTS (dentro de post-card) ── */
.post-card .comments-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.post-card .comments-section > br { display: none; }

.post-card .comments-section > div { margin-top: 8px; }

.post-card .comments-section > div:first-child { margin-top: 0; }

.comment-input-box {
    display: flex;
    gap: 8px;
}

.comment-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    outline: none;
    background: var(--card);
    color: var(--text);
    min-width: 0;
    font-size: 0.85rem;
    transition: box-shadow 0.2s;
}

.comment-input:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

.comment-send {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: #29af00;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.comment-send:hover { opacity: 0.85; }

.comment-send:active { transform: scale(0.96); }

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.post-card .comment {
    background: var(--card);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.post-card .comment b { font-weight: 600; }

.comment-user {
    font-weight: 600;
    margin-right: 6px;
}

.btn-ver-mas {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-ver-mas:hover { background: rgba(255,255,255,0.12); }

/* ── COMMENTS (página independiente comentarios.html) ── */
.page-comments {
    max-width: 700px;
    margin: 0 auto;
}

.page-comments .post-card {
    flex-direction: column;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.back-link:hover { opacity: 0.7; }

.page-comments .comments-section {
    margin: 0 0 40px;
    padding: 0;
}

.page-comments .comments-section .comment-input-box {
    margin-bottom: 20px;
}

.comments-title {
    font-size: 1.1rem;
    margin: 28px 0 16px;
    opacity: 0.8;
    font-weight: 600;
}

.page-comments .comment {
    display: flex;
    gap: 12px;
    margin: 0 0 10px;
    padding: 12px 14px;
    background: var(--card);
    border-radius: 10px;
}

.page-comments .comment .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.page-comments .comment b {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 2px;
}

.page-comments .comment p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.85;
    line-height: 1.4;
}

/* ── SECTIONS (index) ── */
.intro-section {
    max-width: 1000px;
    margin: 0 auto 48px;
}

.intro-section h1 {
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.intro-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.8;
}

.section {
    padding: 40px 0;
}

.section h2 {
    font-size: 1.8rem;
    margin-bottom: 32px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.hero-grid .hero-card {
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
    padding: 0;
}

.hero-grid .hero-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.hero-content {
    padding: 24px;
}

.badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.hero-content h1 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.5;
}

.yskrow-list {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.blog-card-heading-wrapper {
    background: transparent;
    border-radius: 14px;
    transition: transform 0.2s;
}

.blog-card-heading-wrapper:hover {
    transform: translateY(-2px);
}

.blog-card-heading {
    display: block;
    padding: 18px 20px;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}

.text-200 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.blog-card-heading h3 {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.85;
    transition: color 0.2s, transform 0.2s;
}

.blog-card-heading:hover h3 {
    color: #38bdf8;
    transform: translateX(5px);
}

.grid-services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.service-item {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.2s;
}

.service-item:hover {
    transform: translateY(-3px);
}

.service-item h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.service-item p {
    font-size: 0.9rem;
    opacity: 0.7;
    line-height: 1.5;
}

/* ── PORTFOLIO (portafolio.html) ── */
.portfolio-heading {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.repositorios {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.repo {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--card);
    transition: border-color 0.2s;
}

.repo:hover {
    border-color: rgba(255,255,255,0.2);
}

.repo-header {
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.repo-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.repo-header span {
    font-size: 0.75rem;
    opacity: 0.5;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.repo.active .repo-header span {
    transform: rotate(180deg);
}

.repo-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.repo.active .repo-content {
    max-height: 5000px;
    padding: 0 20px 20px;
}

.repo-content h4 {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 16px 0 6px;
}

.repo-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.8;
}

.repo-content ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.repo-content li {
    background: var(--bg);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    opacity: 0.8;
}

/* ── SKELETON ── */
.skeleton {
    height: 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 10px;
    opacity: 0.7;
}

/* ── GRID / CARDS (portafolio) ── */
.grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
}

.card {
    display: flex;
    background-color: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    height: 160px;
    transition: transform 0.2s;
    align-items: stretch;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

.card-image {
    flex: 0 0 150px;
    background-color: #4facfe;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    flex: 1;
    padding: 15px 20px;
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.card-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.card-content p {
    margin: 0;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── BOTTOM NAV (móvil) ── */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    height: 60px;
    background: var(--bg);
    justify-content: space-around;
    align-items: center;
    z-index: 1500;
}

.bottom-nav button {
    background: var(--bg);
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 10px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.bottom-nav button:hover { opacity: 1; }

.bottom-nav a {
    color: var(--sidebar-text);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

/* ── CONTACT ── */
.contact-section {
    padding: 40px;
    border-radius: 30px;
    color: var(--sidebar-text);
    max-width: 900px;
    margin: 20px auto;
    min-height: 100vh;
}

.contact-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: bold;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--sidebar-text);
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-item:hover {
    opacity: 0.8;
    transform: translateX(4px);
}

.contact-item i {
    font-size: 24px;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
}

.contact-item span {
    font-size: 1.2rem;
    font-weight: 400;
}

.fa-envelope { color: #00E5A0; }
.fa-instagram { color: #E1306C; }
.fa-whatsapp { color: #25D366; }

/* ── LOGIN / PERFIL ── */
.login-section {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-box input {
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--card);
    color: var(--text);
}

.login-btn {
    background: #3474d4;
    color: #fff;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.signup-btn {
    background: transparent;
    border: 1px solid #3474d4;
    color: #3474d4;
    padding: 10px;
    border-radius: 10px;
}

.google-btn {
    background: #fff;
    color: #111;
    padding: 10px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

.divider { text-align: center; opacity: 0.5; }

.profile-section {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.profile-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    padding: 30px 20px;
    border-radius: 20px;
    text-align: center;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.profile-card h2 { margin-bottom: 5px; }

.profile-card p {
    opacity: 0.6;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.logout-btn {
    background: #ff3b3b;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
}

/* ── CREATE POST FORM ── */
.create-post {
    max-width: 500px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-post h3 { margin-bottom: 4px; }

.create-post input,
.create-post textarea {
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: var(--card);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}

.create-post textarea {
    min-height: 100px;
    resize: vertical;
}

.create-post button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.create-post button:hover { opacity: 0.8; }

/* ── BLOQUES (admin-portfolio) ── */
#bloques {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 10px 0;
}

.bloque {
    background: var(--card);
    border-radius: 12px;
    padding: 14px 16px;
}

.bloque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bloque-header label {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.7;
}

.bloque-remove {
    background: none;
    border: none;
    color: var(--text);
    opacity: 0.4;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: opacity 0.2s, background 0.2s;
}

.bloque-remove:hover {
    opacity: 1;
    background: rgba(255,0,0,0.15);
}

.bloque textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    font-family: inherit;
}

.bloque input[type="file"] {
    font-size: 0.85rem;
}

.bloque-img-preview img {
    max-width: 200px;
    display: block;
    margin-top: 8px;
    border-radius: 8px;
}

.tabla-editable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tabla-editable th,
.tabla-editable td {
    border: 1px solid rgba(255,255,255,0.12);
    padding: 8px 10px;
    text-align: left;
}

.tabla-editable th {
    background: rgba(255,255,255,0.05);
    font-weight: 600;
}

.tabla-editable td {
    background: transparent;
}

/* ── COMMENTS CONTAINER (comentarios.html) ── */
.comments-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state {
    opacity: 0.5;
    font-size: 0.9rem;
    text-align: center;
    padding: 24px 0;
}

.comments-container .comment {
    background: var(--card);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* ── ADMIN POSTS ── */
.admin-posts {
    max-width: 700px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-header h2 {
    font-size: 1.3rem;
    margin: 0;
}

.btn-create {
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-create:hover { opacity: 0.8; }

.admin-post {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.admin-post.archived {
    opacity: 0.65;
}

.admin-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
}

.admin-post-header h3 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.admin-post-status {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg);
}

.admin-post-arrow {
    font-size: 0.7rem;
    opacity: 0.4;
    transition: transform 0.3s ease;
}

.admin-post-body {
    max-height: 0;
    overflow: hidden;
    padding: 0 18px;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.admin-post-body.open {
    max-height: 800px;
    padding: 0 18px 18px;
}

.admin-post-body label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 14px;
    margin-bottom: 4px;
}

.admin-post-body input[type="text"],
.admin-post-body textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}

.admin-post-body textarea {
    min-height: 80px;
    resize: vertical;
}

.current-image {
    display: block;
    max-width: 200px;
    max-height: 120px;
    border-radius: 8px;
    margin-bottom: 8px;
    object-fit: cover;
}

.admin-post-body input[type="file"] {
    font-size: 0.82rem;
}

.admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-save {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-save:hover { opacity: 0.8; }

.btn-archive {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-archive:hover { opacity: 0.7; }

.btn-delete {
    background: #ff3b3b;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-left: auto;
}

.btn-delete:hover { opacity: 0.8; }

/* ── ADMIN FAB ── */
.admin-fab {
    position: fixed;
    bottom: 76px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1600;
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
    transition: opacity 0.2s, transform 0.2s;
    text-decoration: none;
}

.admin-fab:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.admin-fab.visible {
    display: flex;
}

@media(min-width: 768px) {
    .admin-fab {
        bottom: 30px;
    }
}

/* ── MODAL ── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.modal-content {
    background: var(--card);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 480px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.modal-close:hover { opacity: 1; }

.modal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    margin-bottom: 10px;
}

.modal-content textarea {
    resize: vertical;
}

/* ── LOAD MORE ── */
.load-more-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.load-more-btn:hover { opacity: 0.8; }

/* ── DESKTOP ── */
@media(min-width: 768px) {
    .navbar { display: flex; }
    .hero-topbar { display: none; }
    .bottom-nav { display: none; }

    .hero {
        height: 52vw;
        max-height: 500px;
    }

    .hero-card {
        margin-top: -32px;
        padding: 36px 48px 40px;
        border-radius: 32px 32px 0 0;
    }

    .hero-card h1 { font-size: 2.4rem; }

    .grid {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: none;
        margin: 0;
        width: 100%;
    }

    .card { width: calc(33.33% - 14px); }

    .post-card {
        flex-direction: row;
        align-items: stretch;
    }

    .post-image {
        width: 50%;
        min-height: auto;
    }

    main {
        padding-bottom: 32px;
    }
}

@media (max-width: 640px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .card { height: 120px; }
    .card-image { flex: 0 0 110px; }
    .card-content h3 { font-size: 1rem; }
    .card-content p { font-size: 0.8rem; }
}

