/**
 * Supernorsk Main Stylesheet
 *
 * Custom styles that extend theme.json settings.
 * Most base styling is handled via theme.json - this file is for
 * animations, interactions, and styles that can't be expressed there.
 */

/* ==========================================================================
   Base & Global
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection color */
::selection {
    background: var(--wp--preset--color--primary-light);
    color: var(--wp--preset--color--dark);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

/* Sticky header */
header.wp-block-group {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

header.wp-block-group.is-scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* Navigation link hover effects */
.wp-block-navigation-item__content {
    position: relative;
    transition: color 0.2s ease;
}

.wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--wp--preset--color--primary);
    transition: width 0.3s ease;
}

.wp-block-navigation-item__content:hover::after {
    width: 100%;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .wp-block-navigation__responsive-container.is-menu-open {
        padding: 2rem;
        background: var(--wp--preset--color--white);
    }

    .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
        padding-top: 2rem;
        gap: 1rem;
    }

    .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

/* Base button transition */
.wp-block-button__link {
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

/* Primary button hover */
.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 95, 158, 0.25);
}

/* Secondary (red) button hover */
.wp-block-button__link.has-secondary-background-color:hover {
    box-shadow: 0 4px 12px rgba(186, 12, 47, 0.25);
}

/* CTA style buttons */
.wp-block-button.is-style-supernorsk-cta .wp-block-button__link {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Outline style buttons */
.wp-block-button.is-style-supernorsk-outline .wp-block-button__link {
    background: transparent;
    border: 2px solid currentColor;
}

.wp-block-button.is-style-supernorsk-outline .wp-block-button__link:hover {
    background: var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

/* Button focus state */
.wp-block-button__link:focus-visible {
    outline: 3px solid var(--wp--preset--color--primary);
    outline-offset: 3px;
}

/* ==========================================================================
   Cards & Groups
   ========================================================================== */

/* Service cards - add subtle hover effect to all cards */
.wp-block-group.has-white-background-color {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-group.has-white-background-color:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* Card style for groups */
.wp-block-group.is-style-supernorsk-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.wp-block-group.is-style-supernorsk-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* Highlight box style */
.wp-block-group.is-style-supernorsk-highlight {
    border-left: 4px solid var(--wp--preset--color--primary);
    background: var(--wp--preset--color--light);
}

/* Service card colored top borders */
.wp-block-columns .wp-block-column:nth-child(1) .wp-block-group.has-white-background-color {
    border-top: 4px solid var(--wp--preset--color--primary);
}

.wp-block-columns .wp-block-column:nth-child(2) .wp-block-group.has-white-background-color {
    border-top: 4px solid var(--wp--preset--color--secondary);
}

.wp-block-columns .wp-block-column:nth-child(3) .wp-block-group.has-white-background-color {
    border-top: 4px solid var(--wp--preset--color--info);
}

.wp-block-columns .wp-block-column:nth-child(4) .wp-block-group.has-white-background-color {
    border-top: 4px solid var(--wp--preset--color--success);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

/* Hero cover block */
.wp-block-cover {
    position: relative;
}

/* Hero image placeholder styling */
.wp-block-cover .wp-block-image img,
.wp-block-image img {
    transition: transform 0.4s ease;
}

.wp-block-image:hover img {
    transform: scale(1.02);
}

/* Hero text animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-block-cover .wp-block-column:first-child > * {
    animation: fadeInUp 0.6s ease forwards;
}

.wp-block-cover .wp-block-column:first-child > *:nth-child(1) { animation-delay: 0.1s; }
.wp-block-cover .wp-block-column:first-child > *:nth-child(2) { animation-delay: 0.2s; }
.wp-block-cover .wp-block-column:first-child > *:nth-child(3) { animation-delay: 0.3s; }
.wp-block-cover .wp-block-column:first-child > *:nth-child(4) { animation-delay: 0.4s; }
.wp-block-cover .wp-block-column:first-child > *:nth-child(5) { animation-delay: 0.5s; }

/* ==========================================================================
   Typography Enhancements
   ========================================================================== */

/* Heading hover effect */
h2.wp-block-heading:not(.has-text-align-center) {
    position: relative;
    display: inline-block;
}

/* Section headings */
h2.has-text-align-center {
    position: relative;
    padding-bottom: 1rem;
}

h2.has-text-align-center::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--wp--preset--color--primary);
    border-radius: 2px;
}

/* ==========================================================================
   Newsletter Section
   ========================================================================== */

/* Newsletter section styling */
.wp-block-group.has-primary-background-color {
    position: relative;
    overflow: hidden;
}

.wp-block-group.has-primary-background-color::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.wp-block-group.has-primary-background-color::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    pointer-events: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.wp-block-group {
    position: relative;
}

/* Footer social links */
footer .wp-block-social-links {
    gap: 0.75rem;
}

footer .wp-block-social-link {
    transition: transform 0.2s ease;
}

footer .wp-block-social-link:hover {
    transform: translateY(-3px);
}

/* Footer link hover */
footer .wp-block-navigation-item__content:hover {
    color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   WooCommerce Integration
   ========================================================================== */

.woocommerce-main {
    padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--20);
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
}

.woocommerce .products .product {
    margin-bottom: var(--wp--preset--spacing--30);
    transition: transform 0.3s ease;
}

.woocommerce .products .product:hover {
    transform: translateY(-4px);
}

.woocommerce .product .price {
    color: var(--wp--preset--color--primary);
    font-weight: 600;
    font-size: 1.2rem;
}

.woocommerce .button,
.woocommerce input.button {
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.woocommerce .button:hover,
.woocommerce input.button:hover {
    background-color: var(--wp--preset--color--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(186, 12, 47, 0.25);
}

/* ==========================================================================
   Amelia Booking Integration
   ========================================================================== */

.amelia-app-booking {
    font-family: var(--wp--preset--font-family--system);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    padding: 12px 24px;
    z-index: 100001;
    transition: top 0.3s ease;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    header,
    footer,
    .wp-block-navigation,
    .wp-block-button {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }

    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 782px) {
    /* Reduce card hover effect on touch devices */
    .wp-block-group.has-white-background-color:hover {
        transform: none;
    }

    /* Adjust hero animation */
    .wp-block-cover .wp-block-column:first-child > * {
        animation: none;
        opacity: 1;
    }

    /* Stack buttons on mobile */
    .wp-block-buttons {
        flex-direction: column;
    }

    .wp-block-buttons .wp-block-button {
        width: 100%;
    }
}
