/* Theme8: areacmilano.it. One file, no framework. Sections: tokens, base, header, layout, content,
   old Bootstrap 3 classes used in dat/ (compat), ads, home hub, sidebar, footer. */

/* Tokens */
:root {
  --ink: #16213a;
  --ink-2: #3b4559;
  --muted: #667085;
  --line: #e2e6ee;
  --panel: #f4f6fa;
  --bg: #ffffff;
  --link: #0a58b8;
  --link-hover: #073f86;
  --accent: #d0102b;
  --nav: #16213a;
  --nav-ink: #ffffff;
  --note: #eef4fc;
  --radius: 10px;
  --wrap: 1140px;
  --gutter: 16px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Header: not fixed, so it never sits on top of Google's anchor ads */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.langs { display: flex; gap: 2px; }
.langs a {
  font-size: 0.8rem; font-weight: 600; color: var(--muted); text-decoration: none;
  padding: 6px 7px; border-radius: 6px;
}
.langs a:hover { background: var(--panel); color: var(--ink); }
.langs a.is-current { color: var(--ink); background: var(--panel); }

.main-nav { background: var(--nav); }
.main-nav ul {
  list-style: none; margin: 0 auto; display: flex; gap: 4px;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav a {
  display: block; color: var(--nav-ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 12px 12px; border-bottom: 3px solid transparent;
}
.main-nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--nav-ink); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.main-nav li:first-child a { margin-left: -12px; }
/* Phones: the menu scrolls sideways; the fade shows there is more */
@media (max-width: 767px) {
  .main-nav ul { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); padding-right: 40px; }
}

/* Layout: one reading column; a sidebar from 1024px */
.layout { padding-top: 20px; padding-bottom: 40px; }
.main { min-width: 0; }
@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-top: 28px; }
  .main { max-width: 740px; }
}

.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 16px; font-weight: 800; }
@media (min-width: 768px) { h1 { font-size: 2.2rem; } }

/* Content */
.content h2 { font-size: 1.4rem; line-height: 1.3; margin: 2em 0 0.5em; letter-spacing: -0.01em; }
.content h3 { font-size: 1.15rem; line-height: 1.35; margin: 1.6em 0 0.4em; }
.content h4 { font-size: 1rem; margin: 1.4em 0 0.3em; }
.content p, .content ul, .content ol { margin: 0 0 1em; }
.content ul, .content ol { padding-left: 1.4em; }
.content li { margin: 0.25em 0; }
.content strong { font-weight: 700; }
.content blockquote { margin: 1.2em 0; padding: 4px 16px; border-left: 4px solid var(--line); color: var(--ink-2); }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.content::after { content: ""; display: table; clear: both; }
.content { overflow-wrap: break-word; }

