/* Ability site styles, on top of Bootstrap 5.3. Icons are inline SVG (site-src/icons), no icon font. */

/* ---- Brand tokens ------------------------------------------------------------------------------
   One place for the Ability colours and type. Bootstrap 5 reads its --bs-* variables, so changing
   a value here restyles links, buttons, focus rings and form controls everywhere.
   Light and dark values are separate: the theme follows the visitor's system setting
   (data-bs-theme is set by the small script in templates/layout.html). */
:root {
    --ab-red: #90191B;          /* brand red (from the logo) */
    --ab-red-rgb: 144, 25, 27;
    --ab-red-dark: #741416;     /* hover */
    --ab-red-darker: #5c1012;   /* pressed */
    --ab-footer: #1c1f23;

    --bs-body-font-family: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-line-height: 1.6;
    --bs-primary: var(--ab-red);
    --bs-primary-rgb: var(--ab-red-rgb);
    --bs-border-radius: .5rem;
    --bs-border-radius-lg: .75rem;
    --bs-focus-ring-color: rgba(var(--ab-red-rgb), .25);
}
:root, [data-bs-theme=light] {
    --ab-ink: #1f2328;          /* headings and body text */
    --ab-muted: #5b6370;
    --ab-accent: var(--ab-red); /* red used as text: links, icons */
    --ab-accent-rgb: var(--ab-red-rgb);
    --ab-tint: #fbf1f1;         /* soft red background */
    --ab-surface: #f6f7f9;      /* light section background */
    --ab-border: #e3e6ea;
    --ab-nav-bg: rgba(255, 255, 255, .92);
    --ab-shadow: 0 .5rem 1.5rem rgba(31, 35, 40, .08);

    --bs-body-color: var(--ab-ink);
    --bs-emphasis-color: var(--ab-ink);
    --bs-secondary-color: var(--ab-muted);
    --bs-border-color: var(--ab-border);
    --bs-link-color: var(--ab-red);
    --bs-link-color-rgb: var(--ab-red-rgb);
    --bs-link-hover-color: var(--ab-red-darker);
    --bs-link-hover-color-rgb: 92, 16, 18;
}
[data-bs-theme=dark] {
    --ab-ink: #e7e9ec;
    --ab-muted: #a4acb7;
    --ab-accent: #ef7a7c;       /* the brand red is too dark to read on a dark page */
    --ab-accent-rgb: 239, 122, 124;
    --ab-tint: #2a1a1b;
    --ab-surface: #1b1f24;
    --ab-border: #2f353c;
    --ab-nav-bg: rgba(18, 20, 23, .9);
    --ab-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .4);
    --ab-footer: #0c0e10;

    --bs-body-bg: #121417;
    --bs-body-bg-rgb: 18, 20, 23;
    --bs-body-color: var(--ab-ink);
    --bs-emphasis-color: #fff;
    --bs-secondary-color: var(--ab-muted);
    --bs-border-color: var(--ab-border);
    --bs-tertiary-bg: var(--ab-surface);
    --bs-link-color: var(--ab-accent);
    --bs-link-color-rgb: var(--ab-accent-rgb);
    --bs-link-hover-color: #f6a5a6;
    --bs-link-hover-color-rgb: 246, 165, 166;
}

