@import url('../fonts/fonts.local.css');

:root {
  --bg: #FBF6EC;
  --mist: #DDF0F1;
  --ink: #1C2530;
  --ink-soft: #5C6672;

  --eco: #0A7E8C;
  --eco-soft: #A5E3E6;
  --fin: #5B2A6E;
  --fin-soft: #E3D2F0;
  --trv: #F0614E;
  --trv-soft: #F4D9A8;

  --radius: 14px;
  --shadow: 0 10px 30px -14px rgba(28, 37, 48, 0.28);
  --shadow-soft: 0 4px 16px -8px rgba(28, 37, 48, 0.2);

  --font-head: 'DM Serif Display', 'Playfair Display', Georgia, serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  --maxw: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.overlay-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- progress line ---------- */

.progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--eco), var(--fin), var(--trv));
  z-index: 500;
  transition: width 60ms linear;
}

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  overflow: hidden;
  padding: 36px 0 28px;
  background: linear-gradient(180deg, var(--mist) 0%, var(--bg) 440px);
}

.masthead__glow {
  position: absolute;
  top: -120px;
  left: 50%;
  width: 520px;
  height: 480px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 30%, rgba(165, 227, 230, 0.65) 0%, rgba(165, 227, 230, 0) 55%),
    radial-gradient(circle at 50% 55%, rgba(244, 217, 168, 0.45) 0%, rgba(244, 217, 168, 0) 60%);
  pointer-events: none;
  z-index: 0;
}

.masthead__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.masthead__logo {
  width: 65%;
  max-width: 340px;
}

.masthead__tagline {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.4;
  font-weight: 500;
  max-width: 320px;
}

/* ---------- sections ---------- */

.section {
  margin-top: 20px;
  padding-bottom: 36px;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section__beam {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.section__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.7rem;
  margin: 0;
}

.section__line {
  height: 2px;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 22px;
  border-radius: 2px;
}

.section--economia .section__beam,
.section--economia .section__title { color: var(--eco); }
.section--economia .section__line { background: linear-gradient(90deg, var(--eco), transparent); }

.section--finanza .section__beam,
.section--finanza .section__title { color: var(--fin); }
.section--finanza .section__line { background: linear-gradient(90deg, var(--fin), transparent); }

.section--viaggi .section__beam,
.section--viaggi .section__title { color: var(--trv); }
.section--viaggi .section__line { background: linear-gradient(90deg, var(--trv), transparent); }

/* ---------- fade-in on scroll ---------- */

.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- ECONOMIA: headline-led ---------- */

.eco-list {
  display: flex;
  flex-direction: column;
}

.eco-lead {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  padding: 0 0 26px;
  margin-bottom: 4px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}

.eco-lead__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  opacity: 0;
  transition: opacity 400ms ease;
}

.eco-lead__media.loaded { opacity: 1; }

.eco-lead__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.22;
  margin: 0 0 10px;
}

.eco-lead__preview {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.5;
}

.eco-lead__more {
  color: var(--eco);
  font-weight: 700;
  font-size: 0.88rem;
}

.eco-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid rgba(28, 37, 48, 0.1);
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}

.eco-row__body { flex: 1 1 auto; min-width: 0; }

.eco-row__kicker {
  display: block;
  color: var(--eco);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.eco-row__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.22rem;
  line-height: 1.28;
  margin: 0 0 8px;
}

.eco-row__preview {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.48;
}

.eco-row__more {
  color: var(--eco);
  font-weight: 700;
  font-size: 0.85rem;
}

.eco-row__thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity 400ms ease;
}

.eco-row__thumb.loaded { opacity: 1; }

/* ---------- FINANZA: quote cards ---------- */

.fin-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fin-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  border: none;
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 22px 20px 20px;
}

.fin-card__tab {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 34px 34px 0 0;
  border-color: var(--fin-soft) transparent transparent transparent;
}

.fin-card__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.fin-card__avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity 400ms ease;
}

.fin-card__avatar.loaded { opacity: 1; }

.fin-card__title {
  color: var(--fin);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.35;
  margin: 0;
}

.fin-card__quote {
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 400;
  font-size: 1.32rem;
  line-height: 1.32;
  margin: 0 0 14px;
  color: var(--ink);
}

.fin-card__more {
  color: var(--fin);
  font-weight: 700;
  font-size: 0.88rem;
}

/* ---------- VIAGGI E TURISMO: edge-to-edge image cards ---------- */

.trv-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.trv-card {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.trv-card__media-wrap {
  position: relative;
}

.trv-card__media {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms ease;
}

.trv-card__media.loaded { opacity: 1; }

.trv-card__tag {
  position: absolute;
  top: 16px;
  left: 18px;
  background: var(--trv);
  color: #fff;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.trv-card__body {
  background: var(--trv-soft);
  padding: 20px 18px 24px;
}

.trv-card__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.26;
  margin: 0 0 10px;
  color: var(--ink);
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.trv-card__preview {
  margin: 0 0 16px;
  color: #4A3420;
  font-size: 0.94rem;
  line-height: 1.5;
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.trv-card__button {
  display: inline-block;
  background: var(--trv);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.trv-card__body-inner {
  display: flex;
  flex-direction: column;
  max-width: calc(var(--maxw) - 36px);
  margin: 0 auto;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--ink);
  color: #F2ECE0;
  padding: 32px 0 40px;
  margin-top: 12px;
}

.site-footer__tagline {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.site-footer__email {
  font-size: 0.9rem;
  opacity: 0.85;
}

.site-footer__email a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- article overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay.is-open {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .overlay { transition: none; }
}

.overlay__close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(28, 37, 48, 0.82);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1010;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.overlay__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.overlay__content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.overlay__pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.overlay__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.26;
  margin: 0 0 10px;
}

.overlay__meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 0 0 20px;
}

.overlay__body p {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
}

/* ---------- responsive ---------- */

@media (max-width: 360px) {
  .masthead__tagline { font-size: 0.8rem; }
  .eco-lead__title { font-size: 1.4rem; }
  .section__title { font-size: 1.45rem; }
}
