/*
Theme Name: Marketing Advisor
Theme URI: https://marketingadvisor.in
Author: Marketing Advisor
Author URI: https://marketingadvisor.in
Description: AI-Powered Digital Marketing Agency Theme with Elementor support, custom contact form with SMTP, and page templates.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: marketing-advisor
Tags: custom-logo, custom-menu, elementor, page-templates, contact-form
*/

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */
:root {
    /* Primary colors */
    --ma-bg: #FBF7F3;
    --ma-orange: #E97317;
    --ma-orange-hover: #C85f12;
    --ma-gold: #F0A24E;
    --ma-gold-dark: #C99A5B;

    /* Purple palette */
    --ma-purple-dark: #271C4E;
    --ma-purple-deeper: #221848;
    --ma-purple-mid: #3E3173;
    --ma-purple-light: #5f5688;

    /* Teal palette */
    --ma-teal: #1C4D4A;
    --ma-teal-light: #2A6F6B;
    --ma-teal-bg: #E4F1EF;

    /* Neutral / text */
    --ma-text-dark: #0E0F12;
    --ma-text-body: #6B6478;
    --ma-text-muted: #9A93A6;
    --ma-text-label: #8B83A0;

    /* Surface / borders */
    --ma-surface-white: #FFFFFF;
    --ma-surface-soft: #F6F1F9;
    --ma-surface-card: #F3EEF8;
    --ma-border: #E9E2F0;
    --ma-border-light: #D8D0E4;
    --ma-lavender: #CAC2DC;

    /* Typography */
    --ma-font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --ma-font-serif: 'Instrument Serif', Georgia, serif;

    /* Spacing */
    --ma-section-pad: clamp(64px, 8vw, 110px);
    --ma-container-pad: clamp(20px, 5vw, 56px);
    --ma-container-max: 1280px;

    /* Radius */
    --ma-radius-sm: 4px;
    --ma-radius-md: 8px;
    --ma-radius-lg: 12px;
    --ma-radius-xl: 16px;

    /* Shadows */
    --ma-shadow-card: 0 24px 60px rgba(39, 28, 78, 0.08);
    --ma-shadow-sm: 0 2px 12px rgba(39, 28, 78, 0.06);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--ma-bg);
}

body {
    font-family: var(--ma-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ma-text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--ma-orange);
    color: var(--ma-surface-white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--ma-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--ma-orange-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ma-purple-dark);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

p {
    margin: 0 0 1em;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes marqueeX {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ========================================
   CONTAINER
   ======================================== */
.ma-container {
    max-width: var(--ma-container-max);
    margin: 0 auto;
    padding: 0 var(--ma-container-pad);
}

.ma-section {
    padding: var(--ma-section-pad) 0;
}

/* ========================================
   HEADER / NAV
   ======================================== */
.ma-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(251, 247, 243, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ma-border);
    padding: 0 var(--ma-container-pad);
}

.ma-header__inner {
    max-width: var(--ma-container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.ma-header__logo {
    font-family: var(--ma-font-serif);
    font-size: 22px;
    color: var(--ma-purple-dark);
    text-decoration: none;
    font-weight: 400;
}

.ma-header__logo img {
    max-height: 40px;
    width: auto;
}

.ma-header__nav {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ma-header__nav a {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ma-text-body);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.ma-header__nav a:hover,
.ma-header__nav .current-menu-item > a,
.ma-header__nav .current_page_item > a {
    color: var(--ma-orange);
}

.ma-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ma-surface-white) !important;
    background: var(--ma-orange);
    padding: 10px 22px;
    border-radius: var(--ma-radius-sm);
    transition: background 0.2s;
}

.ma-header__cta:hover {
    background: var(--ma-orange-hover);
    color: var(--ma-surface-white) !important;
}

/* Mobile menu toggle */
.ma-header__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--ma-purple-dark);
}

.ma-header__toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .ma-header__toggle {
        display: block;
    }

    .ma-header__nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--ma-surface-white);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--ma-border);
        box-shadow: var(--ma-shadow-card);
    }

    .ma-header__nav.is-open {
        display: flex;
    }
}

