/* saleem.fi content styles
 *
 * Styles for page/post bodies (the HTML stored in the database). Loaded by the public site,
 * the admin editor's preview and the revision preview, so all three look the same.
 * The markup vocabulary is documented in README.md ("Content markup").
 * Bump ?v= in src/lib/content-css.ts after editing (browsers cache /styles).
 */

:root {
  --ink: #0b1430;
  --navy: #13275f;
  --navy-2: #1d3b8b;
  --brand: #6d4cff;
  --brand-2: #8f6bff;
  --accent: #ffc72c;
  --accent-ink: #1b1400;
  --text: #1c2437;
  --muted: #5d6680;
  --line: #e3e7f1;
  --paper: #f5f7fc;
  --white: #fff;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(11 20 48 / 6%), 0 8px 24px rgb(11 20 48 / 6%);
  --shadow-lg: 0 2px 4px rgb(11 20 48 / 6%), 0 18px 48px rgb(11 20 48 / 12%);
  --wrap: 1180px;
  --measure: 72ch;
  --gutter: clamp(18px, 4vw, 40px);
  --font-sans: var(--font-inter, "Inter"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-jakarta, "Plus Jakarta Sans"), var(--font-sans);
  --font-script: var(--font-caveat, "Caveat"), cursive;
}

/* ------------------------------------------------------------ base text */

