/*
Theme Name:   Il Visionario
Theme URI:    https://ilvisionario.net
Description:  Tema figlio de Il Visionario su GeneratePress. Aspetto approvato col prototipo v1.10 (D50): carta crema, inchiostro, oro.
Author:       Il Visionario
Template:     generatepress
Version:      0.2.8
Requires PHP: 8.1
Text Domain:  ilv-child
License:      GPL-2.0-or-later
*/

/* ---------- Colori e caratteri (gli stessi del prototipo) ---------- */
:root {
  --ink: #121212;
  --paper: #FAFAF7;
  --paper-warm: #F2EEE4;
  --gold: #C9A24B;
  --gold-dark: #8C6A1E;
  --gold-deep: #7A5C17;
  --text-2: #3B3934;
  --text-3: #5E5B55;
  --rule: #DEDAD0;
  --rule-2: #C9C3B4;
  --up: #2E7D4F;
  --down: #B23A2E;
  --f-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-ui: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --w: 1240px;
  color-scheme: light;
}

/* ---------- Base ---------- */
body { background: var(--paper); color: var(--ink); font-family: var(--f-text); font-size: 17px; line-height: 1.55; }
a { color: inherit; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--f-text); font-weight: 700; color: var(--ink); text-wrap: balance; }
.ilv-wrap { max-width: var(--w); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ilv-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* GeneratePress: sfondi e contenitori sulla "carta" */
.site, .separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header,
.one-container .container, .separate-containers .paging-navigation, .inside-page-header, .sidebar .widget { background: transparent; }
.site-content { padding-top: 34px; }
.grid-container { max-width: var(--w); }

/* Pulsanti */
.ilv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--f-ui); font-size: 14px; font-weight: 600; padding: 10px 16px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; line-height: 1.2; border-radius: 0; text-decoration: none; }
.ilv-btn:hover, .ilv-btn:focus { text-decoration: none; background: var(--paper-warm); color: var(--ink); }
.ilv-btn-dark { background: var(--ink); color: var(--paper); }
.ilv-btn-dark:hover, .ilv-btn-dark:focus { background: #2a2a2a; color: var(--paper); }
button, input[type="submit"], .button, .wp-block-button__link { font-family: var(--f-ui); font-weight: 600; background: var(--ink); color: var(--paper); border-radius: 0; }
button:hover, input[type="submit"]:hover, .button:hover { background: #2a2a2a; color: var(--paper); }

/* ---------- Barra superiore ---------- */
.ilv-topbar { background: var(--ink); color: var(--paper-warm); font-family: var(--f-ui); font-size: 12.5px; }
.ilv-topbar .ilv-wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 8px; }
.ilv-topbar .ilv-mail { user-select: all; }

/* ---------- Testata ---------- */
.ilv-masthead { background: var(--paper); }
.ilv-masthead .ilv-wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding-block: 26px 22px; }
.ilv-opinion { display: flex; align-items: center; gap: 12px; font-family: var(--f-ui); font-size: 13px; line-height: 1.3; text-decoration: none; color: var(--ink); }
.ilv-opinion b { display: block; color: var(--gold-dark); letter-spacing: .1em; font-size: 11px; text-transform: uppercase; }
.ilv-avatar { width: 50px; height: 50px; border-radius: 50%; border: 2px solid var(--gold); display: grid; place-items: center; background: var(--paper-warm); font-family: var(--f-display); font-weight: 700; color: var(--gold-dark); flex: none; overflow: hidden; }
.ilv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ilv-brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); }
.ilv-brand:hover { text-decoration: none; }
.ilv-brand svg { flex: none; width: 68px; height: 68px; }
.ilv-brand-name { font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 5.2vw, 58px); line-height: 1; letter-spacing: -.01em; }
.ilv-brand-sub { font-family: var(--f-text); font-style: italic; color: var(--text-2); font-size: 16px; margin: 6px 0 0; text-align: center; }
.ilv-mast-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ilv-menu-btn { display: none; }
.ilv-search { display: none; border-top: 1px solid var(--rule); }
.ilv-search.is-open { display: block; }
.ilv-search .ilv-wrap { padding-block: 14px; }
.ilv-search form { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.ilv-search input[type="search"] { flex: 1; font-family: var(--f-ui); border: 1px solid var(--rule-2); background: #fff; padding: 10px 12px; }

/* ---------- Menu sezioni ---------- */
.ilv-nav { border-top: 3px double var(--ink); border-bottom: 1px solid var(--rule-2); background: var(--paper); }
.ilv-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; margin: 0; padding: 12px 0; list-style: none; font-family: var(--f-ui); font-weight: 600; font-size: 13.5px; letter-spacing: .05em; text-transform: uppercase; }
.ilv-nav li { margin: 0; }
.ilv-nav a { text-decoration: none; color: var(--ink); }
.ilv-nav a:hover { color: var(--gold-dark); }
.ilv-nav .current-menu-item > a, .ilv-nav .current-cat > a, .ilv-nav .current-menu-ancestor > a { color: var(--gold-dark); border-bottom: 2px solid var(--gold); padding-bottom: 4px; }
.ilv-nav .sub-menu, .ilv-nav .children { display: none; }

/* ---------- Articolo ---------- */
.ilv-kicker { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 6px; }
.ilv-kicker a { text-decoration: none; }
.single .entry-title { font-family: var(--f-text); font-weight: 700; font-size: clamp(30px, 4vw, 48px); line-height: 1.1; max-width: 22ch; }
.page .entry-title, .archive .page-title, .search .page-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; }
.archive .page-header, .search .page-header { border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 26px; }
.entry-meta { font-family: var(--f-ui); font-size: 13.5px; color: var(--text-3); }
.single header .entry-meta { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-block: 12px; margin-top: 20px; }
.entry-meta a { color: var(--ink); font-weight: 600; text-decoration: none; }
.single .featured-image { margin: 22px 0 0; }
.single .ilv-featured { margin: 22px 0 0; }
.single .featured-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.single .entry-content { max-width: 68ch; margin-top: 26px; font-size: 19px; line-height: 1.65; }
.entry-content p, .entry-content ul, .entry-content ol, .entry-content blockquote { margin-bottom: 1.05em; }
.entry-content h2, .entry-content h3, .entry-content h4 { line-height: 1.25; margin: 1.3em 0 .6em; }
.entry-content a { color: var(--gold-deep); text-decoration: underline; }
.entry-content blockquote { border-left: 3px solid var(--gold); padding: 0 0 0 16px; font-style: italic; color: var(--text-2); background: none; }
.single .entry-content .ilv-capolettera::first-letter { font-family: var(--f-display); float: left; font-size: 3.6em; line-height: .85; padding: 6px 8px 0 0; color: var(--gold-dark); }
footer.entry-meta { font-size: 13px; border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 28px; max-width: 68ch; }

