/* ===========================================================
   NOTICIAS — public + admin
   Inherits variables from landing.css (:root)
   =========================================================== */

/* =========================================================
   ARTICULO PAGE
   ========================================================= */

/* back link */
.article-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 32px; transition: color .18s;
}
.article-back svg { width: 18px; height: 18px; flex: none; }
.article-back:hover { color: var(--blue-bright); }

/* header block */
.article-header { margin-bottom: 32px; }
.article-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.article-date {
  font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.06em;
}
.article-author {
  font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.04em;
}
#article-title {
  font-size: clamp(28px, 4.5vw, 54px); line-height: 1.08; margin-bottom: 16px;
}
.article-excerpt {
  font-size: 18px; color: var(--muted); line-height: 1.55; max-width: 680px;
  margin-left: auto; margin-right: auto;
}

/* video embed */
.article-video { margin: 32px 0 40px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.article-video-inner { position: relative; padding-top: 56.25%; }
.article-video-inner iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: block; }

/* hero image */
.article-hero-img {
  margin: 32px 0 40px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
}
.article-hero-img img { width: 100%; height: auto; max-height: 620px; object-fit: contain; display: block; }

/* article body text */
.article-content { max-width: 680px; margin-bottom: 48px; margin-left: auto; margin-right: auto; }
.article-content p {
  font-size: 17px; line-height: 1.75; color: var(--muted);
  margin-bottom: 20px;
  text-align: justify; text-justify: inter-word;
}
.article-content p:last-child { margin-bottom: 0; }
.article-content strong { color: var(--ink); font-weight: 600; }
.article-content em { font-style: italic; }
.article-content a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover { color: var(--blue); }
.article-content img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 8px 0 24px; }

/* share row */
.article-share {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 0; border-top: 1px solid var(--line); margin-bottom: 0;
}
.article-share-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); margin-right: 4px;
}
.article-share-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.04); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; transition: all .18s;
}
.article-share-btn svg { width: 15px; height: 15px; }
.article-share-btn:hover { border-color: var(--blue); color: var(--blue-bright); background: color-mix(in oklab,var(--blue) 10%,transparent); }

/* admin edit FAB */
.article-edit-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 100px;
  background: var(--blue); color: #fff;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transition: background .18s, transform .18s, box-shadow .18s;
}
.article-edit-fab:hover {
  background: var(--blue-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}

/* divider before related */
.article-divider { height: 1px; background: var(--line); margin: 48px 0 40px; }

/* related section */
.related-section h2 { font-size: clamp(22px,3vw,32px); margin-bottom: 24px; }

@media (max-width: 640px) {
  #article-title { font-size: clamp(24px,6vw,36px); }
  .article-excerpt { font-size: 16px; }
  .article-content p { font-size: 16px; }
  .article-hero-img { border-radius: 10px; }
}

/* ── Entrance animation ───────────────────────────────────── */
.news-enter {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .4s ease, transform .4s ease;
}
.news-enter.visible { opacity: 1; transform: none; }

/* ── Hero ─────────────────────────────────────────────────── */
.noticias-hero { padding: 80px 0 40px; position: relative; }
.noticias-hero h1 { font-size: clamp(36px,5.5vw,68px); margin-top: 14px; margin-bottom: 10px; }
.noticias-hero > .wrap > p { color: var(--muted); font-size: 17px; max-width: 520px; margin-bottom: 28px; }

/* ── Admin manage link ────────────────────────────────────── */
.admin-manage-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--blue-bright);
  border: 1px solid color-mix(in oklab,var(--blue) 35%,transparent);
  background: color-mix(in oklab,var(--blue) 8%,transparent);
  padding: 8px 16px; border-radius: 8px; transition: all .2s;
}
.admin-manage-link svg { width: 14px; height: 14px; flex: none; }
.admin-manage-link:hover {
  background: color-mix(in oklab,var(--blue) 16%,transparent);
  border-color: var(--blue);
}

