﻿/* ABB - CSS Style Guide */
:root {
    --bg: #ffffff;
    --panel: #f4f5f7;
    --text: #121212;
    --muted: #545b66;
    --text-secondary: var(--muted);
    --border: rgba(0,0,0,.12);
    --primary: #2f2ad9;
    --accent: #6b63ff;
    --primaryText: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,.10);
    --radius: 16px;
    --focus: 0 0 0 4px rgba(47,42,217,.35);
    --heroText: #121212;
    --heroKicker: rgba(18,18,18,.75);
    --heroShadow: 0 10px 26px rgba(0,0,0,.18);
    --heroFadeTop: rgba(255,255,255,0);
    --heroFadeMid: rgba(255,255,255,.25);
}

/* Global styles and resets */
* {
    box-sizing: border-box;
}

/* Remove default margin and set base font */
body {
    margin: 0;
    font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

/* Container for consistent max-width and centering */
.container {
    width: min(1200px, 92vw);
    margin-inline: auto;
}

/* Section spacing */
.section {
    padding: 22px 0;
}

/* Text elements */
.muted {
    color: var(--muted);
}

/* Panels and cards */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

    .skip-link:focus {
        left: 16px;
        top: 16px;
        width: auto;
        height: auto;
        padding: 10px 12px;
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: 10px;
        box-shadow: var(--shadow);
        z-index: 9999;
    }


/* Focus */
:focus-visible {
    box-shadow: var(--focus);
    border-radius: 10px;
    outline: 3px solid;
    outline-offset: 2px;
}

/* Header layout*/
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}

/* Header inner container for spacing and alignment */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

/* Brand logo and nav layout */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Header actions (nav toggle, user menu) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Icon buttons (nav toggle, user menu) */
.icon-btn {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text);
}

html[data-theme="dark"] .icon-btn {
    color: #ffffff;
}

/* Brand logo theme swap */
.brand-logo {
    width: 28px;
    height: auto;
    display: block;
}

/* Dark mode logo */
html[data-theme="dark"] .brand-logo {
    content: url("/assets/logos/abb_logo_dark_mode.svg");
}

/* Scale up on larger screens */
@media (min-width:900px) {
    .brand-logo {
        width: 42px;
    }
}

/* Brand logo scaling */
.brand-logo {
    display: block;
    height: 56px;
    width: auto;
    flex-shrink: 0;
}

/* Scale logo up on larger screens */
@media (min-width: 700px) {
    .brand-logo {
        height: 64px;
    }
}

/* Further scale logo on very large screens */
@media (min-width: 900px) {
    .brand-logo {
        height: 72px;
    }
}


/* Hide inline sprite */
.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Icon styling */
.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* Accessibility: visually hidden but still accessible to screen readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Navigation styles */
.site-nav {
    background: var(--bg);
}

/* Nav inner container for layout and spacing */
.nav-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0 16px;
}

    .nav-inner a {
        padding: 10px 12px;
        border-radius: 12px;
        text-decoration: none;
    }

        .nav-inner a:hover {
            background: var(--panel);
            text-decoration: none;
        }

        .nav-inner a[aria-current="page"] {
            background: var(--panel);
            border: 1px solid var(--border);
        }

/*dark theme*/
html[data-theme="dark"] {
    --bg: #0f1115;
    --panel: #171a21;
    --text: #f4f6fb;
    --muted: #a8b0bf;
    --text-secondary: var(--muted);
    --border: rgba(255,255,255,.12);
    --primary: #6b63ff;
    --primaryText: #000000;
    --shadow: 0 10px 30px rgba(0,0,0,.55);
    --focus: 0 0 0 4px rgba(107,99,255,.40);
    --heroText: #ffffff;
    --heroKicker: rgba(255,255,255,.88);
    --heroShadow: 0 10px 26px rgba(0,0,0,.50);
    --heroFadeTop: rgba(0,0,0,0);
    --heroFadeMid: rgba(0,0,0,.25);
}

/* Links */
a {
    color: inherit;
}
/* Underline on hover for better affordance */
    a:hover {
        text-decoration: underline;
    }


/* HERO */
.hero {
    position: relative;
}

/* hero photo and scaling */
.hero-media--photo {
    position: relative;
    height: clamp(280px, 45vh, 420px);
    overflow: hidden;
    background-image: url("../assets/images/herobanner.webp");
    background-size: 110%;
    background-position: center;
    background-repeat: no-repeat;
    animation: heroZoom 14s ease-in-out infinite alternate;
}

