/*
Theme Name: Viajeros Económicos
Theme URI: https://example.com/viajeros-economicos
Author: Viajeros Económicos
Description: Tema de guías de viaje económicos en español. Sin plugins: incluye portada, presupuestos, consejos y buscador. Logo y textos de portada desde el personalizador.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: viajeros-economicos
*/

/* Sunny travel palette: sea blue, sun yellow, sunset orange. Light only, so the look stays bright. */
:root {
  --bg: #fff8ec;
  --surface: #ffffff;
  --ink: #0b3d62;
  --muted: #4a6578;
  --accent: #ff6b35;
  --sun: #ffc233;
  --sea: #1fb6d6;
  --line: #ffe0c2;
  --night: #0b3d62;
  --sand: #fff3d1;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 800; line-height: 1.08; text-wrap: balance; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0; }
.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; min-width: 0; }
.brand img, .brand .custom-logo { height: 44px; width: auto; }
.brand { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: "Fraunces", Georgia, serif; font-weight: 800; font-size: 1.4rem; color: var(--ink); white-space: nowrap; }
.main-nav ul { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.main-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  background:
    radial-gradient(circle at 88% 22%, var(--sun) 0 90px, transparent 91px),
    radial-gradient(circle at 88% 22%, rgba(255,194,51,.35) 0 150px, transparent 151px),
    linear-gradient(180deg, #8fe0f5 0%, #d6f3fb 55%, #fff8ec 100%);
  color: var(--ink);
  padding-block: 4.5rem 5rem;
  position: relative;
  overflow: hidden;
}
.hero h1 { font-size: clamp(2.6rem, 8vw, 5.6rem); margin-top: .8rem; max-width: 14ch; color: var(--ink); text-shadow: 3px 3px 0 #fff; }
.hero h1 em { font-style: italic; font-weight: 800; color: var(--accent); }
.hero .eyebrow { background: #fff; display: inline-block; padding: .35rem .8rem; border-radius: 999px; border: 2px solid var(--ink); color: var(--ink); }
.hero p.lead { max-width: 46ch; color: var(--ink); font-size: 1.1rem; margin: 1.4rem 0 2rem; font-weight: 600; }
.btn {
  display: inline-block; padding: .9rem 1.6rem; border-radius: 16px;
  background: var(--sun); color: var(--ink); font-weight: 800; text-decoration: none;
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn.dark { background: var(--accent); color: #fff; }
.ticker { margin-top: 3rem; display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--ink); font-size: 14px; font-weight: 600; }
.ticker > div { background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: .7rem 1rem; box-shadow: 4px 4px 0 var(--ink); }
.ticker b { color: var(--accent); font-family: "Fraunces", serif; font-size: 1.6rem; font-weight: 800; display: block; }

/* Rise on load: resting state is visible */
.rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.rise.d1 { animation-delay: .12s; }
.rise.d2 { animation-delay: .25s; }
.rise.d3 { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } .btn { transition: none; } }

section.block { padding-block: 4rem; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.head h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-top: .4rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem;
  display: flex; flex-direction: column; gap: .6rem; min-width: 0;
  transition: transform .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card h3 { font-size: 1.5rem; }
.card h3 a { text-decoration: none; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .meta { font-size: 12px; color: var(--muted); font-weight: 600; }
.card img { border-radius: 14px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }

/* Budget table */
.table-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
table.budget { width: 100%; border-collapse: collapse; min-width: 480px; }
table.budget th, table.budget td { text-align: start; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
table.budget th { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
table.budget td.num { font-variant-numeric: tabular-nums; font-weight: 800; }
table.budget tr:last-child td { border-bottom: none; }

/* Tips */
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.tip { border-top: 3px solid var(--accent); padding-top: 1rem; }
.tip h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.tip p { margin: 0; color: var(--muted); }

/* Subscribe band */
.cta { background: var(--sand); color: #14233a; border-radius: 28px; padding: 2.4rem 1.6rem; text-align: center; }
.cta h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
.cta p { color: #3f4a5c; max-width: 44ch; margin: .8rem auto 1.6rem; }

/* Single / page / archive */
.article { max-width: 720px; margin: 0 auto; padding-block: 3rem 4rem; }
.article h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: .6rem 0 1rem; }
.article .entry-content { font-size: 1.05rem; }
.article .entry-content > * + * { margin-top: 1.1em; }
.article .entry-content h2, .article .entry-content h3 { margin-top: 1.8em; }
.article .entry-content img { border-radius: 16px; }
.article .entry-content table { width: 100%; border-collapse: collapse; }
.article .entry-content td, .article .entry-content th { border-bottom: 1px solid var(--line); padding: .6rem; text-align: start; }
.article-head .meta { color: var(--muted); font-size: 14px; }
.post-thumb { border-radius: 20px; margin-top: 1.4rem; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.archive-head { padding-block: 3rem 1rem; }
.archive-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.pagination { padding-block: 2rem; display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.pagination a, .pagination span { padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.pagination .current { background: var(--accent); color: #0f1d33; border-color: var(--accent); }

/* Footer */
.site-footer { padding-block: 3rem 2rem; color: #d7f0fa; font-size: 14px; background: var(--ink); margin-top: 3rem; position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; background: linear-gradient(90deg, var(--sun) 0 33%, var(--accent) 33% 66%, var(--sea) 66%); }
.site-footer .muted { color: #bfe3f2; }
.site-footer .brand, .site-footer .brand-name { color: #fff; }
.site-footer .footer-nav a { color: #fff; }
.site-footer .footer-nav a:hover { color: var(--sun); }
.site-footer .footer-bottom { border-top-color: rgba(255,255,255,.2); color: #a9d6e8; }
.site-footer .wrap > * + * { margin-top: .5rem; }

/* Search */
.search-form { display: flex; gap: .5rem; margin-top: 1rem; }
.search-form input[type="search"] { flex: 1; min-width: 0; padding: .75rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.search-form button { padding: .75rem 1.2rem; border-radius: 999px; border: 0; background: var(--accent); color: #0f1d33; font-weight: 800; cursor: pointer; }

/* Header: shrinks on scroll, with a gold-to-coral progress line */
.site-header { transition: box-shadow .3s ease, background .3s ease; }
.site-header .wrap { transition: min-height .3s ease; }
.site-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(15,29,51,.45); }
.site-header.is-scrolled .wrap { min-height: 58px; }
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, #e2be70, var(--accent), #e2be70);
  transform-origin: 0 50%; transform: scaleX(0);
  will-change: transform;
}
.site-header { position: sticky; }
.main-nav a { position: relative; padding-block: .2rem; }
.main-nav a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .3s ease;
}
.main-nav a:hover::after, .main-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* Mobile menu button (hidden on desktop) */
.menu-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  background: transparent; cursor: pointer; position: relative; flex: none;
}
.menu-bars, .menu-bars::before, .menu-bars::after {
  display: block; position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.menu-bars { top: 50%; margin-top: -1px; }
.menu-bars::before, .menu-bars::after { content: ""; left: 0; right: 0; }
.menu-bars::before { top: -7px; }
.menu-bars::after { top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-bars::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* Footer */
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.footer-brand { max-width: 36ch; display: grid; gap: .6rem; justify-items: start; }
.footer-brand p { margin: 0; font-size: 14px; }
.footer-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-nav a { text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 13px; }
.footer-bottom p { margin: 0; }

/* Reveal on scroll: only when JS runs. Without JS, everything is visible. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.in .head, .reveal.in .card, .reveal.in .tip { animation: none; }

/* Pages */
.page-hero { background: var(--night); color: var(--sand); padding-block: 3.5rem 3rem; }
.page-hero h1 { color: var(--sand); font-size: clamp(2.2rem, 6vw, 3.4rem); }
.page-hero .eyebrow { color: var(--accent); }

@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -24px rgba(15,29,51,.5);
    display: none; padding-block: 1rem; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  }
  .main-nav.open { display: block; animation: drop .3s ease both; }
  .main-nav ul { flex-direction: column; gap: .9rem; }
  .main-nav a { font-size: 17px; }
  .site-header .wrap { min-height: 64px; }
  .brand-name { font-size: 1.15rem; }
  .hero { padding-block: 3rem 3rem; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .main-nav.open { animation: none; }
}
