/* ==========================================================================
   AutoRental System — Dynamic Content / Prose CSS
   Handles arbitrary CMS/editor-generated HTML: headings, text, lists,
   quotes, code, tables, media, forms, callouts, TOC, and small UI extras.

   Swap fonts in one place: --font-display / --font-body / --font-mono.
   Everything below builds on the tokens you already defined; nothing in
   your original block was removed, only extended.
   ========================================================================== */

:root {
    --ink: #0B1220;
    --body: #5B6472;
    --brand: #2F7A5C;
    --brand-dark: #245F49;
    --brand-tint: #EAF3EF;
    --badge: #DCE7FB;
    --badge-ink: #28407D;
    --surface: #F7F9FC;
    --surface-2: #FFFFFF;
    --border: #E7EAF0;

    /* semantic accents for callouts / states */
    --info: #2B6CB0;      --info-tint: #E7F0FC;
    --success: #2F7A5C;   --success-tint: #EAF3EF;
    --warning: #B7791F;   --warning-tint: #FBF3E3;
    --danger: #C53030;    --danger-tint: #FBEAEA;

    /* fonts — change these two lines to swap the whole system */
    --font-display: 'Sora', sans-serif;
    --font-body: 'Inter', 'Sora', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* scale */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 8px -4px rgba(11,18,32,.08);
    --shadow-md: 0 16px 40px -20px rgba(11,18,32,.22);
    --measure: 68ch; /* comfortable line length for body copy */
}

html { scroll-behavior: smooth; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 4px;
}

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

.logo-mark {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #2F7A5C 0%, #2F7A5C 50%, #7FC6A6 50%, #7FC6A6 100%);
    clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%);
}

.timeline-motif {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.tbar {
    position: absolute;
    height: 10px;
    border-radius: 6px;
    opacity: .5;
}

/* ==========================================================================
   Reading progress bar — attach to a fixed element, update width via JS
   (scrollY / (docHeight - winHeight) * 100). Purely optional UI sugar.
   ========================================================================== */
.reading-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, var(--brand), #7FC6A6);
    z-index: 100; transition: width .1s linear;
}

/* ==========================================================================
   .prose-article — the container for any dynamic/CMS HTML
   ========================================================================== */
.prose-article {
    font-family: var(--font-body);
    max-width: var(--measure);
    color: var(--body);
}

/* Headings */
.prose-article h1 {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--ink);
    font-size: clamp(1.9rem, 1.6rem + 1.2vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 1.25rem;
}
.prose-article h2 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    font-size: 24px;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 90px; /* so anchor jumps clear a fixed header */
}
.prose-article h3 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    font-size: 19px;
    margin-top: 2rem;
    margin-bottom: .75rem;
    scroll-margin-top: 90px;
}
.prose-article h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    font-size: 16px;
    margin-top: 1.5rem;
    margin-bottom: .5rem;
}
.prose-article h5,
.prose-article h6 {
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--body);
    font-size: 12px;
    margin-top: 1.25rem;
    margin-bottom: .5rem;
}

/* First heading right after the top shouldn't add extra gap */
.prose-article > :first-child { margin-top: 0; }

/* Paragraphs */
.prose-article p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    color: var(--body);
}
.prose-article p.lead {
    font-size: 19px;
    line-height: 1.7;
    color: var(--ink);
    font-weight: 500;
}
/* Optional drop-cap utility — add class="has-dropcap" on a <p> */
.prose-article p.has-dropcap::first-letter {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 3.4em;
    line-height: .85;
    float: left;
    margin: .04em .12em 0 0;
    color: var(--brand);
}

/* Inline text */
.prose-article strong { color: var(--ink); font-weight: 700; }
.prose-article em { font-style: italic; }
.prose-article mark {
    background: var(--brand-tint);
    color: var(--brand-dark);
    padding: .05em .3em;
    border-radius: 4px;
}
.prose-article small { font-size: 13px; color: var(--body); }
.prose-article sub, .prose-article sup { font-size: .72em; }
.prose-article kbd {
    font-family: var(--font-mono);
    font-size: .82em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: .12em .45em;
    color: var(--ink);
}
.prose-article abbr {
    text-decoration: underline dotted var(--border);
    cursor: help;
}