/* ── Tag filter bar ───────────────────────────────────────── */
.news-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.news-filter-btn {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 18px; border-radius: 20px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer; transition: all .18s;
}
.news-filter-btn:hover {
  color: var(--ink); border-color: var(--blue);
  background: color-mix(in oklab,var(--blue) 8%,transparent);
}
.news-filter-btn.active {
  background: var(--blue); border-color: var(--blue); color: #051022; font-weight: 600;
}

/* ── Tag chip ─────────────────────────────────────────────── */
.news-tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 10px;
  border-radius: 20px; border: 1px solid; white-space: nowrap;
  color: var(--blue-bright);
  border-color: color-mix(in oklab,var(--blue) 40%,transparent);
  background: color-mix(in oklab,var(--blue) 10%,transparent);
}

/* ── Featured card ────────────────────────────────────────── */
#featured-wrap { padding: 12px 0 0; }
.news-featured {
  display: grid; grid-template-columns: 1fr 1fr;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  transition: border-color .22s, box-shadow .22s;
}
.news-featured:hover {
  border-color: color-mix(in oklab,var(--blue) 40%,transparent);
  box-shadow: 0 20px 60px -16px color-mix(in oklab,var(--blue) 20%,transparent);
}
.nf-img { aspect-ratio: 4/3; overflow: hidden; }
.nf-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.news-featured:hover .nf-img img { transform: scale(1.04); }
.nf-body {
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 44px; gap: 16px;
}
.nf-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nf-date { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: 0.06em; }
.nf-body h2 { font-size: clamp(22px,2.6vw,34px); line-height: 1.12; }
.nf-excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; }
.nf-more {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--blue-bright); display: flex; align-items: center; gap: 6px; margin-top: 4px;
}
.nf-more .ar { transition: transform .18s; }
.news-featured:hover .nf-more .ar { transform: translateX(4px); }

/* ── News listing grid ────────────────────────────────────── */
.news-listing {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 24px;
}

/* Override landing.css .news-card for the dedicated noticias page */
.news-listing .news-card {
  display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  transition: border-color .22s, transform .22s, box-shadow .22s;
}
.news-listing .news-card:hover {
  border-color: color-mix(in oklab,var(--blue) 35%,transparent);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px -12px color-mix(in oklab,var(--blue) 15%,transparent);
}
.news-listing .news-thumb { aspect-ratio: 16/9; overflow: hidden; }
.news-listing .news-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.news-listing .news-card:hover .news-thumb img { transform: scale(1.05); }
.news-listing .news-body {
  display: flex; flex-direction: column; padding: 20px 22px 22px; flex: 1; gap: 10px;
}
.news-listing .news-cat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.news-listing .news-cat .date { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.06em; }
.news-listing .news-card h3 { font-size: clamp(16px,1.4vw,20px); line-height: 1.22; }
.news-listing .excerpt { color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.news-listing .more {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--blue-bright); display: flex; align-items: center; gap: 5px; margin-top: 6px;
}
.news-listing .more .ar { transition: transform .18s; }
.news-listing .news-card:hover .more .ar { transform: translateX(4px); }

/* ── Empty state ──────────────────────────────────────────── */
.news-empty { padding: 80px 0; text-align: center; color: var(--muted); }
.news-empty h3 { font-family: var(--serif); font-size: 24px; margin-bottom: 10px; color: var(--ink); }

/* ── Responsive (public) ──────────────────────────────────── */
@media (max-width: 768px) {
  .news-featured { grid-template-columns: 1fr; }
  .nf-img { aspect-ratio: 16/9; }
  .nf-body { padding: 24px 20px; }
  .noticias-hero { padding: 60px 0 32px; }
}
@media (max-width: 480px) { .news-listing { grid-template-columns: 1fr; } }

/* =========================================================
   ADMIN NOTICIAS
   ========================================================= */

.admin-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 32px; flex-wrap: wrap;
}
.admin-header h1 { font-size: clamp(28px,4vw,48px); margin-top: 10px; }

