/* ================================
   Marlow Digital - Reset v1
   ================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
    padding:0;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    color: var(--color-text);
    background-color: var(--color-bg-soft);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: normal;
    line-height: 1;
}

ul[class],
ol[class] {
    list-style: none;
    padding: 0;
    margin: 0;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

@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;
    }
}

:root {
/* Marlow Digital Design Tokens */
    --color-marlowblue: #0a4db8;
    --color-marlowred: #c62828;

    /* Brand */
    --color-primary: var(--color-marlowblue, #0a4db8);
    --color-accent: var(--color-marlowred, #c62828);

    /* Neutrals */
    --color-text: #1a1a1a;
    --color-text-muted: #666;
    --color-bg: #ffffff;
    --color-bg-soft: #f6f7f9;
    --color-bg-light: #d4d4d4;
    --color-bg-dark: #616161;

    --color-text-light: #fafafa;
    --color-text-dark: #1f1f1f;
    --color-border: #e1e4e8;

    /* Status */
    --color-success: #1e8e3e;
    --color-warning: #f9ab00;
    --color-error: #d93025;

    /* Status colour palettes (background, border, text) */
    --color-success-bg: #f0fdf4;
    --color-success-border: #86efac;
    --color-success-text: #166534;

    --color-warning-bg: #fffbeb;
    --color-warning-border: #fde047;
    --color-warning-text: #92400e;

    --color-error-bg: #fef2f2;
    --color-error-border: #fca5a5;
    --color-error-text: #991b1b;

    --color-info: #0ea5e9;
    --color-info-bg: #f0f9ff;
    --color-info-border: #7dd3fc;
    --color-info-text: #0c4a6e;

    /* Alpha overlays and translucent surfaces */
    --color-surface-light-alpha-subtle: rgba(255, 255, 255, 0.08);
    --color-surface-light-alpha-soft: rgba(255, 255, 255, 0.12);
    --color-surface-light-alpha-medium: rgba(255, 255, 255, 0.16);
    --color-border-light-alpha-soft: rgba(255, 255, 255, 0.22);
    --color-border-light-alpha-medium: rgba(255, 255, 255, 0.36);
    --color-border-light-alpha-strong: rgba(255, 255, 255, 0.56);
    --color-overlay-scrim: rgba(0, 0, 0, 0.22);
    --color-error-focus-ring: rgba(217, 48, 37, 0.2);

    /* Focus */
    --color-focus-ring: rgba(10, 75, 184, 0.2);

    /* Spacing */
    --space-xxs: 0.125rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 5rem;

    /* Radius */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Typography */
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: var(--font-body);

    --line-height-body: 1.6;
    --line-height-heading: 1.25;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-xxl: 1.5rem;

    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

    /* Z-index */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal-backdrop: 1040;
    --z-index-modal: 1050;
    --z-index-popover: 1060;
    --z-index-tooltip: 1070;

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.2s ease-in-out;
    --transition-slow: 0.3s ease-in-out;

    /* Layout */
    --site-max-width: 1200px;

    /* Sizing */
    --size-touch-target: 2.5rem;
    --size-icon-sm: 1rem;
    --size-icon-md: 1.25rem;
    --size-icon-lg: 1.5rem;

    /*
     * Breakpoints: CSS custom properties cannot be used inside @media queries
     * (they are cascade-based, not static values). Use the raw px values directly.
     * Reference:  sm=480px  md=768px  lg=992px  xl=1200px
     */
}

/**
 * Dark Mode Overrides
 *
 * Applied when <body> has the 'dark-mode' class.
 * Redefines neutral colors for dark backgrounds while maintaining
 * status colors and other tokens.
 */
body.dark-mode {
    /* Neutrals — inverted for dark backgrounds */
    --color-text: #fafafa;
    --color-text-muted: #b0b0b0;
    --color-bg: #1a1a1a;
    --color-bg-soft: #2a2a2a;
    --color-bg-light: #404040;
    --color-bg-dark: #0f0f0f;

    --color-text-light: #fafafa;
    --color-text-dark: #f0f0f0;
    --color-border: #404040;

    /* Status background colors — lightened for dark mode */
    --color-success-bg: #0a3d1a;
    --color-success-border: #2d6a3e;
    --color-success-text: #86efac;

    --color-warning-bg: #3a2d05;
    --color-warning-border: #6b5c1a;
    --color-warning-text: #fde047;

    --color-error-bg: #3a1515;
    --color-error-border: #6b2a2a;
    --color-error-text: #fca5a5;

    --color-info-bg: #0a2a3a;
    --color-info-border: #1a4d66;
    --color-info-text: #7dd3fc;

    /* Alpha surfaces — adjusted for dark backgrounds */
    --color-overlay-scrim: rgba(0, 0, 0, 0.5);
    --color-error-focus-ring: rgba(252, 165, 165, 0.2);
    --color-focus-ring: rgba(125, 211, 252, 0.2);

    /* Shadows — lighter for dark mode */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4), 0 10px 10px rgba(0, 0, 0, 0.3);
}