/* Zoom in/out effect*/
@keyframes heroZoom {
    from {
        background-size: 100%;
    }

    to {
        background-size: 120%;
    }
}

/* Bottom fade effect*/
.hero-media--photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient( to bottom, var(--heroFadeTop) 55%, var(--heroFadeMid) 78%, var(--bg) 100% );
    pointer-events: none;
}

/* Overlay container for hero text, positioned at the bottom of the hero image */
.hero-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(14px, 4vw, 34px);
    z-index: 1;
}

.hero-content {
    max-width: 62ch;
}

/* Hero Text */
.hero-heading {
    margin: 0;
}

.hero-welcome {
    color: var(--heroKicker);
    text-shadow: var(--heroShadow);
    display: block;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-shadow: 0 10px 26px rgba(0,0,0,.45);
}

.hero-slogan {
    color: var(--heroText);
    text-shadow: var(--heroShadow);
    display: block;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.08;
    text-shadow: 0 10px 26px rgba(0,0,0,.50);
}

.hero-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-media--photo {
        animation: none;
        background-size: cover;
    }
}

/* Cards layout */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.card {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.card-media {
    height: 100%;
    min-height: 92px;
}

.card-body {
    padding: 12px 12px 12px 0;
}

.card-kicker {
    font-size: .85rem;
    color: var(--muted);
}

.card-title {
    font-weight: 900;
    margin-top: 2px;
}

.card-sub {
    color: var(--muted);
    font-size: .98rem;
    margin-top: 2px;
    max-width: 65ch;
}

.media-1 {
    background: linear-gradient(135deg, rgba(47,42,217,.22), rgba(0,0,0,.02));
}

.media-2 {
    background: linear-gradient(135deg, rgba(0,0,0,.02), rgba(47,42,217,.18));
}

.media-3 {
    background: linear-gradient(135deg, rgba(47,42,217,.16), rgba(107,99,255,.10));
}

.media-4 {
    background: linear-gradient(135deg, rgba(107,99,255,.16), rgba(0,0,0,.02));
}


/* Responsive styles */
@media (min-width: 900px) {

    /* Desktop nav behavior: show nav even if hidden attribute exists */
    .site-nav[hidden] {
        display: block;
    }

    [data-nav-toggle] {
        display: none;
    }

    .nav-inner {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        padding: 0 0 12px;
    }

    .cards {
        grid-template-columns: repeat(4, 1fr);
    }

    .card {
        grid-template-columns: 1fr;
    }

    .card-media {
        min-height: 140px;
    }
}

/* Buttons and form elements */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

    .btn:hover {
        text-decoration: none;
    }

.btn-primary {
    background: var(--primary);
    color: var(--primaryText);
    border-color: transparent;
}

/* Form field layout */
.field {
    display: block;
    margin-bottom: 12px;
}

    .field label {
        display: block;
        font-weight: 700;
        margin: 0 0 6px;
    }


    .field span {
        display: block;
        font-weight: 700;
        margin: 0 0 6px;
    }

input, select, textarea {
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}


/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* AUTH (Login/Signup) */
.auth-shell {
    display: grid;
    place-items: center;
    padding: 10px 0 30px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 0 6px;
}

.auth-sub {
    margin: 0 0 10px;
}

.auth-switch {
    margin: 0 0 16px;
}

.auth-row {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 12px;
}

.auth-link {
    font-weight: 700;
    text-decoration: none;
}

    .auth-link:hover,
    .auth-link:focus-visible {
        text-decoration: underline;
    }

.auth-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0 12px;
}

.auth-social-title {
    margin: 0 0 10px;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: center;
}

.social-btn {
    display: grid;
    place-items: center;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 12px;
/*    background: var(--bg);*/
    box-shadow: var(--shadow);
    cursor: pointer;
}

    .social-btn:hover {
        transform: translateY(-2px);
    }

    .social-btn:focus-visible {
        outline: 3px solid rgba(47,42,217,.25);
        outline-offset: 2px;
    }

.social-ico {
    width: 30px;
    height: 30px;
}

.auth-note {
    display: block;
    margin-top: 10px;
    min-height: 18px;
}

.social-lb-ico {
    width: 50px;
    height: 50px;
}