/* ========================================
   FOOTER
   ======================================== */
.ma-footer {
    background: var(--ma-purple-dark);
    color: var(--ma-lavender);
    padding: clamp(48px, 6vw, 80px) 0 32px;
}

.ma-footer a {
    color: var(--ma-lavender);
}

.ma-footer a:hover {
    color: var(--ma-surface-white);
}

.ma-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

.ma-footer__brand {
    font-family: var(--ma-font-serif);
    font-size: 24px;
    color: var(--ma-surface-white);
    margin-bottom: 16px;
}

.ma-footer__heading {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ma-text-muted);
    margin-bottom: 16px;
}

.ma-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ma-footer__links li {
    margin-bottom: 10px;
}

.ma-footer__links a {
    font-size: 14.5px;
}

.ma-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--ma-text-muted);
}

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

@media (max-width: 480px) {
    .ma-footer__grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   BUTTON STYLES
   ======================================== */
.ma-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ma-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 28px;
    border: none;
    border-radius: var(--ma-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ma-btn--primary {
    background: var(--ma-orange);
    color: var(--ma-surface-white);
}

.ma-btn--primary:hover {
    background: var(--ma-orange-hover);
    color: var(--ma-surface-white);
}

.ma-btn--outline {
    background: transparent;
    color: var(--ma-orange);
    border: 1.5px solid var(--ma-orange);
}

.ma-btn--outline:hover {
    background: var(--ma-orange);
    color: var(--ma-surface-white);
}

.ma-btn--dark {
    background: var(--ma-purple-dark);
    color: var(--ma-surface-white);
}

.ma-btn--dark:hover {
    background: var(--ma-purple-deeper);
    color: var(--ma-surface-white);
}

.ma-btn--link {
    background: none;
    padding: 0;
    color: var(--ma-orange);
    border: none;
}

.ma-btn--link:hover {
    color: var(--ma-orange-hover);
}

/* ========================================
   CARD STYLES
   ======================================== */
.ma-card {
    background: var(--ma-surface-white);
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ma-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ma-shadow-card);
}

.ma-card__img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.ma-card__body {
    padding: 24px;
}

.ma-card__tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ma-text-muted);
    margin-bottom: 8px;
}

.ma-card__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ma-purple-dark);
    margin-bottom: 8px;
    line-height: 1.35;
}

.ma-card__excerpt {
    font-size: 14.5px;
    color: var(--ma-text-body);
    line-height: 1.65;
}

/* ========================================
   CONTACT FORM (Theme built-in)
   ======================================== */
.ma-contact-form {
    background: var(--ma-surface-white);
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-lg);
    padding: clamp(28px, 4vw, 44px);
    box-shadow: var(--ma-shadow-card);
}

.ma-contact-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ma-contact-form__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.ma-contact-form__label {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ma-text-muted);
}

.ma-contact-form__input,
.ma-contact-form__textarea {
    font-family: var(--ma-font-body);
    font-size: 15px;
    color: var(--ma-purple-dark);
    background: var(--ma-surface-soft);
    border: 1px solid var(--ma-border);
    border-radius: 6px;
    padding: 13px 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ma-contact-form__input:focus,
.ma-contact-form__textarea:focus {
    border-color: var(--ma-orange);
}

.ma-contact-form__textarea {
    resize: vertical;
    min-height: 120px;
}

.ma-contact-form__submit {
    width: 100%;
    margin-top: 6px;
}

.ma-contact-form__success {
    text-align: center;
    padding: 40px 0;
}

.ma-contact-form__success h3 {
    font-family: var(--ma-font-serif);
    font-size: 54px;
    color: var(--ma-orange);
    line-height: 1;
    margin-bottom: 18px;
}

.ma-contact-form__success p {
    font-size: 17px;
    color: var(--ma-text-body);
    line-height: 1.6;
}

@media (max-width: 600px) {
    .ma-contact-form__row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SECTION TITLES (Reusable)
   ======================================== */
.ma-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ma-text-muted);
    margin-bottom: 12px;
}

