/* ============ TNBX.online — estilo editorial ============ */
:root {
  --ink: #16130f;
  --ink-soft: #4a4540;
  --paper: #f7f4ee;
  --paper-2: #fffdf9;
  --line: #e3ddd2;
  --red: #c9352b;
  --red-dark: #a02018;
  --gold: #b8893b;
  --shadow: 0 1px 2px rgba(22,19,15,.06), 0 8px 24px rgba(22,19,15,.06);
  --radius: 4px;
  --maxw: 1200px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui: 'Spline Sans', system-ui, sans-serif;
  --font-read: 'Newsreader', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  letter-spacing: .04em;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.topbar a { opacity: .85; transition: opacity .2s; }
.topbar a:hover { opacity: 1; }
.topbar .date { text-transform: uppercase; opacity: .7; }
.topbar .links { display: flex; gap: 18px; align-items: center; }

/* ---------- Masthead ---------- */
.masthead {
  background: var(--paper-2);
  border-bottom: 3px double var(--ink);
  padding: 26px 0 18px;
}
.masthead .container { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo-link { display: inline-block; }
.site-logo { height: clamp(64px, 11vw, 104px); width: auto; }
.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 7vw, 72px);
  letter-spacing: -.02em;
  line-height: .9;
  color: var(--ink);
}
.logo .dot { color: var(--red); }
.tagline {
  font-size: 12px; letter-spacing: .35em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Nav ---------- */
.mainnav {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow);
}
.mainnav .container { display: flex; align-items: center; gap: 4px; height: 52px; overflow-x: auto; }
.mainnav a {
  font-size: 13.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  padding: 8px 14px; white-space: nowrap; border-radius: var(--radius);
  color: var(--ink-soft); transition: color .15s, background .15s;
}
.mainnav a:hover, .mainnav a.active { color: var(--red); }
.mainnav .spacer { flex: 1; }
.mainnav .search { display: flex; align-items: center; gap: 6px; }
.mainnav .search input {
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; width: 150px; font-family: var(--font-ui);
  transition: width .2s, border-color .2s;
}
.mainnav .search input:focus { outline: none; width: 200px; border-color: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  transition: transform .08s, background .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ---------- Tags / chips ---------- */
.chip {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; padding: 3px 9px; border-radius: 3px; color: #fff;
}
.meta { font-size: 12.5px; color: var(--ink-soft); }
.meta a:hover { color: var(--red); }

/* ---------- Carousel ---------- */
.carousel { position: relative; margin: 28px 0 14px; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.carousel-track { display: flex; transition: transform .6s cubic-bezier(.7,0,.2,1); }
.slide { min-width: 100%; position: relative; height: clamp(360px, 52vw, 520px); }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,6,4,.92) 0%, rgba(8,6,4,.45) 45%, rgba(8,6,4,0) 75%);
  display: flex; align-items: flex-end;
}
.slide .caption { padding: clamp(22px, 4vw, 48px); max-width: 760px; color: #fff; }
.slide .caption h2 {
  font-family: var(--font-display); font-weight: 800; line-height: 1.05;
  font-size: clamp(24px, 4vw, 44px); margin: 12px 0 10px; letter-spacing: -.01em;
}
.slide .caption p { font-family: var(--font-read); font-size: clamp(15px, 1.6vw, 18px); opacity: .9; max-width: 620px; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.9); color: var(--ink); font-size: 20px; line-height: 1;
  display: grid; place-items: center; transition: background .2s; z-index: 3;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 16px; } .carousel-btn.next { right: 16px; }
.carousel-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.carousel-dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.45); cursor: pointer; transition: background .2s, width .2s; }
.carousel-dots button.active { background: #fff; width: 26px; border-radius: 5px; }

/* ---------- Layout grid ---------- */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; margin: 36px 0 60px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.section-head {
  display: flex; align-items: center; gap: 14px; margin: 8px 0 20px;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px;
}
.section-head h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.01em;
}
.section-head .rule { flex: 1; }

