/**
 * Main Styles
 * 
 * @package Starter_starter
 */

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
    /* Colors - defaults, overridden by Customizer */
    --starter-theme: #7C3AED;
    --starter-accent: #10B981;
    --starter-text: #1E293B;
    --starter-bg: #F8FAFC;
    --starter-header-bg: #FFFFFF;
    --starter-footer-bg: #1E293B;
    --starter-footer-text: #FFFFFF;
    
    /* Typography */
    --starter-heading-font: 'Inter', system-ui, sans-serif;
    --starter-body-font: 'Inter', system-ui, sans-serif;
    --starter-base-font-size: 16px;
    
    /* Spacing */
    --starter-container-max: 1400px;
    --starter-container-padding: 1rem;
    --starter-header-height: 80px;
    
    /* Transitions */
    --starter-transition: 0.3s ease;
    --starter-transition-fast: 0.15s ease;
    
    /* Border radius */
    --starter-radius-sm: 8px;
    --starter-radius-md: 12px;
    --starter-radius-lg: 20px;
    --starter-radius-xl: 28px;
    
    /* Shadows */
    --starter-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --starter-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --starter-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --starter-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --starter-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--starter-base-font-size);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--starter-body-font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--starter-text);
    background-color: var(--starter-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--starter-heading-font);
    font-weight: 700;
    line-height: 1.2;
    color: var(--starter-text);
    margin-bottom: 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--starter-theme);
    text-decoration: none;
    transition: color var(--starter-transition-fast);
}

a:hover,
a:focus {
    color: var(--starter-accent);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding-top: var(--starter-header-height);
}

.container {
    width: 100%;
    max-width: var(--starter-container-max);
    margin: 0 auto;
    padding-left: var(--starter-container-padding);
    padding-right: var(--starter-container-padding);
}

/* Wide container for front page */
.front-page-content .container {
    max-width: 1600px;
}

@media (max-width: 768px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

.content-area {
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .content-area {
        padding: 0.5rem 0;
    }
}

/* Front page specific - no padding */
.front-page-content {
    padding: 0.5rem 0;
}

@media (max-width: 768px) {
    .front-page-content {
        padding: 0;
    }
    
    .front-page-content .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Fix for age gate spacing on mobile */
    .front-page-content .entry-content > *:first-child {
        margin-top: 0 !important;
    }
}

/* Entry content reset for front page */
.front-page-content .entry-content {
    margin: 0;
    padding: 0;
}

/* WordPress block spacing reset */
.front-page-content .wp-block-html,
.front-page-content .entry-content > div:first-child {
    margin-top: 0;
    margin-bottom: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--starter-header-bg);
    height: var(--starter-header-height);
    transition: all var(--starter-transition);
}

@media (max-width: 768px) {
    :root {
        --starter-header-height: 60px;
    }
}

@media (max-width: 480px) {
    :root {
        --starter-header-height: 55px;
    }
}

.site-header.is-sticky {
    box-shadow: var(--starter-shadow-md);
}

.site-header.is-sticky.has-blur.is-scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--starter-container-max);
    margin: 0 auto;
    padding: 0 var(--starter-container-padding);
}

/* Site Branding */
.site-branding {
    flex-shrink: 0;
}

.site-branding a {
    display: flex;
    align-items: center;
}

.custom-logo {
    max-height: 70px;
    width: auto;
}

@media (max-width: 768px) {
    .custom-logo {
        max-height: 40px;
    }
}

@media (max-width: 480px) {
    .custom-logo {
        max-height: 35px;
    }
}

.site-title-link {
    font-family: var(--starter-heading-font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--starter-text);
}

.site-title-link:hover {
    color: var(--starter-theme);
}

/* Navigation */
.main-navigation {
    display: none;
}

@media (min-width: 768px) {
    .main-navigation {
        display: block;
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    font-weight: 500;
    color: var(--starter-text);
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--starter-theme);
    transition: width var(--starter-transition);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after {
    width: 100%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Switcher */
.starter-language-switcher {
    position: relative;
}

.starter-lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--starter-radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--starter-text);
    cursor: pointer;
    transition: all var(--starter-transition-fast);
}

.starter-lang-toggle:hover {
    border-color: var(--starter-theme);
    color: var(--starter-theme);
}

