/* ============================================================
   Sistema de diseño "Clásico" — tomado de la referencia
   DISEÑO_DESEADO: Cormorant Garamond (títulos) + Lora (cuerpo),
   paleta crema/dorado, tarjetas con borde fino, fotos "plate".
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&family=Lora:wght@400;600&display=swap');

:root {
    --color-bg: #f3f2f2;
    --color-surface: #eae9e9;
    --color-text: #201f1d;
    --color-accent: #b68235;
    --color-accent-2: #ac803e;
    --color-divider: rgba(32, 31, 29, 0.16);

    --color-neutral-100: #f8f4f4;
    --color-neutral-900: #2d2b2b;

    --color-accent-100: #fff3e4;
    --color-accent-700: #7d5411;
    --color-accent-800: #5a3b0a;
    --color-accent-900: #3a270d;

    --font-heading: "Cormorant Garamond", Georgia, serif;
    --font-heading-weight: 600;
    --font-body: "Lora", Georgia, serif;

    --space-1: 4.6px; --space-2: 9.2px; --space-3: 13.8px;
    --space-4: 18.4px; --space-5: 23px; --space-6: 27.6px;
    --space-8: 36.8px; --space-10: 46px;

    --radius-sm: 2px; --radius-md: 4px; --radius-lg: 7px;

    --shadow-sm: 0 1px 2px rgba(45,43,43,0.14);
    --shadow-md: 0 3px 10px rgba(45,43,43,0.16);
    --shadow-lg: 0 12px 32px rgba(45,43,43,0.22);
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); font-size: 15px; line-height: 1.6; text-wrap: pretty; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2); }
h1 { font-size: 42px; } h2 { font-size: 32px; } h3 { font-size: 22px; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-700); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-900); text-decoration: underline; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }
.eyebrow { display: block; font-family: var(--font-body); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent-700); margin-bottom: var(--space-2); }
.text-muted { color: rgba(32,31,29,0.6); }

.hr { height: 1px; border: 0; margin: var(--space-4) 0; background: var(--color-divider); }

/* — fotos con marco "plate" — */
.plate { filter: sepia(0.18) saturate(0.85) contrast(1.04); box-sizing: border-box; border: 6px solid var(--color-surface); outline: 1px solid var(--color-divider); }
.plate img { width: 100%; height: 100%; object-fit: cover; }

/* — botones — */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; text-decoration: none;
    font-family: var(--font-heading); font-weight: var(--font-heading-weight);
    font-size: 15px; line-height: 1.2; color: var(--color-text);
    background: transparent; border: 1px solid transparent;
    padding: 10px 18px; border-radius: var(--radius-md);
    transition: background .15s, border-color .15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: rgba(182,130,53,0.12); text-decoration: none; }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: rgba(32,31,29,0.07); text-decoration: none; }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: rgba(182,130,53,0.10); text-decoration: none; }
.btn-danger { color: #a33; border-color: rgba(170,51,51,0.4); }
.btn-danger:hover { background: rgba(170,51,51,0.08); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* — formularios — */
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-size: 12px; margin-bottom: 6px; color: rgba(32,31,29,0.7); font-family: var(--font-body); font-weight: 600; }
.field-hint { display: block; margin-top: 6px; font-size: 11px; color: rgba(32,31,29,0.55); }
.input, .field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=url], .field input[type=tel], .field input[type=file], .field textarea {
    width: 100%; min-height: 40px; padding: 8px 12px; font: inherit; font-size: 14px;
    color: var(--color-text); background: #fff;
    border: 1px solid var(--color-divider); border-radius: var(--radius-md);
    transition: border-color .15s;
}
.field input:hover, .field textarea:hover { border-color: rgba(32,31,29,0.45); }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.field textarea { min-height: 100px; resize: vertical; }

/* — tarjetas — */
.card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: transparent; border: 1px solid var(--color-divider); }
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 18px; line-height: 1.2; }
.card-body { margin: 0; font-size: 13.5px; opacity: 0.82; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: rgba(32,31,29,0.5); }
.elev-sm { box-shadow: var(--shadow-sm); }

