/* ── Il Bias — Article/Single post CSS ─────────────────────── */
:root {
  --ib-black:     #111111;
  --ib-white:     #ffffff;
  --ib-gray-50:   #f8f8f8;
  --ib-gray-100:  #eeeeee;
  --ib-gray-200:  #cccccc;
  --ib-gray-400:  #767676;
  --ib-gray-600:  #555555;
  --ib-red:       #cc0000;
  --ib-accent:    #1a3a6b;
  --ib-serif:     'Georgia', 'Times New Roman', serif;
  --ib-sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ib-container: 1240px;
  --ib-gap:       24px;
  --ib-radius:    3px;
}

.ilbias-single * { box-sizing: border-box; }
.ilbias-single a { color: inherit; text-decoration: none; }
.ilbias-single a:hover { text-decoration: underline; }
.ilbias-single img { display: block; width: 100%; height: auto; object-fit: cover; }
.ilbias-single { margin: 0; padding: 0; font-family: var(--ib-sans); color: var(--ib-black); background: var(--ib-white); line-height: 1.5; }
.ilbias-single #page,
.ilbias-single .site-content,
.ilbias-single .entry-content { all: unset; display: block; }

/* ── Container ── */
.ib-container { max-width: var(--ib-container); margin: 0 auto; padding: 0 20px; }

/* ── Breaking bar ── */
.ib-breaking { background: var(--ib-red); color: var(--ib-white); padding: 8px 0; font-size: 13px; font-family: var(--ib-sans); }
.ib-breaking .ib-container { display: flex; align-items: center; gap: 12px; }
.ib-breaking-label { background: var(--ib-white); color: var(--ib-red); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 2px; white-space: nowrap; text-transform: uppercase; }
.ib-breaking a { color: var(--ib-white); font-weight: 500; }
.ib-breaking a:hover { opacity: 0.85; text-decoration: none; }

/* ── Header ── */
.ib-header { border-bottom: 2px solid var(--ib-black); padding: 20px 0 0; background: var(--ib-white); }
.ib-header-logo-row { text-align: center; margin-bottom: 16px; }
.ib-logo { display: inline-flex; align-items: baseline; gap: 5px; font-family: var(--ib-serif); line-height: 1; text-decoration: none; }
.ib-logo-il   { font-size: 17px; font-weight: 400; color: var(--ib-black); }
.ib-logo-bias { font-size: 52px; font-weight: 700; letter-spacing: -2px; color: var(--ib-black); }
.ib-logo:hover { text-decoration: none; }

/* ── Nav ── */
.ib-nav { border-top: 1px solid var(--ib-gray-100); }
.ib-nav-inner { display: flex; align-items: center; }
.ib-nav-date { font-size: 11px; color: var(--ib-gray-400); white-space: nowrap; padding: 10px 14px 10px 0; border-right: 1px solid var(--ib-gray-100); margin-right: 4px; font-style: italic; font-family: var(--ib-sans); }
.ib-nav ul { display: flex; list-style: none; margin: 0; padding: 0; }
.ib-nav a { display: block; padding: 10px 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.03em; color: var(--ib-black); text-transform: uppercase; border-bottom: 3px solid transparent; transition: border-color 0.15s; font-family: var(--ib-sans); }
.ib-nav a:hover, .ib-nav a.ib-active { border-bottom-color: var(--ib-red); text-decoration: none; }
.ib-nav .ib-nav-analisi a { color: var(--ib-accent); }

/* ── Mobile header ── */
.ib-mobile-header { display: none; align-items: center; justify-content: space-between; padding: 10px 0; }
.ib-mobile-hamburger { background: none; border: none; cursor: pointer; padding: 4px; display: flex; flex-direction: column; gap: 5px; }
.ib-mobile-hamburger span { display: block; width: 22px; height: 2px; background: var(--ib-black); }
.ib-mobile-logo { font-family: var(--ib-serif); line-height: 1; text-decoration: none; display: inline-flex; align-items: baseline; gap: 3px; }
.ib-mobile-logo .ib-logo-il   { font-size: 11px; font-weight: 400; color: var(--ib-black); }
.ib-mobile-logo .ib-logo-bias { font-size: 32px; font-weight: 700; letter-spacing: -1.5px; color: var(--ib-black); }
.ib-mobile-search { background: none; border: none; cursor: pointer; padding: 4px; font-size: 18px; color: var(--ib-black); }