/* Elenchi di articoli (archivi, ricerca) */
.blog .entry-title, .archive .entry-title, .search .entry-title { font-family: var(--f-text); font-size: 24px; line-height: 1.25; }
.blog .entry-title a, .archive .entry-title a, .search .entry-title a { text-decoration: none; color: var(--ink); }
.blog article, .archive article, .search article { border-bottom: 1px solid var(--rule); padding-bottom: 22px; margin-bottom: 22px; }
.entry-summary { color: var(--text-2); }

/* Barra laterale */
.widget-title { font-family: var(--f-ui); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.sidebar .widget li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-weight: 600; line-height: 1.3; }
.sidebar .widget a { text-decoration: none; }

/* Commenti (D40): moderati, stesso stile del giornale */
.comments-area { font-family: var(--f-ui); }
.comments-title, .comment-reply-title { font-family: var(--f-display); }

/* Condivisione e colonna dell'articolo */
.ilv-share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ilv-share a, .ilv-share button { font-family: var(--f-ui); font-size: 12.5px; font-weight: 600; border: 1px solid var(--rule-2); padding: 6px 10px; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.3; }
.ilv-share a:hover, .ilv-share button:hover { background: var(--paper-warm); color: var(--ink); text-decoration: none; }
.ilv-box { border: 1px solid var(--rule-2); padding: 18px; margin-bottom: 22px; }
.ilv-box .widget-title { margin-bottom: 4px; }
.ilv-box-follow { background: var(--paper-warm); border-color: var(--gold); }
.ilv-box-follow p { font-size: 15.5px; color: var(--text-2); margin-bottom: 14px; }
.ilv-related { list-style: none; margin: 0; padding: 0; }
.ilv-related li { padding: 12px 0; border-bottom: 1px solid var(--rule); font-weight: 600; line-height: 1.3; margin: 0; }
.ilv-related li:last-child { border-bottom: 0; }
.ilv-related a { text-decoration: none; color: var(--ink); }
.ilv-related a:hover { text-decoration: underline; }
.single .site-main { margin-right: 0; }

/* ---------- Piè di pagina ---------- */
.ilv-footer { background: var(--ink); color: #cfc9bb; font-family: var(--f-ui); font-size: 13px; }
.ilv-footer .ilv-wrap { display: grid; grid-template-columns: 1.2fr 2fr; gap: 30px; padding-block: 34px; }
.ilv-fbrand { display: flex; align-items: center; gap: 14px; }
.ilv-fbrand svg { flex: none; width: 56px; height: 56px; }
.ilv-fname { font-family: var(--f-display); font-size: 28px; color: #fff; font-weight: 700; margin: 0; line-height: 1.1; }
.ilv-fsub { font-family: var(--f-text); font-style: italic; color: var(--gold); margin: 4px 0 0; }
.ilv-flinks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 14px; padding: 0; list-style: none; }
.ilv-flinks li { margin: 0; }
.ilv-flinks a { color: #fff; text-decoration: none; }
.ilv-flinks a:hover { text-decoration: underline; }
.ilv-flegal { line-height: 1.6; margin: 0; }
.ilv-footer a:focus-visible { outline-color: var(--gold); }

/* ---------- Telefono ---------- */
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .ilv-topbar .ilv-mail { display: none; }
  .ilv-masthead .ilv-wrap { grid-template-columns: auto minmax(0, 1fr) auto; padding-block: 16px; gap: 12px; }
  .ilv-opinion, .ilv-mast-actions .ilv-btn-dark { display: none; }
  .ilv-menu-btn { display: inline-flex; }
  .ilv-masthead .ilv-btn { padding: 8px 10px; font-size: 13px; }
  .ilv-brand { justify-content: center; gap: 8px; }
  .ilv-brand svg { width: 42px; height: 42px; }
  .ilv-brand-name { font-size: 29px; white-space: nowrap; }
  .ilv-brand-sub { font-size: 12.5px; margin-top: 4px; }
  .ilv-nav ul { display: none; }
  .ilv-nav.is-open ul { display: grid; justify-content: stretch; gap: 0; padding-block: 4px; }
  .ilv-nav.is-open li { border-bottom: 1px solid var(--rule); }
  .ilv-nav.is-open a { display: block; padding: 12px 0; }
  .ilv-footer .ilv-wrap { grid-template-columns: minmax(0, 1fr); }
  .single .entry-content { font-size: 18px; }
  .single .entry-title { font-size: 31px; }
  .site-content { padding-top: 18px; }
}