/* — navegación — */
.nav { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); }
.nav-brand { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 18px; margin-right: auto; }
.nav a:not(.btn) { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:not(.btn):hover { color: var(--color-accent); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 460px; display: flex; align-items: flex-end; background: linear-gradient(135deg, #4a3419, #7d5411); background-size: cover; background-position: center; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(45,43,43,0.15) 0%, rgba(45,43,43,0.78) 100%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; width: 100%; padding: 56px clamp(20px,4vw,48px) 48px; display: flex; gap: var(--space-6); align-items: flex-end; flex-wrap: wrap; }
.hero-avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--color-bg); box-shadow: var(--shadow-md); }
.hero-text { flex: 1; min-width: 260px; color: #fff; }
.hero-text .eyebrow { color: rgba(255,255,255,0.75); }
.hero-text h1 { font-size: clamp(34px, 5vw, 54px); color: #fff; margin-bottom: var(--space-3); }
.hero-text .bio { font-size: 16px; line-height: 1.6; max-width: 56ch; color: rgba(255,255,255,0.9); margin-bottom: var(--space-5); }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero-actions .btn-secondary { color: #fff; border-color: rgba(255,255,255,0.55); }
.hero-actions .btn-secondary:hover { background: rgba(255,255,255,0.12); }

/* ---------- Secciones ---------- */
section.block { padding: var(--space-10) 0; }
.section-head { margin-bottom: var(--space-6); }
.section-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }

.about-grid { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); gap: var(--space-8); align-items: center; }
.about-grid blockquote { font-family: var(--font-heading); font-size: 21px; font-style: italic; margin: var(--space-5) 0 0; padding-left: var(--space-4); border-left: 1px solid var(--color-accent); }
.about-photo { width: 100%; aspect-ratio: 4/5; }
.about-photo-placeholder { width: 100%; aspect-ratio: 4/5; background: var(--color-surface); display: flex; align-items: center; justify-content: center; color: rgba(32,31,29,0.4); font-size: 13px; text-align: center; padding: 20px; }

.areas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }

.posts-grid-classic { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
.post-card-classic { border: 1px solid var(--color-divider); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; }
.post-card-classic .post-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.post-card-classic .post-inner { padding: var(--space-4); }
.post-card-classic p { font-size: 14.5px; line-height: 1.6; color: rgba(32,31,29,0.85); margin: var(--space-2) 0 var(--space-3); }

.gallery-grid-public { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.gallery-grid-public .plate { aspect-ratio: 1/1; }

.contact-grid-classic { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); gap: var(--space-8); }
.contact-side { display: grid; gap: var(--space-5); align-self: start; }
.contact-side .card p { font-size: 14.5px; margin: 0 0 var(--space-2); display: flex; align-items: center; gap: var(--space-2); }

footer.site-footer { padding: var(--space-8) 0 var(--space-6); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.footer-grid .brand { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 18px; margin-bottom: var(--space-2); }
.footer-grid p { font-size: 14px; line-height: 1.6; color: rgba(32,31,29,0.7); margin: 0; }
.footer-grid .label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-accent-700); margin-bottom: var(--space-2); }
.footer-social { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.footer-bottom { font-size: 13px; text-align: center; color: rgba(32,31,29,0.55); padding: var(--space-4) 0 var(--space-6); }

.empty-state { color: rgba(32,31,29,0.5); font-style: italic; font-size: 14px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-body { background: var(--color-bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; font-family: var(--font-body); }
.admin-card { background: #fff; border: 1px solid var(--color-divider); padding: 44px 40px; border-radius: var(--radius-lg); width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.admin-card h1 { font-size: 28px; margin: 0 0 8px; }
.admin-card .sub { color: rgba(32,31,29,0.6); font-size: 14px; margin: 0 0 26px; }
.admin-card .back-link { display: inline-block; margin-top: 18px; font-size: 13px; color: rgba(32,31,29,0.6); }
.admin-card .back-link:hover { color: var(--color-accent); }

.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-left: 38px; }
.input-icon-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.6; font-size: 0.9rem; pointer-events: none; }

.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 18px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-ok { background: #f0f7ec; color: #3d6b2c; border: 1px solid #c9e2ba; }
.alert-err { background: #fbeeee; color: #a33; border: 1px solid #f0caca; }

.dash-shell { display: flex; min-height: 100vh; width: 100%; background: var(--color-bg); font-family: var(--font-body); }
.dash-sidebar { width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--color-divider); padding: 28px 18px; display: flex; flex-direction: column; justify-content: space-between; position: sticky; top: 0; height: 100vh; }
.dash-brand { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 19px; color: var(--color-accent-700); margin-bottom: 28px; padding: 0 6px; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-md); color: rgba(32,31,29,0.65); font-size: 14px; font-weight: 600; transition: background .15s, color .15s; }
.dash-nav a:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.dash-nav a.active { background: var(--color-accent-100); color: var(--color-accent-800); }

.dash-main { flex: 1; min-width: 0; }
.dash-topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 40px; border-bottom: 1px solid var(--color-divider); position: sticky; top: 0; background: rgba(243,242,242,0.9); backdrop-filter: blur(8px); z-index: 5; }
.dash-topbar h1 { margin: 0; font-size: 22px; }
.dash-content { max-width: 780px; padding: 32px 40px 90px; }

.panel { background: #fff; border: 1px solid var(--color-divider); padding: 26px 30px; border-radius: var(--radius-lg); margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.panel h2 { margin: 0; font-size: 21px; }
.panel .panel-desc { color: rgba(32,31,29,0.6); font-size: 13.5px; margin: 4px 0 18px; line-height: 1.55; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field-grid .field.full { grid-column: 1 / -1; }

.photo-row { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.current-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-accent); flex-shrink: 0; }
.current-cover, .current-about { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--color-divider); margin-bottom: 14px; }
.no-cover-placeholder { width: 100%; height: 140px; border-radius: var(--radius-md); margin-bottom: 14px; background: linear-gradient(135deg, #4a3419, #7d5411); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.8); font-size: 13px; }

.link-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--color-divider); }
.link-row:last-of-type { border-bottom: none; }
.link-row .icon-badge { width: 32px; height: 32px; border-radius: 50%; background: var(--color-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.95rem; }
.link-row .info { min-width: 0; flex: 1; }
.link-row .info strong { display: block; font-size: 14px; }
.link-row .info span { display: block; color: rgba(32,31,29,0.55); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row form { margin-left: auto; flex-shrink: 0; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.gallery-item { position: relative; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-divider); background: var(--color-bg); }
.gallery-item img { width: 100%; height: 108px; object-fit: cover; }
.gallery-item .gallery-controls { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 6px 8px; background: #fff; }
.gallery-item .gallery-controls .order-btns { display: flex; gap: 4px; }

.divider-label { display: flex; align-items: center; gap: 12px; color: rgba(32,31,29,0.5); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 14px; }
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--color-divider); }

.sync-log { white-space: pre-wrap; margin-top: 14px; color: rgba(32,31,29,0.65); font-size: 12.5px; background: var(--color-bg); padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--color-divider); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .about-grid, .contact-grid-classic { grid-template-columns: 1fr; }
    .areas-grid { grid-template-columns: 1fr 1fr; }
    .posts-grid-classic { grid-template-columns: 1fr; }
    .gallery-grid-public { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; gap: var(--space-5); }
}
@media (max-width: 860px) {
    .dash-shell { flex-direction: column; }
    .dash-sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; padding: 14px 18px; }
    .dash-brand { margin: 0 18px 0 0; }
    .dash-nav { flex-direction: row; overflow-x: auto; }
    .dash-topbar, .dash-content { padding-left: 20px; padding-right: 20px; }
    .field-grid { grid-template-columns: 1fr; }
    .areas-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .hero-inner { text-align: left; }
    .gallery-grid-public { grid-template-columns: repeat(2, 1fr); }
}