/* Links */
.prose-article a {
    color: var(--brand);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color .15s ease, color .15s ease;
}
.prose-article a:hover {
    color: var(--brand-dark);
    text-decoration-color: var(--brand-dark);
}

/* Lists */
.prose-article ul,
.prose-article ol {
    margin-bottom: 1.25rem;
    padding-left: 1.4rem;
}
.prose-article li {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: .5rem;
    color: var(--body);
}
.prose-article ul { list-style: none; }
.prose-article ul > li { position: relative; padding-left: 1.3rem; }
.prose-article ul > li::before {
    content: "";
    position: absolute;
    left: 0; top: .68em;
    width: 7px; height: 7px;
    border-radius: 999px;
    background: var(--brand);
}
.prose-article ol { list-style: none; counter-reset: prose-ol; }
.prose-article ol > li {
    position: relative;
    padding-left: 2rem;
    counter-increment: prose-ol;
}
.prose-article ol > li::before {
    content: counter(prose-ol);
    position: absolute; left: 0; top: .1em;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 700;
    color: var(--brand-dark);
    background: var(--brand-tint);
    border-radius: 6px;
}
.prose-article ul ul, .prose-article ol ol,
.prose-article ul ol, .prose-article ol ul {
    margin-top: .5rem; margin-bottom: 0;
}
/* Task lists — <li><input type="checkbox" disabled> label</li> */
.prose-article li:has(> input[type="checkbox"]) {
    list-style: none; padding-left: 1.8rem;
}
.prose-article li input[type="checkbox"] {
    position: absolute; margin-left: -1.8rem; margin-top: .3rem;
    accent-color: var(--brand);
}

/* Blockquote */
.prose-article blockquote {
    position: relative;
    margin: 1.75rem 0;
    padding: 1.1rem 1.5rem 1.1rem 3.1rem;
    background: var(--surface);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--ink);
    font-size: 16.5px;
    line-height: 1.75;
}
.prose-article blockquote::before {
    content: "\201C";
    position: absolute; left: 1.1rem; top: .35rem;
    font-family: var(--font-display);
    font-size: 2.2rem; font-weight: 800;
    color: var(--brand);
    opacity: .55;
    line-height: 1;
}
.prose-article blockquote p:last-child { margin-bottom: 0; }
.prose-article blockquote cite {
    display: block; margin-top: .6rem;
    font-style: normal; font-size: 13px; font-weight: 600;
    color: var(--body);
}
.prose-article blockquote cite::before { content: "— "; }

/* Code */
.prose-article code {
    font-family: var(--font-mono);
    font-size: .87em;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--brand-dark);
    padding: .12em .4em;
    border-radius: 5px;
}
.prose-article pre {
    position: relative;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.7;
    background: var(--ink);
    color: #E6EAF2;
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}
.prose-article pre code {
    background: none; border: none; color: inherit;
    padding: 0; font-size: inherit;
}
/* Optional label — <pre data-lang="php"> */
.prose-article pre[data-lang]::before {
    content: attr(data-lang);
    position: absolute; top: 0; right: 0;
    font-family: var(--font-body);
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #9AA6BD;
    background: rgba(255,255,255,.06);
    padding: .3em .7em;
    border-radius: 0 var(--radius-md) 0 var(--radius-sm);
}

/* Tables */
.prose-article .table-scroll { overflow-x: auto; margin-bottom: 1.5rem; }
.prose-article table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14.5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.prose-article thead th {
    text-align: left;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--body);
    background: var(--surface);
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.prose-article tbody td {
    padding: .75rem 1rem;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
}
.prose-article tbody tr:last-child td { border-bottom: none; }
.prose-article tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.prose-article tbody tr:hover { background: var(--brand-tint); }

