/*
 * Main Stylesheet for Museo d'arte Mendrisio
 * Museo d'arte Mendrisio brand styling
 *
 * Fonts: Bodoni Moda (headings), Archivo (body)
 * Colors: airy cobalt accent #3B8FCB (brand) / #216FA5 (text-safe variant)
 */

/* Import Google Fonts - Bodoni Moda and Archivo */
@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400..900;1,6..96,400..900&family=Archivo:ital,wght@0,100..900;1,100..900&display=swap');

/* Custom museo variables */
:root {
    /* Neutrals */
    --museo-primary: #1a1a1a;        /* Almost black for text */
    --museo-secondary: #4a5568;      /* Gray for secondary text */
    --museo-muted: #6b7280;          /* Gray for meta / captions */

    /* Brand — airy cobalt */
    --museo-accent: #3B8FCB;         /* BRAND COLOR — fills, accents, hover surfaces */
    --museo-accent-dark: #216FA5;    /* Text-on-white, white-on-color (WCAG AA safe) */
    --museo-accent-tint: #EAF4FB;    /* Pale wash — section bg, badge bg */

    /* Status — used only by homepage Mostre badges & Concerti "Concluso" badge */
    --museo-success: #0E7C5A;        /* "In corso" badge text */
    --museo-success-tint: #E6F3ED;   /* "In corso" badge bg */
    --museo-alert: #D9534F;          /* reserved for alerts */
    --museo-alert-dark: #A03430;     /* "Concluso" badge text */
    --museo-alert-tint: #FBE9E9;     /* "Concluso" badge bg */

    /* Typography - Museo d'arte Mendrisio fonts */
    --font-sans: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Bodoni Moda', Georgia, "Times New Roman", serif;

    /* Spacing scale - generous whitespace */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* Borders */
    --border-radius: 0.5rem;
    --border-color: #e5e7eb;

    /* Shadows - subtle */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Header height for scroll offset */
    --header-height: 160px;
}

/* Smooth scrolling with offset for sticky header */
html {
    scroll-padding-top: calc(32px + var(--header-height)); /* WP admin bar + sticky header */
}

/* When logged out (no admin bar) */
body:not(.admin-bar) {
    scroll-padding-top: var(--header-height);
}

/* Apply fonts globally */
body {
    font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500; /* Lighter weight for Bodoni Moda */
}

/* Screen reader 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 {
    position: static;
    width: auto;
    height: auto;
    padding: 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* WordPress alignment classes */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Prose (content) styling - Museum editorial quality */
.prose {
    line-height: 1.75;
    color: var(--museo-primary);
    font-size: 1.125rem; /* Slightly larger for better readability */
}

.prose h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    color: var(--museo-primary);
}

.prose h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    color: var(--museo-primary);
}

.prose p {
    margin-bottom: 1.5rem;
    color: var(--museo-primary);
}

.prose a {
    color: var(--museo-accent);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: opacity 0.2s ease;
}

.prose a:hover {
    opacity: 0.7;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.prose li {
    margin-bottom: 0.75rem;
}

.prose blockquote {
    border-left: 4px solid var(--museo-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--museo-secondary);
}

.prose img {
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

/* Eyebrow label (used above sidebar sections, hero meta, etc.) */
.museo-eyebrow {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.12em !important;
    color: var(--museo-muted) !important;
    margin-bottom: 2rem !important;
    font-family: var(--font-sans) !important;
}

/* Status badges (homepage Mostre + Concerti "Concluso") */
.museo-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
}
.museo-badge--active {
    background-color: var(--museo-success-tint);
    color: var(--museo-success);
}
.museo-badge--upcoming {
    background-color: var(--museo-accent-tint);
    color: var(--museo-accent-dark);
}
.museo-badge--ended {
    background-color: var(--museo-alert-tint);
    color: var(--museo-alert-dark);
}

/* Sponsors grid */
.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2rem;
    align-items: center;
}