/* ================================
   Marlow Digital - Layout v1
   ================================ */

/* Site Layout */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

main {
    flex: 1 0 auto;
}

.site-header,
.site-footer {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-index-sticky);
    overflow: visible;
    text-align: left;
}

.site-header a,
.site-footer a {
    color: inherit;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    width: 100%;
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: 0;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-left {
    flex: 1 1 auto;
}

.header-right {
    flex: 0 1 auto;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: inherit;
    text-decoration: none;
}

.site-brand-logo {
    display: block;
    width: auto;
    max-height: 2rem;
}

.site-brand-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-heading);
    white-space: nowrap;
}

.site-footer {
    position: relative;
    text-align: center;
    border-top: 1px solid var(--color-border);
    border-bottom: none;
}

.footer-content {
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: 0;
}

/* Navigation */
.nav-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    font-weight: var(--font-weight-medium);
    color: inherit;
    text-decoration: none;
}

.nav-desktop-hidden {
    display: none;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: var(--size-touch-target);
    min-height: var(--size-touch-target);
    padding: var(--space-xs);
    margin-left: auto;
    color: var(--color-text-light);
    background: var(--color-surface-light-alpha-subtle);
    border: 1px solid var(--color-border-light-alpha-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    background: var(--color-surface-light-alpha-medium);
    border-color: var(--color-border-light-alpha-strong);
    outline: none;
}

.nav-open .nav-toggle {
    color: var(--color-accent);
}

.nav-keep-visible {
    position: relative;
    z-index: calc(var(--z-index-sticky) + 3);
}

.nav-bar {
    display: block;
    width: 1.2rem;
    height: 2px;
    background: currentColor;
    transition: var(--transition-fast);
}

.nav-backdrop {
    display: none;
}

.site-header.nav-force-collapsed .nav-toggle {
    display: inline-flex;
}

.site-header.nav-force-collapsed .nav-in-header,
.site-header .nav-in-header.nav-desktop-hidden {
    position: fixed;
    top: 0;
    right: 0;
    width: min(20rem, 80vw);
    height: 100vh;
    padding: 4.25rem var(--space-md) var(--space-md);
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    border-left: 1px solid var(--color-border-light-alpha-soft);
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: calc(var(--z-index-sticky) + 2);
}

.site-header.nav-force-collapsed .nav-in-header.nav-dropdown,
.site-header .nav-in-header.nav-dropdown.nav-desktop-hidden {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    width: auto;
    height: auto;
    padding: var(--space-md);
    border-left: none;
    border-top: 1px solid var(--color-border);
    transform: translateY(-0.75rem);
    opacity: 0;
    pointer-events: none;
}

.site-header.nav-force-collapsed .nav-in-header .nav-list,
.site-header .nav-in-header.nav-desktop-hidden .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
}

.site-header.nav-force-collapsed .nav-in-header .nav-link,
.site-header .nav-in-header.nav-desktop-hidden .nav-link {
    width: 100%;
    padding: var(--space-sm) 0;
}

.site-header.nav-force-collapsed .nav-in-header.is-open,
.site-header .nav-in-header.nav-desktop-hidden.is-open {
    transform: translateX(0);
}

.site-header.nav-force-collapsed .nav-in-header.nav-dropdown.is-open,
.site-header .nav-in-header.nav-dropdown.nav-desktop-hidden.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.theme-selector {
    position: relative;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--size-touch-target);
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    cursor: pointer;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--size-icon-md);
    height: var(--size-icon-md);
}

