/*
Theme Name: Soluciones Constructora
Theme URI: https://solucionesconstructora.com
Author: Tu Nombre
Description: Tema profesional para empresa constructora. Paleta rojo, negro y blanco. Incluye feed de Instagram vía Smash Balloon, botón WhatsApp flotante, Custom Post Type Proyectos y opciones en el Customizer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sc-theme
Tags: construction, portfolio, one-page, custom-colors, responsive
*/

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

:root {
    --red:        #D92B2B;
    --red-dark:   #A81E1E;
    --black:      #0D0D0D;
    --off-black:  #181818;
    --gray-dark:  #232323;
    --gray-light: #f2f0ed;
    --white:      #ffffff;
    --display:    'Bebas Neue', sans-serif;
    --body:       'DM Sans', sans-serif;
}

html  { scroll-behavior: smooth; }
body  { font-family: var(--body); background: var(--white); color: var(--black); overflow-x: hidden; line-height: 1.6; }
img   { max-width: 100%; height: auto; display: block; }
a     { color: inherit; text-decoration: none; }
ul    { list-style: none; }

/* ============================================================
   TYPOGRAPHY
============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--display);
    font-weight: 400;
    line-height: .95;
    letter-spacing: .5px;
}
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   NAVIGATION
============================================================ */
.site-header {
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6%;
    height: 62px;
    border-bottom: 3px solid var(--red);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: 0 3px 24px rgba(0,0,0,.55); }

.site-branding .site-title {
    font-family: var(--display);
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--white);
    text-decoration: none;
    display: block;
}
.site-branding .site-title .accent { color: var(--red); }

.main-navigation ul { display: flex; gap: 28px; list-style: none; }
.main-navigation a {
    color: rgba(255,255,255,.6);
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: color .2s;
    display: block;
    padding: 4px 0;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a { color: var(--red); }

/* Dropdown */
.main-navigation li { position: relative; }
.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--off-black);
    min-width: 200px;
    border-top: 2px solid var(--red);
    z-index: 999;
}
.main-navigation li:hover > .sub-menu { display: block; }
.main-navigation .sub-menu a {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: .75rem;
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--red);
    color: var(--white);
    padding: 7px 11px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 2px;
    line-height: 1;
}

/* Screen reader */
.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px);
    clip-path: inset(50%); height: 1px; margin: -1px;
    overflow: hidden; padding: 0; position: absolute; width: 1px;
}

/* ============================================================
   HERO
============================================================ */
.hero-section {
    background: var(--black);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 5rem 6% 4.5rem;
    position: relative;
    overflow: hidden;
}
/* grid texture */
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0, rgba(255,255,255,.025) 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(0deg,  rgba(255,255,255,.025) 0, rgba(255,255,255,.025) 1px, transparent 1px, transparent 60px);
    pointer-events: none;
}
.hero-left { position: relative; z-index: 1; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 5px 14px;
    margin-bottom: 1.6rem;
}

.hero-title {
    font-family: var(--display);
    font-size: clamp(3.5rem, 6vw, 6rem);
    line-height: .9;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}
.hero-title .line-red { color: var(--red); display: block; }

.hero-sub {
    color: rgba(255,255,255,.5);
    font-size: .9rem;
    font-weight: 300;
    max-width: 380px;
    line-height: 1.75;
    margin-bottom: 2rem;
}

.hero-ctas { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.btn-red {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    padding: 13px 28px;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .2s;
    font-family: var(--body);
}
.btn-red:hover { background: var(--red-dark); transform: translateY(-2px); }

.btn-ghost {
    color: rgba(255,255,255,.55);
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,.2);
    padding-bottom: 2px;
    transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,.6); }

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.hero-stat .num {
    font-family: var(--display);
    font-size: 2.4rem;
    color: var(--red);
    line-height: 1;
    display: block;
}
.hero-stat .lbl {
    font-size: .68rem;
    color: rgba(255,255,255,.35);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-top: 3px;
    display: block;
}