/* ---- Type --------------------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ab-ink);
    font-weight: 650;
    letter-spacing: -.01em;
    line-height: 1.25;
}
h1, .h1 { font-weight: 700; letter-spacing: -.02em; }
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 { font-weight: 700; letter-spacing: -.02em; }
.lead { color: var(--ab-muted); font-weight: 400; }
a { text-underline-offset: .2em; }
.text-muted { color: var(--ab-muted) !important; }
.bi { vertical-align: -.125em; flex-shrink: 0; }

/* ---- Buttons and form controls in the brand colour ------------------------------------------------ */
.btn { font-weight: 600; }
.btn-primary {
    --bs-btn-bg: var(--ab-red);
    --bs-btn-border-color: var(--ab-red);
    --bs-btn-hover-bg: var(--ab-red-dark);
    --bs-btn-hover-border-color: var(--ab-red-dark);
    --bs-btn-active-bg: var(--ab-red-darker);
    --bs-btn-active-border-color: var(--ab-red-darker);
    --bs-btn-disabled-bg: var(--ab-red);
    --bs-btn-disabled-border-color: var(--ab-red);
    --bs-btn-focus-shadow-rgb: var(--ab-red-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--ab-accent);
    --bs-btn-border-color: var(--ab-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ab-red);
    --bs-btn-hover-border-color: var(--ab-red);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--ab-red-dark);
    --bs-btn-active-border-color: var(--ab-red-dark);
    --bs-btn-focus-shadow-rgb: var(--ab-red-rgb);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: rgba(var(--ab-accent-rgb), .6);
    box-shadow: 0 0 0 .25rem rgba(var(--ab-accent-rgb), .2);
}
.form-check-input:checked { background-color: var(--ab-red); border-color: var(--ab-red); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--ab-red); --bs-dropdown-border-color: var(--ab-border); box-shadow: var(--ab-shadow); }
.card { --bs-card-border-color: var(--ab-border); --bs-card-cap-bg: var(--ab-surface); }

/* Keyboard focus: a clear ring on everything you can tab to */
a:focus-visible, .btn:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible, .navbar-toggler:focus-visible {
    outline: 3px solid rgba(var(--ab-accent-rgb), .55);
    outline-offset: 2px;
    box-shadow: none;
}

/* ---- Page frame ------------------------------------------------------------------------------- */
html { scroll-padding-top: 5rem; } /* anchors land below the sticky navbar */

.ab-navbar {
    background: var(--ab-nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--ab-border);
}
.ab-navbar .navbar-brand img { height: 24px; width: auto; display: block; }
.ab-navbar .nav-link { font-weight: 500; }
.ab-navbar .nav-link:hover { color: var(--ab-accent); }
.ab-lang-code { text-transform: uppercase; font-size: .875em; font-weight: 600; }
.ab-navbar .dropdown-item small { margin-left: .25rem; }
/* the current language in the menu */
body[data-ln=en] .dropdown-item[hreflang=en], body[data-ln=de] .dropdown-item[hreflang=de],
body[data-ln=fr] .dropdown-item[hreflang=fr], body[data-ln=es] .dropdown-item[hreflang=es],
body[data-ln=it] .dropdown-item[hreflang=it], body[data-ln=pt] .dropdown-item[hreflang=pt],
body[data-ln=nl] .dropdown-item[hreflang=nl], body[data-ln=sv] .dropdown-item[hreflang=sv] { font-weight: 700; }

#content { padding-top: 2rem; padding-bottom: 1rem; }

#abfooter .ab-footer { background: var(--ab-footer); color: #c9ced6; margin-top: 3rem; padding: 2.5rem 0 1rem; }
#abfooter .ab-footer-title { color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .75rem; }
#abfooter .row > div { margin-bottom: 1.25rem; line-height: 2; }
#abfooter a { color: #9aa3ae; text-decoration: none; }
#abfooter a:hover { color: #fff; }

/* ---- Home page ---------------------------------------------------------------------------------- */
.ab-hero {
    /* full width: undo the page's top padding and the container-fluid gutter */
    margin: -2rem calc(var(--bs-gutter-x) * -.5) 0;
    padding: 3.5rem 0 3rem;
    background:
        radial-gradient(60rem 30rem at 85% 0%, rgba(var(--ab-red-rgb), .10), transparent 70%),
        linear-gradient(180deg, var(--ab-tint), var(--bs-body-bg));
    border-bottom: 1px solid var(--ab-border);
}
.ab-hero-title { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: 1rem; }
.ab-version-badge { height: .9em; width: auto; vertical-align: -.08em; margin-left: .1em; }
.ab-hero-lead { font-size: 1.25rem; max-width: 34rem; }
.ab-hero-img { max-height: 420px; width: auto; filter: drop-shadow(0 1.25rem 1.5rem rgba(0, 0, 0, .18)); }