/* ── Live pills mobile ── */
.ib-live-pills { display: none; overflow-x: auto; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--ib-gray-100); scrollbar-width: none; }
.ib-live-pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: var(--ib-gray-50); border: 1px solid var(--ib-gray-200); padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; font-family: var(--ib-sans); }
.ib-live-dot { width: 6px; height: 6px; background: var(--ib-red); border-radius: 50%; display: inline-block; animation: ib-pulse 1.5s infinite; }
@keyframes ib-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Category badge ── */
.ib-cat { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--ib-sans); }
.ib-cat.politica   { color: #1a3a6b; }
.ib-cat.esteri     { color: #2d6a4f; }
.ib-cat.analisi    { color: #6a2d1a; }
.ib-cat.lifestyle  { color: #7b4fa6; }
.ib-cat.calcio     { color: #b45309; }
.ib-cat.editoriali { color: #555555; }
.ib-read-time { font-size: 11px; color: var(--ib-gray-400); font-family: var(--ib-sans); }
.ib-article-meta { display: flex; align-items: center; gap: 8px; }

/* ─────────────────────────────────────────────────────────
   ARTICLE LAYOUT
───────────────────────────────────────────────────────── */

.ib-article-page { padding: 40px 0 60px; }

/* Article header — centrato, max 760px */
.ib-article-header { max-width: 760px; margin: 0 auto 28px; }

.ib-breadcrumb { font-size: 12px; color: var(--ib-gray-400); margin-bottom: 16px; font-family: var(--ib-sans); }
.ib-breadcrumb a { color: var(--ib-gray-400); }
.ib-breadcrumb a:hover { color: var(--ib-black); text-decoration: none; }
.ib-breadcrumb span { margin: 0 5px; }

.ib-article-header .ib-article-meta { margin-bottom: 14px; }

.ib-article-h1 { font-family: var(--ib-serif); font-size: 38px; font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; margin: 0 0 16px; color: var(--ib-black); }

.ib-article-sommario { font-family: var(--ib-serif); font-size: 19px; color: var(--ib-gray-600); line-height: 1.55; font-style: italic; margin: 0 0 20px; border-left: 3px solid var(--ib-red); padding-left: 16px; }

.ib-article-byline-bar { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--ib-gray-100); border-bottom: 1px solid var(--ib-gray-100); font-family: var(--ib-sans); font-size: 13px; color: var(--ib-gray-600); }
.ib-article-byline-bar strong { color: var(--ib-black); }
.ib-author-link { color: inherit; text-decoration: none; }
.ib-author-link:hover { text-decoration: underline; }
.ib-article-byline-bar .ib-sep { color: var(--ib-gray-200); }

/* Hero image */
.ib-article-hero { max-width: 900px; margin: 0 auto 40px; }
.ib-article-hero img { border-radius: var(--ib-radius); width: 100%; height: auto; }
.ib-article-hero figcaption { font-size: 12px; color: var(--ib-gray-400); margin-top: 8px; line-height: 1.5; font-family: var(--ib-sans); }

/* Two-column: body + sidebar */
.ib-article-body-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: start; }
.ib-article-content { min-width: 0; }

/* Body typography */
.ib-article-content p { font-family: var(--ib-serif); font-size: 18px; line-height: 1.78; color: #1a1a1a; margin: 0 0 24px; }
.ib-article-content h2 { font-family: var(--ib-serif); font-size: 26px; font-weight: 700; line-height: 1.25; margin: 40px 0 16px; color: var(--ib-black); }
.ib-article-content h3 { font-family: var(--ib-serif); font-size: 21px; font-weight: 700; line-height: 1.3; margin: 32px 0 12px; color: var(--ib-black); }
.ib-article-content a { color: var(--ib-accent); text-decoration: underline; text-decoration-thickness: 1px; }
.ib-article-content a:hover { color: var(--ib-red); }
.ib-article-content blockquote { border-left: 3px solid var(--ib-red); margin: 32px 0; padding: 4px 0 4px 24px; }
.ib-article-content blockquote p { font-size: 20px; font-style: italic; color: var(--ib-gray-600); margin: 0; }
.ib-article-content ul,
.ib-article-content ol { font-family: var(--ib-serif); font-size: 18px; line-height: 1.78; margin: 0 0 24px 28px; color: #1a1a1a; }
.ib-article-content li { margin-bottom: 8px; }
.ib-article-content strong { font-weight: 700; }
.ib-article-content em { font-style: italic; }
.ib-article-content figure { margin: 28px 0; }
.ib-article-content figcaption { font-size: 12px; color: var(--ib-gray-400); margin-top: 8px; font-family: var(--ib-sans); }
/* Nascondi featured image duplicata se inserita come blocco nell'editor */
.ib-article-content .wp-post-image,
.ib-article-content > figure:first-child img[class*="wp-image"] { display: none; }
/* Ripristina immagini dentro card correlate — specificità (0,2,1) batte (0,2,0) */
.ib-article-content .ib-related-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Tags */
.ib-article-tags { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ib-gray-100); display: flex; flex-wrap: wrap; gap: 8px; }
.ib-article-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ib-gray-600); border: 1px solid var(--ib-gray-200); padding: 4px 10px; border-radius: 2px; font-family: var(--ib-sans); }
.ib-article-tag:hover { border-color: var(--ib-black); color: var(--ib-black); text-decoration: none; }

/* Share */
.ib-article-share { margin-top: 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-family: var(--ib-sans); }
.ib-share-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ib-gray-400); }
.ib-share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--ib-gray-200); border-radius: 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ib-gray-600); font-family: var(--ib-sans); cursor: pointer; background: none; }
.ib-share-btn:hover { border-color: var(--ib-black); color: var(--ib-black); text-decoration: none; }

