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

:root {
  --bg: #EEF1F4;
  --ink: #14202B;
  --ink-soft: #4B5A68;
  --band: #0B2C45;

  --eco: #B3262E;
  --eco-soft: #F6E7D3;
  --fin: #14573A;
  --fin-soft: #BFE8D2;
  --trv: #0E6BA8;
  --trv-soft: #F5C242;

  --radius: 14px;
  --shadow: 0 10px 30px -14px rgba(11, 44, 69, 0.28);
  --shadow-soft: 0 4px 16px -8px rgba(11, 44, 69, 0.2);

  --font-head: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -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__band {
  background: var(--band);
  padding: 28px 0 56px;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
  position: relative;
}

.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.masthead__logo {
  width: 60%;
  max-width: 300px;
  border-radius: var(--radius);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.55);
}

.masthead__tagline {
  margin: 0;
  color: #EAF0F6;
  font-size: 0.82rem;
  line-height: 1.35;
  opacity: 0.85;
  font-weight: 500;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  padding-left: 12px;
}

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

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

.section__head {
  display: flex;
  align-items: stretch;
  margin-bottom: 20px;
}

.section__tab {
  flex: 0 0 auto;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  padding: 10px 0;
  border-radius: 8px 0 0 8px;
}

.section__tab span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.section__rule-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding-left: 12px;
}

.section__rule {
  height: 3px;
  width: 100%;
  border-radius: 2px;
}

.section--economia .section__tab { background: var(--eco); }
.section--economia .section__rule { background: linear-gradient(90deg, var(--eco), transparent); }
.section--finanza .section__tab { background: var(--fin); }
.section--finanza .section__rule { background: linear-gradient(90deg, var(--fin), transparent); }
.section--viaggi .section__tab { background: var(--trv); }
.section--viaggi .section__rule { background: linear-gradient(90deg, var(--trv), transparent); }

.section__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 4px;
}

/* ---------- 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: editorial numbered list ---------- */

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

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

.eco-row:first-child { padding-top: 0; }

.eco-row__num {
  flex: 0 0 auto;
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--eco);
  line-height: 1;
  min-width: 42px;
}

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

.eco-row__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.08rem;
  margin: 0 0 6px;
  line-height: 1.3;
}

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

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

.eco-row__thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.eco-row--hero {
  flex-direction: column;
}

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

.eco-row--hero .eco-row__media.loaded { opacity: 1; }

.eco-row--hero .eco-row__num {
  font-size: 3.2rem;
}

/* ---------- FINANZA: data cards ---------- */

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

.fin-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  border: none;
  font: inherit;
  color: inherit;
  padding: 0;
}

.fin-card__rule {
  height: 7px;
  background: var(--fin);
}

.fin-card__media {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms ease;
}

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

.fin-card__body {
  padding: 18px 20px 20px;
}

.fin-card__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 8px;
  line-height: 1.3;
}

.fin-card__preview {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

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

/* ---------- VIAGGI E TURISMO: panoramic cards ---------- */

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

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

.trv-card__media-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

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

.trv-card__tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--trv-soft);
  color: #3A2B00;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.trv-card__body {
  padding: 14px 4px 0;
}

.trv-card--right .trv-card__body {
  text-align: right;
}

.trv-card__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 8px;
  line-height: 1.3;
}

.trv-card__preview {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

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

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

.site-footer {
  background: var(--band);
  color: #EAF0F6;
  padding: 32px 0 40px;
  margin-top: 12px;
  clip-path: polygon(0 10%, 100% 0, 100% 100%, 0 100%);
}

.site-footer__tagline {
  font-family: var(--font-head);
  font-weight: 700;
  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(20, 32, 43, 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: 700;
  font-size: 1.7rem;
  line-height: 1.25;
  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 (min-width: 480px) {
  .eco-row__thumb { width: 112px; height: 112px; }
}

@media (max-width: 360px) {
  .masthead__tagline { display: none; }
  .eco-row__num { font-size: 2.1rem; min-width: 34px; }
  .eco-row__thumb { width: 80px; height: 80px; }
}