.ab-apps { margin-top: 3.5rem; }
.ab-section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.ab-app-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; margin-bottom: .75rem;
    border-radius: .65rem; font-size: 1.35rem;
    color: var(--ab-accent); background: var(--ab-tint);
}
.ab-apps .card-body p { color: var(--ab-muted); }
.ab-badge-pro { background: var(--ab-tint); color: var(--ab-accent); font-size: .6rem; font-weight: 600; vertical-align: .2em; }

/* The text blocks below (HOME_2..4) come from the translations: restyle, don't rewrite them */
.ab-home-body .display-3 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-top: 3.5rem !important; }
.ab-home-body .midpage { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 3rem; }
.ab-home-body .midpage small { display: block; font-size: .6em; font-weight: 400; color: var(--ab-muted); margin-top: .35rem; }
.ab-home-body .carousel { border: 1px solid var(--ab-border); border-radius: var(--bs-border-radius-lg); overflow: hidden; box-shadow: var(--ab-shadow); }
.ab-home-body .carousel-control-prev-icon, .ab-home-body .carousel-control-next-icon { filter: invert(1) grayscale(1) drop-shadow(0 0 2px rgba(255,255,255,.8)); }

/* Tick lists: feature lists on the home and product pages */
.ab-home-body ul, .ab-features ul { list-style: none; padding-left: 0; }
.ab-home-body ul > li, .ab-features ul > li { position: relative; padding-left: 1.75rem; }
.ab-home-body ul > li::before, .ab-features ul > li::before {
    content: ""; position: absolute; left: 0; top: .3em; width: 1.05em; height: 1.05em;
    background: var(--ab-accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- Products page -------------------------------------------------------------------------------- */
.ab-product-tabs .nav-link { color: var(--ab-muted); }
.ab-product-tabs .nav-link.active { color: var(--ab-ink); }
.ab-product-tabs .nav-link h4 { margin: 0; color: inherit; font-size: 1.15rem; }
.ab-price-card .card-body { padding: 1.5rem; }
.ab-price { font-size: 2.25rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: .5rem 0 1rem; color: var(--ab-ink); }
.ab-licence p:first-child { font-size: .9rem; color: var(--ab-accent); margin-bottom: .5rem; }
.ab-licence p { color: var(--ab-muted); }

/* ---- Small touches ------------------------------------------------------------------------------- */
.ab-lift { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.ab-lift:hover { transform: translateY(-3px); box-shadow: var(--ab-shadow); border-color: rgba(var(--ab-accent-rgb), .35); }
@media (prefers-reduced-motion: reduce) { .ab-lift, .ab-lift:hover { transition: none; transform: none; } }

/* ---- Old helpers, kept for existing text --------------------------------------------------------- */
#content li:not(:last-child) {
    margin-bottom: 8px;
}

.ability_red  {color: var(--ab-accent)}
.icon-lg { font-size: 100px; width: 130px; height: 130px; line-height:130px;}
.icon-small { font-size: 15px; width: 26px; height: 26px; line-height:26px;}

/* FAQ articles (old content with fixed-size images and tables): fit narrow screens */
.ab-faq img { max-width: 100%; height: auto; }
.ab-faq table { display: block; max-width: 100%; overflow-x: auto; }
.ab-faq a, .ab-faq code { overflow-wrap: anywhere; }
/* A label as shown in the software ({ui:File > Save As} in FAQ text) */
.ab-ui { font-weight: 600; }

/* Bootstrap 4 names that may still be in FAQ articles stored in DynamoDB (not part of this build) */
.card-block { flex: 1 1 auto; padding: 1rem; }
.form-group { margin-bottom: 1rem; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.float-right { float: right !important; }
.float-left { float: left !important; }