.content {
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--font-sans);
  overflow-wrap: break-word;
}
.content > :first-child { margin-top: 0; }
.content :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 1.6em 0 0.5em;
  text-wrap: balance;
}
.content h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; }
.content h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); font-weight: 800; }
.content h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); font-weight: 700; }
.content h4 { font-size: 1.15rem; font-weight: 700; }
.content h5, .content h6 { font-size: 1rem; font-weight: 700; }
.content p, .content ul, .content ol, .content blockquote, .content table, .content dl, .content pre { margin: 0 0 1.1em; }
.content :where(ul, ol) { padding-left: 1.3em; }
.content li { margin: 0.3em 0; }
.content li::marker { color: var(--brand); }
.content a { color: var(--navy-2); text-decoration: underline; text-decoration-color: rgb(29 59 139 / 30%); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: text-decoration-color 0.15s; }
.content a:hover { text-decoration-color: currentColor; }
.content strong { font-weight: 700; color: var(--ink); }
.content hr { border: 0; height: 1px; background: var(--line); margin: 2.2em 0; }
.content blockquote { border-left: 3px solid var(--brand); margin-left: 0; padding: 0.2em 0 0.2em 1.2em; color: var(--muted); font-size: 1.1em; }
.content pre { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; overflow: auto; font-size: 0.9em; }
.content table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.content :where(th, td) { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.content th { font-weight: 700; color: var(--ink); background: var(--paper); }

/* media */
.content img { max-width: 100%; height: auto; display: inline-block; vertical-align: middle; }
.content figure { margin: 0 0 1.4em; }
.content figure img { border-radius: var(--radius-sm); }
.content figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 8px; }
.content video, .content iframe { display: block; width: 100%; max-width: 100%; border: 0; border-radius: var(--radius-sm); background: #0a0f1f; margin: 0 0 1.4em; }
.content video { height: auto; max-height: 80vh; }
.content .embed { position: relative; aspect-ratio: 16 / 9; margin: 0 0 1.4em; border-radius: var(--radius-sm); overflow: hidden; background: #0a0f1f; }
.content .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 0; }
.content .embed--map { aspect-ratio: 4 / 3; max-height: 460px; }
.content .pdf { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 1.4em; background: var(--paper); }
.content .pdf iframe { height: min(80vh, 900px); margin: 0; border-radius: 0; background: #fff; }
.content .pdf__bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 0.92rem; }
.content .pdf__bar strong { margin-right: auto; }

/* ------------------------------------------------------------ eyebrow, actions, buttons */

.content .eyebrow {
  font: 700 0.78rem/1.3 var(--font-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.8em;
}
.content .eyebrow + :is(h1, h2, h3) { margin-top: 0; }
.content .actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4em 0; }
.content .actions + .actions { margin-top: -0.4em; }

.btn,
.content .btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 0.95rem/1 var(--font-sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 6px 18px rgb(255 199 44 / 28%);
}
.btn:hover, .content .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgb(255 199 44 / 38%); text-decoration: none; }
.btn:active, .content .btn:active { transform: translateY(0); }
.btn:focus-visible, .content .btn:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 3px; }
.btn--ghost, .content .btn--ghost { background: transparent; color: var(--ink); border-color: rgb(11 20 48 / 22%); box-shadow: none; }
.btn--ghost:hover, .content .btn--ghost:hover { background: rgb(11 20 48 / 5%); box-shadow: none; }
.btn--dark, .content .btn--dark { background: var(--ink); color: #fff; box-shadow: none; }

/* ------------------------------------------------------------ bands (full-width sections) */

.content .band {
  position: relative;
  padding: clamp(48px, 8vw, 104px) var(--gutter);
  margin: 0;
}
.content .band > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.content .band > :is(p, ul, ol, blockquote, h3, h4) { max-width: min(var(--wrap), var(--measure)); }
.content .band > :is(h2, h2 + p) { text-align: center; }
.content .band > h2 + p { color: var(--muted); font-size: 1.1rem; margin-bottom: 2em; }
.content .band > :first-child { margin-top: 0; }
.content .band > :last-child { margin-bottom: 0; }
/* two plain bands in a row share one gap; after a coloured band the next keeps its padding */
.content .band:not([class*="band--"]) + .band:not([class*="band--"]) { padding-top: 0; }
/* blocks with their own margin rule still centre inside a band */
.content .band > :is(.cols, .embed, .pdf, .stats, .gallery, .post-grid, .form, figure) { margin-left: auto; margin-right: auto; }
.content .band:not([class*="band--"]) + .band:not([class*="band--"]) { padding-top: 0; }

.content .band--soft { background: var(--paper); }
.content .band--warm { background: #fff8e6; }
.content :is(.band--ink, .band--brand) {
  color: #dfe5f7;
  background:
    radial-gradient(900px 420px at 85% -10%, rgb(143 107 255 / 35%), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgb(255 199 44 / 14%), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--ink) 100%);
  overflow: hidden;
}
.content .band--brand {
  background:
    radial-gradient(900px 420px at 90% -20%, rgb(255 255 255 / 18%), transparent 60%),
    radial-gradient(800px 420px at -10% 120%, rgb(255 199 44 / 18%), transparent 60%),
    linear-gradient(150deg, #3b2bb8 0%, #2a1f86 45%, var(--ink) 100%);
}
.content :is(.band--ink, .band--brand) :is(h1, h2, h3, h4, strong) { color: #fff; }
.content :is(.band--ink, .band--brand) a:not(.btn) { color: #fff; text-decoration-color: rgb(255 255 255 / 45%); }
.content :is(.band--ink, .band--brand) .eyebrow { color: var(--accent); }
.content :is(.band--ink, .band--brand) > h2 + p { color: #c4cbe4; }
.content :is(.band--ink, .band--brand) .btn--ghost { color: #fff; border-color: rgb(255 255 255 / 40%); }
.content :is(.band--ink, .band--brand) .btn--ghost:hover { background: rgb(255 255 255 / 10%); }
.content :is(.band--ink, .band--brand) hr { background: rgb(255 255 255 / 16%); }

/* hero: the first band of a page */
.content .band--hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(56px, 9vw, 120px); }
.content .band--hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.05; margin: 0 0 0.45em; }
.content .band--hero .eyebrow { font: 600 1.7rem/1 var(--font-script); letter-spacing: 0; text-transform: none; margin-bottom: 0.4em; }
.content .band--hero > .cols { align-items: center; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.content .band--hero figure { margin: 0; }
.content .band--hero figure img { border-radius: 0; filter: drop-shadow(0 30px 40px rgb(0 0 0 / 35%)); }
.content .band--hero .cols > :last-child:has(> figure:only-child) { align-self: end; margin-bottom: calc(-1 * clamp(56px, 9vw, 120px)); }
.content .band--hero p { font-size: 1.15rem; }

/* ------------------------------------------------------------ columns */

.content .cols {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  margin: 0 0 1.6em;
  align-items: start;
}
.content .cols > * { min-width: 0; }
.content .cols > * > :first-child { margin-top: 0; }
.content .cols > * > :last-child { margin-bottom: 0; }
.content .cols:has(> :nth-child(5):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.content .cols:has(> :nth-child(2):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: center; }

/* ------------------------------------------------------------ cards, features, stats */

.content .card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 2.6vw, 30px);
  box-shadow: var(--shadow);
  height: 100%;
}
.content .card > :first-child { margin-top: 0; }
.content .card > :last-child { margin-bottom: 0; }
.content .card .actions { margin-bottom: 0; }
.content .card--ink, .content .card--brand { color: #dfe5f7; border-color: transparent; background: linear-gradient(160deg, var(--navy), var(--ink)); }
.content .card--brand { background: linear-gradient(160deg, #4a36d6, #2a1f86); }
.content :is(.card--ink, .card--brand) :is(h2, h3, h4, strong) { color: #fff; }
.content .tint-blue { background: #eef5ff; border-color: #d9e7ff; }
.content .tint-green { background: #eef8ef; border-color: #d6eed9; }
.content .tint-yellow { background: #fff8e3; border-color: #f7e7b5; }
.content .tint-orange { background: #fff2e8; border-color: #fbdcc4; }
.content .tint-pink { background: #fdf0f6; border-color: #f6d6e6; }
.content .tint-purple { background: #f3efff; border-color: #e1d8ff; }
.content .tint-grey { background: var(--paper); }

.content .feature > img:first-child { width: 52px; height: 52px; object-fit: contain; margin-bottom: 14px; border-radius: 12px; }
.content .feature h3 { font-size: 1.15rem; margin: 0 0 0.35em; }
.content .feature p { color: var(--muted); font-size: 0.98rem; margin: 0; }
.content .cols > .feature { padding: 4px 0; }

.content .stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 1.8em 0 0; }
.content .stat { display: grid; gap: 4px; }
.content .stat strong { font: 800 clamp(2rem, 3.4vw, 2.6rem)/1 var(--font-display); letter-spacing: -0.02em; color: inherit; }
.content :is(.band--ink, .band--brand) .stat strong { color: var(--accent); }
.content .stat span { font-size: 0.88rem; color: var(--muted); max-width: 16ch; line-height: 1.35; }
.content :is(.band--ink, .band--brand) .stat span { color: #b9c1dd; }

.content .checks { list-style: none; padding: 0; display: grid; gap: 10px; }
.content .checks li { position: relative; padding-left: 30px; margin: 0; font-weight: 600; }
.content .checks li::before { content: ""; position: absolute; left: 0; top: 0.25em; width: 20px; height: 20px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%231b1400' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* ------------------------------------------------------------ gallery (scrolling row) */

.content .gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 22%, 260px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding: 4px 2px 14px;
  margin: 0 0 1.4em;
}
.content .gallery figure { margin: 0; scroll-snap-align: start; }
.content .gallery img { width: 100%; height: auto; aspect-ratio: auto; object-fit: cover; border-radius: var(--radius-sm); }
.content .gallery:has(img[width="150"]) { grid-auto-columns: 120px; align-items: center; }
.content .gallery:has(img[width="150"]) img { filter: grayscale(1); opacity: 0.8; transition: filter 0.2s, opacity 0.2s; border-radius: 12px; }
.content .gallery:has(img[width="150"]) img:hover { filter: none; opacity: 1; }
.content .gallery-wrap { position: relative; }
.content .gallery-nav { position: absolute; top: calc(50% - 22px); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; z-index: 1; color: var(--ink); }
.content .gallery-nav--prev { left: -8px; }
.content .gallery-nav--next { right: -8px; }
.content .gallery-nav svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ read more */

.content details.more { margin: 0 0 1.1em; }
.content details.more > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 0.92rem; color: var(--navy-2); padding: 6px 0;
}
.content details.more > summary::-webkit-details-marker { display: none; }
.content details.more > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.content details.more[open] > summary { order: 2; }
.content details.more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.content details.more[open] { display: flex; flex-direction: column; }
.content details.more[open] > summary { font-size: 0; }
.content details.more[open] > summary::before { content: "Show less"; font-size: 0.92rem; }

/* ------------------------------------------------------------ post grid (data-posts) */

.post-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 0 0 1.6em; }
.post-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; position: relative;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-card__media { aspect-ratio: 16 / 10; background: linear-gradient(150deg, var(--navy-2), var(--brand)); display: grid; place-items: center; overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; }
.post-card__media span { font: 800 3rem/1 var(--font-display); color: rgb(255 255 255 / 85%); }
.post-card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 0.8rem; color: var(--muted); }
.post-card__cat { font-weight: 700; color: var(--brand) !important; text-decoration: none !important; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; position: relative; z-index: 1; }
.post-card__title { font: 700 1.15rem/1.3 var(--font-display) !important; letter-spacing: -0.01em; margin: 0 !important; color: var(--ink); }
.post-card__title a { color: inherit !important; text-decoration: none !important; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__excerpt { color: var(--muted); font-size: 0.95rem; line-height: 1.55; margin: 0 !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__more { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 0.9rem; color: var(--navy-2); display: inline-flex; align-items: center; gap: 6px; }
.post-card__more svg { width: 14px; height: 14px; transition: transform 0.2s; }
.post-card:hover .post-card__more svg { transform: translateX(3px); }

/* ------------------------------------------------------------ forms (data-form) */

.form { display: grid; gap: 18px; max-width: 640px; }
.form__fields { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field__label, .field legend { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.field__req { color: #c2364a; }
.field :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, select) {
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 11px 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field :is(input, textarea, select):focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(109 76 255 / 15%); }
.field fieldset { border: 0; padding: 0; margin: 0; }
.field fieldset ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.field fieldset li { display: flex; gap: 10px; align-items: center; margin: 0; }
.field fieldset input { width: 18px; height: 18px; accent-color: var(--brand); }
.field__error { color: #c2364a; font-size: 0.85rem; font-style: normal; }
.field.has-error :is(input, textarea, select) { border-color: #c2364a; }
.form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form__submit { justify-self: start; }
.form__submit.is-sending { opacity: 0.75; pointer-events: none; }
.form-status:empty { display: none; }
.form-status[data-state="pending"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.form-status[data-state="success"], .form-status[data-state="error"] { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid; }
.form-status[data-state="success"] { background: #effaf2; border-color: #bfe6cb; color: #14532d; }
.form-status[data-state="error"] { background: #fff1f2; border-color: #fecdd3; color: #881337; }
.form-status__icon { width: 26px; height: 26px; flex: none; fill: currentColor; }
.form-status__icon path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.form-status__title { font-weight: 700; margin: 0; }
.form-status__text { margin: 4px 0 0; font-size: 0.95rem; }
.form-status__again { margin-top: 10px; background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; cursor: pointer; }
.form[data-sent="true"] .form__fields, .form[data-sent="true"] .form__submit { display: none; }
.content :is(.band--ink, .band--brand) .field__label, .content :is(.band--ink, .band--brand) .field legend { color: #fff; }

/* ------------------------------------------------------------ small screens */

@media (max-width: 720px) {
  .content .band--hero > .cols { grid-template-columns: 1fr; }
  .content .band--hero .cols > :last-child:has(> figure:only-child) { margin-bottom: calc(-1 * clamp(56px, 9vw, 120px)); max-width: 420px; margin-inline: auto; }
  .content .band > :is(h2, h2 + p) { text-align: left; }
  .content .gallery { grid-auto-columns: 70%; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .content .btn, .post-card, .post-card__more svg { transition: none; }
}