/* Hero visual (right column) */
.hero-visual { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.hv-main {
    background: var(--off-black);
    border: 1px solid rgba(255,255,255,.06);
    height: 240px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hv-main-bg {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(.5);
    transition: filter .5s;
}
.hv-main:hover .hv-main-bg { filter: brightness(.65); }

/* fallback when no image */
.hv-main-fallback {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a1a1a 40%, #1a1a1a 100%);
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
}
.hv-main-fallback .ico { font-size: 3.5rem; color: rgba(217,43,43,.2); }
.hv-main-fallback .cap { font-family: var(--display); font-size: .8rem; color: rgba(255,255,255,.12); letter-spacing: .3em; text-transform: uppercase; }

.hv-badge {
    position: absolute; bottom: 14px; left: 14px;
    background: var(--red); color: var(--white);
    font-family: var(--display); font-size: .95rem; letter-spacing: 2px;
    padding: 6px 16px;
    z-index: 2;
}
.hv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hv-card {
    background: var(--off-black);
    border: 1px solid rgba(255,255,255,.06);
    height: 88px;
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.hv-card .n { font-family: var(--display); font-size: 1.8rem; color: var(--red); line-height: 1; }
.hv-card .t { font-size: .64rem; color: rgba(255,255,255,.3); letter-spacing: .12em; text-transform: uppercase; }

/* ============================================================
   TICKER
============================================================ */
.ticker-wrap { background: var(--red); overflow: hidden; padding: 11px 0; white-space: nowrap; }
.ticker { display: inline-block; animation: sc-tick 22s linear infinite; }
@keyframes sc-tick { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker-item {
    display: inline-block;
    font-family: var(--display);
    font-size: .95rem;
    letter-spacing: 3px;
    color: var(--white);
    padding: 0 34px;
    opacity: .9;
}
.ticker-dot { color: rgba(255,255,255,.35); }

/* ============================================================
   SECTION COMMONS
============================================================ */
.sc-section { padding: 5.5rem 6%; }

.sc-label {
    display: block;
    font-size: .67rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: .6rem;
}
.sc-title {
    font-family: var(--display);
    font-size: clamp(2.4rem, 4vw, 3.8rem);
    line-height: .95;
    margin-bottom: 3rem;
}

/* ============================================================
   SERVICIOS
============================================================ */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.service-card {
    background: var(--gray-light);
    padding: 2.2rem 1.8rem;
    border-bottom: 3px solid transparent;
    transition: border-color .25s, background .25s;
}
.service-card:hover { border-bottom-color: var(--red); background: var(--white); }
.service-card .svc-icon { font-size: 1.4rem; color: var(--red); margin-bottom: 1rem; display: block; }
.service-card h3 { font-family: var(--display); font-size: 1.5rem; letter-spacing: .5px; margin-bottom: .6rem; }
.service-card p { font-size: .84rem; color: #555; line-height: 1.75; }

/* ============================================================
   PROYECTOS
============================================================ */
.projects-section { background: var(--black); padding: 5.5rem 6%; }
.projects-section .sc-title { color: var(--white); }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.project-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #1c1c1c;
    aspect-ratio: 4/3;
}
.project-card img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s ease, filter .4s;
    filter: brightness(.65);
}
.project-card:hover img { transform: scale(1.06); filter: brightness(.8); }

/* fallback pattern */
.project-card-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.project-card-fallback i { font-size: 3rem; color: rgba(255,255,255,.08); }

.project-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0, transparent 55%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 1.4rem;
    opacity: 0;
    transition: opacity .3s;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-tag { font-size: .63rem; color: var(--red); font-weight: 700; letter-spacing: .15em; text-transform: uppercase; margin-bottom: .25rem; display: block; }
.project-name { font-family: var(--display); font-size: 1.4rem; color: var(--white); letter-spacing: .5px; display: block; }
.project-loc  { font-size: .73rem; color: rgba(255,255,255,.45); margin-top: 3px; display: block; }

/* ============================================================
   INSTAGRAM FEED
============================================================ */
.instagram-section { background: var(--gray-light); padding: 5.5rem 6%; }
.insta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.insta-handle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--black);
    font-weight: 600;
    font-size: .82rem;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--red);
    padding-bottom: 3px;
    transition: color .2s;
}
.insta-handle:hover { color: var(--red); }

