/**
 * Display Styles - Screen Media
 * Applied to screen displays (monitors, tablets, phones)
 */

/* Base styles */
body {
    background-color: #FAFAF0;
    color: #333333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #1A1A1A;
}

/* Main header styling - Electronics Guide */
body > header {
    text-align: center;
    padding-top: 2em;
    padding-bottom: 1em;
    position: relative;
}

body > header h1 {
    font-size: 2.5em;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    background: linear-gradient(135deg, var(--nav-gradient-start) 0%, var(--nav-gradient-middle) 50%, var(--nav-gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3)) drop-shadow(0 4px 16px rgba(168, 85, 247, 0.2));
}

/* Subtle shimmer animation on hover */
body > header h1::before {
    content: "";
    position: absolute;
    inset: -0.5em;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    pointer-events: none;
}

body > header:hover h1::before {
    opacity: 1;
}

/* Intro text for policy pages */
.intro {
    text-align: center;
}

/* Links - more aggressive breaking for long URLs */
a {
    overflow-wrap: break-word;
    word-break: break-all;
}

/* CSS Custom Properties */
:root {
    --nav-link-color: #333333;
    --nav-link-hover: #1A1A1A;
    --nav-accent: #8B4513;
    --nav-accent-light: #A0522D;
    --nav-spacing: 1em;
    --transition-speed: 0.2s;
    --nav-gradient-start: #6366f1;
    --nav-gradient-middle: #a855f7;
    --nav-gradient-end: #ec4899;
    --nav-text-light: #ffffff;
    --nav-hover-bg: rgba(255, 255, 255, 0.2);
    --nav-active-bg: rgba(255, 255, 255, 0.3);
    --nav-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    --nav-hover-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

/* Layout constraints for readability */
header,
nav,
main,
footer {
    max-width: 45em;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1em;
    padding-right: 1em;
}

/* Navigation Container - Sticky on Mobile (Main nav only) */
body > nav {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--nav-gradient-start) 0%, var(--nav-gradient-middle) 50%, var(--nav-gradient-end) 100%);
    border-bottom: none;
    padding-top: 1em;
    padding-bottom: 0.5em;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.75em;
    align-items: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: blur(12px);
    transition: padding-bottom 0.3s ease;
}

/* Increase bottom padding when menu is open for visual balance */
body > nav:has(.nav-toggle:checked) {
    padding-bottom: 1em;
}

/* Hide checkbox visually but keep accessible */
.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Hamburger Menu Button - Mobile Only */
.nav-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75em;
    height: 2.75em;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.75em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    grid-column: 1;
    grid-row: 1;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.nav-toggle-label::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-toggle-label:hover::before {
    opacity: 1;
}

.nav-toggle-label:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav-toggle-label:active {
    transform: translateY(0) scale(1);
}

/* Hamburger Icon */
.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 1.4em;
    height: 2.5px;
    background-color: var(--nav-text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -0.5em;
}

.hamburger::after {
    top: 0.5em;
}

/* Animate to X when checked */
.nav-toggle:checked ~ .nav-toggle-label .hamburger {
    background-color: transparent;
}

.nav-toggle:checked ~ .nav-toggle-label .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle:checked ~ .nav-toggle-label .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Navigation Menu - Mobile First */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    grid-column: 1 / -1;
    grid-row: 2;
}

/* Show menu when checkbox is checked */
.nav-toggle:checked ~ .nav-menu {
    max-height: 25em;
    opacity: 1;
}

