/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #131313;
    color: #e2e2e2;
    overflow-x: hidden;
}

/* Prevent text overflow and enable word-wrapping for long URLs and text */
a, p, span, li {
    word-break: break-word;
    overflow-wrap: break-word;
}

a {
    word-break: break-all;
}

/* Accessibility: Focus Styles */
:focus-visible {
    outline: 3px solid #e30613;
    outline-offset: 2px;
}

a:focus-visible, 
button:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #e30613;
    outline-offset: 2px;
}

/* Screen Reader Only (sr-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-width: 0;
}

.sr-only.focus:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.font-space-grotesk {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Headings with wider spacing */
h1.font-space-grotesk,
h2.font-space-grotesk,
h3.font-space-grotesk,
h4.font-space-grotesk,
h5.font-space-grotesk,
h6.font-space-grotesk {
    letter-spacing: 0.05em;
}

/* Buttons with wider spacing */
button.font-space-grotesk {
    letter-spacing: 0.05em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #131313;
}

::-webkit-scrollbar-thumb {
    background: #e30613;
}

/* 3D Gallery Container - Only for Look Inside carousel */
.gallery-container {
    width: 180px;
    height: 260px;
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    animation: gallery 60s linear infinite;
    cursor: pointer;
}

.gallery-container span {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(375px);
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-container span img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(227, 6, 19, 0.3);
    cursor: pointer;
    transition: filter 0.3s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.gallery-container span img:hover {
    filter: brightness(1.1);
}

@keyframes gallery {
    0% {
        transform: perspective(1000px) rotateY(0deg);
    }
    100% {
        transform: perspective(1000px) rotateY(360deg);
    }
}

/* Hero Book Image - Mobile Responsive Spacing */
.hero-book-image {
    margin-top: 80px;
    margin-bottom: 80px;
}

/* Images with light shadow effect */
.light-shadow-image {
    box-shadow: 0 -30px 50px rgba(255,255,255,0.4), 0 10px 20px rgba(255,255,255,0.3), 10px 0px 25px rgba(255,255,255,0.2), -10px 0px 25px rgba(255,255,255,0.2), 0 30px 50px rgba(255,255,255,0.4) !important;
}

.light-shadow-box {
    box-shadow: 0 -30px 50px rgba(255,255,255,0.4), 0 10px 20px rgba(255,255,255,0.3), 10px 0px 25px rgba(255,255,255,0.2), -10px 0px 25px rgba(255,255,255,0.2), 0 30px 50px rgba(255,255,255,0.4) !important;
}

/* Dots styling - default inline for desktop */
.dots-mobile {
    display: inline;
}

@media (max-width: 768px) {
    
    .hero-book-image {
        margin-top: 30px;
        margin-bottom: 30px;
    }
    
    .light-shadow-image {
        box-shadow: 0 -15px 25px rgba(255,255,255,0.2), 0 5px 10px rgba(255,255,255,0.15), 5px 0px 12px rgba(255,255,255,0.1), -5px 0px 12px rgba(255,255,255,0.1), 0 15px 25px rgba(255,255,255,0.2) !important;
    }
    
    .light-shadow-box {
        box-shadow: 0 -15px 25px rgba(255,255,255,0.2), 0 5px 10px rgba(255,255,255,0.15), 5px 0px 12px rgba(255,255,255,0.1), -5px 0px 12px rgba(255,255,255,0.1), 0 15px 25px rgba(255,255,255,0.2) !important;
    }
    
    .gallery-heading {
        font-size: 1.25rem !important;
        max-width: 80px;
        word-spacing: 100vw;
    }
    
    .dots-mobile {
        display: block;
    }
    
    .pages-number {
        margin-top: -60px !important;
    }
}

/* Expand Look Inside section width */
.bg-surface-container-low .container {
    max-width: 1200px;
}

/* Lightbox Modal */
.lightbox-modal {
    display: none !important;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.lightbox-modal[style*="display: flex"] {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation: slideIn 0.3s ease-in;
    border-radius: 10px;
    box-shadow: 0 0 60px rgba(227, 6, 19, 0.5);
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #e30613;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(227, 6, 19, 0.8);
}

/* Lightbox Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(227, 6, 19, 0.7);
    color: white;
    border: none;
    font-size: 40px;
    padding: 15px 20px;
    cursor: pointer;
    z-index: 1000;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:hover {
    background-color: rgba(227, 6, 19, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav .material-symbols-outlined {
    font-size: 40px;
}

/* Lightbox Counter */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Red Button Styles */
button.bg-red-600,
a.bg-red-600,
div.bg-red-600 {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

button.bg-red-600:hover,
a.bg-red-600:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

button.bg-red-600:active,
a.bg-red-600:active {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* Hamburger Menu Responsive Styles */
/* Mobile Navigation - Optimize for small screens */
@media (max-width: 767px) {
    nav {
        padding: 1rem 1rem !important;
        gap: 0.5rem !important;
    }
    
    nav > div:first-child img {
        height: 2rem !important;
        width: auto !important;
    }
    
    #hamburger-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.375rem !important;
        order: 2;
        flex-shrink: 0;
        cursor: pointer !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
    }
    
    #hamburger-menu span {
        display: block !important;
        background-color: #ffffff !important;
        width: 1.25rem !important;
        height: 0.125rem !important;
    }
    
    nav > a:last-child {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
        order: 3;
        flex-shrink: 0;
    }
    
    nav > div:nth-child(2) {
        display: none !important;
    }
}

/* Mobile Menu Display Control */
#mobile-menu {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 4rem !important;
    left: 0 !important;
    width: 100% !important;
    background-color: rgba(19, 19, 19, 0.95) !important;
    z-index: 51 !important;
    gap: 1rem !important;
    padding: 1.5rem !important;
    backdrop-filter: blur(20px) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#mobile-menu.menu-closed {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Responsive sizing for 1100 number on mobile */
@media (max-width: 767px) {
    h2 > span.text-primary-container {
        font-size: 160px !important;
    }
    
    /* Center 1100 PAGES on mobile */
    .relative.z-10 h2 {
        text-align: center !important;
    }
    
    .relative.z-10 h2 > span.text-primary-container {
        margin-left: 0 !important;
    }
}

@media (max-width: 480px) {
    h2 > span.text-primary-container {
        font-size: 120px !important;
    }
}

/* Make Michael Angelo Batio image and text stack vertically on mobile */
@media (max-width: 767px) {
    .max-w-5xl > .flex.gap-8.items-start {
        flex-direction: column !important;
    }
    
    .max-w-5xl > .flex.gap-8.items-start img {
        width: 100% !important;
        height: auto !important;
    }
}

/* Hide hamburger button on medium+ screens (768px and above) */
@media (min-width: 768px) {
    #hamburger-menu {
        display: none !important;
    }
    
    #mobile-menu {
        display: none !important;
    }
    
    /* Add extra padding to content sections on desktop for privacy-policy and imprint */
    .bg-surface-container section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

