@font-face {
  font-family: 'MuseoModerno';
  src: url('/fonts/MuseoModerno.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --trust: #ffbe37;
  --me: #6b1fad;
  --news: #99e17a;
  --lemon: #fbff21;
  --sky: #348ddb;
  --navy: #1e3653;
  --blaze: #fc4c00;
  --ink: #1e3653;
  --muted: #5d6b80;
  --line: rgba(30, 54, 83, 0.14);
  --card: rgba(255, 255, 255, 0.93);
  --radius: 22px;
  --shadow: 0 10px 40px rgba(10, 20, 60, 0.18);
  --font: 'MuseoModerno', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(circle at top left, #0019ff, #ffffff);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

a {
  color: var(--sky);
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.grad-text {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- header ---------- */

.site-header {
  padding: 18px 16px 0;
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 20px;
}

.logo {
  font-family: 'MuseoModerno', sans-serif;
  font-weight: 900;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-shadow: 2px 2px 0 var(--navy);
}
.logo-trust {
  color: #ffbe37;
}
.logo-me {
  color: #6b1fad;
}
.logo-news {
  color: #99e17a;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a,
.nav .linklike {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 15px;
}
.nav a:hover,
.nav .linklike:hover {
  background: rgba(52, 141, 219, 0.12);
}
.nav .nav-cta {
  background: var(--navy);
  color: #fff;
}
.nav .nav-cta:hover {
  background: var(--me);
}
.nav-user {
  color: var(--muted);
  font-size: 14px;
  padding: 0 4px;
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .nav {
    justify-content: center;
  }
}

/* ---------- layout ---------- */

.main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.site-footer {
  text-align: center;
  font-size: 13px;
  color: var(--navy);
  padding: 0 16px 24px;
  opacity: 0.75;
}

.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row.wrap {
  flex-wrap: wrap;
}
.row.end {
  justify-content: flex-end;
}

.loading {
  text-align: center;
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 56px 28px;
}
.empty h2 {
  font-size: 34px;
  margin: 0 0 6px;
}

/* ---------- buttons & fields ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 600 15px var(--font);
  padding: 9px 18px;
  border-radius: 999px;
  border: 2px solid var(--navy);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, background 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--me);
  border-color: var(--me);
}
.btn-danger {
  border-color: var(--blaze);
  color: var(--blaze);
}
.btn-small {
  padding: 6px 14px;
  font-size: 14px;
}
.btn-block {
  width: 100%;
}

.linklike {
  background: none;
  border: none;
  font: inherit;
  color: var(--sky);
  cursor: pointer;
  padding: 0;
}
.linklike.danger {
  color: var(--blaze);
  font-size: 13px;
}

input[type='text'],
input[type='password'],
input[type='url'],
input[type='number'],
textarea,
select {
  font: 15px var(--font);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--sky);
}
textarea {
  width: 100%;
  resize: vertical;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 600;
}
.field input {
  width: 100%;
}

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  cursor: pointer;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 14px;
}
.form-error {
  color: var(--blaze);
  font-weight: 600;
  margin: 0 0 12px;
}

.badge {
  display: inline-block;
  background: var(--lemon);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

/* ---------- auth ---------- */

.auth-card {
  max-width: 420px;
  width: 100%;
  margin: 30px auto;
}
.auth-card h2 {
  margin-top: 0;
  font-size: 30px;
}

/* ---------- post list ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post-card {
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 50px rgba(10, 20, 60, 0.26);
}
.post-card.featured {
  grid-column: 1 / -1;
}
.post-card.featured .post-card-title {
  font-size: 36px;
}
.post-card-cover {
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--line);
}
.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card-body {
  padding: 22px 26px 24px;
}
.post-card-title {
  font-size: 26px;
  line-height: 1.15;
  margin: 4px 0 10px;
}
.post-card-excerpt {
  margin: 0 0 12px;
  color: var(--muted);
}
.read-more {
  font-weight: 700;
  color: var(--me);
}

.post-meta {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- article ---------- */

.article {
  padding: 40px clamp(20px, 5vw, 56px);
}
.post-title {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08;
  margin: 0 0 8px;
  font-weight: 800;
}
.post-body {
  margin-top: 28px;
}
.admin-strip {
  display: flex;
  justify-content: flex-end;
}

/* ---------- blocks ---------- */

.b-heading {
  line-height: 1.15;
  margin: 0.6em 0 0.3em;
  font-weight: 700;
}
h1.b-heading {
  font-size: 44px;
}
h2.b-heading {
  font-size: 32px;
}
h3.b-heading {
  font-size: 24px;
}

.b-text {
  font-size: 18px;
  margin: 0 0 1em;
  overflow-wrap: break-word;
}
.b-text ul,
.b-text ol,
.b-quote-body ul,
.b-quote-body ol {
  margin: 0.3em 0;
  padding-left: 1.4em;
}

.b-quote {
  display: flex;
  gap: 18px;
  margin: 1.2em 0;
}
.b-quote-bar {
  width: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.b-quote-body {
  font-size: 22px;
  font-style: italic;
  flex: 1;
}

.b-spacer {
  width: 100%;
}

.b-divider {
  margin: 1.4em 0;
  display: flex;
  justify-content: center;
}
.b-divider-line {
  border-radius: 99px;
}

.b-button {
  margin: 1.2em 0;
}
.b-button-link {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.1s;
}
.b-button-link:hover {
  transform: translateY(-2px);
}

/* images & frames */
.b-image {
  margin: 1.4em 0;
}
.b-image.align-center {
  margin-left: auto;
  margin-right: auto;
}
.b-image.align-right {
  margin-left: auto;
}
.b-image figcaption {
  font-size: 15px;
  font-style: italic;
  text-align: center;
  margin-top: 8px;
}
.frame img {
  display: block;
  width: 100%;
  height: auto;
}
.img-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, #eef2f7, #eef2f7 12px, #e3e9f1 12px, #e3e9f1 24px);
  color: var(--muted);
}
.frame-solid {
  padding: 6px;
}
.frame-thick {
  padding: 20px;
}
.frame-rounded {
  padding: 8px;
  border-radius: 26px;
}
.frame-rounded img,
.frame-rounded .img-placeholder {
  border-radius: 18px;
}
.frame-circle {
  padding: 8px;
  border-radius: 50%;
  aspect-ratio: 1;
}
.frame-circle img,
.frame-circle .img-placeholder {
  border-radius: 50%;
  aspect-ratio: 1;
  height: 100%;
  object-fit: cover;
}
.frame-double {
  padding: 6px;
}
.frame-double .frame-inner {
  background: #fff;
  padding: 6px;
}
.frame-polaroid {
  padding: 14px 14px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: rotate(-1.5deg);
}
.frame-polaroid figcaption {
  margin-top: 12px;
  font-size: 18px;
}
.frame-tilted {
  padding: 10px;
  transform: rotate(2deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.frame-shadow {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

/* ---------- comments ---------- */

.comments h3 {
  margin-top: 0;
}
.comment {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.comment-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
}
.comment-head .linklike {
  margin-left: auto;
}
.comment-text {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.comment-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* ---------- settings ---------- */

.settings {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}
.settings h2 {
  margin-top: 0;
}
.bg-preview {
  height: 140px;
  border-radius: 16px;
  margin-bottom: 12px;
  border: 2px solid var(--line);
}

/* ---------- editor ---------- */

.editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 22px;
  position: sticky;
  top: 10px;
  z-index: 20;
}
.editor-heading {
  margin: 0;
  font-size: 24px;
}
.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.editor-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.title-input {
  font: 800 clamp(28px, 5vw, 44px) var(--font);
  line-height: 1.15;
  margin: 0;
  padding: 4px 0;
  border-bottom: 2px dashed var(--line);
  outline: none;
  caret-color: var(--navy);
  overflow-wrap: anywhere;
}
.title-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  opacity: 0.5;
}

.ed-blocks {
  display: flex;
  flex-direction: column;
}
.ed-block {
  padding: 14px 22px 20px;
}
.ed-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.ed-block-type {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--me);
}
.ed-block-tools {
  display: flex;
  gap: 4px;
}
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--navy);
}
.icon-btn:hover:not(:disabled) {
  background: #eef4fb;
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.toolbar-settings {
  gap: 10px 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.toolbar input[type='text'],
.toolbar input[type='url'] {
  min-width: 0;
  width: 200px;
  padding: 6px 10px;
  font-size: 14px;
}
.toolbar select {
  padding: 5px 8px;
  font-size: 14px;
}
.tool {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: 14px var(--font);
  color: var(--navy);
}
.tool:hover {
  background: #eef4fb;
}
.tool-color {
  font-weight: 800;
  background-image: linear-gradient(90deg, #ffbe37, #6b1fad, #99e17a);
  background-size: 100% 4px;
  background-repeat: no-repeat;
  background-position: bottom;
}
.num {
  width: 72px;
}
.range-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.range-out {
  font-size: 13px;
  min-width: 42px;
}

.ed-rich {
  min-height: 1.6em;
  outline: none;
  border-radius: 10px;
  padding: 6px 8px;
  margin: 0;
  caret-color: var(--navy);
  border: 2px dashed transparent;
}
.ed-rich:hover {
  border-color: var(--line);
}
.ed-rich:focus {
  border-color: rgba(52, 141, 219, 0.5);
  background-color: rgba(255, 255, 255, 0.6);
}
.ed-rich:empty::before {
  content: attr(data-placeholder);
  opacity: 0.4;
}
.ed-block .b-quote {
  margin: 6px 0 0;
}
.ed-live {
  padding: 4px;
}
.ed-live .b-spacer {
  outline: 2px dashed var(--line);
  border-radius: 6px;
}

.add-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  opacity: 0.35;
  transition: opacity 0.15s;
}
.add-bar:hover,
.add-bar:focus-within,
.add-bar:last-child {
  opacity: 1;
}
.add-btn {
  font: 600 13px var(--font);
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--navy);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.add-btn:hover {
  background: var(--navy);
  color: #fff;
}

/* fill button */
.fill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  font: 14px var(--font);
  color: var(--navy);
}
.fill-btn:hover {
  border-color: var(--sky);
}
.fill-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* fill picker popover */
.fill-picker {
  position: absolute;
  z-index: 1000;
  width: 300px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(10, 20, 60, 0.3);
  padding: 16px;
  font-size: 14px;
}
.fp-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.fp-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 10px 0 6px;
  font-weight: 700;
}
.fp-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, 28px);
  gap: 6px;
}
.fp-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
}
.fp-swatch:hover {
  transform: scale(1.12);
}
.fp-swatch.selected {
  outline: 3px solid var(--sky);
  outline-offset: 1px;
}
.fp-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.fp-tabs button {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 5px;
  cursor: pointer;
  font: 13px var(--font);
  color: var(--navy);
}
.fp-tabs button.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.fp-custom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fp-row > span:first-child {
  width: 48px;
  color: var(--muted);
}
.fp-row input[type='range'] {
  flex: 1;
}
.fp-stops {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fp-color {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fp-color input[type='color'] {
  width: 40px;
  height: 32px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}
.fp-color input[type='text'] {
  width: 100px;
  padding: 5px 8px;
  font-size: 14px;
}
.fp-x {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--blaze);
}
.fp-add {
  align-self: flex-start;
  border: none;
  background: none;
  color: var(--sky);
  cursor: pointer;
  font: 600 13px var(--font);
  padding: 0;
}
.fp-preview {
  height: 36px;
  border-radius: 10px;
  margin: 10px 0;
  border: 1px solid var(--line);
}
.fp-apply {
  width: 100%;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2000;
  max-width: calc(100% - 32px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast-success {
  background: #2c7a3f;
}
.toast-error {
  background: var(--blaze);
}

@media (max-width: 600px) {
  .card:not(.post-card) {
    padding: 20px;
  }
  .post-card.featured .post-card-title {
    font-size: 28px;
  }
  .toolbar input[type='text'],
  .toolbar input[type='url'] {
    width: 100%;
  }
}

/* Size gradient titles to their text so the whole gradient shows. */
.post-title,
.post-card-title,
.title-input {
  width: fit-content;
  max-width: 100%;
}
.title-input {
  min-width: min(320px, 100%);
}

/* ---------- tags & search ---------- */

.small {
  font-size: 13px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 13px var(--font);
  line-height: 1;
  padding: 6px 11px;
  border-radius: 999px;
  border: none;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
button.tag-chip {
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
button.tag-chip:hover {
  transform: translateY(-1px);
}
.tag-chip.selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy);
}
.tag-chip.dim {
  opacity: 0.45;
}
.tag-chip.dim:hover {
  opacity: 0.8;
}
.tag-x {
  border: none;
  background: none;
  font-size: 15px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  opacity: 0.8;
}
.tag-x:hover {
  opacity: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0 10px;
}
.article .tag-row {
  margin: 12px 0 0;
}

.search-card {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.search-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.search-input {
  flex: 1;
  min-width: 0;
  font: 16px var(--font);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  outline: none;
  background: #fff;
}
.search-input:focus {
  border-color: var(--sky);
}
.tag-filter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.results {
  display: flex;
  flex-direction: column;
}

.tag-editor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-editor .tag-row {
  margin: 0;
}
.tag-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-form input[type='text'] {
  width: 180px;
}
.tag-preview {
  min-width: 80px;
}
.tag-manage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