.sponsors-grid img {
    max-width: 100%;
    height: auto;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.sponsors-grid img:hover {
    filter: grayscale(0%);
}

/* Main Menu Styling - Simplified Dropdown */
.museo-main-menu,
.main-navigation .museo-main-menu,
#site-navigation .museo-main-menu {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.museo-menu-item,
.museo-main-menu > li {
    position: relative;
    display: inline-block;
    float: none !important;
}

.museo-menu-link {
    display: flex;
    align-items: center;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.0rem;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.museo-menu-link:hover {
    color: var(--museo-accent);
}

.museo-menu-item.current-menu-item > .museo-menu-link,
.museo-menu-item.current_page_item > .museo-menu-link {
    color: var(--museo-accent);
    font-weight: 600;
}

/* Dropdown Menu */
.museo-dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 220px;
    background: white;
    border-top: 3px solid var(--museo-accent);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

/* Show dropdown on hover */
.museo-has-dropdown:hover .museo-dropdown-menu {
    display: block;
}

/* Dropdown Items */
.museo-dropdown-item {
    border-bottom: 1px solid #f3f4f6;
}

.museo-dropdown-item:last-child {
    border-bottom: none;
}

.museo-dropdown-link {
    display: block;
    color: var(--museo-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.museo-dropdown-link:hover {
    color: var(--museo-accent);
    background-color: #f9fafb;
}

/* Mobile Menu Styling */
.museo-mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.museo-mobile-item {
    border-bottom: 1px solid #e5e7eb;
}

.museo-mobile-link {
    display: block;
    padding: 0.75rem 0;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.museo-mobile-link:hover {
    color: var(--museo-accent);
}

.museo-mobile-toggle {
    color: #6b7280;
    transition: color 0.2s ease;
}

.museo-mobile-toggle:hover {
    color: var(--museo-accent);
}

.museo-mobile-submenu {
    list-style: none;
    padding-left: 1rem;
    margin: 0;
    background-color: #f9fafb;
    border-left: 3px solid var(--museo-accent);
}

.museo-mobile-subitem {
    border-bottom: 1px solid #e5e7eb;
}

.museo-mobile-subitem:last-child {
    border-bottom: none;
}

.museo-mobile-subitem .museo-mobile-link {
    font-size: 0.9375rem;
    padding: 0.625rem 1rem;
}

/* Mobile Menu - Level 3 */
.museo-mobile-subsubmenu {
    list-style: none;
    padding-left: 1rem;
    margin: 0;
    background-color: #f3f4f6;
    border-left: 2px solid var(--museo-accent);
}

.museo-mobile-subsubitem {
    border-bottom: 1px solid #e5e7eb;
}

.museo-mobile-subsubitem:last-child {
    border-bottom: none;
}

.museo-mobile-subsubitem .museo-mobile-link {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Legacy navigation styles for compatibility */
.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-navigation > ul,
.main-navigation ul.museo-main-menu {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    flex-wrap: nowrap !important;
}

.main-navigation li {
    display: inline-block !important;
    float: none !important;
}

.main-navigation a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-navigation a:hover {
    color: var(--museo-secondary);
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    color: var(--museo-primary);
    font-weight: 600;
}

/* Footer menu */
.site-footer nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer nav a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer nav a:hover {
    color: white;
}

/* Responsive embeds */
.wp-block-embed.is-type-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.wp-block-embed.is-type-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Logo styling - centered above menu, then compact on scroll */
.site-branding .custom-logo {
    max-height: 80px;
    width: auto;
    transition: all 0.3s ease;
}

.site-branding .custom-logo-link {
    display: inline-block;
}

/* WooCommerce button overrides — brand blue instead of default purple */
.woocommerce .button.alt,
.woocommerce .button.checkout-button,
.woocommerce a.button.alt,
.woocommerce a.button.checkout-button,
.woocommerce a.checkout-button,
.woocommerce #place_order,
.woocommerce .wc-proceed-to-checkout a.checkout-button,
.woocommerce .wc-proceed-to-checkout .checkout-button,
.woocommerce button.button.alt,
.woocommerce-page .button.alt,
.woocommerce-page a.button.alt,
.woocommerce-page #place_order,
.woocommerce-page .wc-proceed-to-checkout a.checkout-button {
    background-color: var(--museo-accent) !important;
    border-color: var(--museo-accent) !important;
    color: #fff !important;
    border-radius: 0 !important;
    font-weight: 600 !important;
}
.woocommerce .button.alt:hover,
.woocommerce .button.checkout-button:hover,
.woocommerce a.button.alt:hover,
.woocommerce a.checkout-button:hover,
.woocommerce #place_order:hover,
.woocommerce .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce button.button.alt:hover,
.woocommerce-page .button.alt:hover,
.woocommerce-page a.button.alt:hover,
.woocommerce-page #place_order:hover,
.woocommerce-page .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* WooCommerce notification icon — brand blue instead of green */
.woocommerce-message::before,
.woocommerce-info::before {
    color: var(--museo-accent) !important;
}
.woocommerce-message {
    border-top-color: var(--museo-accent) !important;
}
.woocommerce-info {
    border-top-color: var(--museo-accent) !important;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .main-navigation {
        display: none;
    }
}