.ma-section-title {
    font-family: var(--ma-font-serif);
    font-size: clamp(32px, 5vw, 52px);
    color: var(--ma-purple-dark);
    line-height: 1.1;
    margin-bottom: 20px;
}

.ma-section-title em {
    color: var(--ma-orange);
    font-style: italic;
}

.ma-section-subtitle {
    font-size: 17px;
    line-height: 1.75;
    color: var(--ma-text-body);
    max-width: 60ch;
}

/* ========================================
   BLOG / SINGLE POST
   ======================================== */
.ma-post {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(40px, 6vw, 80px) var(--ma-container-pad);
}

.ma-post__header {
    margin-bottom: 40px;
}

.ma-post__category {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ma-orange);
    margin-bottom: 14px;
    display: block;
}

.ma-post__title {
    font-family: var(--ma-font-serif);
    font-size: clamp(28px, 4vw, 44px);
    color: var(--ma-purple-dark);
    line-height: 1.15;
    margin-bottom: 18px;
}

.ma-post__meta {
    font-size: 14px;
    color: var(--ma-text-muted);
    display: flex;
    align-items: center;
    gap: 16px;
}

.ma-post__featured-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--ma-radius-lg);
    margin-bottom: 40px;
}

.ma-post__content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--ma-text-body);
}

.ma-post__content h2 {
    font-size: 28px;
    margin: 48px 0 16px;
}

.ma-post__content h3 {
    font-size: 22px;
    margin: 36px 0 12px;
}

.ma-post__content p {
    margin-bottom: 1.5em;
}

.ma-post__content img {
    border-radius: var(--ma-radius-md);
    margin: 24px 0;
}

.ma-post__content blockquote {
    border-left: 3px solid var(--ma-orange);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--ma-surface-soft);
    border-radius: 0 var(--ma-radius-md) var(--ma-radius-md) 0;
    font-style: italic;
    color: var(--ma-purple-dark);
}

.ma-post__content a {
    color: var(--ma-orange);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ma-post__content ul, .ma-post__content ol {
    padding-left: 24px;
    margin-bottom: 1.5em;
}

.ma-post__content li {
    margin-bottom: 0.5em;
}

/* Blog archive grid */
.ma-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

@media (max-width: 480px) {
    .ma-blog-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   WP ADMIN BAR FIX
   ======================================== */
body.admin-bar .ma-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .ma-header {
        top: 46px;
    }
}

/* ========================================
   ELEMENTOR COMPATIBILITY
   ======================================== */
.elementor-page .ma-header + .site-content {
    padding-top: 0;
}

.elementor-page .ma-post {
    max-width: none;
    padding: 0;
}

/* ========================================
   PAGE TEMPLATE RESPONSIVE OVERRIDES
   ======================================== */

/* Grid collapses on mobile for all page templates */
@media (max-width: 768px) {
    .ma-home .ma-hero,
    .ma-services-page section,
    .ma-industries-page section,
    .ma-case-studies-page section,
    .ma-about-page section {
        padding-left: 0;
        padding-right: 0;
    }

    /* Two-column grids collapse to single */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1.2fr"],
    [style*="grid-template-columns:1fr 1.2fr"],
    [style*="grid-template-columns: 1fr 1.3fr"],
    [style*="grid-template-columns:1fr 1.3fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    [style*="grid-template-columns:repeat(auto-fill, minmax(320px"],
    [style*="grid-template-columns:repeat(auto-fill, minmax(360px"],
    [style*="grid-template-columns:repeat(auto-fill, minmax(340px"],
    [style*="grid-template-columns:repeat(auto-fill, minmax(240px"],
    [style*="grid-template-columns:repeat(auto-fill, minmax(260px"],
    [style*="grid-template-columns:repeat(auto-fill, minmax(220px"] {
        grid-template-columns: 1fr !important;
    }
}
