/*
Theme Name: ViaggiaFacile
Theme URI: https://www.viaggiafacile.info
Author: ViaggiaFacile
Description: Tema WordPress per magazine di viaggi: sezioni a blocchi (Itinerari, Consigli, News), banner pubblicitari AdSense e diretti, newsletter integrata e supporto al plugin ViaggiaFacile Planner per pianificare viaggi gratis.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: viaggiafacile
Tags: blog, news, travel, block-styles, custom-logo, custom-menu, featured-images
*/

/* ============ Design tokens ============ */
:root {
  --vf-sand: #fdfbf6;
  --vf-ink: #14211f;
  --vf-muted: #5d6b68;
  --vf-sea: #0e7c72;
  --vf-sea-dark: #0a5f58;
  --vf-sun: #f2994a;
  --vf-coral: #e2603f;
  --vf-line: #e6e1d6;
  --vf-card: #ffffff;
  --vf-radius: 16px;
  --vf-shadow: 0 10px 30px rgba(20, 33, 31, .08);
  --vf-max: 1200px;
  --vf-font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --vf-display: "Fraunces", Georgia, "Times New Roman", serif;
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--vf-font);
  background: var(--vf-sand);
  color: var(--vf-ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--vf-sea); text-decoration: none; }
a:hover { color: var(--vf-sea-dark); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--vf-display); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