/* Feed real de Smash Balloon va aquí — los estilos de abajo ajustan la apariencia */
.instagram-feed-wrapper { min-height: 200px; }

/* Override Smash Balloon para que encaje con el diseño */
#sb_instagram { padding: 0 !important; }
#sb_instagram .sbi_photo_wrap img { border-radius: 0 !important; transition: transform .4s, filter .4s !important; }
#sb_instagram .sbi_photo_wrap:hover img { transform: scale(1.06) !important; filter: brightness(.8) !important; }
#sb_instagram #sbi_load .sbi_load_btn {
    background: var(--red) !important;
    border-radius: 0 !important;
    font-family: var(--body) !important;
    font-weight: 600 !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
}

/* Placeholder cuando Smash Balloon NO está activo */
.insta-placeholder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.insta-placeholder-item {
    aspect-ratio: 1/1;
    background: #ddd;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #bbb;
    transition: transform .3s;
}
.insta-placeholder-item:hover { transform: scale(1.02); }
.insta-plugin-note {
    margin-top: 1.2rem;
    font-size: .76rem;
    color: #888;
    text-align: center;
    padding: 10px 16px;
    border: 1px dashed #ccc;
    line-height: 1.6;
}

/* ============================================================
   NOSOTROS / ABOUT
============================================================ */
.about-section { display: grid; grid-template-columns: 1fr 1fr; }
.about-visual {
    background: var(--off-black);
    min-height: 380px;
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem;
    position: relative; overflow: hidden; padding: 4rem;
}
.about-visual::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(45deg, rgba(217,43,43,.04) 0, rgba(217,43,43,.04) 1px, transparent 1px, transparent 28px);
}
/* Si hay imagen de fondo en about */
.about-visual.has-image::before { display: none; }
.about-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.35); }

.about-big    { font-family: var(--display); font-size: 6rem; color: var(--red); line-height: 1; position: relative; z-index: 1; }
.about-divider { width: 60px; height: 3px; background: var(--red); position: relative; z-index: 1; }
.about-small  { font-size: .75rem; color: rgba(255,255,255,.3); letter-spacing: .2em; text-transform: uppercase; position: relative; z-index: 1; }

