/*
Theme Name: IBP Template
Theme URI: https://ibp.com
Author: Elevaiti
Author URI: https://elevaiti.com
Description: Tema personalizado IBP - Migración de React a WordPress Gutenberg
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: ibp
Requires at least: 6.4
Requires PHP: 8.0
*/

/* ============================================================
   CSS VARIABLES — Generic Theme (change these to rebrand)
   ============================================================ */
:root {
    /* ── BRAND COLORS (override these per client) ── */
    --color-primary:        #1B1F4B;   /* Main brand color (teal for IBP) */
    --color-primary-dark:   #141736;   /* Darker shade of primary */
    --color-secondary:      #ebb524;   /* Accent color (yellow for IBP) */
    --color-secondary-dark: #d4a020;   /* Darker shade of secondary (hover) */
    --color-secondary-light: rgba(235, 181, 36, 0.15); /* Secondary with opacity */

    /* ── NEUTRALS ── */
    --color-dark:       #1c1917;   /* Dark background / primary text */
    --color-light:      #fafaf9;   /* Light background */
    --color-light-alt:  #f5f5f4;   /* Alternate light background */
    --color-text:       #1c1917;   /* Body text */
    --color-text-light: #78716c;   /* Muted text */
    --color-text-mid:   #57534e;   /* Mid-tone text */
    --color-border:     #f5f5f4;   /* Default border color */
    --color-stone-200:  #e7e5e4;
    --color-stone-300:  #d6d3d1;
    --color-white:      #ffffff;

    /* ── TYPOGRAPHY ── */
    --font-mono:  "Courier New", Courier, monospace;
    --font-sans:  "Inter", "Roboto", sans-serif;
    --font-heading: "Courier New", Courier, monospace;
    --font-body:    "Inter", "Roboto", sans-serif;

    /* ── LAYOUT ── */
    --container-max:       1280px;
    --container-max-width: 1200px;
    --container-padding:   2rem;
    --section-py:          5rem;
    --section-px:          1.5rem;
    --spacing-section:     5rem;

    /* ── TRANSITIONS ── */
    --transition: 0.3s ease;

    /* ── LEGACY ALIASES (ibp-specific → generic) ── */
    --ibp-teal:   var(--color-primary);
    --ibp-yellow: var(--color-secondary);
    --ibp-white:  var(--color-white);

    /* ── STONE PALETTE (Tailwind-compatible) ── */
    --stone-50:   var(--color-light);
    --stone-100:  var(--color-light-alt);
    --stone-200:  var(--color-stone-200);
    --stone-300:  var(--color-stone-300);
    --stone-400:  #a8a29e;
    --stone-500:  var(--color-text-light);
    --stone-600:  var(--color-text-mid);
    --stone-700:  #44403c;
    --stone-800:  #292524;
    --stone-900:  var(--color-dark);

    /* ── WORDPRESS CUSTOM PROPERTIES ── */
    --wp--preset--color--ibp-teal:   var(--color-primary);
    --wp--preset--color--ibp-yellow: var(--color-secondary);
    --wp--preset--color--stone-900:     var(--color-dark);
    --wp--preset--color--stone-50:      var(--color-light);
    --wp--style--global--content-size:  var(--container-max);
    --wp--style--global--wide-size:     1400px;
}

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

/* ============================================================
   BASE
   ============================================================ */
body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--stone-900);
    background-color: var(--ibp-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    line-height: 1.2;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ============================================================
   CONTAINER UTILITY
   ============================================================ */
.ibp-container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--section-px);
}

