/* global css styling over all components (use prefix) */

@import './_colors.css';

@font-face {
    font-family: 'cormorant-garamond';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/CormorantGaramond-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'cormorant-garamond';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/CormorantGaramond-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'cormorant-garamond';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/CormorantGaramond-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'cormorant-garamond';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url('./fonts/CormorantGaramond-Italic-VariableFont_wght.ttf') format('truetype');
}

@font-face {
    font-family: 'open-sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/OpenSans-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'open-sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/OpenSans-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'open-sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/OpenSans-Bold.ttf') format('truetype');
}



:root {
    /* ========================================
       TYPOGRAPHY - FONT FAMILIES
       ======================================== */
    --font-family-heading: 'cormorant-garamond', Georgia, serif;
    --font-family-body: 'open-sans', Arial, sans-serif;
    /* ========================================
       Z-INDEX LAYERS
       ======================================== */
    --zindex-skip-link: 9999;
    --zindex-overlay: 900;
    --zindex-sidebar-edit-menue: 800;
    --zindex-sidebar: 700;
    --zindex-header: 600;
    --zindex-dropdown: 500;
    --zindex-footer: 100;
    --zindex-accordion-close: 2;
    --zindex-minus: -1;
    /* ========================================
       BREAKPOINTS (Reference only)
       Mobile First: use min-width in media queries
       ======================================== */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
    /* ========================================
       ACCESSIBILITY - COLORS
       WCAG 2.1 AA requires 4.5:1 contrast for text
       ======================================== */
    --focus: var(--triesen-blue);
    --focus-outline: 3px solid var(--focus);
    /* ========================================
       ACCESSIBILITY - TOUCH TARGETS
       WCAG 2.5.5: Min 44x44px for touch targets
       ======================================== */
    --touch-target-min: 2.75rem;
    /* ========================================
       SPACING - MOBILE FIRST BASE VALUES
       Overridden in media queries for larger screens
       ======================================== */
    --spacing-sm: 0.2rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

   --content-padding-x: 2rem;
    --content-narrow-padding-x: clamp(3.5rem, calc(50vw - 35rem), 35rem);
}

/* ========================================
   ACCESSIBILITY - FOCUS STYLES
   ======================================== */
*:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 0.125rem;
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   Respect user preference for reduced motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   ACCESSIBILITY - SCREEN READER ONLY
   Visually hidden but accessible to screen readers
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   ACCESSIBILITY - SKIP LINK
   For keyboard navigation
   ======================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: var(--zindex-skip-link);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--triesen-blue);
    color: var(--white);
    text-decoration: none;
}

    .skip-link:focus {
        top: 0;
    }

/* ========================================
   HTML EDITOR STYLING
   ======================================== */

.edhtml p {
    margin: 0;
    font-size: 1.25rem;
    font-style: normal;
    font-weight: 400;
    line-height: 2.1875rem;
    letter-spacing: 0.4px;
}

.edhtml h1 {
    font-family: var(--font-family-heading);
    color: var(--blue-4);
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: 0.76px;
    padding-bottom: 1rem;
}

.edhtml h2 {
    margin-top: 0;
    font-size: 2.5rem;
    font-style: normal;
    font-weight: 500;
    line-height: 3.4375rem;
}

    .edhtml h2 + p {
        margin-top: 0;
        font-size: 1.375rem;
        font-style: normal;
        font-weight: 300;
        line-height: 2.5rem;
    }

.edhtml h3 {
    margin: 0;
    font-size: 1.5625rem;
    font-style: normal;
    font-weight: 500;
    line-height: 2.1875rem;
}

    .edhtml h3 + p {
        margin-top: 0;
    }

.edhtml strong {
    font-weight: bold;
}

.edhtml h4 {
    color: var(--gray-aa);
    font-family: var(--font-family-body);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 2.25rem;
    letter-spacing: 0.44px;
    padding-top: 1rem;
}

.edhtml tr {
    line-height: normal;
}

/* Editor content is often rendered inside a layout <ul>, so the browser would treat its lists as nested. */
.edhtml ul {
    list-style-type: disc;
}

.edhtml ul ul {
    list-style-type: circle;
}

.edhtml ul ul ul {
    list-style-type: square;
}

@media (max-width: 63.99rem) {
    .edhtml table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .edhtml th,
    .edhtml td {
        white-space: nowrap;
    }
}

/* ========================================
   TYPOGRAPHY - SYLLABLE SEPARATION (HYPHENATION)
   Enables automatic hyphenation for all titles and subtitles.
   Requires the lang attribute (set to "de" on <html>) to work correctly.
   ======================================== */
[class*="title"] {
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphenate-limit-chars: 10 5 5;
}

/* ========================================
   MOBILE FIRST - BASE STYLES
   These apply to mobile (smallest screens)
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    overflow-x: hidden;
    scrollbar-width: none;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    scrollbar-width: none;
}

    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        display: none;
    }

.hidden {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.content-narrow {
    width: 100%;
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (max-width: 64rem) {
    .full-bleed {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
    }

    .content-wide {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 64rem) {
    :root {
        --content-padding-x: 3.5rem;
    }

    .content-narrow {
        padding-left: var(--content-narrow-padding-x) !important;
        padding-right: var(--content-narrow-padding-x) !important;
    }

    .full-bleed {
        margin-left: var(--content-padding-x);
        margin-right: var(--content-padding-x);
    }

    .content-wide {
        padding-left: var(--content-padding-x);
        padding-right: var(--content-padding-x);
    }
}