/* Media */
.prose-article img,
.prose-article video {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    display: block;
}
.prose-article figure { margin: 1.75rem 0; }
.prose-article figure img { box-shadow: var(--shadow-sm); }
.prose-article figcaption {
    margin-top: .6rem;
    font-size: 13px;
    color: var(--body);
    text-align: center;
}
/* Responsive embed wrapper — wrap an <iframe> in <div class="embed-16x9"> */
.embed-16x9 {
    position: relative; width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.embed-16x9 iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* Divider */
.prose-article hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2.5rem 0;
    position: relative;
}
.prose-article hr::after {
    content: "";
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 6px; height: 6px; border-radius: 999px;
    background: var(--brand);
}

/* Details / accordion */
.prose-article details {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: .9rem 1.1rem;
    margin-bottom: 1.25rem;
    background: var(--surface-2);
}
.prose-article summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
    display: flex; align-items: center; justify-content: space-between;
}
.prose-article summary::-webkit-details-marker { display: none; }
.prose-article summary::after {
    content: "+";
    font-family: var(--font-mono);
    color: var(--brand);
    transition: transform .2s ease;
}
.prose-article details[open] summary::after { transform: rotate(45deg); }
.prose-article details p:last-child { margin-bottom: 0; margin-top: .75rem; }

/* Callouts / admonitions — <div class="callout callout-info"> */
.callout {
    display: flex; gap: .75rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    font-size: 14.5px;
    line-height: 1.7;
}
.callout .callout-icon {
    width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
}
.callout p:last-child { margin-bottom: 0; }
.callout-info    { background: var(--info-tint);    border-color: color-mix(in srgb, var(--info) 25%, transparent);    color: var(--info); }
.callout-success { background: var(--success-tint); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.callout-warning { background: var(--warning-tint); border-color: color-mix(in srgb, var(--warning) 25%, transparent); color: var(--warning); }
.callout-danger  { background: var(--danger-tint);  border-color: color-mix(in srgb, var(--danger) 25%, transparent);  color: var(--danger); }
.callout p, .callout li { color: inherit; }

/* Badges / tags for taxonomy, category pills, etc. */
.tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600;
    padding: .3em .75em;
    border-radius: 999px;
    background: var(--badge);
    color: var(--badge-ink);
}
.tag-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--body);
}

/* ==========================================================================
   Table of contents
   ========================================================================== */
.toc-link {
    display: block;
    font-size: 13px;
    color: var(--body);
    padding: 6px 0;
    border-left: 2px solid var(--border);
    padding-left: 14px;
    transition: .15s;
}
.toc-link:hover {
    color: var(--brand);
    border-left-color: var(--brand);
}
.toc-link.is-active {
    color: var(--brand-dark);
    font-weight: 600;
    border-left-color: var(--brand);
}
.toc-link.is-sub { padding-left: 28px; font-size: 12.5px; }

/* ==========================================================================
   Forms embedded in dynamic content (newsletter blocks, contact CTAs, etc.)
   ========================================================================== */
.prose-article input,
.prose-article textarea,
.prose-article select,
.form-field {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .65rem .85rem;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-feature-settings: "tnum" 1; /* tabular numerals for prices/dates */
}
.prose-article input:focus,
.prose-article textarea:focus,
.prose-article select:focus,
.form-field:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.prose-article label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--ink);
    margin-bottom: .4rem;
}
.prose-article button,
.btn {
    font-family: var(--font-body);
    font-weight: 600; font-size: 14.5px;
    border-radius: var(--radius-sm);
    padding: .65rem 1.3rem;
    border: none; cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* ==========================================================================
   Responsive tuning
   ========================================================================== */
@media (max-width: 640px) {
    .prose-article h1 { font-size: 1.7rem; }
    .prose-article h2 { font-size: 20px; margin-top: 2rem; }
    .prose-article h3 { font-size: 17px; }
    .prose-article p, .prose-article li { font-size: 15px; }
    .prose-article blockquote { padding: 1rem 1.1rem 1rem 2.6rem; }
    .prose-article pre { font-size: 12.5px; padding: .9rem 1rem; }
}