/* Colours are sampled from the mockups: placeholders until Barko confirms its brand values.
   Fonts are self-hosted (SIL Open Font License 1.1): the CSP only allows font-src 'self', and no visitor data goes
   to a font CDN. */

@font-face {
    font-family: "Archivo";
    src: url("../fonts/archivo-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter Tight";
    src: url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --barko-navy-950: #0a1128;
    --barko-navy-800: #15233f;
    --barko-cream-100: #f2ede3;
    --barko-cream-50: #f7f5f0;
    --barko-white: #ffffff;
    /* Text pairs checked at 4.5:1 or better on their backgrounds. */
    --barko-text-on-dark: #ffffff;
    --barko-text-muted-on-dark: #b8c0d0;
    --barko-text-on-light: #13213a;
    --barko-text-muted-on-light: #4a5468;
    --barko-rule-on-dark: rgb(255 255 255 / 0.16);
    --barko-rule-on-light: rgb(19 33 58 / 0.14);
    /* The divider colour, fainter: see .barko-photo-edge. */
    --barko-photo-edge: rgb(19 33 58 / 0.1);
    --barko-outline-on-dark: #5b6680;
    /* Form field lines on dark bands: 3:1 or better on both navies (WCAG 1.4.11; #5b6680 is 2.7:1 on navy-800). */
    --barko-control-on-dark: #8a94a9;
    --barko-font-display: "Archivo", system-ui, sans-serif;
    --barko-heading-weight: 750;
    --barko-font-text: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --barko-content-width: 80rem;
    --barko-gutter: clamp(1rem, 4vw, 2rem);
    --barko-chrome-gutter: clamp(1rem, 3vw, 3rem);
}

.barko-site {
    --bs-font-sans-serif: var(--barko-font-text);
    --bs-body-font-family: var(--barko-font-text);
    --b2-font-body: var(--barko-font-text);
    --b2-font-heading: var(--barko-font-display);
    font-family: var(--barko-font-text);
}

/* Barko.UI's theme has this rule but only loads on pages that use Barko.UI; same low specificity here. */
:where(.barko-site) :is(h1, h2, h3, h4, h5, h6) {
    font-family: var(--barko-font-display);
}

/* Barko.UI parts that hard-code a system font instead of its variables (b2-base.css 1.0.0). */
.barko-site .bui-card,
.barko-site .bui-card .bui-card-actions a,
.barko-site .bui-grid,
.barko-site .bui-toolbar .bui-toolbar-item .bui-tbar-btn {
    font-family: inherit;
}

/* Keeps #anchor jumps clear of the fixed header. */
html {
    scroll-padding-top: 5rem;
}

.barko-container {
    max-width: var(--barko-content-width);
    margin-inline: auto;
}

.barko-section {
    padding: clamp(4rem, 9vw, 8rem) var(--barko-gutter);
    font-family: var(--barko-font-text);
}

.barko-section--dark {
    background: var(--barko-navy-950);
    color: var(--barko-text-on-dark);
}

.barko-section--dark.barko-section--navy {
    background: var(--barko-navy-800);
}

.barko-section--cream {
    background: var(--barko-cream-100);
    color: var(--barko-text-on-light);
}

.barko-eyebrow {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

    .barko-eyebrow::before {
        content: "";
        width: 2rem;
        height: 1px;
        background: currentColor;
    }

.barko-eyebrow--plain::before {
    display: none;
}

/* Write headings in sentence case in the markup; CSS uppercases them. */
.barko-display {
    margin: 0;
    font: var(--barko-heading-weight) clamp(2.5rem, 6vw, 4.25rem)/0.95 var(--barko-font-display);
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

/* Skip link (WCAG 2.4.1): shown only while focused. */
.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    padding: 0.75rem 1.25rem;
    background: var(--barko-white);
    color: var(--barko-navy-950);
    font: 700 0.875rem/1 var(--barko-font-text);
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    outline: 2px solid var(--barko-navy-950);
    outline-offset: 2px;
    transform: none;
}

/* The skip link's target: focusable by script, no ring of its own. */
main:focus {
    outline: none;
}

/* Motion: one easing everywhere, quick to start and soft to settle. */
:root {
    --barko-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Only once reveal.js has run (html.reveal-ready), so the page reads fine without it or with reduced motion. */
.reveal-ready [data-reveal] {
    transition: opacity 800ms var(--barko-ease-out), transform 800ms var(--barko-ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-ready [data-reveal]:not([data-revealed]) {
    opacity: 0;
    transform: translateY(1.5rem);
}

.reveal-ready [data-reveal] .barko-eyebrow::before {
    transition: width 800ms ease 200ms;
}

.reveal-ready [data-reveal]:not([data-revealed]) .barko-eyebrow::before {
    width: 0;
}

/* Page titles are on screen as the page opens, so they rise in once rather than on scroll. CSS only: no script
   needed, and the end state is the element as styled, so nothing stays hidden if the animation doesn't run. */
@media (prefers-reduced-motion: no-preference) {
    [data-enter] {
        animation: barko-enter 900ms var(--barko-ease-out) both;
        animation-delay: var(--enter-delay, 0ms);
    }
}

@keyframes barko-enter {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }
}

/* Printed pages never scroll into view: show everything. */
@media print {
    .reveal-ready [data-reveal],
    [data-enter] {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}

.barko-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.barko-section--light {
    background: var(--barko-cream-50);
    color: var(--barko-text-on-light);
}

.barko-section--white {
    background: var(--barko-white);
    color: var(--barko-text-on-light);
}

.barko-display--section {
    font-size: clamp(2rem, 4vw, 3rem);
}

.barko-lead {
    max-width: 36rem;
    margin: 1.5rem 0 0;
    color: var(--barko-text-muted-on-light);
    line-height: 1.7;
}

.barko-section--dark .barko-lead {
    color: var(--barko-text-muted-on-dark);
}

/* For a photo box on a cream or white background: a hairline just inside the edge, so a pale sky or wall doesn't
   fade into the page. It disappears into darker photos. It sits over the photo, so it stays put while a photo zooms
   on hover. Not for photos on navy, or with text over them: those have an edge already. */
.barko-photo-edge {
    position: relative;
}

.barko-photo-edge::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px var(--barko-photo-edge);
    pointer-events: none;
}

.barko-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 3.5rem 0 0;
    padding: 0;
    list-style: none;
    background: var(--barko-rule-on-light); /* shows through the gaps as rules */
}

.barko-tiles--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.barko-tiles--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.barko-tiles > li {
    padding: 2rem;
    background: var(--barko-cream-50);
}

.barko-section--white .barko-tiles > li {
    background: var(--barko-white);
}

.barko-section--dark .barko-tiles {
    background: var(--barko-rule-on-dark);
}

.barko-section--dark .barko-tiles > li {
    background: var(--barko-navy-950);
}

.barko-tile__title {
    margin: 0;
    font: var(--barko-heading-weight) 1.5rem/1.1 var(--barko-font-display);
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.barko-tile__meta {
    margin: 1rem 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.barko-tile__meta:first-child {
    margin-top: 0;
}

.barko-tile__meta + .barko-tile__title {
    margin-top: 0.75rem;
}

.barko-tile__body {
    margin: 1rem 0 0;
    color: var(--barko-text-muted-on-light);
    font-size: 0.875rem;
    line-height: 1.7;
}

.barko-tile__body a {
    color: inherit;
}

.barko-section--dark .barko-tile__body {
    color: var(--barko-text-muted-on-dark);
}

.barko-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 0.875rem 1.25rem;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 200ms ease, color 200ms ease;
}

.barko-button:disabled {
    cursor: progress;
    opacity: 0.6;
}

.barko-button:hover {
    border-color: var(--barko-navy-950);
    background: var(--barko-navy-950);
    color: var(--barko-text-on-dark);
}

.barko-section--dark .barko-button:hover {
    border-color: var(--barko-white);
    background: var(--barko-white);
    color: var(--barko-text-on-light);
}

.barko-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.barko-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 3rem 0;
    color: var(--barko-text-muted-on-light);
    font-size: 0.875rem;
}

.barko-status__spinner {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--barko-rule-on-light);
    border-top-color: var(--barko-navy-800);
    border-radius: 50%;
    animation: barko-spin 800ms linear infinite;
}

@keyframes barko-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .barko-status__spinner {
        animation: none;
    }
}

.barko-status--empty {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 36rem;
    padding: 2rem;
    border: 1px solid var(--barko-rule-on-light);
}

.barko-status__icon {
    color: var(--barko-navy-800);
    font-size: 1.75rem;
    line-height: 1;
}

.barko-status__title {
    margin: 0;
    color: var(--barko-text-on-light);
    font: var(--barko-heading-weight) 1.125rem/1.2 var(--barko-font-display);
    text-transform: uppercase;
}

.barko-status__text {
    margin: 0;
    line-height: 1.6;
}

.barko-status__text a {
    color: inherit;
    text-decoration: underline;
}

.barko-status__retry {
    margin-top: 0.75rem;
}

@media (max-width: 959.98px) {
    .barko-tiles,
    .barko-tiles--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .barko-tiles,
    .barko-tiles--2,
    .barko-tiles--4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 599.98px) {
    .barko-display {
        font-size: 1.875rem;
    }

    .barko-display--section {
        font-size: 1.625rem;
    }
}