/* search bar */
.admin-search-wrap {
  position: relative; display: flex; align-items: center;
  margin-bottom: 16px;
}
.admin-search-icon {
  position: absolute; left: 14px; width: 16px; height: 16px;
  color: var(--faint); pointer-events: none; flex: none;
}
.admin-search-input {
  width: 100%; padding: 11px 40px 11px 42px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2);
  border-radius: 10px; color: var(--ink); font-family: var(--sans);
  font-size: 14px; outline: none; transition: border-color .18s, background .18s;
}
.admin-search-input::placeholder { color: var(--faint); }
.admin-search-input:focus {
  border-color: var(--blue);
  background: color-mix(in oklab, var(--blue) 6%, transparent);
}
.admin-search-clear {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--faint); display: grid; place-items: center;
  padding: 4px; border-radius: 4px; transition: color .15s;
}
.admin-search-clear:hover { color: var(--ink); }

/* table */
.admin-table-wrap { border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--panel); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table thead { background: rgba(255,255,255,.03); }
.admin-table th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint); padding: 14px 18px; text-align: left;
  border-bottom: 1px solid var(--line); font-weight: 500;
}
.admin-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.td-title { font-weight: 500; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.td-status {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 10px;
  border-radius: 20px; border: 1px solid;
}
.td-status.published { color: #1ed760; background: rgba(30,215,96,.1); border-color: rgba(30,215,96,.3); }
.td-status.draft { color: var(--faint); background: rgba(255,255,255,.04); border-color: var(--line); }
.td-date { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.td-actions { display: flex; gap: 8px; justify-content: flex-end; }

.td-featured-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--faint); border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; transition: color .18s, transform .18s;
}
.td-featured-btn:hover { color: #f0a500; transform: scale(1.15); }
.td-featured-btn.is-featured { color: #f0a500; }

.admin-btn-view {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.04); color: var(--muted);
  white-space: nowrap; transition: all .18s;
}
.admin-btn-view:hover {
  border-color: color-mix(in oklab,var(--blue) 60%,transparent);
  color: var(--blue-bright);
  background: color-mix(in oklab,var(--blue) 10%,transparent);
}

.admin-btn-sm {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  padding: 6px 14px; border-radius: 7px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.04); color: var(--ink); cursor: pointer; transition: all .18s;
}
.admin-btn-sm:hover { border-color: var(--blue); color: var(--blue-bright); background: color-mix(in oklab,var(--blue) 10%,transparent); }
.admin-btn-sm.danger:hover { border-color: #f43f5e; color: #f43f5e; background: rgba(244,63,94,.1); }

/* overlay + modal */
.admin-form-overlay {
  position: fixed; inset: 0; background: rgba(9,11,17,.8); backdrop-filter: blur(8px);
  z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.admin-form-overlay.open { opacity: 1; pointer-events: auto; }
.admin-form-modal {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 32px; max-width: 760px; width: 100%; max-height: 90vh; overflow-y: auto;
  transform: translateY(16px); transition: transform .22s;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.14) transparent;
}
.admin-form-modal::-webkit-scrollbar { width: 5px; }
.admin-form-modal::-webkit-scrollbar-track { background: transparent; }
.admin-form-modal::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14); border-radius: 99px;
}
.admin-form-modal::-webkit-scrollbar-thumb:hover { background: var(--blue); }
.admin-form-overlay.open .admin-form-modal { transform: translateY(0); }
.admin-form-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-form-top h2 { font-size: 22px; font-family: var(--serif); }
.admin-form-close {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.04); color: var(--muted); font-size: 18px;
  cursor: pointer; display: grid; place-items: center; transition: all .18s;
}
.admin-form-close:hover { border-color: var(--blue); color: var(--blue-bright); }

