40,\n 'width' => 120,\n 'flex-width' => true,\n 'flex-height' => true,\n ] );\n\n // Editor color palette (pentru Gutenberg)\n add_theme_support( 'editor-color-palette', [\n [ 'name' => 'Spark Blue', 'slug' => 'spark-blue', 'color' => '#4fc3f7' ],\n [ 'name' => 'Spark Red', 'slug' => 'spark-red', 'color' => '#e53935' ],\n [ 'name' => 'Spark Purple', 'slug' => 'spark-purple', 'color' => '#7c4dff' ],\n [ 'name' => 'Background', 'slug' => 'bg-dark', 'color' => '#0a0a18' ],\n [ 'name' => 'Text Primary', 'slug' => 'text-primary', 'color' => '#e8e8f0' ],\n ] );\n\n // Meniu navigare principal\n register_nav_menus( [\n 'main-menu' => __( 'Meniu Principal', 'dvw-theme' ),\n 'footer-menu' => __( 'Meniu Footer', 'dvw-theme' ),\n ] );\n\n // Traduceri (pentru extensibilitate)\n load_theme_textdomain( 'dvw-theme', DVW_DIR . '/languages' );\n}\nadd_action( 'after_setup_theme', 'dvw_theme_setup' );\n\n\n// ─────────────────────────────────────────────\n// 2. ENQUEUE ASSETS\n// ─────────────────────────────────────────────\nfunction dvw_enqueue_assets() {\n $v = DVW_VERSION;\n $uri = DVW_URI . '/assets';\n\n // Google Fonts\n wp_enqueue_style(\n 'dvw-google-fonts',\n 'https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Space+Mono:wght@400;700&family=DM+Sans:wght@400;500&display=swap',\n [],\n null\n );\n\n // CSS — în ordine corectă\n $styles = [\n 'dvw-reset' => 'css/reset.css',\n 'dvw-variables' => 'css/variables.css',\n 'dvw-variables-night'=> 'css/variables-night.css',\n 'dvw-typography' => 'css/typography.css',\n 'dvw-layout' => 'css/layout.css',\n 'dvw-components' => 'css/components.css',\n 'dvw-animations' => 'css/animations.css',\n ];\n\n $prev = 'dvw-google-fonts';\n foreach ( $styles as $handle => $file ) {\n wp_enqueue_style( $handle, "$uri/$file", [ $prev ], $v );\n $prev = $handle;\n }\n\n // JS — performance-guard primul, restul în ordine\n wp_enqueue_script( 'dvw-perf-guard', "$uri/js/performance-guard.js", [], $v, true );\n wp_enqueue_script( 'dvw-neural-spark', "$uri/js/neural-spark.js", ['dvw-perf-guard'], $v, true );\n wp_enqueue_script( 'dvw-nav', "$uri/js/nav.js", ['dvw-neural-spark'], $v, true );\n wp_enqueue_script( 'dvw-scroll-story', "$uri/js/scroll-story.js", ['dvw-nav'], $v, true );\n wp_enqueue_script( 'dvw-theme-toggle', "$uri/js/theme-toggle.js", ['dvw-scroll-story'], $v, true );\n wp_enqueue_script( 'dvw-main', "$uri/js/main.js", ['dvw-theme-toggle'], $v, true );\n\n // Pasează date din PHP către JS (URL-ul temei, ajax URL etc.)\n wp_localize_script( 'dvw-main', 'dvwData', [\n 'ajaxUrl' => admin_url( 'admin-ajax.php' ),\n 'themeUri' => DVW_URI,\n 'nonce' => wp_create_nonce( 'dvw_nonce' ),\n 'siteUrl' => home_url(),\n ] );\n}\nadd_action( 'wp_enqueue_scripts', 'dvw_enqueue_assets' );\n\n\n// ─────────────────────────────────────────────\n// 3. WIDGET AREAS\n// ─────────────────────────────────────────────\nfunction dvw_register_sidebars() {\n register_sidebar( [\n 'name' => __( 'Sidebar Blog', 'dvw-theme' ),\n 'id' => 'sidebar-blog',\n 'description' => __( 'Widget-uri afișate în sidebar-ul blogului.', 'dvw-theme' ),\n 'before_widget' => '
',\n 'after_widget' => '
',\n 'before_title' => '',\n ] );\n\n register_sidebar( [\n 'name' => __( 'Footer — Coloana 1', 'dvw-theme' ),\n 'id' => 'footer-1',\n 'before_widget' => '',\n 'before_title' => '',\n 'after_title' => '
',\n ] );\n}\nadd_action( 'widgets_init', 'dvw_register_sidebars' );\n\n\n// ─────────────────────────────────────────────\n// 4. CUSTOMIZER — texte și social links editabile\n// ─────────────────────────────────────────────\nfunction dvw_customizer( WP_Customize_Manager $wp_customize ) {\n\n // ── Panoul DVW Settings ──\n $wp_customize->add_panel( 'dvw_panel', [\n 'title' => __( 'DVW Theme Settings', 'dvw-theme' ),\n 'priority' => 30,\n ] );\n\n // ── Secțiunea Hero ──\n $wp_customize->add_section( 'dvw_hero', [\n 'title' => __( 'Hero — Homepage', 'dvw-theme' ),\n 'panel' => 'dvw_panel',\n ] );\n\n dvw_add_text_setting( $wp_customize, 'dvw_hero_label', 'dvw_hero', 'Label deasupra H1', 'STRATEGIST · CREATIVE · SYSTEM BUILDER' );\n dvw_add_text_setting( $wp_customize, 'dvw_hero_title', 'dvw_hero', 'Titlu H1 hero', 'Build systems that actually sell.' );\n dvw_add_text_setting( $wp_customize, 'dvw_hero_subtitle', 'dvw_hero', 'Subtitlu hero', 'I turn raw ideas into systems that work — from strategy to execution, from concept to conversion.' );\n dvw_add_text_setting( $wp_customize, 'dvw_hero_cta_text', 'dvw_hero', 'Text buton CTA', 'ENTER MY MIND →' );\n dvw_add_url_setting( $wp_customize, 'dvw_hero_cta_url', 'dvw_hero', 'URL buton CTA', '/contact/' );\n\n // ── Secțiunea About ──\n $wp_customize->add_section( 'dvw_about', [\n 'title' => __( 'Pagina About', 'dvw-theme' ),\n 'panel' => 'dvw_panel',\n ] );\n\n dvw_add_text_setting( $wp_customize, 'dvw_about_intro', 'dvw_about', 'Intro bio (paragraf 1)', "I started my career in content marketing and quickly realized that random posts don't build businesses." );\n dvw_add_text_setting( $wp_customize, 'dvw_about_intro_2', 'dvw_about', 'Intro bio (paragraf 2)', "Over the years I've worked across industries — from personal brands to product companies — building the frameworks that make marketing feel inevitable instead of accidental." );\n dvw_add_text_setting( $wp_customize, 'dvw_about_tagline', 'dvw_about', 'Tagline personal', "My obsession? Turning chaos into clarity. And clarity into cash." );\n\n // ── Secțiunea Contact / Social ──\n $wp_customize->add_section( 'dvw_social', [\n 'title' => __( 'Contact & Social Links', 'dvw-theme' ),\n 'panel' => 'dvw_panel',\n ] );\n\n dvw_add_text_setting( $wp_customize, 'dvw_email', 'dvw_social', 'Email', 'dianavladut95@gmail.com' );\n dvw_add_url_setting( $wp_customize, 'dvw_linkedin_url', 'dvw_social', 'LinkedIn URL', 'https://linkedin.com/in/dianavonw' );\n dvw_add_text_setting( $wp_customize, 'dvw_linkedin_label','dvw_social','LinkedIn text', 'linkedin.com/in/dianavonw' );\n dvw_add_url_setting( $wp_customize, 'dvw_instagram_url','dvw_social', 'Instagram URL', 'https://instagram.com/dianavonw' );\n dvw_add_text_setting( $wp_customize, 'dvw_instagram_label','dvw_social','Instagram handle','@dianavonw' );\n dvw_add_text_setting( $wp_customize, 'dvw_availability', 'dvw_social', 'Status disponibilitate', 'Open to new projects — Q3 2026' );\n\n // ── Secțiunea CTA Band ──\n $wp_customize->add_section( 'dvw_cta', [\n 'title' => __( 'CTA Band Global', 'dvw-theme' ),\n 'panel' => 'dvw_panel',\n ] );\n dvw_add_text_setting( $wp_customize, 'dvw_cta_title', 'dvw_cta', 'Titlu CTA', 'Ready to enter a better system?' );\n dvw_add_text_setting( $wp_customize, 'dvw_cta_sub', 'dvw_cta', 'Subtitlu CTA', 'Stop patchworking. Start building something that actually works.' );\n dvw_add_text_setting( $wp_customize, 'dvw_cta_btn', 'dvw_cta', 'Text buton', 'BOOK A CALL →' );\n}\nadd_action( 'customize_register', 'dvw_customizer' );\n\n/** Helper — adaugă un setting de tip text + control */\nfunction dvw_add_text_setting( $wpc, $id, $section, $label, $default = '' ) {\n $wpc->add_setting( $id, [ 'default' => $default, 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ] );\n $wpc->add_control( $id, [ 'label' => $label, 'section' => $section, 'type' => 'text' ] );\n}\n\n/** Helper — adaugă un setting de tip URL */\nfunction dvw_add_url_setting( $wpc, $id, $section, $label, $default = '' ) {\n $wpc->add_setting( $id, [ 'default' => $default, 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage' ] );\n $wpc->add_control( $id, [ 'label' => $label, 'section' => $section, 'type' => 'url' ] );\n}\n\n/** Helper global — citește o opțiune din Customizer cu fallback la default */\nfunction dvw_get( string $key ): string {\n $defaults = [\n 'dvw_hero_label' => 'STRATEGIST · CREATIVE · SYSTEM BUILDER',\n 'dvw_hero_title' => 'Build systems that actually sell.',\n 'dvw_hero_subtitle' => "I turn raw ideas into systems that work — from strategy to execution, from concept to conversion.",\n 'dvw_hero_cta_text' => 'ENTER MY MIND →',\n 'dvw_hero_cta_url' => '/contact/',\n 'dvw_about_intro' => "I started my career in content marketing and quickly realized that random posts don't build businesses.",\n 'dvw_about_intro_2' => "Over the years I've worked across industries — from personal brands to product companies — building the frameworks that make marketing feel inevitable instead of accidental.",\n 'dvw_about_tagline' => "My obsession? Turning chaos into clarity. And clarity into cash.",\n 'dvw_email' => 'dianavladut95@gmail.com',\n 'dvw_linkedin_url' => 'https://linkedin.com/in/dianavonw',\n 'dvw_linkedin_label' => 'linkedin.com/in/dianavonw',\n 'dvw_instagram_url' => 'https://instagram.com/dianavonw',\n 'dvw_instagram_label' => '@dianavonw',\n 'dvw_availability' => 'Open to new projects — Q3 2026',\n 'dvw_cta_title' => 'Ready to enter a better system?',\n 'dvw_cta_sub' => 'Stop patchworking. Start building something that actually works.',\n 'dvw_cta_btn' => 'BOOK A CALL →',\n ];\n $val = get_theme_mod( $key, $defaults[ $key ] ?? '' );\n return esc_html( $val );\n}\n\n\n// ─────────────────────────────────────────────\n// 5. CUSTOM POST TYPE — Testimoniale\n// ─────────────────────────────────────────────\nfunction dvw_register_cpt() {\n register_post_type( 'testimonial', [\n 'labels' => [\n 'name' => __( 'Testimoniale', 'dvw-theme' ),\n 'singular_name' => __( 'Testimonial', 'dvw-theme' ),\n 'add_new_item' => __( 'Adaugă testimonial', 'dvw-theme' ),\n 'edit_item' => __( 'Editează testimonial','dvw-theme' ),\n ],\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_rest' => true,\n 'supports' => [ 'title', 'editor', 'custom-fields' ],\n 'menu_icon' => 'dashicons-format-quote',\n 'has_archive' => false,\n ] );\n\n // Taxonomie serviciu pentru testimoniale\n register_taxonomy( 'testimonial_service', 'testimonial', [\n 'labels' => [\n 'name' => __( 'Servicii', 'dvw-theme' ),\n 'singular_name' => __( 'Serviciu', 'dvw-theme' ),\n ],\n 'public' => false,\n 'show_ui' => true,\n 'show_in_rest' => true,\n 'hierarchical' => true,\n ] );\n}\nadd_action( 'init', 'dvw_register_cpt' );\n\n\n// ─────────────────────────────────────────────\n// 6. SEO — Meta tags de bază (fallback dacă nu e Rank Math)\n// ─────────────────────────────────────────────\nfunction dvw_meta_tags() {\n // Nu duplica dacă Rank Math / Yoast sunt active\n if ( defined( 'RANK_MATH_VERSION' ) || defined( 'WPSEO_VERSION' ) ) return;\n\n global $post;\n $title = wp_get_document_title();\n $description = '';\n $og_image = DVW_URI . '/assets/images/og-default.jpg';\n\n if ( is_singular() && ! empty( $post ) ) {\n $description = has_excerpt( $post ) ? get_the_excerpt( $post ) : wp_trim_words( get_the_content( null, false, $post ), 25 );\n if ( has_post_thumbnail( $post ) ) {\n $img = wp_get_attachment_image_src( get_post_thumbnail_id( $post ), 'full' );\n if ( $img ) $og_image = $img[0];\n }\n } elseif ( is_front_page() ) {\n $description = "I don't just do marketing. I build how ideas connect. Portfolio personal Diana von W.";\n }\n\n $description = esc_attr( wp_strip_all_tags( $description ) );\n $og_url = esc_url( ( is_ssl() ? 'https' : 'http' ) . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\n echo "\n\n";\n if ( $description ) echo '' . "\n";\n echo '' . "\n";\n if ( $description ) echo '' . "\n";\n echo '' . "\n";\n echo '' . "\n";\n echo '' . "\n";\n echo '' . "\n";\n echo "\n";\n}\nadd_action( 'wp_head', 'dvw_meta_tags', 1 );\n\n\n// ─────────────────────────────────────────────\n// 7. SCHEMA JSON-LD\n// ─────────────────────────────────────────────\nfunction dvw_schema_jsonld() {\n $email = dvw_get( 'dvw_email' );\n $linkedin = get_theme_mod( 'dvw_linkedin_url', 'https://linkedin.com/in/dianavonw' );\n $instagram = get_theme_mod( 'dvw_instagram_url', 'https://instagram.com/dianavonw' );\n\n $person_schema = [\n '@context' => 'https://schema.org',\n '@type' => 'Person',\n 'name' => 'Diana von W.',\n 'url' => home_url(),\n 'email' => $email,\n 'jobTitle' => 'Marketing Strategist & System Builder',\n 'sameAs' => array_filter( [ $linkedin, $instagram ] ),\n 'knowsAbout'=> [ 'Marketing Strategy', 'Content Systems', 'Sales Funnels', 'Digital Products', 'Brand Strategy' ],\n ];\n\n $website_schema = [\n '@context' => 'https://schema.org',\n '@type' => 'WebSite',\n 'name' => get_bloginfo( 'name' ),\n 'url' => home_url(),\n 'description' => get_bloginfo( 'description' ),\n 'potentialAction' => [\n '@type' => 'SearchAction',\n 'target' => home_url( '/?s={search_term_string}' ),\n 'query-input' => 'required name=search_term_string',\n ],\n ];\n\n // Pe pagina de servicii adaugă și Service schema\n $schemas = [ $person_schema, $website_schema ];\n\n if ( is_page( 'services' ) ) {\n $schemas[] = [\n '@context' => 'https://schema.org',\n '@type' => 'ProfessionalService',\n 'name' => 'Diana von W. — Marketing & Strategy Services',\n 'url' => home_url( '/services/' ),\n 'provider' => [ '@type' => 'Person', 'name' => 'Diana von W.' ],\n 'serviceType' => [ 'Funnel Strategy', 'Content Systems', 'Digital Products', 'Brand Strategy', 'Offer Strategy', 'Consulting' ],\n 'areaServed' => 'Online',\n 'priceRange' => '€€€',\n ];\n }\n\n foreach ( $schemas as $schema ) {\n echo '' . "\n";\n }\n}\nadd_action( 'wp_head', 'dvw_schema_jsonld', 5 );\n\n\n// ─────────────────────────────────────────────\n// 8. CONTACT FORM — AJAX handler\n// ─────────────────────────────────────────────\nfunction dvw_handle_contact() {\n check_ajax_referer( 'dvw_nonce', 'nonce' );\n\n $name = sanitize_text_field( $_POST['name'] ?? '' );\n $email = sanitize_email( $_POST['email'] ?? '' );\n $need = sanitize_text_field( $_POST['need'] ?? '' );\n $message = sanitize_textarea_field( $_POST['message'] ?? '' );\n\n if ( ! $email || ! $name || ! $message ) {\n wp_send_json_error( [ 'message' => 'Câmpuri obligatorii lipsesc.' ] );\n }\n\n $to = dvw_get( 'dvw_email' ) ?: get_option( 'admin_email' );\n $subject = "Mesaj nou de la $name — dianavonw.ro";\n $body = "Nume: $name\nEmail: $email\nServiciu: $need\n\n$message";\n $headers = [ "Reply-To: $name <$email>", 'Content-Type: text/plain; charset=UTF-8' ];\n\n $sent = wp_mail( $to, $subject, $body, $headers );\n\n if ( $sent ) {\n wp_send_json_success( [ 'message' => 'CONNECTION ESTABLISHED' ] );\n } else {\n wp_send_json_error( [ 'message' => 'Eroare la trimitere. Încearcă din nou.' ] );\n }\n}\nadd_action( 'wp_ajax_nopriv_dvw_contact', 'dvw_handle_contact' );\nadd_action( 'wp_ajax_dvw_contact', 'dvw_handle_contact' );\n\n\n// ─────────────────────────────────────────────\n// 9. UTILITAR — active nav class\n// ─────────────────────────────────────────────\nfunction dvw_nav_class( string $page_slug ): string {\n if ( is_page( $page_slug ) ) return 'nav__link active';\n if ( $page_slug === 'blog' && ( is_home() || is_archive() || is_single() ) ) return 'nav__link active';\n return 'nav__link';\n}\n\n\n// ─────────────────────────────────────────────\n// 10. BLOG — excerpt length\n// ─────────────────────────────────────────────\nadd_filter( 'excerpt_length', fn() => 25 );\nadd_filter( 'excerpt_more', fn() => '...' );\n\n\n// ─────────────────────────────────────────────\n// 11. DEZACTIVEAZĂ emoji WP (performanță)\n// ─────────────────────────────────────────────\nremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\nremove_action( 'wp_print_styles', 'print_emoji_styles' );\nremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\nremove_action( 'admin_print_styles', 'print_emoji_styles' );\n