/* Panel de redacción — mismo tema «Zafra» que el sitio */
:root {
  --ink: #0F1E17; --text: #33403A; --muted: #5B6660; --paper: #F7F5EF; --bg: #EFECE3;
  --line: #DCD7C9; --cane: #1E5B3A; --red: #C41E2E; --red-deep: #7E1520; --gold: #E3B23C;
  --on-dark: #F7F5EF; --on-dark-muted: #B9C2BC;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: Archivo, 'Helvetica Neue', sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); }
a { color: var(--ink); }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
img { max-width: 100%; display: block; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=search],
input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; border: 1px solid #C9C3B3; background: #fff; padding: 8px 10px;
  font: 500 15px var(--body); color: var(--ink); border-radius: 0;
}
textarea { resize: vertical; }
.narrow { max-width: 110px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 0; font: 700 16px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn--sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn--red { background: var(--red); color: var(--on-dark); }
.btn--red:hover { background: var(--red-deep); color: var(--on-dark); }
.btn--outline { border: 2px solid var(--ink); background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--on-dark); }
.linkish { background: none; border: 0; padding: 8px 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }
.linkish--red { color: var(--red); }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 230px; max-width: 100%; background: var(--ink); color: var(--on-dark); padding: 22px 14px; display: flex; flex-direction: column; gap: 18px; }
.side__brand { font: 800 24px/1 var(--display); text-transform: uppercase; color: var(--on-dark); text-decoration: none; padding: 0 10px; }
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__nav a { color: var(--on-dark); text-decoration: none; padding: 11px 10px; font-weight: 600; }
.side__nav a:hover { background: #1A2E24; color: var(--on-dark); }
.side__nav a.is-on { background: #24392E; box-shadow: inset 4px 0 0 var(--gold); }
.side__nav .side__new { background: var(--gold); color: var(--ink); font-weight: 700; margin-bottom: 8px; }
.side__nav .side__new:hover, .side__nav .side__new.is-on { background: #F0C55A; color: var(--ink); box-shadow: none; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; color: var(--on-dark-muted); font-size: 14px; }
.side__foot a, .side__foot .linkish { color: var(--on-dark-muted); text-align: left; }
.main { flex: 999 1 640px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) {
  .side { flex-basis: 100%; padding: 14px; gap: 10px; }
  .side__nav { flex-direction: row; flex-wrap: wrap; }
  .side__nav a { padding: 10px; }
  .side__foot { flex-direction: row; flex-wrap: wrap; gap: 14px; margin: 0; }
  .main { padding: 18px 16px; }
}

.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.head h1 { margin: 0; font: 800 34px/1 var(--display); text-transform: uppercase; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.count { font-size: 20px; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 0; font-weight: 400; }

.notice { background: var(--cane); color: var(--on-dark); padding: 12px 16px; font-weight: 600; }
.notice--error { background: var(--red); }
.notice p { margin: 0; }

.panel { background: #fff; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.panel__title { font: 800 18px/1 var(--display); text-transform: uppercase; margin: 0; cursor: default; }
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: '▸ '; color: var(--muted); }
details[open].panel > summary::before { content: '▾ '; }

.pill { display: inline-block; padding: 4px 8px; font: 700 11px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; background: #DDE6F0; color: #1E3A5F; vertical-align: middle; }
.pill--green { background: #D8EBDD; color: #14432A; }
.pill--gray { background: #E6E3DA; color: #4A524E; }
.pill--gold { background: #F6E4B4; color: #5A4210; }
.pill--red { background: var(--red); color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters input { flex: 1 1 260px; width: auto; }
.filters select { flex: 0 1 180px; width: auto; }

.table-box { overflow-x: auto; background: #fff; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 700 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #FBFAF6; }
.t-title { font: 700 19px/1.15 var(--display); text-decoration: none; margin-right: 8px; }
.t-view { font-size: 13px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; }
.pager a { min-width: 40px; min-height: 40px; display: grid; place-items: center; background: #fff; text-decoration: none; font-weight: 600; }
.pager a[aria-current] { background: var(--ink); color: var(--on-dark); }

/* Editor */
.edit-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.edit-main { flex: 999 1 560px; min-width: 0; }
.edit-side { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.lbl { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.title-input { border: 0 !important; border-bottom: 2px solid var(--line) !important; padding: 4px 0 10px !important; font: 800 34px/1.05 var(--display) !important; text-transform: uppercase; resize: none; }
.excerpt-input { font: 400 17px/1.5 var(--serif) !important; }
.toolbar { display: flex; flex-wrap: wrap; gap: 2px; border: 1px solid var(--line); background: var(--paper); padding: 5px; position: sticky; top: 0; z-index: 2; }
.toolbar button { min-width: 42px; min-height: 38px; padding: 0 10px; border: 0; background: transparent; font: 600 14px var(--body); color: var(--ink); cursor: pointer; }
.toolbar button:hover { background: var(--line); }
.toolbar button[aria-pressed="true"] { background: var(--ink); color: var(--on-dark); }
.toolbar__right { margin-left: auto; }
.rte { border: 1px solid var(--line); border-top: 0; min-height: 420px; padding: 20px; margin-top: -10px; outline: none; }
.rte:focus { box-shadow: inset 0 0 0 2px var(--gold); }
.source { min-height: 420px; margin-top: -10px; font: 13px/1.5 ui-monospace, Consolas, monospace !important; }

.prose { font: 400 18px/1.65 var(--serif); color: #1F2A25; }
.prose > * + * { margin-top: 16px; }
:where(.prose p) { margin: 0; }
.prose h2, .prose h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: 1; margin: 28px 0 0; }
.prose h2 { font-size: 30px; } .prose h3 { font-size: 24px; }
.prose blockquote { margin: 20px 0; padding-left: 20px; border-left: 6px solid var(--gold); font: 800 26px/1.1 var(--display); text-transform: uppercase; }
.prose a { color: var(--red); }
.prose figure { margin: 20px 0; }
.prose figcaption { font: 13px var(--body); color: var(--muted); padding-top: 6px; }
.prose .video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.prose .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.dropzone { aspect-ratio: 16 / 10; border: 2px dashed #B9B3A3; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 12px; cursor: pointer; overflow: hidden; }
.dropzone img { width: 100%; height: 100%; object-fit: cover; }
.dropzone.is-over { border-color: var(--red); background: #FBF1F1; }
input[type=file]:focus-visible + * , .dropzone:focus-within { outline: 3px solid var(--gold); }
.check { display: flex; gap: 10px; align-items: center; min-height: 36px; cursor: pointer; }
.check input { width: 20px; height: 20px; }
.slug { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.danger { padding: 6px 0 30px; }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-width: 640px; }
.form-grid label:not(.check) { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.form-grid .btn { justify-self: start; margin-top: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 8px; }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-inline input { flex: 1 1 200px; width: auto; }
.form-inline label { font-weight: 600; }
.stream-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.user-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

/* Acceso */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login { width: 100%; max-width: 400px; background: var(--paper); padding: 32px; display: flex; flex-direction: column; gap: 8px; }
.login__mark { width: 52px; height: 52px; background: var(--red); color: var(--on-dark); display: grid; place-items: center; font: 800 24px/1 var(--display); transform: skewX(-8deg); margin-bottom: 8px; }
.login h1 { margin: 0 0 8px; font: 800 30px/1 var(--display); text-transform: uppercase; }
.login label { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.login .btn { margin-top: 16px; }
.login .error { margin: 0; background: var(--red); color: #fff; padding: 10px 12px; }
.login .back { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Foto principal */
.cover-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Recortador */
.crop { width: min(1000px, 96vw); max-height: 94vh; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
.crop::backdrop { background: rgba(15, 30, 23, .82); }
.crop__box { display: flex; flex-direction: column; max-height: 94vh; }
.crop__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.crop__head h2 { margin: 0; font: 800 26px/1 var(--display); text-transform: uppercase; }
.crop__close { width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.crop__stage { background: #111; height: min(58vh, 560px); }
.crop__stage img { display: block; max-width: 100%; }
.crop__tools { display: flex; flex-wrap: wrap; gap: 14px 28px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.crop__group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crop__label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.crop__group button { min-height: 38px; padding: 0 12px; border: 1px solid #C9C3B3; background: #fff; font: 600 14px var(--body); cursor: pointer; }
.crop__group button[aria-pressed="true"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.crop__group select { width: auto; min-height: 38px; }
.crop__size { font-size: 13px; color: var(--muted); }
.crop__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; }

/* Fotos dentro del editor */
.rte img { cursor: pointer; height: auto; }
.rte img.is-selected { outline: 4px solid var(--gold); outline-offset: 2px; }
.rte figure.size-s { max-width: 40%; margin-inline: auto; }
.rte figure.size-m { max-width: 60%; margin-inline: auto; }
.rte figure.size-l { max-width: 80%; margin-inline: auto; }
.img-tools { position: absolute; z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; background: var(--ink); padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.img-tools[hidden] { display: none; }
.img-tools button { min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--on-dark); font: 600 13px var(--body); cursor: pointer; }
.img-tools button:hover { background: #24392E; }
.img-tools .img-tools__del { color: #FF9C9C; }
.esp-fields { display: flex; flex-direction: column; gap: 6px; }
.esp-fields[hidden] { display: none; }
.thumb { max-width: 160px; max-height: 110px; object-fit: contain; background: var(--paper); border: 1px solid var(--line); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #F0C55A; color: var(--ink); }
.notice--builder { background: #FDF3D6; color: var(--ink); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.notice--builder p { margin: 0; font-weight: 500; }
