/*
Theme Name: ChemicaLife Scientific Editorial
Theme URI: https://chemicalife.com/
Author: ChemicaLife
Description: Responsive editorial WordPress theme adapted from the ChemicaLife Stitch project.
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: chemicalife
*/

:root {
  --cl-surface: #f7f9ff;
  --cl-paper: #ffffff;
  --cl-ink: #0b1d2d;
  --cl-muted: #3e4949;
  --cl-teal: #006565;
  --cl-blue: #1960a3;
  --cl-line: #bdc9c8;
  --cl-soft: #eef4ff;
  --cl-danger: #ba1a1a;
  --cl-warning: #8a4900;
}

html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cl-surface); color: var(--cl-ink); }
body.admin-bar header.sticky, body.admin-bar header.fixed { top: 32px !important; }
.cl-anchor { display: block; position: relative; top: -112px; visibility: hidden; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ffb77d !important;
  outline-offset: 3px;
}

.cl-mobile-menu {
  display: none;
  position: fixed;
  inset: 72px 16px auto 16px;
  z-index: 9999;
  padding: 16px;
  border: 1px solid var(--cl-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(11, 29, 45, .16);
}
.cl-mobile-menu.is-open { display: grid; gap: 4px; }
.cl-mobile-menu a { color: var(--cl-ink); font: 600 15px/1.4 "Public Sans", sans-serif; padding: 12px; text-decoration: none; }
.cl-mobile-toggle { display: none !important; }
.cl-form-message { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--cl-blue); background: var(--cl-soft); color: var(--cl-ink); font-size: 14px; }
.cl-form-message.is-error { border-left-color: var(--cl-danger); background: #ffdad6; color: #93000a; }

@media (max-width: 782px) {
  body.admin-bar header.sticky, body.admin-bar header.fixed { top: 46px !important; }
  .cl-mobile-toggle { display: inline-flex !important; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  body[data-cl-page] header, body[data-cl-page] nav { max-width: 100%; }
  body[data-cl-page] header { padding-left: 16px !important; padding-right: 16px !important; }
  body[data-cl-page] header img { max-width: 170px; height: auto; }
  body[data-cl-page] main { overflow-x: clip; }
  body[data-cl-page] table { display: block; max-width: 100%; overflow-x: auto; }
}

/* WordPress-native article and fallback pages */
.cl-site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(189,201,200,.7); background: rgba(247,249,255,.96); backdrop-filter: blur(12px); }
.cl-site-header__inner, .cl-container { width: min(100% - 32px, 1152px); margin-inline: auto; }
.cl-site-header__inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.cl-brand { color: var(--cl-teal); font: 700 26px/1.2 "Playfair Display", Georgia, serif; text-decoration: none; }
.cl-nav { display: flex; align-items: center; gap: 24px; }
.cl-nav a { color: var(--cl-muted); font: 600 14px/1.4 "Public Sans", sans-serif; text-decoration: none; }
.cl-nav a:hover { color: var(--cl-teal); }
.cl-content { padding-block: clamp(48px, 8vw, 96px); }
.cl-article { max-width: 780px; margin-inline: auto; }
.cl-kicker { color: var(--cl-blue); font: 600 13px/1.4 "Public Sans", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.cl-title { margin: 12px 0 20px; color: var(--cl-ink); font: 700 clamp(38px, 7vw, 64px)/1.08 "Playfair Display", Georgia, serif; letter-spacing: -.025em; }
.cl-meta { color: var(--cl-muted); font: 400 14px/1.6 "Public Sans", sans-serif; }
.cl-prose { margin-top: 44px; color: var(--cl-ink); font: 400 18px/1.78 "Public Sans", system-ui, sans-serif; }
.cl-prose h2, .cl-prose h3 { color: var(--cl-ink); font-family: "Playfair Display", Georgia, serif; line-height: 1.2; }
.cl-prose h2 { margin-top: 2.2em; font-size: 34px; }
.cl-prose h3 { margin-top: 1.8em; font-size: 26px; }
.cl-prose a { color: var(--cl-blue); }
.cl-prose img { max-width: 100%; height: auto; }
.cl-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.cl-card { border: 1px solid var(--cl-line); border-radius: 6px; background: #fff; padding: 24px; }
.cl-card h2 { margin: 0 0 12px; font: 600 25px/1.25 "Playfair Display", Georgia, serif; }
.cl-card a { color: inherit; text-decoration: none; }
.cl-pagination { margin-top: 48px; }
.cl-site-footer { border-top: 1px solid var(--cl-line); background: var(--cl-soft); padding: 48px 0; color: var(--cl-muted); font: 400 14px/1.6 "Public Sans", sans-serif; }
.cl-footer-grid { display: flex; justify-content: space-between; gap: 32px; }

@media (max-width: 760px) {
  .cl-nav { display: none; }
  .cl-card-grid { grid-template-columns: 1fr; }
  .cl-footer-grid { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