.theme-toggle-chevron {
    font-size: var(--font-size-xs);
}

.theme-icon {
    display: block;
    width: 100%;
    height: 100%;
}

.theme-menu {
    position: absolute;
    right: 0;
    top: calc(100% + var(--space-xs));
    width: min(18rem, 92vw);
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    box-shadow: var(--shadow-md);
    z-index: calc(var(--z-index-sticky) + 4);
}

.theme-menu-description {
    margin: 0 0 var(--space-xs);
    color: var(--color-text-light);
    opacity: 0.8;
    font-size: var(--font-size-sm);
}

.theme-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-light);
    text-align: left;
    cursor: pointer;
}

.theme-option-main {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.theme-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
}

.theme-option-label {
    font-size: var(--font-size-sm);
}

.theme-option:hover,
.theme-option:focus-visible {
    background: var(--color-surface-light-alpha-soft);
    outline: none;
}

.theme-check {
    opacity: 0;
}

.theme-option.is-selected .theme-check {
    opacity: 1;
}

@media (max-width: 768px) {
    .site-header {
      padding: var(--space-sm) var(--space-md);
    }

    .header-container {
      gap: var(--space-sm);
    }

    .nav-in-header {
        position: fixed;
        top: 0;
        right: 0;
        width: min(20rem, 80vw);
        height: 100vh;
        padding: 4.25rem var(--space-md) var(--space-md);
        background-color: var(--color-bg-dark);
        color: var(--color-text-light);
        border-left: 1px solid var(--color-border-light-alpha-soft);
        box-shadow: var(--shadow-md);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: calc(var(--z-index-sticky) + 2);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        padding: 0;
        margin: 0;
        background: var(--color-overlay-scrim);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-base);
        z-index: calc(var(--z-index-sticky) + 1);
    }

    .nav-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-in-header.nav-dropdown {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        width: auto;
        height: auto;
        padding: var(--space-md);
        border-left: none;
        border-top: 1px solid var(--color-border);
        transform: translateY(-0.75rem);
        opacity: 0;
        pointer-events: none;
    }

    .nav-in-header .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .nav-in-header .nav-link {
        width: 100%;
        padding: var(--space-sm) 0;
    }

    .nav-in-header.is-open {
        transform: translateX(0);
    }

    .nav-in-header.nav-dropdown.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-open .nav-bar:nth-child(1) {
        transform: translateY(0.42rem) rotate(45deg);
    }

    .nav-open .nav-bar:nth-child(2) {
        opacity: 0;
    }

    .nav-open .nav-bar:nth-child(3) {
        transform: translateY(-0.42rem) rotate(-45deg);
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-desktop-hidden {
        display: block;
    }

    .header-right {
        gap: var(--space-xs);
    }

    .theme-menu {
        right: 0;
    }

    .nav-open .nav-keep-visible {
        position: fixed;
        top: var(--space-sm);
        right: var(--space-md);
        background-color: var(--color-bg-dark);
        color: var(--color-text-light);
        box-shadow: var(--shadow-sm);
    }
}

/* Hero */
.hero {
  display: flex;
  align-items:center;
  min-height: 60vh;
}

.hero-inner {
  width: 100%;
}

.hero-content {
  max-width: 700px;
  margin-inline:auto;
  display: flex;
  flex-direction: column;
  align-items:center;
}

.hero-actions {
  margin-top: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Containers and Sections */
.container {
    width: 100%;
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
}
.container-wide { max-width: 1400px; }
.container-narrow { max-width: 800px; }

.section {
  padding: var(--space-lg) 0;
}

.section-tight {
    padding: var(--space-md) 0;
}

.section-loose {
    padding: var(--space-xl) 0;
}

/* ================================
   Marlow Digital - Utilities v1
   ================================ */

/* Screen reader only */
.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;
}

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Display */
.d-block { display: block; }
.d-flex { display: flex; }
.d-none { display: none; }