/* ---------- Article cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 26px; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; gap: 10px; }
.card .thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.05); }
.card .thumb .chip { position: absolute; top: 10px; left: 10px; }
.card h4 {
  font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.15;
  letter-spacing: -.01em; transition: color .15s;
}
.card:hover h4 { color: var(--red); }
.card p { font-family: var(--font-read); font-size: 15px; color: var(--ink-soft); }

.card.row { flex-direction: row; gap: 14px; align-items: flex-start; }
.card.row .thumb { width: 116px; flex: 0 0 116px; aspect-ratio: 1; }
.card.row h4 { font-size: 16px; }

/* ---------- Sidebar ---------- */
.sidebar > div { background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin-bottom: 24px; }
.sidebar .rank { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sidebar .rank:last-child { border-bottom: none; }
.sidebar .rank .num { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--red); line-height: 1; min-width: 32px; }
.sidebar .rank h5 { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.sidebar .cat-list a { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.sidebar .cat-list a:last-child { border: none; }
.sidebar .cat-list a:hover { color: var(--red); }

/* ---------- Post page ---------- */
.article { max-width: 760px; margin: 36px auto 0; }
.article .kicker { color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; }
.article h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 5vw, 46px); line-height: 1.05; letter-spacing: -.02em; margin: 10px 0 14px; }
.article .lead { font-family: var(--font-read); font-size: 20px; color: var(--ink-soft); margin-bottom: 18px; }
.article .byline { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.article .byline .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; }
.article .cover { border-radius: 6px; overflow: hidden; margin-bottom: 26px; box-shadow: var(--shadow); }
.article .body { font-family: var(--font-read); font-size: 19px; line-height: 1.75; color: #221f1a; }
.article .body p { margin-bottom: 22px; }
.article .body p:first-of-type::first-letter { font-family: var(--font-display); font-size: 64px; font-weight: 900; float: left; line-height: .8; padding: 6px 10px 0 0; color: var(--red); }
.author-box { margin: 40px 0; padding: 22px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; display: flex; gap: 16px; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 34px; box-shadow: var(--shadow); }
.auth-card h2 { font-family: var(--font-display); font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-soft); margin-bottom: 22px; font-size: 14px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 15px; background: var(--paper); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; font-family: var(--font-read); line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--red); }
.field .hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width:600px){ .row-2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

/* ---------- Panel / dashboard ---------- */
.panel { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 90px); }
@media (max-width: 800px){ .panel { grid-template-columns: 1fr; } }
.panel-side { background: var(--ink); color: var(--paper); padding: 28px 18px; }
.panel-side .pl { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin-bottom: 24px; }
.panel-side a { display: block; padding: 10px 12px; border-radius: var(--radius); font-size: 14px; font-weight: 500; opacity: .8; margin-bottom: 4px; transition: background .15s, opacity .15s; }
.panel-side a:hover, .panel-side a.active { background: rgba(255,255,255,.1); opacity: 1; }
.panel-side .sep { height: 1px; background: rgba(255,255,255,.15); margin: 18px 0; }
.panel-main { padding: 32px; }
.panel-main h1 { font-family: var(--font-display); font-size: 30px; font-weight: 800; margin-bottom: 4px; }
.panel-main .sub { color: var(--ink-soft); margin-bottom: 26px; }

.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 30px; }
@media (max-width:700px){ .stats { grid-template-columns: repeat(2,1fr); } }
.stat { background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.stat .n { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--red); }
.stat .l { font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }

.table { width: 100%; border-collapse: collapse; background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { background: #efe9df; font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .05em; color: var(--ink-soft); }
.table tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.badge.pub { background: #d7f0db; color: #1c7a2c; }
.badge.draft { background: #f1e3c4; color: #8a6510; }
.badge.admin { background: #e7d6f7; color: #6a23a8; }
.badge.author { background: #d9e6fb; color: #1f5fc4; }

.card-block { background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: 22px; margin-bottom: 24px; }
.card-block h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 14px; }

/* ---------- Flash ---------- */
.flash { padding: 12px 18px; border-radius: var(--radius); margin: 14px 0; font-size: 14px; font-weight: 500; }
.flash.error { background: #fbe2df; color: var(--red-dark); border: 1px solid #f1c4bf; }
.flash.success { background: #d7f0db; color: #1c7a2c; border: 1px solid #b4e0bc; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper); margin-top: 60px; padding: 48px 0 28px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; }
@media (max-width:700px){ .footer .cols { grid-template-columns: 1fr; } }
.footer .logo-sm { font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.footer .logo-sm .dot { color: var(--red); }
.footer p { opacity: .7; font-size: 14px; margin-top: 10px; max-width: 340px; }
.footer h6 { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; opacity: .6; margin-bottom: 12px; }
.footer a { display: block; opacity: .8; padding: 5px 0; font-size: 14px; }
.footer a:hover { opacity: 1; color: var(--red); }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 34px; padding-top: 18px; font-size: 12.5px; opacity: .6; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty .big { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 6px; }

.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--font-display); font-size: 120px; font-weight: 900; color: var(--red); line-height: 1; }
