/*
Theme Name: C'era Una Volta Il Tordo Matto
Theme URI: https://denkhub.io/
Author: DenkHub
Description: Tema custom FSE per la macelleria di Zagarolo. Stile rustic-elevated, Liberty/Art Nouveau.
Version: 1.1.0
*/

/* =========================================
   0. INTERACTIVE UILITIES (NEW)
   ========================================= */
/* =========================================
   0. INTERACTIVE UILITIES
   ========================================= */
/* Default Cursor restored */

/* Infinite Marquee */
/* Infinite Marquee */
.marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
    background: var(--color-primary-dark);
    padding: 20px 0;
    /* Borders removed */
}

.marquee-content {
    display: inline-block;
    animation: marqueeScroll 20s linear infinite;
}

.hero-content {
    margin-top: 10vh;
    /* Added margin */
}

.highlight-content {
    text-align: center;
    /* Ensure centering */
}


.marquee-item {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-secondary);
    margin-right: 60px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes marqueeScroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* =========================================
   1. VARIABLES & SETUP
   ========================================= */
:root {
    /* Color Palette - Gold & Grain Edition */
    --color-primary: #2b3d2d;
    /* Darker, richer Green */
    --color-primary-dark: #1a251b;
    --color-secondary: #FBD798;
    /* Base Gold */
    --color-gold-light: #fff5d6;
    --color-gold-dark: #b8860b;
    --color-base: #f4f1ea;
    /* Textured Cream */
    --color-text: #2c2c2c;
    --color-text-light: #f1f1f1;
    --color-accent: #C8A165;
    /* Darker Gold for borders */

    /* Typography */
    --font-heading: 'Amarante', serif;
    --font-body: 'Lora', serif;

    /* Spacing */
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Transitions */
    --transition-fast: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-smooth: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Slower, majestic */
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--color-base);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    /* Native smooth scrolling for anchors */
}

/* Film Grain Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    /* Noise data URI (light noise) */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.6;
    mix-blend-mode: overlay;
}