/* fields */
.admin-field { margin-bottom: 18px; }
.admin-field label {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.admin-field input[type="text"],
.admin-field input[type="url"],
.admin-field input[type="date"],
.admin-field select,
.admin-field textarea {
  width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 12px 14px; color: var(--ink); font-family: var(--sans);
  font-size: 14px; line-height: 1.5; resize: vertical; transition: border-color .18s; outline: none;
  box-sizing: border-box;
}
.admin-field input[type="text"]:focus,
.admin-field input[type="url"]:focus,
.admin-field input[type="date"]:focus,
.admin-field select:focus,
.admin-field textarea:focus { border-color: var(--blue); background: rgba(61,139,255,.06); }
.admin-field input[type="text"]::placeholder,
.admin-field input[type="url"]::placeholder,
.admin-field textarea::placeholder { color: var(--faint); }
.admin-field select,
.admin-field input[type="date"] { appearance: none; cursor: pointer; color-scheme: dark; }

/* content toolbar (WordPress-style formatting buttons) */
.content-toolbar {
  display: flex; align-items: center; gap: 4px; padding: 6px;
  border: 1px solid var(--line-2); border-bottom: none;
  border-radius: 8px 8px 0 0; background: rgba(255,255,255,.03);
}
.content-toolbar button {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; font-size: 15px; transition: all .15s;
}
.content-toolbar button:hover { background: rgba(255,255,255,.07); color: var(--ink); border-color: var(--line-2); }
.content-toolbar button.is-uploading { opacity: .5; pointer-events: none; }
.content-toolbar-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.content-toolbar + textarea#f-content { border-radius: 0 0 8px 8px; }
.admin-field > p {
  margin-top: 6px; font-family: var(--mono); font-size: 11px;
  color: var(--faint); line-height: 1.5;
}

/* image upload */
.admin-img-upload {
  position: relative; border: 1px dashed var(--line-2); border-radius: 10px; overflow: hidden;
  cursor: pointer; background: rgba(255,255,255,.02); min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .18s, background .18s;
}
.admin-img-upload:hover { border-color: var(--blue); background: color-mix(in oklab,var(--blue) 6%,transparent); }
.admin-img-upload.has-image { min-height: unset; border-style: solid; border-color: var(--line-2); background: var(--panel); }
.upload-label {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 20px; color: var(--faint); font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.06em; text-align: center; pointer-events: none;
}
.upload-label svg { width: 36px; height: 36px; stroke: var(--faint); }
.admin-img-upload img { width: 100%; height: auto; max-height: 320px; object-fit: contain; display: block; }
.admin-img-upload input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.img-remove-btn {
  display: none; position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.65); color: #fff; cursor: pointer;
  align-items: center; justify-content: center; transition: background .18s;
}
.img-remove-btn svg { width: 14px; height: 14px; }
.img-remove-btn:hover { background: #D85A30; }
.admin-img-upload.has-image .img-remove-btn { display: flex; }

/* tag checkboxes */
.admin-tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-tag-check {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: 20px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02);
  cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--muted); transition: all .18s;
}
.admin-tag-check input[type="checkbox"] { display: none; }
.admin-tag-check:has(input:checked) {
  border-color: var(--blue);
  background: color-mix(in oklab,var(--blue) 12%,transparent);
  color: var(--blue-bright);
}
.admin-tag-check:hover { border-color: var(--blue); color: var(--ink); }

/* toggles */
.admin-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.admin-toggle { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; display: block; }
.admin-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.admin-toggle .slider {
  position: absolute; inset: 0; border-radius: 22px;
  background: var(--line-2); cursor: pointer; transition: background .2s;
}
.admin-toggle .slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); top: 3px; left: 3px; transition: transform .2s, background .2s;
}
.admin-toggle input:checked + .slider { background: var(--blue); }
.admin-toggle input:checked + .slider::before { transform: translateX(18px); background: #fff; }

/* form actions */
.admin-form-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}

@media (max-width: 768px) {
  .admin-header { flex-direction: column; gap: 14px; }
  .admin-table-wrap { overflow-x: auto; }
  .admin-table { min-width: 560px; }
  .admin-form-modal { padding: 24px 20px; }
}