.starter-lang-toggle svg {
    transition: transform var(--starter-transition-fast);
}

.starter-lang-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.starter-lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border-radius: var(--starter-radius-md);
    box-shadow: var(--starter-shadow-xl);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--starter-transition);
    z-index: 100;
    overflow: hidden;
}

.starter-language-switcher.is-open .starter-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.starter-lang-dropdown li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.starter-lang-dropdown li:last-child {
    border-bottom: none;
}

.starter-lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--starter-text);
    transition: background var(--starter-transition-fast);
}

.starter-lang-dropdown a:hover {
    background: rgba(0, 0, 0, 0.03);
}

.starter-lang-dropdown img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
}

.starter-lang-dropdown .active a {
    background: rgba(124, 58, 237, 0.1);
    color: var(--starter-theme);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--starter-text);
    border-radius: 2px;
    transition: all var(--starter-transition);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: var(--starter-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 2rem var(--starter-container-padding);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all var(--starter-transition);
    overflow-y: auto;
    z-index: 999;
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-menu {
    list-style: none;
    margin-bottom: 2rem;
}

.mobile-nav-menu li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-menu a {
    display: block;
    padding: 1rem 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--starter-text);
}

.mobile-menu .starter-language-switcher {
    width: 100%;
}

.mobile-menu .starter-lang-toggle {
    width: 100%;
    justify-content: space-between;
}

.mobile-menu .starter-lang-dropdown {
    position: static;
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

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

.site-footer {
    background-color: var(--starter-footer-bg);
    color: var(--starter-footer-text);
    padding: 1.5rem 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: var(--starter-container-max);
    margin: 0 auto;
    padding: 0 var(--starter-container-padding);
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-copyright {
    font-size: 0.875rem;
    opacity: 0.8;
}

.footer-navigation .footer-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    list-style: none;
}

@media (min-width: 768px) {
    .footer-navigation .footer-menu {
        justify-content: flex-end;
    }
}

.footer-menu a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--starter-footer-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    transition: opacity var(--starter-transition-fast);
}

.footer-menu a:hover {
    opacity: 1;
    color: var(--starter-footer-text);
}

/* ==========================================================================
   Content
   ========================================================================== */

.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    margin-bottom: 0;
}

.entry-content {
    max-width: 65ch;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-family: var(--starter-heading-font);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--starter-radius-md);
    cursor: pointer;
    transition: all var(--starter-transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--starter-accent) 0%, color-mix(in srgb, var(--starter-accent) 70%, var(--starter-theme)) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    color: white;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.error-404-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error-404-inner {
    text-align: center;
}

.error-code {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.error-code span {
    font-family: var(--starter-heading-font);
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--starter-theme) 0%, var(--starter-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-code .zero {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.error-404 .page-title {
    margin-bottom: 1rem;
}

.error-404 .page-content p {
    max-width: 40ch;
    margin: 0 auto 2rem;
    color: #64748B;
}

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

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    background: var(--starter-theme);
    color: white;
    padding: 0.5rem 1rem;
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    transition: top var(--starter-transition);
    border-radius: 0 0 var(--starter-radius-sm) var(--starter-radius-sm);
}

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

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--starter-theme);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--starter-theme);
    outline-offset: 2px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.visible { display: block !important; }

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

@media print {
    .site-header,
    .site-footer,
    .age-gate,
    .cookie-notice {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .site-main {
        padding-top: 0;
    }
}

/* ==========================================================================
   Front Page Specific
   ========================================================================== */

/* Hide page title on front page */
.home .entry-header,
.front-page-content .entry-header,
body.home .entry-title,
body.page-template-default.home .entry-header {
    display: none !important;
}

/* Front page content area */
.front-page-content {
    padding-top: 2rem;
}

.front-page-content .entry-content {
    max-width: 100%;
}

/* ==========================================================================
   Mobile Fixes
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --starter-header-height: 70px;
    }
    
    .site-main {
        padding-top: var(--starter-header-height);
    }
    
    .content-area {
        padding: 1.5rem 0;
    }
    
    .front-page-content {
        padding-top: 1rem;
    }
    
    /* Fix large gaps in mobile */
    .entry-content > *:first-child {
        margin-top: 0;
    }
}
