/* Westlands news editor – deliberately simple, large and friendly */
:root {
  --navy: #13305e;
  --blue: #1f5aa8;
  --blue-100: #dceaf9;
  --blue-50: #eef5fd;
  --cream: #fff8ee;
  --sun: #ffc64f;
  --sun-100: #fff1cc;
  --coral-700: #b8462a;
  --sage-700: #2e7a50;
  --ink: #1d2a44;
  --ink-soft: #4a5876;
  --radius: 20px;
  --shadow: 0 10px 30px -16px rgba(19, 48, 94, .35);
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body.cms { margin: 0; background: var(--cream); color: var(--ink); font-family: "Rubik", Verdana, sans-serif; line-height: 1.55; }
h1, h2 { color: var(--navy); line-height: 1.2; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: 2rem; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.cms-wrap { width: min(1000px, 100% - 32px); margin-inline: auto; }
.cms-wrap--narrow { width: min(820px, 100% - 32px); }
.cms-main { padding: 40px 0 80px; }
.cms-muted { color: var(--ink-soft); }

/* Top bar */
.cms-bar { background: #fff; box-shadow: 0 4px 18px -12px rgba(19,48,94,.4); }
.cms-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; }
.cms-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.cms-brand img { height: 52px; width: auto; }
.cms-brand span { font-weight: 400; color: var(--navy); padding-left: 14px; border-left: 2px solid var(--blue-100); }
.cms-tabs { display: flex; gap: 6px; margin-right: auto; margin-left: 10px; }
.cms-tabs a { font-weight: 600; color: var(--navy); text-decoration: none; padding: 8px 18px; border-radius: 99px; }
.cms-tabs a:hover { background: var(--blue-50); }
.cms-tabs a.is-active { background: var(--blue-100); color: var(--blue); }
.cms-bar__links { display: flex; align-items: center; gap: 12px; }
.cms-bar__links form { margin: 0; }
.cms-link-btn { font: inherit; color: var(--blue); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* Buttons */
.cms-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 48px; padding: .6em 1.2em;
  font: 600 1rem "Rubik", sans-serif; color: var(--navy); background: #fff; border: 2px solid var(--blue-100);
  border-radius: 99px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.cms-btn:hover { border-color: var(--blue); }
.cms-btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.cms-btn--primary:hover { background: var(--navy); border-color: var(--navy); }
.cms-btn--big { min-height: 58px; font-size: 1.1rem; padding: .7em 1.6em; }
.cms-btn--block { width: 100%; }
.cms-btn--quiet { border-color: transparent; background: transparent; text-decoration: underline; }
/* Same chunky style as the website's "Let's Talk" button */
.cms-btn--sun, .cms-btn--coral { border: 0; color: #13305e; box-shadow: 0 4px 0 rgba(19, 48, 94, .25); transition: transform .15s, box-shadow .15s; }
.cms-btn--sun { background: var(--sun); }
.cms-btn--coral { background: #ff8b6e; }
.cms-btn--sun:hover, .cms-btn--coral:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(19, 48, 94, .25); }
.cms-btn--sun:active, .cms-btn--coral:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(19, 48, 94, .25); }
.cms-btn--danger { color: var(--coral-700); border-color: #f3d2c9; }
.cms-btn--danger:hover { border-color: var(--coral-700); }

/* Cards, alerts, badges */
.cms-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 22px; }
.cms-card__title { font-size: 1.3rem; }
.cms-alert { border-radius: 14px; padding: 16px 20px; margin: 0 0 22px; font-weight: 500; }
.cms-alert ul { margin: 6px 0 0; padding-left: 1.2em; }
.cms-alert p { margin: 0; }
.cms-alert--ok { background: #dcf1e4; color: var(--sage-700); border: 2px solid #b5dfc4; }
.cms-alert--error { background: #ffe3da; color: var(--coral-700); border: 2px solid #f6c3b5; }
.cms-badge { display: inline-block; margin-left: 8px; padding: 2px 12px; border-radius: 99px; font-size: .85rem; font-weight: 600; background: #dcf1e4; color: var(--sage-700); }
.cms-badge--draft { background: var(--sun-100); color: #8a5a00; }

/* Login */
.cms-login { width: min(480px, 100% - 32px); margin: 40px auto; text-align: center; }
.cms-login .cms-form { text-align: left; margin-top: 24px; }
.cms-password { display: flex; gap: 8px; margin: 6px 0 20px; }
.cms-password input { flex: 1; }
.cms-password__toggle { font: 600 .95rem "Rubik", sans-serif; padding: 0 16px; border-radius: 12px; border: 2px solid var(--blue-100); background: #fff; color: var(--navy); cursor: pointer; }

/* Dashboard */
.cms-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.cms-head p { margin: 0; }
.cms-list { list-style: none; margin: 0; padding: 0; }
.cms-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: center; padding: 18px 20px; margin-bottom: 14px; }
.cms-item h2 { font-size: 1.15rem; margin: 0 0 4px; }
.cms-item p { margin: 0; }
.cms-item__thumb { width: 120px; height: 90px; border-radius: 12px; overflow: hidden; background: var(--sun-100); }
.cms-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cms-item__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cms-item__actions form { margin: 0; }
.cms-empty { text-align: center; padding: 50px 20px; }
.cms-item--sortable { grid-template-columns: 28px 80px 1fr auto; }
.cms-handle { cursor: grab; font-size: 1.6rem; line-height: 1; color: var(--ink-soft); text-align: center; user-select: none; }
.cms-handle:active { cursor: grabbing; }
.cms-item.is-dragging { opacity: .5; outline: 3px solid var(--blue); }
.cms-avatar { width: 64px; height: 80px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--blue-100); }
.cms-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.cms-avatar span { font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.cms-avatar--blue span { color: #fff; }
.cms-avatar--blue { background: #3b82d6; }
.cms-avatar--sun { background: var(--sun); }
.cms-avatar--sun span { color: var(--navy); }
.cms-avatar--coral { background: #ff8b6e; }
.cms-avatar--sage { background: #7cc39b; }
.cms-order { display: flex; gap: 6px; }
.cms-btn--icon { min-width: 48px; padding: 0; font-size: 1.2rem; }
.cms-btn:disabled, .cms-btn:disabled:hover { color: var(--ink-soft); background: var(--blue-50); border-color: var(--blue-100); box-shadow: none; transform: none; cursor: default; }

/* Forms */
.cms-back { font-weight: 600; text-decoration: none; }
.cms-field { margin-bottom: 22px; }
.cms-field:last-child { margin-bottom: 0; }
.cms-field--date input { max-width: 240px; }
label, .cms-field > label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.cms-optional { font-weight: 400; color: var(--ink-soft); font-size: .9em; }
.cms-help { margin: 0 0 8px; font-size: .9rem; color: var(--ink-soft); }
input[type="text"], input[type="password"], input[type="date"], textarea {
  width: 100%; font: inherit; color: var(--ink); padding: 12px 16px; border-radius: 12px;
  border: 2px solid var(--blue-100); background: var(--blue-50);
}
input:focus, textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.cms-input--big { font-size: 1.3rem; font-weight: 600; }
textarea { resize: vertical; }

.cms-photo { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; margin-bottom: 22px; }
.cms-photo__preview { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--sun-100); display: grid; place-items: center; }
.cms-photo__preview img { width: 100%; height: 100%; object-fit: cover; }
.cms-photo__empty { color: var(--ink-soft); font-size: .9rem; }
.cms-photo__controls label.cms-btn { display: inline-flex; margin: 0 0 8px; }
.cms-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cms-file:focus-visible + .cms-help { outline: 3px solid var(--sun); }
.cms-photo__controls:focus-within label.cms-btn { border-color: var(--blue); }
.cms-check, .cms-radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); cursor: pointer; }
.cms-check input, .cms-radio input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.cms-radio { padding: 14px 16px; border-radius: 14px; border: 2px solid var(--blue-100); margin-bottom: 10px; }
.cms-radio:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }

/* Story editor */
.cms-editor { border: 2px solid var(--blue-100); border-radius: 14px; overflow: hidden; }
.cms-editor:focus-within { border-color: var(--blue); }
.cms-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--blue-50); border-bottom: 2px solid var(--blue-100); position: sticky; top: 0; }
.cms-toolbar button {
  font: 500 .95rem "Rubik", sans-serif; min-height: 42px; padding: 0 14px; border-radius: 10px;
  border: 2px solid transparent; background: #fff; color: var(--navy); cursor: pointer;
}
.cms-toolbar button:hover { border-color: var(--blue); }
.cms-editor__area { min-height: 340px; padding: 20px 24px; background: #fff; font-size: 1.05rem; line-height: 1.7; }
.cms-editor__area:focus { outline: none; }
.cms-editor__area > * { margin: 0 0 .9em; }
.cms-editor__area h2 { font-size: 1.4rem; }
.cms-editor__area ul, .cms-editor__area ol { padding-left: 1.4em; }
.cms-editor__area blockquote { padding: 14px 18px; background: var(--sun-100); border-left: 6px solid var(--sun); border-radius: 10px; }

.cms-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* Team & gallery editors */
.cms-item__thumb--square { width: 80px; height: 80px; }
.cms-fieldset { border: 0; padding: 0; margin: 0; }
.cms-fieldset legend { font-weight: 600; color: var(--navy); margin-bottom: 10px; padding: 0; }
.cms-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.cms-swatch { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); padding: 10px 16px; border: 2px solid var(--blue-100); border-radius: 99px; cursor: pointer; margin: 0; }
.cms-swatch:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.cms-swatch input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.cms-swatch__dot { width: 22px; height: 22px; border-radius: 50%; }
.cms-photo__preview--oval { aspect-ratio: 170 / 216; width: 170px; border-radius: 50%; justify-self: center; }
.cms-photo__preview--oval img { object-position: 50% 8%; }
.cms-photo__initials { font-weight: 700; font-size: 1.6rem; color: var(--navy); }
.cms-avatar--blue .cms-photo__initials { color: #fff; }
.cms-photo__preview--square { aspect-ratio: 1; }
.cms-photo__preview--square[data-focus="top"] img { object-position: 50% 15%; }
.cms-photo__preview--square[data-focus="centre"] img { object-position: 50% 50%; }
.cms-photo__preview--square[data-focus="bottom"] img { object-position: 50% 85%; }

@media (max-width: 680px) {
  .cms-item { grid-template-columns: 80px 1fr; }
  .cms-item--sortable { grid-template-columns: 28px 64px 1fr; }
  .cms-item__thumb { width: 80px; height: 64px; }
  .cms-item__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .cms-photo { grid-template-columns: 1fr; }
  .cms-card { padding: 22px 18px; }
  .cms-brand span { display: none; }
}

/* Colour fills for team ovals – last so they win over the default preview background */
.cms-avatar--blue { background: #3b82d6; }
.cms-avatar--sun { background: var(--sun); }
.cms-avatar--coral { background: #ff8b6e; }
.cms-avatar--sage { background: #7cc39b; }
