/*
Theme Name: Topline Tour Chile
Theme URI: https://toplinetourchile.cl
Author: Topline Tour Chile + FlowCode AI
Description: Block theme a medida para Topline Tour Chile — turismo receptivo brasilero (nieve, montaña, viñedos y litoral).
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: toplinetour
*/

/* ===== Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,500;0,600;0,700;1,500;1,600&family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== Base ===== */
:root{
  --tlt-shadow: 0 18px 40px -18px rgba(7,37,63,.45);
  --tlt-shadow-sm: 0 8px 20px -12px rgba(7,37,63,.35);
}
body{ -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }

h1,h2,h3,h4,h5,h6{ letter-spacing:-.01em; line-height:1.08; }
.is-style-overline{
  font-family:"Inter",sans-serif; text-transform:uppercase; letter-spacing:.22em;
  font-size:.82rem; font-weight:700; color:var(--wp--preset--color--rojo);
}
/* Contraste: overline sobre fondos oscuros pasa a blanco cálido */
.has-azul-background-color .is-style-overline,
.has-azul-oscuro-background-color .is-style-overline,
.wp-block-cover .is-style-overline{ color:#F2C9A8; }

/* Evita la "costura" blanca entre secciones alignfull apiladas (blockGap raíz) */
.wp-block-group.alignfull{ margin-top:0; margin-bottom:0; }

/* ===== Buttons ===== */
.wp-block-button__link{
  font-family:"Inter",sans-serif; letter-spacing:.01em;
  font-weight:700; transition:transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.wp-block-button__link:hover{ transform:translateY(-2px); box-shadow:var(--tlt-shadow-sm); }
.wp-block-button.is-style-rojo .wp-block-button__link{
  background:var(--wp--preset--color--rojo); color:#fff;
}
.wp-block-button.is-style-rojo .wp-block-button__link:hover{ background:var(--wp--preset--color--rojo-oscuro); }
.wp-block-button.is-style-ghost .wp-block-button__link{
  background:transparent; color:#fff; box-shadow:inset 0 0 0 2px rgba(255,255,255,.6);
}
.wp-block-button.is-style-ghost .wp-block-button__link:hover{ box-shadow:inset 0 0 0 2px #fff; background:rgba(255,255,255,.1); }
.wp-block-button.is-style-ghost-dark .wp-block-button__link{
  background:transparent; color:var(--wp--preset--color--azul); box-shadow:inset 0 0 0 2px var(--wp--preset--color--azul);
}
.wp-block-button.is-style-ghost-dark .wp-block-button__link:hover{ background:var(--wp--preset--color--azul); color:#fff; }

/* ===== Header ===== */
.tlt-header{ position:sticky; top:0; z-index:100; backdrop-filter:saturate(140%) blur(8px); }
.tlt-header-inner{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem;
  max-width:1280px; margin-left:auto; margin-right:auto; padding-left:1.25rem; padding-right:1.25rem;
}
.tlt-logo-badge{ display:flex; align-items:center; }
.tlt-logo-badge img{ max-height:56px; width:56px; height:56px; object-fit:cover; border-radius:50%; display:block; box-shadow:0 0 0 2px rgba(255,255,255,.5); }

.tlt-nav-links{ display:flex; align-items:center; gap:1.6rem; flex-wrap:wrap; }
.tlt-nav-links a{
  font-family:"Inter",sans-serif; letter-spacing:.01em; font-size:.95rem; font-weight:600;
  color:#fff; text-decoration:none;
}
.tlt-nav-links a:hover{ color:#F2C9A8; }
.tlt-lang-switch{
  font-size:.85rem !important; font-weight:700 !important; border:1px solid rgba(255,255,255,.4);
  border-radius:6px; padding:.3rem .6rem;
}
.tlt-lang-switch span{ opacity:.55; }
.tlt-lang-switch span.is-current{ opacity:1; }

/* Hamburguesa: checkbox nativo HERMANO del label y del nav (nunca anidado, si no el selector ~ no funciona) */
.tlt-nav-toggle{ position:absolute; left:-9999px; }
.tlt-nav-toggle-label{
  display:none; cursor:pointer; width:30px; height:22px; position:relative; flex-shrink:0;
}
.tlt-nav-toggle-label span{
  display:block; position:absolute; left:0; width:100%; height:3px; border-radius:2px;
  background:#fff; transition:transform .2s ease, opacity .2s ease;
}
.tlt-nav-toggle-label span:nth-child(1){ top:0; }
.tlt-nav-toggle-label span:nth-child(2){ top:9px; }
.tlt-nav-toggle-label span:nth-child(3){ top:18px; }
.tlt-nav-toggle:focus + .tlt-nav-toggle-label{ outline:2px solid #fff; outline-offset:4px; }
.tlt-nav-toggle:checked + .tlt-nav-toggle-label span:nth-child(1){ transform:translateY(9px) rotate(45deg); }
.tlt-nav-toggle:checked + .tlt-nav-toggle-label span:nth-child(2){ opacity:0; }
.tlt-nav-toggle:checked + .tlt-nav-toggle-label span:nth-child(3){ transform:translateY(-9px) rotate(-45deg); }

/* ===== Cards & hover ===== */
.tlt-card{ transition:transform .2s ease, box-shadow .2s ease; height:100%; }
.tlt-card:hover{ transform:translateY(-6px); box-shadow:var(--tlt-shadow); }
.tlt-tour-img img{ aspect-ratio:4/3; object-fit:cover; width:100%; }
.tlt-proj figure{ margin:0; overflow:hidden; border-radius:10px; }
.tlt-proj img{ aspect-ratio:4/3; object-fit:cover; width:100%; transition:transform .5s ease; }
.tlt-proj:hover img{ transform:scale(1.07); }

/* ===== Precio ===== */
.tlt-precio{ font-family:"Fraunces",serif; font-weight:600; color:var(--wp--preset--color--rojo); font-size:1.3rem; }
.tlt-precio-nota{ font-size:.78rem; color:var(--wp--preset--color--piedra); }

/* ===== Formulario de contacto ===== */
.tlt-form{ display:grid; gap:1rem; }
.tlt-form .row{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
@media(max-width:600px){ .tlt-form .row{ grid-template-columns:1fr; } }
.tlt-form label{ font-weight:600; font-size:.9rem; display:block; margin-bottom:.35rem; color:var(--wp--preset--color--carbon); }
.tlt-form input,.tlt-form select,.tlt-form textarea{
  width:100%; padding:.8rem .9rem; border:1px solid #cfd8e3; border-radius:8px;
  font:inherit; background:#fff; color:var(--wp--preset--color--carbon);
}
.tlt-form input:focus,.tlt-form select:focus,.tlt-form textarea:focus{
  outline:none; border-color:var(--wp--preset--color--rojo); box-shadow:0 0 0 3px rgba(193,39,45,.18);
}
.tlt-form button{
  font-family:"Inter",sans-serif; font-weight:700;
  background:var(--wp--preset--color--rojo); color:#fff; border:0; padding:.95rem 1.6rem;
  border-radius:8px; cursor:pointer; font-size:1rem; transition:background .18s, transform .18s;
}
.tlt-form button:hover{ background:var(--wp--preset--color--rojo-oscuro); transform:translateY(-2px); }
.tlt-alert{ padding:1rem 1.2rem; border-radius:8px; background:#e7f7ec; color:#176a37; border:1px solid #b6e6c5; font-weight:600; }

/* ===== Floating WhatsApp ===== */
.tlt-wa{
  position:fixed; right:20px; bottom:20px; z-index:200; width:58px; height:58px;
  border-radius:50%; background:#25D366; display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 28px -8px rgba(0,0,0,.45); transition:transform .2s; color:#fff;
}
.tlt-wa:hover{ transform:scale(1.08); }
.tlt-wa svg{ width:32px; height:32px; fill:#fff; }

/* ===== Franja de confianza ===== */
.tlt-franja{
  background:var(--wp--preset--color--azul-oscuro)!important;
  border-top:3px solid var(--wp--preset--color--rojo); border-bottom:3px solid var(--wp--preset--color--rojo);
  position:relative; overflow:hidden;
}
.tlt-franja-item{ margin:0!important; white-space:nowrap; color:#fff!important; }
@media(max-width:782px){
  .tlt-franja-item{ font-size:.88rem!important; }
}

/* ===== Footer credit ===== */
.tlt-credit{
  font-family:"Inter",sans-serif; letter-spacing:.04em;
  color:#9fb7cc; transition:color .2s, text-shadow .2s;
}
.tlt-credit:hover{ color:#F2C9A8; text-shadow:0 0 12px rgba(242,201,168,.5); }

/* ===== Responsive / Mobile ===== */
@media (max-width: 1023px){
  .wp-block-cover h1.wp-block-heading{
    font-size: clamp(1.55rem, 6.6vw, 2.1rem) !important;
    line-height: 1.12 !important;
    overflow-wrap: break-word; word-break: normal; hyphens: none;
  }
  .wp-block-cover{ min-height: 78vh !important; }
  .wp-block-cover .wp-block-cover__inner-container{ width: 100%; max-width: 100%; }
  .wp-block-cover .wp-block-cover__inner-container > .wp-block-group{ max-width: 100%; }
  .wp-block-cover p{ font-size: 1.02rem !important; }
  .is-style-overline{ font-size: .72rem; letter-spacing:.16em; }

  .wp-block-cover .wp-block-buttons{ width: 100%; }
  .wp-block-cover .wp-block-buttons .wp-block-button{ flex: 1 1 100%; }
  .wp-block-cover .wp-block-buttons .wp-block-button__link{ display:block; text-align:center; }

  h2.wp-block-heading{ font-size: clamp(1.7rem, 7vw, 2.2rem) !important; }

  .tlt-nav-toggle-label{ display:block; order:3; }
  .tlt-header-cta{ order:4; }
  .tlt-nav-links{
    display:none; flex-direction:column; align-items:flex-start; gap:1.2rem;
    position:fixed; inset:0; top:72px; z-index:150; overflow-y:auto;
    background:var(--wp--preset--color--azul-oscuro); padding:2rem 1.5rem;
  }
  .tlt-nav-toggle:checked ~ .tlt-nav-links{ display:flex; }
  .tlt-nav-links a{ font-size:1.4rem !important; padding:.4rem 0; width:100%; }

  .tlt-wa{ width:52px; height:52px; right:14px; bottom:14px; }
  .tlt-wa svg{ width:28px; height:28px; }

  .tlt-logo-badge img{ max-height:46px; width:46px; height:46px; }

  main h1.wp-block-heading,
  .has-azul-oscuro-background-color h1.wp-block-heading{
    font-size: clamp(1.9rem, 8vw, 2.4rem) !important;
    line-height: 1.1 !important;
    overflow-wrap: break-word;
  }

  .wp-block-social-links .wp-social-link{ width:40px !important; height:40px !important; }
  footer a, .wp-block-column a:not(.wp-block-button__link){ display:inline-block; padding:.18rem 0; }

  img, iframe, video, table, pre{ max-width:100% !important; height:auto; }
  .wp-block-group, .wp-block-columns, .wp-block-column{ max-width:100%; }
  html, body{ overflow-x:hidden; }
}

/* ===== Tablet (768–1023px): recuperar columnas en fila ===== */
@media (min-width: 600px) and (max-width: 1023px){
  .wp-block-columns:not(.is-not-stacked-on-mobile){
    flex-direction:row !important; flex-wrap:wrap !important; gap:1.4rem;
  }
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column{
    flex-basis:30% !important; flex-grow:1 !important; min-width:0 !important;
  }
  footer .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column{ flex-basis:42% !important; }
  .wp-block-media-text{ grid-template-columns:1fr 1fr !important; }
  .wp-block-media-text.has-media-on-the-right{ grid-template-columns:1fr 1fr !important; }

  .wp-block-cover h1.wp-block-heading{ font-size: clamp(2.2rem, 5.5vw, 3rem) !important; }
  main h1.wp-block-heading,
  .has-azul-oscuro-background-color h1.wp-block-heading{ font-size: clamp(2.4rem, 5vw, 3rem) !important; }
}

/* menú de admin de WP no debe tapar el header sticky */
@media (max-width: 1023px){
  html{ scroll-padding-top: 64px; }
}

/* anclas bajo header sticky */
[id]{ scroll-margin-top: 90px; }

/* ===== Misc ===== */
.has-rojo-color{ color:var(--wp--preset--color--rojo)!important; }
.tlt-divider{ width:64px; height:4px; background:var(--wp--preset--color--rojo); border-radius:2px; }
.tlt-stars{ color:var(--wp--preset--color--rojo); letter-spacing:.15em; font-size:1.1rem; margin-bottom:.6rem!important; }