.about-content {
    background: var(--black);
    color: var(--white);
    padding: 5rem 6%;
    display: flex; flex-direction: column; justify-content: center;
}
.about-content .sc-label { color: var(--red); }
.about-content .sc-title { color: var(--white); margin-bottom: 1.2rem; }
.about-text { color: rgba(255,255,255,.5); font-size: .86rem; line-height: 1.8; margin-bottom: 1.8rem; }
.about-features { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.about-feature {
    display: flex; align-items: center; gap: 8px;
    font-size: .78rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
    color: rgba(255,255,255,.65);
}
.about-feature i { color: var(--red); font-size: .85rem; }

/* ============================================================
   CONTACTO
============================================================ */
.contact-section { padding: 5.5rem 6%; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 4rem; align-items: start; margin-top: 2.5rem; }

.contact-info { display: flex; flex-direction: column; gap: 1.4rem; }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-icon {
    width: 42px; height: 42px; flex-shrink: 0;
    background: var(--black); color: var(--red);
    display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.contact-icon.wa { background: #25d366; color: var(--white); }
.contact-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #999; margin-bottom: 2px; }
.contact-value { font-size: .9rem; font-weight: 500; color: var(--black); }
a.contact-value { color: var(--red); }

.contact-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #ddd;
    font-family: var(--body); font-size: .87rem;
    outline: none;
    transition: border-color .2s;
    border-radius: 0; -webkit-appearance: none;
    background: var(--white); color: var(--black);
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--red); }
.contact-form textarea { height: 115px; resize: vertical; }
.contact-form .btn-red { width: 100%; padding: 14px; border: none; cursor: pointer; font-size: .78rem; letter-spacing: .12em; }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    background: var(--black);
    border-top: 3px solid var(--red);
    padding: 2rem 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-logo { font-family: var(--display); font-size: 1.25rem; color: var(--white); letter-spacing: 2px; }
.footer-logo .accent { color: var(--red); }
.footer-copy { font-size: .75rem; color: rgba(255,255,255,.3); letter-spacing: .04em; }

/* ============================================================
   WHATSAPP BUTTON
============================================================ */
.whatsapp-wrapper {
    position: fixed; bottom: 26px; right: 26px;
    display: flex; align-items: center; z-index: 9999;
}
.wa-label {
    background: var(--white); color: #333;
    padding: 8px 16px; border-radius: 50px 0 0 50px; margin-right: -16px;
    font-weight: 500; font-size: .8rem;
    box-shadow: -3px 3px 10px rgba(0,0,0,.12);
    opacity: 0; transform: translateX(14px);
    transition: opacity .35s, transform .35s;
    pointer-events: none; white-space: nowrap;
}
.whatsapp-wrapper:hover .wa-label { opacity: 1; transform: translateX(0); }
.wa-button {
    width: 58px; height: 58px; border-radius: 50%;
    background: #25d366; color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.65rem;
    text-decoration: none;
    animation: wa-pulse 2.5s infinite;
    position: relative; z-index: 1;
    transition: background .2s, transform .2s;
}
.wa-button:hover { background: #1da851; animation: none; transform: scale(1.08); }
@keyframes wa-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(37,211,102,.65); }
    70%  { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0   rgba(37,211,102,0); }
}

/* Scroll to top */
#sc-scroll-top {
    display: none;
    position: fixed; bottom: 96px; right: 26px;
    background: var(--red); color: var(--white);
    border: none; width: 40px; height: 40px;
    cursor: pointer; font-size: .95rem;
    align-items: center; justify-content: center;
    z-index: 9998; transition: background .2s, transform .2s;
}
#sc-scroll-top.visible { display: flex; }
#sc-scroll-top:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ============================================================
   WORDPRESS CORE CLASSES
============================================================ */
.wp-block-image img { max-width: 100%; }
.aligncenter { display: block; margin: 0 auto; }
.alignleft    { float: left; margin-right: 1.5rem; margin-bottom: .5rem; }
.alignright   { float: right; margin-left: 1.5rem; margin-bottom: .5rem; }
.wp-caption-text { font-size: .82rem; color: #777; text-align: center; margin-top: 5px; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
    .hero-section        { grid-template-columns: 1fr; }
    .hero-visual         { display: none; }
    .about-section       { grid-template-columns: 1fr; }
    .about-visual        { min-height: 240px; }
    .contact-grid        { grid-template-columns: 1fr; }
    .insta-placeholder-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .site-header { padding: 0 5%; flex-wrap: wrap; height: auto; gap: 0; }
    .site-header .header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 0; }
    .menu-toggle { display: block; }
    .main-navigation { display: none; width: 100%; }
    .main-navigation.active { display: flex; }
    .main-navigation ul { flex-direction: column; width: 100%; background: var(--off-black); padding: 6px 0 12px; gap: 0; }
    .main-navigation a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,.05); }

    .sc-section, .projects-section, .instagram-section, .contact-section { padding: 4rem 5%; }
    .services-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .about-features { grid-template-columns: 1fr; }
    .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
    .insta-header { flex-direction: column; align-items: flex-start; }
    .site-footer { flex-direction: column; align-items: flex-start; }
    .whatsapp-wrapper { bottom: 18px; right: 18px; }
}

@media (max-width: 480px) {
    .projects-grid { grid-template-columns: 1fr; }
    .hero-ctas .btn-ghost { display: none; }
}