.table-scroll { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: var(--radius); }
.content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; border: 0; }
.content th, .content td { border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.content th { background: var(--panel); font-weight: 700; }
.content tr:last-child td { border-bottom: 0; }
.content th + th, .content td + td { border-left: 1px solid var(--line); }

/* Old Bootstrap 3 classes used in dat/ */
.img-responsive { display: block; max-width: 100%; height: auto; }
.img-thumbnail { padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.pull-left { float: left; margin: 0 16px 8px 0 !important; max-width: 40%; }
.pull-right { float: right; margin: 0 0 8px 16px; max-width: 40%; }
@media (max-width: 599px) { .pull-left, .pull-right { float: none; max-width: 160px; margin: 0 0 12px !important; } }
.well { background: var(--note); border-left: 4px solid var(--link); border-radius: var(--radius); padding: 14px 18px; margin: 1.4em 0; }
.well > :last-child { margin-bottom: 0; }
.embed-responsive { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); margin: 1em 0; }
.embed-responsive iframe, .embed-responsive-item { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.source-credit { font-size: 0.8rem; color: var(--muted); text-align: right; margin-top: -0.5em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Ads: reserved space so the text does not jump; an unfilled unit disappears */
.ad-slot { margin: 24px 0 28px; text-align: center; }
.ad-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-slot ins.adsbygoogle { min-height: 250px; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-placeholder {
  min-height: 250px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed #b8c0ce; border-radius: var(--radius); color: var(--muted); font-size: 0.85rem;
  background: repeating-linear-gradient(135deg, #fafbfc 0 12px, #f3f5f8 12px 24px);
}

/* Home hub */
.hub { margin: 0 0 28px; }
.status {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px;
  background: var(--panel); border-radius: var(--radius); padding: 12px 14px; font-size: 0.95rem;
}
.status-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 0.5em; }
.status a { font-weight: 600; white-space: nowrap; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
}
.card strong { color: var(--link); font-size: 1rem; }
.card span { color: var(--ink-2); font-size: 0.875rem; line-height: 1.4; }
.card:hover { border-color: var(--link); color: var(--ink); }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(4, 1fr); } }

/* Sidebar (below the text on phones) */
.side { margin-top: 32px; }
@media (min-width: 1024px) { .side { margin-top: 0; } }
.side h2 { font-size: 1rem; margin: 0 0 10px; }
.facts { background: var(--panel); border-radius: var(--radius); padding: 16px 18px; border-top: 4px solid var(--accent); }
.facts dl { margin: 0; }
.facts dl div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts dl div:last-child { border-bottom: 0; }
.facts dt { font-size: 0.8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: 0.95rem; line-height: 1.4; }
.facts .checked { margin: 8px 0 0; font-size: 0.75rem; color: var(--muted); }
.guides { margin-top: 24px; }
.guides ul { list-style: none; margin: 0; padding: 0; }
.guides li { border-bottom: 1px solid var(--line); }
.guides a { display: block; padding: 9px 0; text-decoration: none; font-size: 0.95rem; }
.guides a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Footer */
.site-footer { background: var(--panel); border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 0.9rem; }
.footer-links { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a, .footer-langs a, .copy a { color: var(--ink-2); }
.footer-langs { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.copy { margin: 0; color: var(--muted); }

/* Ads inside the text start below any floated image */
.content .ad-slot { clear: both; }

/* Read next: plain links, so the next page is one tap away */
.next { margin-top: 40px; }
.next h2 { font-size: 1.2rem; margin: 0 0 12px; }
.next ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .next ul { grid-template-columns: 1fr 1fr; } }
.next a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 0.95rem; line-height: 1.4;
}
.next a::after { content: "›"; font-size: 1.3rem; color: var(--muted); }
.next a:hover { border-color: var(--link); }
/* Phones and tablets: read next replaces the sidebar's guide list */
@media (max-width: 1023px) { .has-next .guides { display: none; } }

/* Contact form (contact-form.php) */
.contact-form { max-width: 560px; margin: 1.2em 0; }
.contact-form label { font-weight: 600; font-size: 0.95rem; }
.contact-form .form-control {
  width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--ink);
  border: 1px solid #c5ccd8; border-radius: 8px; background: #fff;
}
.contact-form .form-control:focus { outline: 2px solid var(--link); outline-offset: 1px; border-color: var(--link); }
.contact-form .btn { font: inherit; font-weight: 700; color: #fff; background: var(--link); border: 0; border-radius: 8px; padding: 10px 22px; cursor: pointer; }
.contact-form .btn:hover { background: var(--link-hover); }

/* Contact form states (Bootstrap 3 names, so theme3 styles them too) */
.contact-form .form-group { margin: 0 0 16px; }
.contact-form .help-block { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--muted); }
.contact-form .has-error .form-control { border-color: #c4314b; }
.contact-form .has-error .help-block, .contact-form .has-error label { color: #a3203a; }
.contact-form .btn[disabled] { opacity: 0.7; cursor: progress; }
.alert { border-radius: var(--radius); padding: 14px 18px; margin: 1.2em 0; border: 1px solid transparent; }
.alert:focus { outline: 2px solid var(--link); outline-offset: 2px; }
.alert-success { background: #e8f5ec; border-color: #b9dfc4; color: #14532d; }
.alert-success h2 { margin: 0 0 6px; font-size: 1.3rem; }
.alert-success p:last-child { margin-bottom: 0; }
.alert-danger { background: #fdecee; border-color: #f3c2c9; color: #7a1528; }