.nav-menu li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu li:last-child {
    border-bottom: none;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 1em 1.25em;
    color: var(--nav-text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375em;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-break: normal;
    overflow-wrap: normal;
    border-left: 3px solid transparent;
    backdrop-filter: blur(12px);
    position: relative;
    letter-spacing: 0.01em;
}

.nav-menu a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu a:hover::before,
.nav-menu a:focus::before {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a:focus {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-left-color: rgba(255, 255, 255, 0.9);
    padding-left: 1.5em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-menu a[aria-current="page"] {
    color: var(--nav-text-light);
    font-weight: 600;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-left-color: var(--nav-text-light);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Breadcrumbs */
.breadcrumb {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    font-size: 0.8125em;
    color: rgba(255, 255, 255, 0.9);
    grid-column: 2;
    grid-row: 1;
    align-items: center;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    margin: 0;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
    word-break: normal;
    overflow-wrap: normal;
}

.breadcrumb a:hover,
.breadcrumb a:focus {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: rgba(255, 255, 255, 1);
    font-weight: 500;
}

/* Desktop Navigation - 768px and up */
@media (min-width: 768px) {
    /* Remove sticky positioning and grid on desktop */
    body > nav {
        position: relative;
        border-bottom: none;
        padding: 2.5em;
        display: block;
        background: linear-gradient(135deg, var(--nav-gradient-start) 0%, var(--nav-gradient-middle) 50%, var(--nav-gradient-end) 100%);
        border-radius: 1.25em;
        box-shadow: var(--nav-shadow), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
        margin-bottom: 2.5em;
        overflow: hidden;
        backdrop-filter: blur(16px);
    }

    /* Add subtle animated gradient overlay */
    body > nav::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
        background-size: 300% 300%;
        animation: shimmer 6s ease-in-out infinite;
        pointer-events: none;
        z-index: 0;
    }

    /* Add subtle noise texture for depth */
    body > nav::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.03"/></svg>');
        pointer-events: none;
        z-index: 0;
    }

    @keyframes shimmer {
        0%, 100% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
    }

    /* Hide hamburger menu on desktop */
    .nav-toggle-label {
        display: none;
    }

    /* Show menu by default on desktop */
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75em;
        justify-content: center;
        align-items: center;
        max-height: none;
        opacity: 1;
        overflow: visible;
        position: relative;
        z-index: 1;
    }

    .nav-menu li {
        border-bottom: none;
    }

    .nav-menu a {
        padding: 1em 2em;
        position: relative;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
        border-left: none;
        color: var(--nav-text-light);
        font-weight: 600;
        font-size: 0.9375em;
        letter-spacing: 0.03em;
        border-radius: 0.75em;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(16px);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
        overflow: hidden;
    }

    /* Animated gradient on hover */
    .nav-menu a::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
        opacity: 0;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: -1;
    }

    .nav-menu a:hover::before,
    .nav-menu a:focus::before {
        opacity: 1;
    }

    .nav-menu a:hover,
    .nav-menu a:focus {
        transform: translateY(-4px) scale(1.05);
        padding-left: 2em;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.4);
        border-color: rgba(255, 255, 255, 0.4);
    }

    .nav-menu a[aria-current="page"] {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
        font-weight: 700;
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5), 0 6px 16px rgba(0, 0, 0, 0.25);
        border-color: rgba(255, 255, 255, 0.5);
    }

    /* Remove old ::after display:none rule */
    .nav-menu a::after {
        display: none;
    }

    /* Breadcrumbs styling for desktop */
    .breadcrumb {
        border-top: none;
        padding-top: 0;
        margin-top: 1.5em;
        grid-column: auto;
        grid-row: auto;
    }

    /* Header enhancement for tablet and up */
    body > header h1 {
        font-size: 3em;
    }
}

/* Wide Desktop - Split Header Layout - 1024px and up */
@media (min-width: 1024px) {
    /* Create a flex container for header + nav when they're siblings */
    body > header + nav {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 1em;
    }

    /* Position breadcrumbs on their own line */
    body > header + nav .breadcrumb {
        flex-basis: 100%;
        margin-top: 1em;
    }

    /* Larger header for wide desktops */
    body > header h1 {
        font-size: 3.5em;
        letter-spacing: -0.03em;
    }

    body > header {
        padding-top: 2.5em;
        padding-bottom: 1.5em;
    }
}

/* Footer Styles */
footer {
    margin-top: 3em;
    padding-top: 2em;
    padding-bottom: 1em;
    text-align: center;
    font-size: 0.875em;
    color: #666666;
}

footer p {
    margin: 0.5em 0;
}

footer nav {
    margin-top: 0.25em;
}

footer a {
    color: #666666;
    text-decoration: underline;
    transition: color var(--transition-speed) ease;
}

footer a:hover,
footer a:focus {
    color: var(--nav-accent);
}

/* Footer Navigation Buttons */
.footer-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-bottom: 2em;
}

.footer-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 1em 2em;
    background: linear-gradient(135deg, var(--nav-gradient-start) 0%, var(--nav-gradient-middle) 50%, var(--nav-gradient-end) 100%);
    color: var(--nav-text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2em;
    font-family: inherit;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(168, 85, 247, 0.2);
    backdrop-filter: blur(12px);
}

.footer-nav-btn svg {
    flex-shrink: 0;
}

.footer-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5), 0 0 50px rgba(168, 85, 247, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.footer-nav-btn:active {
    transform: translateY(0);
}

.footer-nav-btn:focus {
    outline: 2px solid var(--nav-gradient-middle);
    outline-offset: 2px;
}