/* =========================================
   2. TYPOGRAPHY & GOLD EFFECTS
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    margin-top: 0;
    line-height: 1.1;
    color: var(--color-primary);
}

/* Gold Gradient Text */
.text-highlight,
h1.hero-title span,
.btn--gold {
    background: linear-gradient(135deg,
            #d4af37 0%,
            #fbd798 25%,
            #fbf5b7 50%,
            #d4af37 75%,
            #aa771c 100%);
    background-size: 200% auto;
    animation: shine 4s linear infinite;
}

/* Apply clip only to text elements, not buttons */
.text-highlight,
h1.hero-title span {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

h1.hero-title {
    font-size: clamp(3.5rem, 9vw, 6.5rem);
    color: var(--color-text-light);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Deep shadow */
}

.text-highlight {
    /* color: var(--color-secondary); - Removed as gradient handles color */
    display: block;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: var(--spacing-md);
    position: relative;
    display: inline-block;
}

.section-title--light {
    color: var(--color-text-light);
}

.eyebrow {
    font-family: var(--font-heading);
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.drop-cap::first-letter {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    float: left;
    margin-right: 0.5rem;
    line-height: 0.8;
    color: var(--color-primary);
}

/* =========================================
   3. COMPONENTS
   ========================================= */
/* Luxury Buttons */
.btn {
    display: inline-block;
    padding: 14px 40px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.btn--outline {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.btn--outline:hover {
    background: #d4af37;
    color: var(--color-primary-dark);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.btn--gold {
    /* Background defined in Typography section for gradient */
    color: var(--color-primary-dark);
    font-weight: 700;
    box-shadow: 0 5px 20px rgba(251, 215, 152, 0.3);
    border: none;
}

.btn--gold:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(251, 215, 152, 0.5);
}

.btn--text {
    padding: 0;
    border: none;
    color: var(--color-primary);
    border-bottom: 1px solid currentColor;
}

/* Torn Paper / Shape Dividers - Renamed to avoid cache conflict */
.shape-divider-bottom {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: var(--color-base);
    -webkit-mask-image: url('assets/images/torn-edge.png');
    mask-image: url('assets/images/torn-edge.png');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    transform: rotate(180deg);
    pointer-events: none;
    z-index: 5;
}

.shape-divider-top {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: var(--color-base);
    -webkit-mask-image: url('assets/images/torn-edge.png');
    mask-image: url('assets/images/torn-edge.png');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    pointer-events: none;
    z-index: 5;
}

/* Art Nouveau Frame */
.art-nouveau-frame {
    position: relative;
    padding: 20px;
    border: 3px double var(--color-accent);
}

.art-nouveau-frame::before,
.art-nouveau-frame::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-primary);
    transition: var(--transition-smooth);
}

.art-nouveau-frame::before {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.art-nouveau-frame::after {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: #ddd;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.1);
}

.gradient-placeholder {
    background: linear-gradient(135deg, #325034 0%, #2a402b 100%);
    position: relative;
    overflow: hidden;
}

.gradient-placeholder::after {
    content: 'IMG';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    color: rgba(255, 255, 255, 0.1);
    font-size: 4rem;
}

/* Scroll Icon */
.scroll-indicator {
    display: inline-block;
    padding-top: 60px;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--color-secondary);
    border-radius: 14px;
    display: block;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--color-secondary);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        top: 6px;
        opacity: 1;
    }

    100% {
        top: 20px;
        opacity: 0;
    }
}

/* =========================================
   4. SECTIONS
   ========================================= */
/* Theatrical Hero */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Dramatic Spotlight Gradient */
    background: radial-gradient(circle at 50% 40%,
            #3e5c40 0%,
            #2b3d2d 40%,
            #111912 85%);
    color: var(--color-text-light);
    overflow: hidden;
    text-align: center;
}

/* Hero Orb Animation */
.hero-orb {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(251, 215, 152, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: pulseLight 8s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulseLight {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.hero-subtitle {
    font-family: var(--font-heading);
    /* Switch to Amarante for subtitle too */
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--color-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-description {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    opacity: 0.9;
}

.hero-content {
    margin-top: 10vh;
}

.hero-actions {
    margin-top: 30px;
}

/* Intro */
.intro-section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

@media (max-width: 768px) {
    .container--split {
        grid-template-columns: 1fr;
    }
}

/* Highlight (Link to Product) */
.highlight-section {
    position: relative;
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: var(--spacing-xl) 0;
    overflow: hidden;
    text-align: center;
}

.ornament {
    width: 100px;
    height: 2px;
    background: var(--color-secondary);
    margin: var(--spacing-md) auto;
    position: relative;
}

.ornament::before {
    content: '❖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-primary);
    padding: 0 10px;
    color: var(--color-secondary);
}

.highlight-description {
    font-size: 1.5rem;
    max-width: 700px;
    margin: 0 auto var(--spacing-md);
}

/* Visit Section */
.visit-section {
    padding: var(--spacing-xl) 0;
}

.visit-card {
    display: flex;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.visit-text {
    flex: 1;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.visit-map-placeholder {
    flex: 1;
    background-color: #eee;
    min-height: 300px;
}

/* =========================================
   5. ANIMATIONS (Utilities)
   ========================================= */
.fade-in-up,
.fade-in-left,
.fade-in-right {
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

/* Initial States */
.fade-in-up {
    transform: translateY(60px);
}

.fade-in-left {
    transform: translateX(-60px);
}

.fade-in-right {
    transform: translateX(60px);
}

/* Active States (added by JS) */
.is-visible.fade-in-up {
    opacity: 1;
    transform: translateY(0);
}

.is-visible.fade-in-left {
    opacity: 1;
    transform: translateX(0);
}

.is-visible.fade-in-right {
    opacity: 1;
    transform: translateX(0);
}

/* Delay Utilities */
.delay-200 {
    transition-delay: 0.2s;
}

.delay-400 {
    transition-delay: 0.4s;
}

/* =========================================
   6. HEADER 2025 (New Implementation)
   ========================================= */
.header-2025 {
    padding: 20px 40px;
    position: fixed;
    /* Sticky top */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* Gradient: Green to Transparent */
    background: linear-gradient(to bottom, var(--color-primary-dark) 0%, transparent 100%);
    transition: padding 0.4s ease;
}

/* Header Background Transition Fix (Pseudo-element) */
.header-2025::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary-dark);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    /* Behind content */
}

.header-2025:hover::before {
    opacity: 1;
}



/* Flex Container for Header content */
.header-2025 .e-con-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo Container */
.header-logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Adjust spacing between icon and text */
}

.logo-img-1 img {
    width: 60px;
    /* Reduced from 134px */
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo-img-2 {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transform: translateX(-10px);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    white-space: nowrap;
}

.logo-img-2 img {
    width: 150px;
    height: auto;
    display: block;
}

/* Logo Hover Effect: Reveal Logotype */
.header-logo-container:hover .logo-img-2 {
    opacity: 1;
    width: 150px;
    /* Expand to full width */
    transform: translateX(0);
}

/* Menu Navigation (Desktop) */
.home-menu .e-n-menu-wrapper {
    display: flex;
}

.home-menu ul.e-n-menu-heading {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
    /* Space between menu items */
}

.home-menu .e-n-menu-item a {
    text-decoration: none;
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 1.2rem;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.home-menu .e-n-menu-item a:hover {
    color: var(--color-secondary);
}

/* Mobile Menu Toggle & Styles (Basic implementation) 
   Actual Elementor mobile menu is complex JS, we'll strive for a functional equivalent 
*/
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--color-primary);
}

@media (max-width: 1024px) {
    .home-menu {
        display: none;
        /* Hide desktop menu on tablet/mobile */
    }

    .home-menu-mobile {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    /* Adjust logo sizes on mobile if needed */
    .logo-img-1 img {
        width: 100px;
    }

    .logo-img-2 img {
        width: 200px;
    }
}

/* Hero Logotype */
.hero-logotype {
    width: 600px;
    /* Adjust size as needed */
    max-width: 90vw;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

@media (max-width: 768px) {
    .hero-logotype {
        width: 100%;
        max-width: 300px;
    }
}

/* =========================================
   7. PAGE TEMPLATES
   ========================================= */

/* Standard Page */
.page-container {
    max-width: 900px;
    margin: 120px auto 60px;
    /* Top margin accounts for fixed header */
    padding: 0 20px;
}

.entry-header {
    text-align: center;
    margin-bottom: 40px;
}

.entry-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-primary);
}

.entry-content {
    font-family: var(--font-body);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-text);
}

/* =========================================
   8. PARCHMENT PAGE TEMPLATE (Default)
   ========================================= */

.legend-hero {
    min-height: 50vh;
    padding: 140px 20px 80px;
    /* Accounts for fixed header */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #2b3d2d 0%, #1a251b 100%);
    text-align: center;
    color: var(--color-gold-light);
    margin-bottom: -50px;
    /* Overlap with parchment */
}

.legend-title {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 1rem;
    color: var(--color-gold-light);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.legend-subtitle,
.legend-subtitle p {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--color-secondary);
    max-width: 800px;
    margin: 0 auto;
}

/* Parchment CSS */
.parchment-section {
    position: relative;
    padding-bottom: 80px;
    z-index: 2;
}

.parchment-wrapper {
    position: relative;
    background-color: #f4e4bc;
    /* Parchment base color */
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.15"/></svg>');
    margin: 0 auto;
    max-width: 1000px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2),
        inset 0 0 100px rgba(160, 120, 60, 0.1);
    /* Inner glow/aging */
    padding: 80px 60px;
    border-radius: 2px;
}

.parchment-wrapper::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(160, 120, 60, 0.3);
    pointer-events: none;
}

.parchment-content {
    color: #3e2b1d;
    /* Dark brown ink */
}

/* Media Frame (Featured Image) */
.media-frame {
    background: #fff;
    padding: 15px 15px 50px 15px;
    /* Polaroid style bottom padding */
    box-shadow: 3px 6px 20px rgba(0, 0, 0, 0.25);
    transform: rotate(2deg);
    max-width: 600px;
    margin: 0 auto 60px;
    /* Space before content */
    transition: transform 0.3s ease;
}

.media-frame:hover {
    transform: rotate(0deg) scale(1.01);
}

.media-image-container img {
    display: block;
    width: 100%;
    height: auto;
    filter: sepia(0.2) contrast(1.1);
    /* Vintage photo feel */
}

.media-caption {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    color: #555;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
}

/* Gutenberg Typography & Block Styles on Parchment */
.parchment-typography {
    font-family: var(--font-body);
    font-size: 1.2rem;
    line-height: 1.8;
}

.parchment-typography h1,
.parchment-typography h2,
.parchment-typography h3,
.parchment-typography h4,
.parchment-typography h5,
.parchment-typography h6 {
    font-family: var(--font-heading);
    color: #5d3a1a;
    /* Darker wood/brown for headings */
    margin-top: 2em;
    margin-bottom: 0.8em;
    text-align: center;
}

.parchment-typography h2 {
    font-size: 2.5rem;
    border-bottom: 2px solid rgba(160, 120, 60, 0.2);
    padding-bottom: 15px;
    display: inline-block;
    width: 100%;
}

.parchment-typography p {
    margin-bottom: 1.5rem;
}

/* Drop Cap for the first paragraph of the content */
.parchment-typography>p:first-of-type::first-letter {
    font-family: var(--font-heading);
    font-size: 4rem;
    float: left;
    margin-right: 15px;
    line-height: 0.8;
    color: #8b5a2b;
}

.parchment-typography blockquote {
    margin: 40px 0;
    padding: 20px 40px;
    border-left: none;
    background: rgba(0, 0, 0, 0.03);
    font-style: italic;
    text-align: center;
    position: relative;
    border-radius: 4px;
}

.parchment-typography blockquote::before {
    content: '“';
    font-family: var(--font-heading);
    font-size: 4rem;
    color: rgba(160, 120, 60, 0.4);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.parchment-typography ul,
.parchment-typography ol {
    margin: 0 auto 30px;
    max-width: 800px;
    padding-left: 40px;
}

.parchment-typography li {
    margin-bottom: 10px;
}

/* WordPress Alignments within Parchment */
.parchment-typography .alignwide,
.parchment-typography .alignfull {
    max-width: 100%;
    width: 100%;
}

@media (max-width: 768px) {
    .parchment-wrapper {
        padding: 40px 20px;
    }

    .legend-title {
        font-size: 2.5rem;
    }

    .parchment-typography h2 {
        font-size: 2rem;
    }
}