/* ===== Opinionated · Ada Miclea — temă „academic dar viu" (fără gri) ===== */
:root {
  --ink: #221a23;          /* text închis, aubergine-ink */
  --muted: #6e5d52;        /* secundar — maro cald, NU gri */
  --paper: #f7f2ea;        /* fundal crem cald */
  --card: #ffffff;
  --line: #e7dcc8;         /* contur cald */
  --navy: #17223d;         /* indigo academic (header) */
  --navy-2: #213056;
  --burgundy: #8a2433;
  --burgundy-d: #6f1c29;
  --green: #1f6b54;
  --green-d: #16513f;
  --gold: #df9233;         /* accent viu, cald */
  --gold-d: #c2761c;
  --gold-soft: #fbe8cd;
  --link: #8a2433;
  --radius: 12px;
  --shadow: 0 8px 26px rgba(23,34,61,.10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--gold-d); }
h1, h2, h3 { line-height: 1.22; font-family: "Iowan Old Style", Georgia, serif; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.sm { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.page-h1 { font-size: 2rem; margin: 18px 0 6px; color: var(--navy); }

/* ===== Topbar ===== */
.topbar { background: var(--navy); color: #fff; box-shadow: 0 2px 0 var(--gold); }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 18px;
}
.brand { color: #fff; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-main { font-weight: 800; font-size: 1.35rem; letter-spacing: -.3px; }
.brand-sub { color: var(--gold); font-size: 1rem; font-style: italic; }
.search { flex: 1; display: flex; max-width: 620px; }
.search input {
  flex: 1; border: none; border-radius: 8px 0 0 8px; padding: 10px 14px; font-size: 15px;
  font-family: inherit;
}
.search button {
  border: none; background: var(--gold); color: var(--navy);
  padding: 0 18px; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 16px;
}
.search button:hover { background: var(--gold-d); }
.topnav { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.topnav a { color: #fff; font-size: .95rem; }
.nav-admin { color: var(--gold) !important; font-weight: 700; }
.inline { display: inline; margin: 0; }
.linklike {
  background: none; border: none; color: #fff; cursor: pointer; font-size: .95rem;
  padding: 0; font-family: inherit;
}
.linklike:hover { text-decoration: underline; }

/* ===== Buttons (toate colorate — niciun gri) ===== */
.btn-amber {
  display: inline-block; background: linear-gradient(180deg, #eca347, var(--gold));
  border: 1px solid var(--gold-d); color: #3a2710; padding: 10px 20px; border-radius: 999px;
  font-weight: 700; cursor: pointer; text-align: center; font-size: .98rem; font-family: inherit;
}
.btn-amber:hover { background: linear-gradient(180deg, var(--gold), var(--gold-d)); text-decoration: none; color: #2c1d0a; }
.btn-amber.lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-amber.sm { padding: 6px 14px; font-size: .85rem; }
.btn-amber.full, .btn-line.full { display: block; width: 100%; }
.btn-line {
  display: inline-block; background: #fff; border: 1.5px solid var(--burgundy);
  color: var(--burgundy); padding: 9px 18px; border-radius: 999px; cursor: pointer;
  text-align: center; font-weight: 600; font-family: inherit;
}
.btn-line:hover { background: var(--burgundy); color: #fff; text-decoration: none; }
.btn-sm {
  display: inline-block; font-size: .8rem; padding: 5px 11px; border: 1.5px solid var(--green);
  border-radius: 7px; background: #fff; color: var(--green-d); cursor: pointer; font-family: inherit;
}
.btn-sm:hover { background: var(--green); color: #fff; text-decoration: none; }
.btn-sm.danger { color: var(--burgundy); border-color: var(--burgundy); }
.btn-sm.danger:hover { background: var(--burgundy); color: #fff; }
.btn-danger {
  background: #fff; border: 1.5px solid var(--burgundy); color: var(--burgundy);
  padding: 9px 18px; border-radius: 8px; cursor: pointer; font-family: inherit; font-weight: 600;
}
.btn-danger:hover { background: var(--burgundy); color: #fff; }

/* ===== Flash ===== */
.flash { max-width: 1200px; margin: 14px auto; padding: 11px 18px; border-radius: 9px; }
.flash-ok { background: #e6f3ec; color: var(--green-d); border: 1px solid #b9ddc8; }
.flash-err { background: #f7e7e3; color: var(--burgundy-d); border: 1px solid #e6c2bb; }

/* ===== Layout pagina principala (bio + continut) ===== */
.home-layout { display: grid; grid-template-columns: 290px 1fr; gap: 28px; padding: 22px 0 40px; align-items: start; }

/* --- Card bio --- */
.bio-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow); position: sticky; top: 18px;
  border-top: 4px solid var(--burgundy);
}
.bio-photo { width: 130px; height: 130px; margin: 0 auto 14px; }
.bio-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid var(--gold-soft); }
.bio-photo-ph {
  width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--navy-2), var(--burgundy));
}
.bio-name { text-align: center; margin: 0 0 4px; font-size: 1.4rem; color: var(--navy); }
.bio-tagline { text-align: center; margin: 0 0 12px; color: var(--burgundy); font-style: italic; font-size: .96rem; }
.bio-text { font-size: .92rem; color: var(--ink); }
.bio-text p { margin: .5em 0; }
.bio-links { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.bio-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-radius: 9px; color: #fff; font-weight: 700; font-size: .9rem;
}
.bio-link:hover { text-decoration: none; color: #fff; filter: brightness(1.07); }
.bio-link .bl-act { font-weight: 600; font-size: .78rem; opacity: .92; }
.bl-resume   { background: linear-gradient(180deg, #ec9a3e, var(--gold-d)); }
.bl-linkedin { background: linear-gradient(180deg, #2f7fc4, #1f5f96); }
.bl-orcid    { background: linear-gradient(180deg, #6fae3c, var(--green-d)); }
.bl-contact  { background: linear-gradient(180deg, #a83344, var(--burgundy-d)); }
.bio-edit { display: block; text-align: center; margin-top: 14px; font-size: .85rem; }

/* --- Continut principal --- */
.home-main { min-width: 0; }
.intro { padding: 4px 0 10px; }
.intro-sub { color: var(--muted); font-size: 1.08rem; margin: 0; max-width: 60ch; }

.cat-section { margin: 30px 0 8px; }
.cat-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.cat-head h2 { margin: 0; font-size: 1.45rem; color: var(--navy); position: relative; padding-left: 14px; }
.cat-head h2::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: var(--gold); }
.cat-count { background: var(--navy); color: #fff; font-size: .78rem; padding: 2px 9px; border-radius: 999px; font-family: Georgia, serif; }

/* ===== Grid de carduri ===== */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; color: var(--ink);
  transition: box-shadow .16s, transform .16s, border-color .16s;
}
.card:hover { box-shadow: var(--shadow); text-decoration: none; transform: translateY(-3px); border-color: var(--gold); }
.card-article { border-left: 4px solid var(--green); }
.card-problem { border-left: 4px solid var(--burgundy); }
.card-img { position: relative; aspect-ratio: 16/10; background: #faf4ea; display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img-ph { font-size: 2.8rem; color: var(--navy-2); opacity: .35; font-family: Georgia, serif; }
.card-img-ph.big { font-size: 4.5rem; }
.ribbon { position: absolute; top: 10px; left: 10px; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; font-family: Georgia, serif; }
.ribbon-free { background: var(--green); color: #fff; }
.ribbon-locked { background: var(--burgundy); color: #fff; }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--gold-d); font-weight: 700; font-family: Georgia, serif; }
.card-title { margin: 0; font-size: 1.08rem; font-weight: 700; color: var(--navy); }
.card-summary { margin: 0; font-size: .9rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.price { font-weight: 800; font-size: 1.1rem; color: var(--burgundy); font-family: Georgia, serif; }
.price.free { color: var(--green); }
.card-cta { font-size: .85rem; color: var(--gold-d); font-weight: 600; }
.badge-owned { color: var(--green-d); font-weight: 700; font-size: .85rem; }

/* ===== Rating ===== */
.rating { display: flex; align-items: center; gap: 8px; }
.stars { color: var(--gold-d); letter-spacing: 1px; }

/* ===== Articol (gratuit) ===== */
.article { max-width: 760px; margin: 0 auto; padding: 8px 0 36px; }
.article-title { font-size: 2.1rem; color: var(--navy); margin: 8px 0 10px; }
.article-hero { width: 100%; border-radius: var(--radius); margin: 14px 0; border: 1px solid var(--line); }

/* ===== Pagina problema ===== */
.crumbs { padding: 16px 0 4px; font-size: .85rem; color: var(--muted); }
.detail { display: grid; grid-template-columns: 360px 1fr; gap: 30px; padding: 12px 0 24px; }
.detail-media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.detail-media .card-img-ph { background: #faf4ea; border-radius: var(--radius); width: 100%; aspect-ratio: 16/11; display: flex; align-items: center; justify-content: center; }
.detail-main h1 { margin: 6px 0 8px; font-size: 1.85rem; color: var(--navy); }
.lead { font-size: 1.12rem; color: #3c2f30; }

/* ===== Prose (continut bogat) ===== */
.prose { font-size: 1.02rem; }
.prose img { max-width: 100%; border-radius: 8px; }
.prose h2 { font-size: 1.4rem; margin-top: 1.3em; color: var(--navy); }
.prose h3 { font-size: 1.15rem; color: var(--burgundy-d); }
.prose blockquote { border-left: 4px solid var(--gold); margin: 1em 0; padding: 6px 18px; color: #4a3b34; background: #fdf7ec; border-radius: 0 8px 8px 0; }
.prose code { background: #f1ece1; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.prose .katex-display { margin: 1em 0; }

/* ===== Buybox ===== */
.buybox { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; box-shadow: var(--shadow); border-top: 4px solid var(--gold); }
.buybox-price { font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; color: var(--burgundy); font-family: Georgia, serif; }
.buy-perks { list-style: none; padding: 0; margin: 0 0 16px; font-size: .92rem; color: #43352f; }
.buy-perks li { padding: 3px 0; }

/* ===== Soluție ===== */
.answer-section { padding: 18px 0 36px; border-top: 1px solid var(--line); margin-top: 20px; }
.answer-section h2 { margin: 4px 0 16px; color: var(--navy); }

/* --- Cititor protejat --- */
.reader { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.reader-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px; background: var(--navy); color: #fff; }
.reader-badge { font-weight: 700; font-size: .9rem; }
.reader-bar .muted { color: #c8cfe0; }
.reader-page {
  position: relative; z-index: 1; padding: 26px 28px; min-height: 160px;
  -webkit-user-select: none; user-select: none;
}
.reader-watermark {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
  transform: rotate(-28deg) scale(1.4); opacity: .07;
}
.reader-watermark span { color: var(--burgundy); font-weight: 800; font-size: 1.05rem; white-space: nowrap; padding: 26px 30px; font-family: Georgia, serif; }

/* --- Blocare dispozitiv --- */
.device-block { text-align: center; padding: 40px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.device-block h3 { margin: 8px 0; color: var(--navy); }
.device-block p { max-width: 48ch; margin: 0 auto 16px; color: var(--muted); }

/* --- Paywall --- */
.answer-locked { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.locked-blur { padding: 24px; filter: blur(5px); user-select: none; pointer-events: none; min-height: 150px; }
.locked-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; text-align: center; padding: 22px;
  background: linear-gradient(180deg, rgba(247,242,234,.6), rgba(247,242,234,.95));
}
.lock-icon { font-size: 2.4rem; }

/* ===== Dispozitive (cont) ===== */
.devices-section { margin: 40px 0 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.devices-section h2 { color: var(--navy); }
.device-list { list-style: none; padding: 0; margin: 14px 0; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.device-info { display: flex; flex-direction: column; gap: 2px; }
.device-label { font-weight: 600; }
.badge-current { background: var(--green); color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 999px; font-weight: 700; }

/* ===== Auth ===== */
.auth-card { max-width: 400px; margin: 40px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border-top: 4px solid var(--burgundy); }
.auth-card h1 { margin: 0 0 16px; font-size: 1.6rem; color: var(--navy); }
.auth-card label, .fld { display: block; margin-bottom: 14px; font-size: .9rem; font-weight: 600; }
.auth-card input, .fld input, .fld textarea, .fld select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 15px;
  border: 1.5px solid #d9ccb6; border-radius: 8px; font-weight: 400; font-family: inherit; background: #fffdf9;
}
.fld input:focus, .fld textarea:focus, .fld select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

/* ===== Empty ===== */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h1 { font-size: 3rem; margin: 0 0 6px; color: var(--navy); }
.empty .btn-amber { margin-top: 12px; }
.empty-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ===== Admin ===== */
.admin-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 8px; flex-wrap: wrap; gap: 12px; }
.admin-head h1 { color: var(--navy); }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 12px 0 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; border-bottom: 3px solid var(--gold); }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--navy); font-family: Georgia, serif; }
.stat-lbl { font-size: .8rem; color: var(--muted); }

.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
.tbl th { background: var(--navy); color: #fff; font-size: .76rem; text-transform: uppercase; letter-spacing: .5px; font-family: Georgia, serif; }
.tbl-thumb { width: 50px; }
.tbl-thumb img { width: 42px; height: 32px; object-fit: cover; border-radius: 5px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-ok { background: #e6f3ec; color: var(--green-d); padding: 2px 9px; border-radius: 999px; font-size: .78rem; }
.badge-draft { background: var(--gold-soft); color: var(--gold-d); padding: 2px 9px; border-radius: 999px; font-size: .78rem; }
.badge-manual { background: #e9edf7; color: var(--navy-2); padding: 2px 9px; border-radius: 999px; font-size: .78rem; }

/* ===== Editor ===== */
.editor-form, .settings-form { padding: 10px 0 26px; }
.kind-toggle { display: flex; gap: 10px; margin: 8px 0 18px; flex-wrap: wrap; }
.kind-opt input { position: absolute; opacity: 0; }
.kind-pill { display: inline-block; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; color: var(--muted); }
.kind-opt input:checked + .kind-pill { border-color: var(--burgundy); background: var(--burgundy); color: #fff; }
.editor-grid { display: grid; grid-template-columns: 1fr 310px; gap: 22px; align-items: start; }
.editor-col-main .fld { margin-top: 14px; }
.lock-label { color: var(--burgundy); }
.lbl-article { display: none; }
.lbl-problem { display: inline; }
body.is-article .lbl-article { display: inline; }
body.is-article .lbl-problem { display: none; }
.ed-wrap { margin-bottom: 6px; }
.quill { background: #fff; min-height: 150px; border-radius: 0 0 8px 8px; font-family: Georgia, serif; }
.quill-locked { background: #fdf7ec; }
.preview { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }
.preview summary { cursor: pointer; font-size: .85rem; color: var(--gold-d); font-weight: 600; padding: 6px 0; }
.preview .prose { padding: 6px 0 12px; }
.math-hint { margin-top: 14px; }
.math-hint code { background: #f1ece1; padding: 1px 5px; border-radius: 4px; }
.side-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.side-box .btn-line { margin-top: 8px; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.chk input { width: auto; }
.cover-preview { width: 100%; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--line); }
#cover-file, #photo-file { display: none; }
.img-upload .linklike { color: var(--burgundy); margin-top: 6px; display: inline-block; }
.danger-form { margin: 20px 0; }
.grant-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: 540px; margin-bottom: 26px; box-shadow: var(--shadow); }
.grant-form .fld { margin-bottom: 12px; }
.admin-edit-link { padding: 8px 0 30px; }

/* ===== Quill snow: reskin fara gri sters ===== */
.ql-toolbar.ql-snow { border-color: var(--line) !important; border-radius: 8px 8px 0 0; background: #fbf7f0; }
.ql-container.ql-snow { border-color: var(--line) !important; }

/* ===== Footer ===== */
.footer { background: var(--navy); color: #d4dae8; margin-top: 30px; padding: 26px 0; font-size: .88rem; border-top: 4px solid var(--gold); }
.footer p { margin: 2px 0; }
.footer .muted { color: #9aa6c0; }

/* ===== Responsive ===== */
@media (max-width: 920px) {
  .home-layout { grid-template-columns: 1fr; }
  .bio-card { position: static; }
  .detail { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}