/* ── Sidebar articolo ── */
.ib-article-sidebar { position: sticky; top: 24px; }
.ib-sidebar-block { margin-bottom: 32px; }
.ib-sidebar-title { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; border-top: 3px solid var(--ib-black); padding-top: 10px; margin: 0 0 14px; font-family: var(--ib-sans); }
.ib-piu-letti { list-style: none; counter-reset: rank; margin: 0; padding: 0; }
.ib-piu-letti li { counter-increment: rank; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--ib-gray-100); align-items: start; }
.ib-piu-letti li:first-child { padding-top: 0; }
.ib-piu-letti li:last-child { border-bottom: none; }
.ib-piu-letti li::before { content: counter(rank); font-family: var(--ib-serif); font-size: 22px; font-weight: 700; color: var(--ib-gray-200); line-height: 1; padding-top: 2px; }
.ib-piu-letti-title { font-family: var(--ib-serif); font-size: 14px; font-weight: 700; line-height: 1.35; }
.ib-piu-letti-cat { font-size: 10px; color: var(--ib-gray-400); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; font-family: var(--ib-sans); }

/* ── Leggi anche ── */
.ib-related { margin-top: 60px; padding-top: 20px; border-top: 3px solid var(--ib-black); }
.ib-related-title { font-family: var(--ib-sans); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 20px; }
.ib-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ib-gap); }
.ib-related-card-img { aspect-ratio: 16/9; overflow: hidden; border-radius: var(--ib-radius); margin-bottom: 12px; }
.ib-related-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ib-related-card .ib-article-meta { margin-bottom: 8px; }
.ib-related-card-title { font-family: var(--ib-serif); font-size: 16px; font-weight: 700; line-height: 1.3; margin: 0 0 6px; }
.ib-related-card-byline { font-size: 11px; color: var(--ib-gray-400); font-family: var(--ib-sans); }