/* Gap utilities */
.gap-0 { gap: 0; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Margin and Padding */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-sm); }
.mt-1 { margin-top: var(--space-sm); }
.mb-1 { margin-bottom: var(--space-sm); }
.m-2 { margin: var(--space-md); }
.mt-2 { margin-top: var(--space-md); }
.mb-2 { margin-bottom: var(--space-md); }
.m-3 { margin: var(--space-lg); }
.mt-3 { margin-top: var(--space-lg); }
.mb-3 { margin-bottom: var(--space-lg); }
.m-auto { margin: auto; }
.p-0 { padding: 0; }
.p-1 { padding: var(--space-sm); }
.pt-1 { padding-top: var(--space-sm); }
.pb-1 { padding-bottom: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.pt-2 { padding-top: var(--space-md); }
.pb-2 { padding-bottom: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.pt-3 { padding-top: var(--space-lg); }
.pb-3 { padding-bottom: var(--space-lg); }

/* Flex utilities */
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }

/* Grid Utilities */
.grid {
  display: grid;
  gap: var(--space-md);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ================================
   Marlow Digital - Components v1
   ================================ */

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-body);
  color: var(--color-text-light);
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.btn:hover {
    opacity: 0.9;
}

/* Form elements */
input,
textarea,
select {
    padding: var(--space-sm);
    font-size: var(--font-size-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-focus-ring);
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}



/* Card component */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
    padding: var(--space-md);
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);  
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.card-body {
  flex: 1;
}

.card-footer {
  margin-top: auto;
}

/* CTA block — used when a page section needs a centred call-to-action group */
/* card-media and cta components: add back when a component uses them */


/* Standard error page */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  padding: var(--space-xl);
}

.error-inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  width: 100%;
  max-width: 42rem;
  padding: var(--space-lg);
  background-color: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.error-visual {
  flex: 0 0 clamp(10rem, 28vw, 15rem);
}

.error-image {
  display: block;
  width: 100%;
  height: auto;
}

.error-content {
  flex: 1 1 auto;
  text-align: left;
}

.error-title {
  margin-bottom: var(--space-sm);
  color: var(--color-text);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-heading);
}

.error-message {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
}

.error-actions {
  margin: 0;
}

.error-link {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-bg);
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: var(--transition-base);
}

.error-link:hover {
  opacity: 0.92;
  text-decoration: none;
}

@media (max-width: 768px) {
  .error-inner {
    flex-direction: column;
    text-align: center;
  }

  .error-visual {
    flex-basis: auto;
    width: min(100%, 14rem);
  }

  .error-content {
    text-align: center;
  }
}

/* Reusable contact plugin */
.contact-plugin {
  width: 100%;
}

.contact-plugin-header {
  margin-bottom: var(--space-md);
}

.contact-plugin-title {
  margin: 0 0 var(--space-xs);
}

.contact-plugin-intro {
  margin: 0;
  color: var(--color-text-muted);
}

.contact-plugin-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-plugin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.contact-field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-field-group-full {
  grid-column: 1 / -1;
}

.contact-field-group label {
  font-weight: var(--font-weight-medium);
}

.contact-field-group label span {
  color: var(--color-error);
  margin-left: 0.2rem;
}

.contact-plugin-form input:not([type="checkbox"]):not([type="radio"]),
.contact-plugin-form textarea {
  width: 100%;
}

.contact-consent-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.contact-consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  cursor: pointer;
}

.contact-consent-hint {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.contact-plugin-actions {
  display: flex;
  justify-content: flex-start;
}

.contact-plugin-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: var(--font-size-sm);
}

.contact-plugin-status.is-error {
  color: var(--color-error);
}

.contact-plugin-status.is-success {
  color: var(--color-success);
}

.contact-field-invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 2px var(--color-error-focus-ring);
}

@media (max-width: 768px) {
  .contact-plugin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* .contact-field-group-full: grid-column: 1/-1 has no effect on a 1-col grid; no override needed */
}

/* ================================
   Alerts Component
   ================================ */

.alerts-container {
    position: fixed;
    top: var(--alerts-top, 10%);
    left: 50%;
    transform: translateX(-50%);
    width: var(--alerts-width, 90%);
    z-index: var(--z-index-fixed, 1030);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    pointer-events: none; /* let clicks pass through the gap between alerts */
}

.alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--alerts-padding, var(--space-md));
    border-radius: var(--radius-md);
    border: 1px solid;
    animation: slideInDown 0.3s ease-out;
    pointer-events: all; /* re-enable clicks on each alert */
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.alert-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}

.alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--size-icon-lg);
    width: var(--size-icon-lg);
    height: var(--size-icon-lg);
    margin-top: var(--space-xxs);
}

.alert-message {
    font-size: var(--font-size-md);
    line-height: var(--line-height-body);
    word-wrap: break-word;
}

.alert-close {
    flex: 0 0 auto;
    padding: 0;
    width: var(--size-icon-lg);
    height: var(--size-icon-lg);
    border: none;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--size-icon-lg);
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    margin-top: var(--space-xxs);
}

.alert-close:hover,
.alert-close:focus {
    opacity: 1;
    outline: none;
}

/* Alert Types */

.alert-success {
    background-color: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
}

.alert-success .alert-icon::before {
    content: '✓';
    font-weight: bold;
}

.alert-warning {
    background-color: var(--color-warning-bg);
    border-color: var(--color-warning-border);
    color: var(--color-warning-text);
}

.alert-warning .alert-icon::before {
    content: '!';
    font-weight: bold;
    font-size: var(--font-size-xl);
}

.alert-error {
    background-color: var(--color-error-bg);
    border-color: var(--color-error-border);
    color: var(--color-error-text);
}

.alert-error .alert-icon::before {
    content: '✕';
    font-weight: bold;
    font-size: var(--font-size-xl);
}

.alert-info {
    background-color: var(--color-info-bg);
    border-color: var(--color-info-border);
    color: var(--color-info-text);
}

.alert-info .alert-icon::before {
    content: 'ⓘ';
    font-weight: bold;
}

/* Responsive */

@media (max-width: 768px) {
    .alert {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    .alert-content {
        gap: var(--space-xs);
    }

    .alert-message {
        font-size: var(--font-size-sm);
    }
}


/**
 * Cookie Consent Banner Styles
 *
 * Styled as a fixed modal at the bottom of the page.
 * Respects dark mode via tokens.
 */

[data-cookie-consent-banner] {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-index-modal-backdrop);
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: var(--space-lg);
    box-shadow: 0 -4px 6px var(--color-overlay-scrim);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-body);
    color: var(--color-text);
    animation: slideUp 0.3s ease-out;
}

[data-cookie-consent-banner][hidden] {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-container {
    max-width: var(--site-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.cookie-consent-content {
    flex: 1;
}

.cookie-consent-heading {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.cookie-consent-description {
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.cookie-consent-link {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-primary);
    transition: opacity var(--transition-fast);
}

.cookie-consent-link:hover {
    opacity: 0.8;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

.cookie-policy-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.cookie-consent-button {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    background-color: transparent;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: var(--size-touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-consent-button:hover {
    background-color: var(--color-bg-soft);
    border-color: var(--color-text);
}

.cookie-consent-button:focus {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.cookie-consent-button[data-cookie-consent-accept] {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
}

.cookie-consent-button[data-cookie-consent-accept]:hover {
    opacity: 0.9;
}

.cookie-consent-button[data-cookie-consent-reject] {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.cookie-consent-button[data-cookie-consent-reject]:hover {
    background-color: var(--color-error-bg);
    border-color: var(--color-error-border);
    color: var(--color-error-text);
}

.cookie-consent-button[data-cookie-consent-settings] {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
    padding: var(--space-xs) var(--space-sm);
    min-height: 0;
}

.cookie-consent-button[data-cookie-consent-settings]:hover {
    background-color: var(--color-bg-soft);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    [data-cookie-consent-banner] {
        padding: var(--space-md);
    }

    .cookie-consent-actions {
        flex-direction: column;
    }

    .cookie-consent-button {
        width: 100%;
    }

    .cookie-consent-button[data-cookie-consent-settings] {
        width: auto;
        align-self: flex-start;
    }
}

/* Ensure banner works in dark mode */
body.dark-mode [data-cookie-consent-banner] {
    background-color: var(--color-bg);
    border-top-color: var(--color-border);
    color: var(--color-text);
    box-shadow: 0 -4px 6px var(--color-overlay-scrim);
}