.vf-container { width: 100%; max-width: var(--vf-max); margin: 0 auto; padding: 0 20px; }
.vf-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ Header ============ */
.vf-topbar { background: var(--vf-ink); color: #fff; font-size: .82rem; }
.vf-topbar .vf-container { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 16px; }
.vf-topbar a { color: #ffd9a8; }

.vf-header { background: #fff; border-bottom: 1px solid var(--vf-line); position: sticky; top: 0; z-index: 50; }
.vf-header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.vf-brand { display: flex; align-items: center; gap: 10px; font-family: var(--vf-display); font-size: 1.4rem; font-weight: 700; color: var(--vf-ink); text-decoration: none; }
.vf-brand:hover { text-decoration: none; }
.vf-brand img { max-height: 46px; width: auto; }
.vf-brand-mark { width: 40px; height: 40px; }
.vf-brand small { display: block; font-family: var(--vf-font); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--vf-muted); font-weight: 600; }

.vf-nav { margin-left: auto; }
.vf-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.vf-nav a { color: var(--vf-ink); font-weight: 600; font-size: .95rem; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.vf-nav a:hover, .vf-nav .current-menu-item > a { color: var(--vf-sea); border-color: var(--vf-sun); }
.vf-header-cta { background: var(--vf-sea); color: #fff !important; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; text-decoration: none !important; }
.vf-header-cta:hover { background: var(--vf-sea-dark); }
.vf-burger { display: none; background: none; border: 1px solid var(--vf-line); border-radius: 10px; padding: 8px 10px; font-size: 1.1rem; cursor: pointer; margin-left: auto; }

/* ============ Hero ============ */
.vf-hero { position: relative; background: linear-gradient(140deg, #0e7c72 0%, #114a5c 60%, #14211f 100%); color: #fff; overflow: hidden; }
.vf-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 80% 20%, rgba(242,153,74,.35), transparent 45%); pointer-events: none; }
.vf-hero-bg { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; opacity: .35; }
.vf-hero-inner { position: relative; z-index: 2; padding: 74px 0 88px; max-width: 720px; }
.vf-hero h1 { color: #fff; }
.vf-hero p { font-size: 1.12rem; color: #e7f1ef; }
.vf-eyebrow { display: inline-block; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--vf-sun); margin-bottom: 14px; }
.vf-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.vf-btn { display: inline-block; border-radius: 999px; padding: 13px 26px; font-weight: 700; border: 2px solid transparent; cursor: pointer; font-size: .98rem; text-decoration: none !important; transition: transform .15s ease, background .15s ease; }
.vf-btn:hover { transform: translateY(-1px); }
.vf-btn-primary { background: var(--vf-sun); color: #24160a; }
.vf-btn-primary:hover { background: #ffb066; }
.vf-btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.vf-btn-sea { background: var(--vf-sea); color: #fff; }
.vf-btn-sea:hover { background: var(--vf-sea-dark); }

/* ============ Sezioni a blocchi ============ */
.vf-section { padding: 56px 0; }
.vf-section--alt { background: #fff; border-top: 1px solid var(--vf-line); border-bottom: 1px solid var(--vf-line); }
.vf-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.vf-section-head p { color: var(--vf-muted); margin: 0; max-width: 60ch; }
.vf-section-head h2 { margin: 0; }
.vf-section-link { font-weight: 700; white-space: nowrap; }

.vf-grid { display: grid; gap: 22px; }
.vf-grid-3 { grid-template-columns: repeat(3, 1fr); }
.vf-grid-2 { grid-template-columns: repeat(2, 1fr); }
.vf-grid-4 { grid-template-columns: repeat(4, 1fr); }

.vf-card { background: var(--vf-card); border: 1px solid var(--vf-line); border-radius: var(--vf-radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.vf-card:hover { transform: translateY(-3px); box-shadow: var(--vf-shadow); }
.vf-card-thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, #cfe6e2, #eadfcb); overflow: hidden; }
.vf-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vf-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vf-card-body h3 { margin: 0; font-size: 1.16rem; }
.vf-card-body h3 a { color: var(--vf-ink); }
.vf-card-excerpt { color: var(--vf-muted); font-size: .94rem; margin: 0; }
.vf-meta { font-size: .78rem; color: var(--vf-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.vf-badge { display: inline-block; background: #e7f2f0; color: var(--vf-sea-dark); border-radius: 999px; padding: 4px 12px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.vf-badge--sun { background: #fdefdf; color: #9a5613; }
.vf-badge--coral { background: #fdeae5; color: #a53a1f; }

/* Blocco itinerari in evidenza */
.vf-feature { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.vf-feature-main .vf-card-thumb { aspect-ratio: 16/9; }
.vf-feature-side { display: grid; gap: 22px; }
.vf-feature-side .vf-card { flex-direction: row; }
.vf-feature-side .vf-card-thumb { width: 40%; aspect-ratio: auto; flex: none; }

/* Consigli list */
.vf-tip { display: flex; gap: 14px; background: #fff; border: 1px solid var(--vf-line); border-radius: var(--vf-radius); padding: 18px; }
.vf-tip-num { font-family: var(--vf-display); font-size: 1.6rem; color: var(--vf-sun); font-weight: 700; line-height: 1; }

/* ============ Newsletter ============ */
.vf-newsletter { background: linear-gradient(120deg, var(--vf-ink), #123a37); color: #fff; border-radius: 24px; padding: 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; }
.vf-newsletter h2 { color: #fff; margin: 0 0 8px; }
.vf-newsletter p { color: #d8e5e2; margin: 0; }
.vf-newsletter-form { display: grid; gap: 10px; }
.vf-newsletter-form input[type="text"],
.vf-newsletter-form input[type="email"] { width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-size: 1rem; font-family: inherit; }
.vf-newsletter-form input::placeholder { color: #b8c8c5; }
.vf-newsletter-form label.vf-consent { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: #cddad7; }
.vf-newsletter-msg { font-size: .9rem; padding: 10px 14px; border-radius: 10px; margin-top: 8px; }
.vf-newsletter-msg.ok { background: rgba(120, 220, 170, .18); color: #b8f0d5; }
.vf-newsletter-msg.err { background: rgba(255, 120, 100, .18); color: #ffc9bf; }
.vf-hp { position: absolute !important; left: -9999px; }

/* ============ Ads ============ */
.vf-ad { margin: 0 auto; text-align: center; }
.vf-ad-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0; }
.vf-ad-label { font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: #9aa5a2; }
.vf-ad-placeholder { width: 100%; max-width: 970px; min-height: 100px; border: 1px dashed var(--vf-line); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; color: #b3bcba; font-size: .82rem; }
.vf-ad--sidebar .vf-ad-placeholder { min-height: 250px; }
.vf-ad-direct img { border-radius: 12px; margin: 0 auto; }

/* ============ Layout contenuti ============ */
.vf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding: 44px 0; }
.vf-sidebar { display: grid; gap: 24px; align-content: start; }
.vf-widget { background: #fff; border: 1px solid var(--vf-line); border-radius: var(--vf-radius); padding: 20px; }
.vf-widget h3, .vf-widget .widget-title { margin-top: 0; font-size: 1.05rem; }
.vf-widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.vf-entry { background: #fff; border: 1px solid var(--vf-line); border-radius: var(--vf-radius); padding: 32px; }
.vf-entry-content { font-size: 1.05rem; }
.vf-entry-content img { border-radius: 12px; margin: 1.4rem 0; }
.vf-entry-content blockquote { border-left: 4px solid var(--vf-sun); margin: 1.5rem 0; padding: 4px 0 4px 18px; color: var(--vf-muted); font-style: italic; }
.vf-entry-header { margin-bottom: 20px; }
.vf-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.vf-pagination .page-numbers { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--vf-line); background: #fff; }
.vf-pagination .current { background: var(--vf-sea); color: #fff; border-color: var(--vf-sea); }

/* ============ Footer ============ */
.vf-footer { background: var(--vf-ink); color: #cddad7; margin-top: 40px; padding: 48px 0 24px; }
.vf-footer h3 { color: #fff; font-size: 1rem; }
.vf-footer a { color: #cddad7; }
.vf-footer a:hover { color: #fff; }
.vf-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.vf-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.vf-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; font-size: .82rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ============ Responsive ============ */
@media (max-width: 1000px) {
  .vf-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .vf-layout { grid-template-columns: 1fr; }
  .vf-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .vf-grid-3, .vf-grid-2, .vf-feature { grid-template-columns: 1fr; }
  .vf-newsletter { grid-template-columns: 1fr; padding: 28px; }
  .vf-burger { display: block; }
  .vf-nav { position: absolute; top: 76px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--vf-line); display: none; padding: 16px 20px; }
  .vf-nav.is-open { display: block; }
  .vf-nav ul { flex-direction: column; gap: 12px; }
  .vf-header-cta { display: none; }
  .vf-feature-side .vf-card { flex-direction: column; }
  .vf-feature-side .vf-card-thumb { width: 100%; }
}
@media (max-width: 560px) {
  .vf-grid-4 { grid-template-columns: 1fr; }
  .vf-entry { padding: 20px; }
  .vf-footer-grid { grid-template-columns: 1fr; }
}