@media (min-width: 640px)  { .ibp-container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .ibp-container { padding-inline: 2rem; } }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal,
.reveal-left,
.reveal-right {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left  { transform: translateX(-24px); }
.reveal-right { transform: translateX(24px); }

.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 2rem;
    border: 2px solid var(--ibp-yellow);
    background: var(--ibp-yellow);
    color: var(--stone-900);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary:hover {
    background: transparent;
    color: var(--ibp-yellow);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 2rem;
    border: 2px solid white;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

/* ============================================================
   SECTION DEFAULTS
   ============================================================ */
.section-py   { padding-block: var(--section-py); }
.bg-dark      { background-color: var(--stone-900); }
.bg-light     { background-color: var(--stone-50); }
.bg-yellow    { background-color: var(--ibp-yellow); }
.text-yellow  { color: var(--ibp-yellow); }

/* ============================================================
   KEN BURNS ANIMATION (used in hero)
   ============================================================ */
@keyframes kenBurns {
    0%   { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-ken-burns {
    animation: kenBurns 10s ease-out forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }

/* ============================================================
   CONTAINER VARIANTS
   ============================================================ */
.ibp-container-xl {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 640px)  { .ibp-container-xl { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .ibp-container-xl { padding-inline: 2rem; } }

.ibp-container-md {
    max-width: 64rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 640px)  { .ibp-container-md { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .ibp-container-md { padding-inline: 2rem; } }

/* ============================================================
   ACCENT COLOR SPAN
   ============================================================ */
.ibp-accent {
    color: var(--color-secondary);
}

/* ============================================================
   HEADER — Pixel-perfect from React reference
   ============================================================ */
.ibp-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s;
}

.ibp-header__inner {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

@media (min-width: 640px)  { .ibp-header__inner { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .ibp-header__inner { padding-inline: 2rem; height: 5rem; } }

.ibp-header__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    text-decoration: none;
}

.ibp-header__logo img {
    height: 3rem;
    width: auto;
    border-radius: 50%;
}

@media (min-width: 768px) {
    .ibp-header__logo img { height: 3.5rem; }
}

.ibp-header__logo-text {
    display: none;
    flex-direction: column;
    line-height: 1.2;
}

@media (min-width: 640px) {
    .ibp-header__logo-text { display: flex; }
}

.ibp-header__logo-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-text);
    letter-spacing: -0.025em;
    font-family: "Courier New", Courier, monospace;
}

.ibp-header__logo-tagline {
    font-size: 0.625rem;
    color: var(--color-text-light);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.ibp-header__nav {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .ibp-header__nav { display: flex; }
}

.ibp-nav__menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ibp-nav__menu a,
.ibp-nav__menu li > a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-mid);
    font-family: "Courier New", Courier, monospace;
    text-decoration: none;
    transition: color 0.2s;
}

.ibp-nav__menu a:hover { color: var(--color-text); }

/* Sub-menus hidden by default */
.ibp-nav__menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 100;
}

.ibp-nav__menu .menu-item-has-children {
    position: relative;
}

.ibp-nav__menu .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.ibp-nav__menu .sub-menu li > a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-mid);
    white-space: nowrap;
}

.ibp-nav__menu .sub-menu li > a:hover {
    background: var(--color-light);
    color: var(--color-text);
}

.ibp-header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ibp-header__phone {
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-mid);
    font-family: "Courier New", Courier, monospace;
}

@media (min-width: 1024px) {
    .ibp-header__phone { display: block; }
}

.ibp-header__cta {
    background-color: var(--color-secondary);
    color: var(--color-text) !important;
    font-weight: 700;
    padding: 0.625rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    font-family: "Courier New", Courier, monospace;
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.ibp-header__cta:hover {
    background-color: var(--color-secondary-dark);
    color: var(--color-text) !important;
}

.ibp-header__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

@media (min-width: 768px) {
    .ibp-header__toggle { display: none; }
}

.ibp-header__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: all 0.3s;
}

/* Mobile menu */
.ibp-mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
}

.ibp-mobile-menu.is-open {
    display: flex;
}

.ibp-mobile-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ibp-mobile-menu__list a {
    display: block;
    padding: 0.75rem 0;
    font-family: "Courier New", Courier, monospace;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

/* ============================================================
   FOOTER — Pixel-perfect from React reference
   ============================================================ */
.ibp-footer {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.ibp-footer__inner {
    padding-block: 4rem;
}

.ibp-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .ibp-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .ibp-footer__grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

.ibp-footer__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ibp-footer__logo-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background-color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-text);
    flex-shrink: 0;
}

.ibp-footer__logo-name {
    font-weight: 700;
    font-size: 1.25rem;
    font-family: "Courier New", Courier, monospace;
}

.ibp-footer__logo-tagline {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
}

.ibp-footer__desc {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.ibp-footer__social {
    display: flex;
    gap: 0.75rem;
}

.ibp-footer__social-link {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.ibp-footer__social-link:hover {
    background-color: var(--color-secondary-dark);
    color: var(--color-text);
    transform: translateY(-2px);
}

.ibp-footer__col-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.ibp-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ibp-footer__links a {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-family: "Courier New", Courier, monospace;
    transition: color 0.2s;
}

.ibp-footer__links a:hover {
    color: #ffffff;
}

.ibp-footer__contact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    font-family: "Courier New", Courier, monospace;
}

.ibp-footer__contact a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.ibp-footer__contact a:hover { color: #ffffff; }

.ibp-footer__contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ibp-footer__contact-icon {
    color: var(--color-secondary);
    flex-shrink: 0;
}

.ibp-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 3rem;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .ibp-footer__bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.ibp-footer__copy {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    font-family: "Courier New", Courier, monospace;
}

.ibp-footer__legal {
    display: flex;
    gap: 1.5rem;
}

.ibp-footer__legal a {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    font-family: "Courier New", Courier, monospace;
    text-decoration: none;
    transition: color 0.2s;
}

.ibp-footer__legal a:hover { color: #ffffff; }

/* ============================================================
   PAGE CONTENT OFFSET (for fixed header)
   ============================================================ */
#page-content {
    padding-top: 0;
}