/* ── Footer ── */
.ib-footer { background: var(--ib-black); color: var(--ib-white); padding: 40px 0 20px; margin-top: 60px; }
.ib-footer-grid { display: grid; grid-template-columns: 200px repeat(3, 1fr); gap: 32px; margin-bottom: 32px; }
.ib-footer-brand { display: flex; flex-direction: column; }
.ib-footer-brand .ib-logo { margin-bottom: 12px; }
.ib-footer-brand .ib-logo .ib-logo-il   { color: var(--ib-gray-400); }
.ib-footer-brand .ib-logo .ib-logo-bias { color: var(--ib-white); font-size: 36px; }
.ib-footer-brand p { font-size: 12px; color: var(--ib-gray-400); line-height: 1.6; }
.ib-footer-col h4 { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ib-gray-400); margin: 0 0 12px; font-family: var(--ib-sans); }
.ib-footer-col ul { list-style: none; margin: 0; padding: 0; }
.ib-footer-col ul li { margin-bottom: 8px; }
.ib-footer-col ul a { font-size: 13px; color: #ccc; }
.ib-footer-col ul a:hover { color: var(--ib-white); text-decoration: none; }
.ib-footer-bottom { border-top: 1px solid #333; padding-top: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--ib-gray-400); font-family: var(--ib-sans); }
.ib-footer-bottom a { color: var(--ib-gray-400); }
.ib-footer-bottom a:hover { color: var(--ib-white); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .ib-article-body-wrap { grid-template-columns: 1fr; }
  .ib-article-sidebar { position: static; }
  .ib-related-grid { grid-template-columns: repeat(2, 1fr); }
  .ib-footer-grid { grid-template-columns: 1fr 1fr; }
  .ib-article-h1 { font-size: 30px; }
  .ib-article-sommario { font-size: 17px; }
}
@media (max-width: 600px) {
  .ib-header-logo-row { display: none; }
  .ib-nav { display: none; }
  .ib-mobile-header { display: flex; }
  .ib-live-pills { display: flex; }
  .ib-article-h1 { font-size: 25px; }
  .ib-article-sommario { font-size: 16px; }
  .ib-article-content p { font-size: 17px; line-height: 1.7; }
  .ib-article-byline-bar { flex-wrap: wrap; gap: 8px; }
  .ib-related-grid { grid-template-columns: 1fr; }
  .ib-footer-grid { grid-template-columns: 1fr; }
  .ib-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── Menu mobile aperto ── */
.ib-mobile-hamburger span { transition: transform .2s ease, opacity .15s ease; }
@media (max-width: 600px) {
  .ib-header.ib-nav-open .ib-nav { display: block; border-top: 1px solid var(--ib-gray-100); }
  .ib-header.ib-nav-open .ib-nav-inner { flex-direction: column; align-items: flex-start; padding: 4px 0 8px; }
  .ib-header.ib-nav-open .ib-nav-date { display: none; }
  .ib-header.ib-nav-open .ib-nav ul { flex-direction: column; width: 100%; padding: 0; }
  .ib-header.ib-nav-open .ib-nav ul li a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--ib-gray-100); font-size: 15px; font-weight: 500; }
  .ib-header.ib-nav-open .ib-nav ul li:last-child a { border-bottom: none; }
  .ib-header.ib-nav-open .ib-mobile-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .ib-header.ib-nav-open .ib-mobile-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .ib-header.ib-nav-open .ib-mobile-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ── Badge editoriale ── */
.ib-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; padding: 3px 8px; border-radius: 2px; text-transform: uppercase; font-family: var(--ib-sans); margin-bottom: 8px; line-height: 1; }
.ib-badge-esclusivo { background: #1a1a1a; color: #ffffff; }
.ib-badge-live { background: var(--ib-red); color: #ffffff; animation: ib-badge-pulse 1.8s ease-in-out infinite; }
@keyframes ib-badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }

/* ─────────────────────────────────────────────────────────────
   LIVE BLOG
   ───────────────────────────────────────────────────────────── */

/* Barra stato live/chiusa */
.ib-live-status-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 12px; border-radius: 3px; margin-bottom: 16px;
}
.ib-live-active  { background: var(--ib-red); color: #fff; }
.ib-live-closed  { background: var(--ib-gray-100); color: var(--ib-gray-600); }
.ib-live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; animation: ib-dot-blink 1.2s ease-in-out infinite;
}
@keyframes ib-dot-blink { 0%,100% { opacity:1; } 50% { opacity:.3; } }
.ib-live-time { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; opacity: .9; }

/* Intro editoriale (post_content) */
.ib-live-intro {
  font-size: 15px; line-height: 1.65; color: var(--ib-black);
  border-left: 3px solid var(--ib-gray-200); padding-left: 16px;
  margin-bottom: 28px;
}
.ib-live-intro p { margin: 0 0 .8em; }

/* Box "In evidenza" (pinned update) */
.ib-live-pinned {
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 4px;
  padding: 16px 20px; margin-bottom: 28px;
}
.ib-live-pinned-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ib-gray-600); margin-bottom: 8px;
}
.ib-live-pinned .ib-live-update-title {
  font-family: var(--ib-serif); font-size: 18px; font-weight: 700; margin: 0 0 8px; line-height: 1.3;
}
.ib-live-pinned .ib-live-update-text {
  font-size: 15px; line-height: 1.6; margin: 0 0 10px; color: var(--ib-black);
}
.ib-live-pinned .ib-live-update-meta {
  font-size: 12px; color: var(--ib-gray-400); display: flex; gap: 10px; align-items: center;
}

