:root {
    --bg: #f7f7f3;
    --surface: #ffffff;
    --surface-soft: #eef1eb;
    --surface-dark: #121212;
    --text: #161616;
    --muted: #5c5c5c;
    --border: #dadad2;
    --accent: #0f6d4c;
    --accent-dark: #0c553c;
    --danger: #9b2226;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    --radius: 22px;
    --max-width: 1180px;
    --admin-offset: 0px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

body.is-admin {
    --admin-offset: 62px;
}

img {
    max-width: 100%;
    display: block;
}

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

.wrapper {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
}

.wrapper.narrow {
    width: min(calc(100% - 32px), 980px);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #111;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-topbar__inner {
    width: min(calc(100% - 32px), var(--max-width));
    min-height: 62px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar__inner span {
    color: rgba(255, 255, 255, 0.72);
    margin-left: 10px;
    font-size: 0.95rem;
}

.admin-topbar__actions {
    display: flex;
    gap: 10px;
}

.site-nav {
    position: sticky;
    top: var(--admin-offset);
    z-index: 900;
    background: rgba(247, 247, 243, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-inner {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.nav-links a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: 0.2s ease;
}

.nav-links a:hover {
    background: #fff;
    color: var(--text);
}

.nav-links .nav-login {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-weight: 700;
}

.nav-links .nav-login:hover {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
}

.nav-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 1rem;
}

.hero {
    padding: 60px 0 42px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 26px;
    align-items: stretch;
}

.hero-copy,
.hero-media {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.hero-copy {
    padding: clamp(8px, 2vw, 18px) 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 4.4vw, 4.4rem);
    line-height: 1.03;
}

.hero-text {
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    color: var(--muted);
    max-width: 64ch;
}

.hero-media {
    min-height: 360px;
    overflow: hidden;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    padding: 40px;
    color: var(--muted);
    text-align: center;
    background: linear-gradient(135deg, #f3f5ef, #e8efe7);
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent);
}

.content-section {
    padding: 34px 0;
}

.content-section .wrapper {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: clamp(20px, 3vw, 30px) 0;
}

.content-section + .content-section .wrapper {
    border-top: 1px solid var(--border);
}

.bg-soft .wrapper,
.bg-dark .wrapper {
    background: transparent;
    color: inherit;
    border-color: var(--border);
}

.bg-dark .eyebrow,
.bg-dark p,
.bg-dark li,
.bg-dark h2,
.bg-dark h3,
.bg-dark a {
    color: inherit;
}

.section-head {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.4rem);
}

.section-title-input {
    width: min(100%, 720px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.85);
}

.content-grid {
    display: grid;
    gap: 20px;
}

.content-grid.cols-1 {
    grid-template-columns: 1fr;
}

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

.content-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-card {
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.content-card p:first-child,
.content-card h2:first-child,
.content-card h3:first-child,
.content-card ul:first-child {
    margin-top: 0;
}

.content-card p,
.content-card li {
    font-size: 1.05rem;
}

.content-card ul,
.content-card ol {
    padding-left: 22px;
}

.inline-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
    margin: 12px auto;
}

.inline-image.img-size-small {
    width: min(220px, 100%);
}

.inline-image.img-size-medium {
    width: min(420px, 100%);
}

.inline-image.img-size-large {
    width: 100%;
}

.inline-image.img-align-left {
    margin-left: 0;
    margin-right: auto;
}

.inline-image.img-align-center {
    margin-left: auto;
    margin-right: auto;
}

.inline-image.img-align-right {
    margin-left: auto;
    margin-right: 0;
}

.inline-image.is-selected {
    outline: 3px solid rgba(15, 109, 76, 0.35);
    outline-offset: 4px;
}

.site-footer {
    padding: 34px 0 48px;
    color: var(--muted);
}

.site-footer .wrapper {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-light {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.btn-light:hover {
    background: #f5f5f5;
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.full {
    width: 100%;
}

.flash {
    border-radius: 16px;
    padding: 14px 18px;
    margin: 18px 0 10px;
    border: 1px solid var(--border);
    background: #fff;
}

.flash.success {
    border-color: rgba(15, 109, 76, 0.22);
    background: #eef9f4;
}

.flash.error {
    border-color: rgba(155, 34, 38, 0.22);
    background: #fff2f2;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-wrapper {
    width: min(100%, 460px);
}

.login-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 0 0 12px;
}

.login-card label,
.admin-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card input,
.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    background: #fff;
    margin-bottom: 16px;
}

.muted,
.credentials,
.toolbar-note {
    color: var(--muted);
}

.admin-block {
    padding: 0 0 22px;
}

.admin-block .wrapper {
    background: transparent;
    padding: 0;
    border: 0;
    box-shadow: none;
}

.admin-block details {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

.admin-block summary {
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.admin-block summary::-webkit-details-marker {
    display: none;
}

.admin-form {
    margin-top: 18px;
}

.admin-grid-two,
.admin-grid-three {
    display: grid;
    gap: 16px;
}

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

.admin-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full-width {
    grid-column: 1 / -1;
}

.admin-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-actions-row.compact {
    justify-content: flex-start;
}

.editor-toolbar[hidden] {
    display: none !important;
}

.editor-toolbar {
    position: sticky;
    top: calc(var(--admin-offset) + 88px);
    z-index: 120;
}

.editor-toolbar-slot {
    display: none;
    margin-bottom: 12px;
}

.editor-toolbar-slot.is-active {
    display: block;
}

.toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
    padding: 12px;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 2px;
}

.editor-toolbar button {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    min-height: 40px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
}

.editor-toolbar button:hover {
    border-color: #bfc5b9;
    background: #f8f8f6;
}

.editable-area {
    min-height: 180px;
    border: 2px dashed transparent;
    border-radius: 18px;
    padding: 12px;
    outline: none;
    background: rgba(255, 255, 255, 0.65);
}

.editable-area:empty::before {
    content: 'Escribe aquí el contenido...';
    color: #9a9a9a;
}

.editable-area.is-active,
.editable-area:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
}

.editable-area img {
    max-width: 100%;
    height: auto;
    display: block;
}

.editable-area h1,
.editable-area h2,
.editable-area h3,
.editable-area p {
    margin-top: 0;
}

.editor-panel {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
}

.checkbox-wrap {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}


.hero-media img {
    border-radius: 0;
}

body:not(.is-admin) .hero {
    padding-bottom: 22px;
}

body:not(.is-admin) .section-head {
    margin-bottom: 16px;
}

body:not(.is-admin) .content-grid {
    gap: 18px;
}

@media (max-width: 980px) {
    .hero-grid,
    .content-grid.cols-2,
    .content-grid.cols-3,
    .admin-grid-three,
    .admin-grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 16px;
        right: 16px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: var(--shadow);
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .nav-login {
        text-align: center;
    }

    .section-head {
        flex-direction: column;
    }
}


@media (max-width: 720px) {
    .editor-actions-sticky .admin-actions-row {
        width: 100%;
    }

    .editor-actions-sticky .btn {
        width: 100%;
    }

    .toolbar-divider {
        display: none;
    }
}