/* Feed aggiornamenti */
.ib-live-feed { margin-top: 12px; }

.ib-live-feed-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ib-gray-600); padding: 10px 0; border-bottom: 2px solid var(--ib-black);
  margin-bottom: 0;
}
.ib-live-feed-header-closed { color: var(--ib-gray-400); border-bottom-color: var(--ib-gray-200); }
.ib-live-dot-sm {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ib-red); animation: ib-dot-blink 1.2s ease-in-out infinite;
}
.ib-live-refresh-status { margin-left: auto; font-weight: 400; font-size: 11px; color: var(--ib-gray-400); }

/* Singolo aggiornamento */
.ib-live-update {
  display: grid; grid-template-columns: 52px 1fr; gap: 0 14px;
  border-bottom: 1px solid var(--ib-gray-100); padding: 18px 0;
  transition: background .2s;
}
.ib-live-update:target { background: #fffde7; }
.ib-live-update-is-pinned { background: #fafafa; }

/* Colonna ora */
.ib-live-update-time {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 3px;
}
.ib-live-update-hm {
  font-size: 14px; font-weight: 700; color: var(--ib-red); line-height: 1.2; white-space: nowrap;
}
.ib-live-update-date {
  font-size: 10px; color: var(--ib-gray-400); text-align: center; line-height: 1.3; white-space: nowrap;
}

/* Corpo aggiornamento */
.ib-live-update-body {}
.ib-live-update-title {
  font-family: var(--ib-serif); font-size: 17px; font-weight: 700;
  line-height: 1.35; margin: 0 0 8px; color: var(--ib-black);
}
.ib-live-update-text {
  font-size: 15px; line-height: 1.65; color: var(--ib-black);
  margin: 0 0 10px;
}
.ib-live-update-img {
  max-width: 100%; height: auto; border-radius: 3px; margin-bottom: 10px;
}
.ib-live-update-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ib-gray-400);
}
.ib-live-update-anchor {
  color: var(--ib-gray-200); font-weight: 700; text-decoration: none;
}
.ib-live-update-anchor:hover { color: var(--ib-gray-400); }
.ib-live-pinned-tag { font-size: 12px; }

/* Animazione nuovo aggiornamento (iniettato via JS) */
.ib-live-update-new {
  animation: ib-update-in .6s ease-out;
}
@keyframes ib-update-in {
  from { background: #fff3cd; }
  to   { background: transparent; }
}

/* Mobile */
@media (max-width: 680px) {
  .ib-live-update { grid-template-columns: 44px 1fr; gap: 0 10px; padding: 14px 0; }
  .ib-live-update-hm  { font-size: 13px; }
  .ib-live-update-title { font-size: 15px; }
  .ib-live-update-text  { font-size: 14px; }
}
