/*
 * style_refresh.css
 * Restyling 2026 della homepage accademica di Gabriele D'Angelo.
 *
 * Questo file e' volutamente separato da style_modern.css: viene caricato
 * dopo i fogli esistenti e ne ridefinisce solo la presentazione. Il flusso
 * di generazione, gli include e l'upload restano invariati.
 */

body.modern {
  --refresh-bg: #f5f7f9;
  --refresh-surface: #ffffff;
  --refresh-surface-soft: #f8fafc;
  --refresh-text: #172235;
  --refresh-muted: #667085;
  --refresh-border: #dfe4ea;
  --refresh-border-strong: #cfd6df;
  --refresh-navy: #0f2a50;
  --refresh-navy-2: #173c6b;
  --refresh-red: #bb2e29;
  --refresh-red-soft: #fbefee;
  --refresh-link: #165aa7;
  --refresh-green: #2d8a57;
  --refresh-shadow: 0 14px 36px rgba(15, 42, 80, 0.075);
  --refresh-shadow-soft: 0 5px 18px rgba(15, 42, 80, 0.05);
  --refresh-radius: 16px;
  --refresh-radius-small: 12px;
  --refresh-page: 1300px;

  background: var(--refresh-bg);
  color: var(--refresh-text);
  font-size: 16px;
  line-height: 1.62;
}

body.modern a {
  color: var(--refresh-link);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-underline-offset: .18em;
  text-decoration-thickness: .08em;
}

/*
 * Normalizzazione tipografica dei link storici. style_main.css assegna alle
 * classi link/linksmall il vecchio Verdana a 11-12px: nel layout moderno
 * questo rendeva i collegamenti visibilmente piu' piccoli e con un carattere
 * diverso rispetto al testo circostante. Le classi continuano a controllare
 * colore, peso e sottolineatura, ma famiglia, corpo e interlinea ora seguono
 * il contesto in cui il link compare.
 */
body.modern :is(.link, .linksmall, .linksmallnu, .linksmallorange, .falselink) {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Anche le etichette storiche usate come contenitori di link devono avere
 * la stessa metrica del testo normale; il grassetto esplicito resta intatto. */
body.modern .titledarksmall {
  font-family: inherit;
  font-size: 1rem;
  line-height: inherit;
}

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
body.modern .gda-header {
  background: rgba(255, 255, 255, .98);
}

body.modern .brand-row {
  max-width: var(--refresh-page);
  margin: 0 auto;
  min-height: 72px;
  padding: 14px clamp(18px, 3vw, 36px);
  gap: 14px 28px;
}

body.modern .brand-row .brand {
  display: flex;
  align-items: center;
}

/* Secondary circular graphic mark: keeps the original Gd'A SVG untouched. */
body.modern .brand-row .brand::before {
  content: "";
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  margin-right: 11px;
  border-radius: 50%;
  background: #fff url("img/gda-symbol.jpg") center / cover no-repeat;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 42, 80, .14), 0 2px 8px rgba(15, 42, 80, .08);
}

body.modern .gda-logo-svg {
  width: 100px;
  height: auto;
  color: var(--refresh-navy);
}

body.modern .brand-row .little {
  max-width: 560px;
  color: #778294;
  font-size: .76rem;
  line-height: 1.35;
  font-style: italic;
}

body.modern .brand-row font[color="#FFFFFF"] {
  margin-left: auto;
}

body.modern .icon-nav {
  gap: 22px;
}

body.modern .icon-group {
  gap: 9px;
}

body.modern .icon-group--prefs {
  padding-left: 17px;
  border-left: 1px solid var(--refresh-border);
}

body.modern .icon-link {
  min-width: 34px;
  min-height: 34px;
  padding: 6px;
  color: var(--refresh-navy);
  border: 1px solid transparent;
  border-radius: 9px;
}

body.modern a.topnavbold.icon-link:hover,
body.modern .theme-toggle:hover {
  color: var(--refresh-red);
  background: var(--refresh-red-soft);
  border-color: #ecd3da;
  text-decoration: none;
}

body.modern .navy-rule {
  height: 3px;
  background: var(--refresh-red);
}

/* ---------------------------------------------------------------------
   Navigazione
   --------------------------------------------------------------------- */
body.modern .gda-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .965);
  border-bottom: 1px solid var(--refresh-border);
  box-shadow: 0 2px 12px rgba(15, 42, 80, .045);
  backdrop-filter: blur(12px);
}

body.modern .nav-inner {
  max-width: var(--refresh-page);
  margin: 0 auto;
  padding: 8px clamp(18px, 3vw, 36px);
  gap: 8px 24px;
}

body.modern .gda-nav .navpipe {
  color: transparent;
  font-size: 0;
}

body.modern .gda-nav .nav {
  position: relative;
  color: var(--refresh-navy);
  font-size: .88rem;
  font-weight: 680;
  letter-spacing: 0;
  padding: 8px 10px;
  margin-right: 2px;
  border-radius: 8px;
}

body.modern .gda-nav .nav::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--refresh-red);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .16s ease;
}

body.modern .gda-nav .nav:hover,
body.modern .gda-nav .nav:focus-visible {
  color: var(--refresh-red);
  background: var(--refresh-red-soft);
  text-decoration: none;
}

body.modern .gda-nav .nav:hover::after,
body.modern .gda-nav .nav:focus-visible::after {
  transform: scaleX(1);
}

body.modern .whitedate,
body.modern .updated {
  color: var(--refresh-muted);
  font-size: .78rem;
}

/* ---------------------------------------------------------------------
   Homepage: shell e sidebar
   --------------------------------------------------------------------- */
body.modern.home-page .gda-main {
  max-width: var(--refresh-page);
  margin: 0 auto;
  grid-template-columns: minmax(270px, 314px) minmax(0, 1fr);
  gap: clamp(30px, 3vw, 46px);
  padding: 32px clamp(18px, 3vw, 36px) 62px;
}

body.modern.home-page .gda-sidebar {
  min-width: 0;
}

body.modern.home-page .crest-row {
  gap: 18px;
  min-height: 108px;
  margin: 0 0 16px;
  padding: 16px 22px;
  align-items: center;
  justify-content: center;
  background: var(--refresh-surface);
  border: 1px solid var(--refresh-border);
  border-radius: var(--refresh-radius);
  box-shadow: var(--refresh-shadow-soft);
}

body.modern.home-page .crest-row img {
  width: auto;
  max-width: calc(50% - 12px);
  max-height: 76px;
  object-fit: contain;
}

body.modern.home-page .info-card {
  margin-bottom: 18px;
  padding: 2px 20px 5px;
  background: var(--refresh-surface);
  border: 1px solid var(--refresh-border);
  border-radius: var(--refresh-radius);
  box-shadow: var(--refresh-shadow-soft);
}

body.modern.home-page .info-identity {
  padding: 19px 0 16px;
  border-bottom: 1px solid var(--refresh-border);
}

body.modern.home-page .info-identity__name {
  color: var(--refresh-navy);
  font-size: 1.43rem;
  line-height: 1.15;
  letter-spacing: -.025em;
}

body.modern.home-page .info-identity__role {
  margin-top: 7px;
  color: var(--refresh-red);
  font-size: .77rem;
  font-weight: 760;
  letter-spacing: .055em;
  text-transform: uppercase;
}

body.modern.home-page .info-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--refresh-border);
}

body.modern.home-page .info-row:last-child {
  border-bottom: 0;
}

body.modern.home-page .info-row dt {
  margin-bottom: 8px;
  color: var(--refresh-navy);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .085em;
  text-transform: uppercase;
}

body.modern.home-page .info-row dd,
body.modern.home-page .info-row dd em,
body.modern.home-page .sitenews {
  color: var(--refresh-muted);
  font-size: .82rem;
  line-height: 1.55;
}

body.modern.home-page .info-tag {
  margin: 3px 4px 3px 0;
  padding: 5px 9px;
  color: #344054;
  background: #f1f4f7 !important;
  border: 1px solid #dfe4e9;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 670;
}

body.modern.home-page .sidebar-footer {
  margin-top: 4px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  color: var(--refresh-muted);
  background: var(--refresh-surface);
  border: 1px solid var(--refresh-border);
  border-top: 3px solid var(--refresh-red);
  border-radius: var(--refresh-radius-small);
  box-shadow: var(--refresh-shadow-soft);
}

body.modern.home-page .personal-footer__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

body.modern.home-page .sidebar-footer img.jpolis {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  opacity: .9;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 42, 80, .08);
}

body.modern.home-page .personal-footer__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

body.modern.home-page .personal-footer__name {
  color: var(--refresh-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .86rem;
  font-weight: 700;
}

body.modern.home-page .personal-footer__copyright {
  margin-top: 3px;
  color: var(--refresh-muted);
  font-size: .66rem;
  white-space: nowrap;
}

body.modern.home-page .sidebar-footer .footer-social {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.modern.home-page .sidebar-footer .footer-social .icon-link {
  min-width: 29px;
  min-height: 29px;
  width: 29px;
  height: 29px;
  padding: 5px;
  color: #657184;
  background: #f5f7f9;
  border: 1px solid #e2e7ec;
  border-radius: 8px;
}

body.modern.home-page .sidebar-footer .footer-social .icon-link svg {
  width: 17px;
  height: 17px;
}

body.modern.home-page .sidebar-footer .footer-social .icon-link:hover {
  color: var(--refresh-red);
  background: var(--refresh-red-soft);
  border-color: rgba(187, 46, 41, .18);
}

/* ---------------------------------------------------------------------
   Homepage: hero
   --------------------------------------------------------------------- */
body.modern .home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 212px;
  margin: 0 0 16px;
  padding: clamp(28px, 4vw, 40px) clamp(28px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 83% 28%, rgba(22, 90, 167, .11) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 72%, rgba(187, 46, 41, .10) 0 2px, transparent 3px),
    linear-gradient(122deg, #eef4fa 0%, #f8fafc 50%, #f2f5f8 100%);
  border: 1px solid #d8e0e9;
  border-radius: var(--refresh-radius);
  box-shadow: var(--refresh-shadow-soft);
}

body.modern .home-hero::before {
  content: "Gd'A";
  position: absolute;
  z-index: -1;
  right: 24px;
  bottom: -50px;
  color: rgba(15, 42, 80, .055);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(8rem, 15vw, 12.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.08em;
  user-select: none;
}

body.modern .home-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 18px 20px 18px auto;
  width: 38%;
  opacity: .32;
  background-image:
    linear-gradient(27deg, transparent 48.8%, rgba(15, 42, 80, .16) 49%, rgba(15, 42, 80, .16) 50%, transparent 50.2%),
    linear-gradient(153deg, transparent 48.8%, rgba(187, 46, 41, .12) 49%, rgba(187, 46, 41, .12) 50%, transparent 50.2%);
  background-size: 58px 58px;
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}

body.modern .home-hero__eyebrow {
  margin: 0 0 9px;
  color: var(--refresh-red);
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.modern .home-hero__affiliation {
  margin: -4px 0 12px;
  color: var(--refresh-muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .025em;
}

body.modern .home-hero h2 {
  max-width: none;
  margin: 0;
  color: var(--refresh-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.35vw, 2.15rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.025em;
}

@media (min-width: 1100px) {
  body.modern .home-hero h2 {
    white-space: nowrap;
  }
}

body.modern .home-hero__lead {
  max-width: 760px;
  margin: 15px 0 0;
  color: #42536a;
  font-size: .98rem;
  line-height: 1.55;
}

body.modern .home-hero__profile {
  max-width: 760px;
  margin: 18px 0 0;
  padding: 13px 0 0 15px;
  border-top: 1px solid rgba(15, 42, 80, .10);
  border-left: 2px solid rgba(187, 46, 41, .38);
  color: #5d6b7d;
  font-size: .84rem;
  line-height: 1.55;
}

body.modern .home-hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 18px;
}

body.modern .home-hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--refresh-navy);
  font-size: .82rem;
  font-weight: 720;
  text-decoration: none;
}

body.modern .home-hero__links a::after {
  content: "→";
  color: var(--refresh-red);
  transition: transform .15s ease;
}

body.modern .home-hero__links a:hover::after {
  transform: translateX(3px);
}

/* ---------------------------------------------------------------------
   Homepage: shortcut cards
   --------------------------------------------------------------------- */
body.modern .quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin: 0 0 20px;
}

body.modern .qcard {
  --card-accent: var(--refresh-red);
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  justify-content: stretch;
  min-height: 90px;
  padding: 14px 14px 14px 16px;
  color: var(--refresh-navy);
  text-align: left;
  background: var(--refresh-surface) !important;
  border: 1px solid var(--refresh-border);
  border-radius: var(--refresh-radius-small);
  box-shadow: none;
  overflow: hidden;
}

body.modern .qcard::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--card-accent);
}

body.modern .qcard__icon {
  grid-row: 1 / 3;
  width: 37px;
  height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--card-accent);
  background: #f3f6f9;
  border-radius: 10px;
}

body.modern .qcard__icon svg {
  width: 22px;
  height: 22px;
}

body.modern .qcard__title {
  align-self: end;
  color: var(--refresh-navy);
  font-size: .89rem;
  font-weight: 740;
  line-height: 1.22;
}

body.modern .qcard__meta {
  align-self: start;
  margin-top: 4px;
  color: var(--refresh-muted);
  font-size: .7rem;
  font-weight: 500;
  line-height: 1.28;
}

body.modern .qcard:hover {
  transform: translateY(-2px);
  border-color: var(--refresh-border-strong);
  box-shadow: 0 10px 25px rgba(15, 42, 80, .09);
  text-decoration: none;
}

body.modern .qcard--teal   { --card-accent: #147c72; }
body.modern .qcard--red    { --card-accent: var(--refresh-red); }
body.modern .qcard--orange { --card-accent: #bd6f1d; }
body.modern .qcard--yellow { --card-accent: #a18716; }
body.modern .qcard--cyan   { --card-accent: #1d8090; }
body.modern .qcard--green  { --card-accent: #31824e; }
body.modern .qcard--violet { --card-accent: #7c4d9a; }
body.modern .qcard--blue   { --card-accent: #3564a7; }

/* ---------------------------------------------------------------------
   Homepage: attivita e pubblicazioni
   --------------------------------------------------------------------- */
body.modern .home-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 16px;
  align-items: start;
}

body.modern .home-panels .section-block {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--refresh-surface);
  border: 1px solid var(--refresh-border);
  border-radius: var(--refresh-radius);
  box-shadow: var(--refresh-shadow-soft);
}

body.modern .home-panels .section-block h2 {
  margin: 0;
  padding: 15px 19px;
  border: 0;
  border-bottom: 1px solid var(--refresh-border);
  background: #fbfcfd;
  color: var(--refresh-navy);
  font-size: .98rem;
  line-height: 1.3;
}

body.modern .home-panels .section-block h2 a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

body.modern .home-panels .section-block h2 a::after {
  content: "→";
  color: var(--refresh-link);
  font-weight: 500;
}

body.modern .home-panels .activity-list,
body.modern .home-panels .pub-list {
  padding: 4px 18px 7px;
}

body.modern .home-panels .activity-list li,
body.modern .home-panels .pub-list li {
  padding: 12px 3px;
  border-bottom: 1px solid #e9edf1;
}

/* Nelle ultime attivita' il ruolo vive su una riga propria: la descrizione
   ha cosi' tutta la larghezza disponibile e i nomi lunghi delle riviste
   non vengono spezzati in modo casuale accanto al badge. */
body.modern .home-panels .activity-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

body.modern .home-panels .activity-list .titledarksmallredonyellow {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 3px 8px;
  color: #8b211e;
  background: rgba(187, 46, 41, .09);
  border: 1px solid rgba(187, 46, 41, .16);
}

body.modern .home-panels .activity-list .text {
  display: block;
  min-width: 0;
  color: #4f5d70;
  font-size: .82rem;
  line-height: 1.43;
}

body.modern .home-panels .activity-list li:hover,
body.modern .home-panels .pub-list li:hover {
  background: #fafbfd;
}

body.modern .home-panels .text {
  color: #5d6878;
  font-size: .83rem;
  line-height: 1.46;
}

body.modern .home-panels .titledarksmallredonyellow {
  margin-bottom: 4px;
  color: #7e4c05;
  background: #fff2cf;
  font-size: .68rem;
  border-radius: 999px;
}

body.modern .home-panels .titlevdarksmallred {
  color: var(--refresh-navy);
  font-size: .85rem;
  line-height: 1.35;
}

body.modern .home-panels .titlevdarksmallred a {
  color: var(--refresh-navy);
  text-decoration: none;
}

body.modern .home-panels .titlevdarksmallred a:hover {
  color: var(--refresh-link);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Pagine interne
   --------------------------------------------------------------------- */
body.modern .gda-page-main {
  max-width: var(--refresh-page);
  margin: 0 auto;
  padding: 32px clamp(18px, 3vw, 36px) 58px;
  gap: clamp(24px, 3vw, 38px);
}

body.modern:has(.gda-sidebar-col) .gda-page-main {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 304px);
}

body.modern .gda-content-col {
  background: var(--refresh-surface);
  border: 1px solid var(--refresh-border);
  border-radius: var(--refresh-radius);
  box-shadow: var(--refresh-shadow-soft);
}

/* Le card laterali delle pagine interne ereditavano ancora la palette
   pastello storica. Le manteniamo riconoscibili con un accento cromatico,
   ma usiamo superfici neutre coerenti con la homepage. */
body.modern .gda-sidebar-col .note {
  --note-accent: var(--refresh-red);
  position: relative;
  margin: 0 0 13px;
  padding: 15px 16px 14px 18px;
  background: var(--refresh-surface) !important;
  border: 1px solid var(--refresh-border);
  border-left: 4px solid var(--note-accent);
  border-radius: 12px;
  box-shadow: var(--refresh-shadow-soft);
}

body.modern .gda-sidebar-col .note::before {
  display: none !important;
}

body.modern .gda-sidebar-col .note.red     { --note-accent: var(--refresh-red); }
body.modern .gda-sidebar-col .note.orange  { --note-accent: #bd6f1d; }
body.modern .gda-sidebar-col .note.yellow  { --note-accent: #a18716; }
body.modern .gda-sidebar-col .note.cyan    { --note-accent: #1d8090; }
body.modern .gda-sidebar-col .note.green   { --note-accent: #31824e; }
body.modern .gda-sidebar-col .note.violet  { --note-accent: #7c4d9a; }
body.modern .gda-sidebar-col .note.teal    { --note-accent: #147c72; }

body.modern .gda-sidebar-col .note .titledarksmall,
body.modern .gda-sidebar-col .note .titledarksmall a {
  color: var(--refresh-navy);
}

body.modern .gda-sidebar-col .note .text {
  color: var(--refresh-muted);
  line-height: 1.48;
}

body.modern .gda-content-col > table {
  width: 100% !important;
}

body.modern .gda-content-col > table > tbody > tr > td {
  background: transparent !important;
}

body.modern .gda-content-col > table > tbody > tr > td:not([rowspan]) {
  padding-top: 6px;
  padding-bottom: 6px;
}

body.modern .gda-content-col .navpipe {
  color: var(--refresh-navy);
}

body.modern .gda-content-col h2.navpipe,
body.modern .gda-content-col h3.subtitle,
body.modern .gda-content-col .subtitle {
  color: var(--refresh-navy);
}

body.modern .gda-content-col a.link,
body.modern .gda-content-col a.linksmall,
body.modern .gda-content-col a.linksmallnu {
  color: var(--refresh-link);
}

body.modern .gda-sidebar-col > table {
  background: var(--refresh-surface) !important;
  border-color: var(--refresh-border);
  border-radius: var(--refresh-radius);
  box-shadow: var(--refresh-shadow-soft);
}

body.modern .gda-sidebar-col .note {
  border-radius: 12px;
}

body.modern .gda-footer-table {
  border-image: linear-gradient(90deg, var(--refresh-red), var(--refresh-red)) 1;
}

body.modern .address-table,
body.modern .quick-feature {
  border-color: var(--refresh-border);
  box-shadow: var(--refresh-shadow-soft);
}

/* ---------------------------------------------------------------------
   Focus, motion e responsive
   --------------------------------------------------------------------- */
body.modern a:focus-visible,
body.modern button:focus-visible {
  outline: 3px solid rgba(187, 46, 41, .28);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  body.modern .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.modern .home-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body.modern .brand-row {
    min-height: 0;
    padding-top: 13px;
    padding-bottom: 13px;
  }

  body.modern .brand-row .little {
    display: none;
  }

  body.modern .brand-row font[color="#FFFFFF"] {
    margin-left: auto;
  }

  body.modern .nav-inner {
    align-items: flex-start;
  }

  body.modern .gda-nav .nav {
    padding-left: 7px;
    padding-right: 7px;
  }

  body.modern.home-page .gda-main {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }

  body.modern.home-page .gda-content {
    order: 1;
  }

  body.modern.home-page .gda-sidebar {
    order: 2;
  }

  body.modern.home-page .gda-sidebar {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr);
    gap: 14px;
  }

  body.modern.home-page .crest-row {
    margin: 0;
  }

  body.modern.home-page .info-card {
    margin: 0;
  }

  body.modern.home-page .sidebar-footer {
    grid-column: 1 / -1;
  }

  body.modern:has(.gda-sidebar-col) .gda-page-main {
    grid-template-columns: 1fr;
  }

  body.modern .gda-content-col {
    border-radius: 13px;
  }
}

@media (max-width: 620px) {
  body.modern .gda-logo-svg {
    width: 88px;
  }

  body.modern .icon-nav {
    gap: 8px;
  }

  body.modern .icon-group--prefs {
    padding-left: 8px;
  }

  body.modern .nav-inner {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  body.modern .menu1-table + .updated,
  body.modern .whitedate,
  body.modern .updated {
    display: none;
  }

  body.modern.home-page .gda-sidebar {
    display: block;
  }

  body.modern.home-page .crest-row,
  body.modern.home-page .info-card {
    margin-bottom: 14px;
  }

  body.modern .home-hero {
    min-height: 0;
    padding: 26px 22px;
  }

  body.modern .home-hero__title-break {
    display: none;
  }

  body.modern .home-hero::after {
    display: none;
  }

  body.modern .home-hero__lead {
    font-size: .91rem;
  }

  body.modern .home-hero__profile {
    margin-top: 16px;
    padding: 11px 0 0 12px;
    font-size: .82rem;
  }

  body.modern .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.modern .qcard {
    min-height: 78px;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 9px;
    padding: 12px 10px 12px 13px;
  }

  body.modern .qcard__icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  body.modern .qcard__icon svg {
    width: 19px;
    height: 19px;
  }

  body.modern .qcard__title {
    grid-row: 1 / 3;
    align-self: center;
    font-size: .82rem;
    line-height: 1.22;
  }

  body.modern .qcard__meta {
    display: none;
  }

  body.modern .home-panels .section-block h2 {
    padding-left: 16px;
    padding-right: 16px;
  }

  body.modern .home-panels .activity-list,
  body.modern .home-panels .pub-list {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 345px) {
  body.modern .quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.modern *,
  body.modern *::before,
  body.modern *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* ---------------------------------------------------------------------
   Dark mode
   --------------------------------------------------------------------- */
html.dark-mode body.modern {
  --refresh-bg: #10151c;
  --refresh-surface: #171d26;
  --refresh-surface-soft: #1c2430;
  --refresh-text: #e9edf3;
  --refresh-muted: #a9b2c0;
  --refresh-border: #2b3543;
  --refresh-border-strong: #394759;
  --refresh-navy: #edf3fb;
  --refresh-navy-2: #c9dcf3;
  --refresh-red: #bb2e29;
  --refresh-red-soft: #2c1d24;
  --refresh-link: #8abaf0;
  --refresh-shadow: none;
  --refresh-shadow-soft: none;

  background: var(--refresh-bg);
  color: var(--refresh-text);
}

html.dark-mode body.modern .gda-header,
html.dark-mode body.modern .gda-nav,
html.dark-mode body.modern.home-page .crest-row,
html.dark-mode body.modern.home-page .info-card,
html.dark-mode body.modern .qcard,
html.dark-mode body.modern .home-panels .section-block,
html.dark-mode body.modern .gda-content-col,
html.dark-mode body.modern .gda-sidebar-col > table {
  background: var(--refresh-surface) !important;
}

html.dark-mode body.modern .gda-sidebar-col .note {
  background: var(--refresh-surface) !important;
  border-color: var(--refresh-border);
  box-shadow: none;
}

html.dark-mode body.modern .gda-nav,
html.dark-mode body.modern .home-panels .section-block h2 {
  border-color: var(--refresh-border);
}

html.dark-mode body.modern .home-panels .section-block h2 {
  background: #151b23;
}

html.dark-mode body.modern .home-hero {
  background:
    radial-gradient(circle at 83% 28%, rgba(138, 186, 240, .12) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 72%, rgba(187, 46, 41, .14) 0 2px, transparent 3px),
    linear-gradient(122deg, #172331 0%, #171d26 55%, #1b222c 100%);
  border-color: var(--refresh-border);
}

html.dark-mode body.modern .home-hero::before {
  color: rgba(237, 243, 251, .04);
}


html.dark-mode body.modern .home-hero__eyebrow {
  color: #f0f3f7;
}

html.dark-mode body.modern .gda-nav .nav:hover,
html.dark-mode body.modern .gda-nav .nav:focus-visible,
html.dark-mode body.modern a.topnavbold.icon-link:hover,
html.dark-mode body.modern .theme-toggle:hover {
  color: #ffffff;
}

html.dark-mode body.modern .home-panels .activity-list .titledarksmallredonyellow {
  color: #f3d1cf;
  background: rgba(187, 46, 41, .16);
  border-color: rgba(187, 46, 41, .32);
}

html.dark-mode body.modern.home-page .sidebar-footer .footer-social .icon-link {
  color: #b7c0cd;
  background: #202936;
  border-color: #354252;
}

html.dark-mode body.modern.home-page .sidebar-footer .footer-social .icon-link:hover {
  color: #ffffff;
  background: rgba(187, 46, 41, .18);
  border-color: rgba(187, 46, 41, .38);
}

html.dark-mode body.modern .home-hero__profile {
  color: #aeb8c6;
  border-top-color: rgba(255, 255, 255, .08);
  border-left-color: rgba(187, 46, 41, .52);
}

html.dark-mode body.modern .home-hero__lead,
html.dark-mode body.modern .qcard__meta,
html.dark-mode body.modern .home-panels .text,
html.dark-mode body.modern.home-page .info-row dd,
html.dark-mode body.modern.home-page .info-row dd em,
html.dark-mode body.modern.home-page .sitenews {
  color: var(--refresh-muted);
}

html.dark-mode body.modern.home-page .info-tag {
  color: #cbd5e1;
  background: #222b37 !important;
  border-color: #354252;
}

html.dark-mode body.modern .qcard__icon {
  background: #202936;
}

html.dark-mode body.modern .home-panels .activity-list li,
html.dark-mode body.modern .home-panels .pub-list li {
  border-bottom-color: var(--refresh-border);
}

html.dark-mode body.modern .home-panels .activity-list li:hover,
html.dark-mode body.modern .home-panels .pub-list li:hover {
  background: #1b222c;
}

/* Random quote: keep the attribution visually separate from the quotation. */
body.modern .brand-row .quote-text,
body.modern .brand-row .quote-author {
  display: block;
}

body.modern .brand-row .quote-author {
  margin-top: .16rem;
  color: #8b93a1;
  font-size: .72rem;
  line-height: 1.25;
}

/* =====================================================================
   Shared personal footer component - home and all internal pages
   ===================================================================== */
body.modern .personal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

body.modern .personal-footer__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

body.modern .personal-footer img.jpolis {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: cover;
  opacity: 1;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 42, 80, .12), 0 2px 7px rgba(15, 42, 80, .07);
}

body.modern .personal-footer__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

body.modern .personal-footer__name {
  color: var(--refresh-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .01em;
}

body.modern .personal-footer__copyright {
  margin-top: 4px;
  color: var(--refresh-muted);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .025em;
  white-space: nowrap;
}

body.modern .personal-footer .footer-social {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

body.modern .personal-footer .footer-social .icon-link {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #657184;
  background: #f5f7f9;
  border: 1px solid #e2e7ec;
  border-radius: 8px;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

body.modern .personal-footer .footer-social .icon-link:hover {
  color: var(--refresh-red);
  background: #fff;
  border-color: rgba(187, 46, 41, .32);
  transform: translateY(-1px);
}

body.modern .personal-footer .footer-social .icon-link svg {
  width: 17px;
  height: 17px;
}

/* Internal pages: turn the old footer table into the same quiet card used
   by the homepage sidebar. The legacy table remains only as a generator
   compatibility shell. */
body.modern .gda-footer-table {
  width: min(100%, 620px) !important;
  margin: 20px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-image: none !important;
  background: transparent !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

body.modern .gda-footer-table > tbody > tr:not(:last-child),
body.modern .gda-footer-table > tr:not(:last-child) {
  display: none;
}

body.modern .gda-footer-table .personal-footer-cell {
  padding: 0 !important;
  background: transparent !important;
}

body.modern .personal-footer--page {
  padding: 11px 12px;
  color: var(--refresh-muted);
  background: var(--refresh-surface);
  border: 1px solid var(--refresh-border);
  border-top: 3px solid var(--refresh-red);
  border-radius: var(--refresh-radius-small);
  box-shadow: var(--refresh-shadow-soft);
}

/* Homepage: the outer sidebar-footer remains the card; avoid a nested card. */
body.modern.home-page .sidebar-footer .personal-footer--home {
  width: 100%;
}

/* Dark mode for both variants. */
html.dark-mode body.modern .personal-footer__name {
  color: #f3f6fa;
}

html.dark-mode body.modern .personal-footer .footer-social .icon-link {
  color: #b9c2cf;
  background: #202936;
  border-color: #354252;
}

html.dark-mode body.modern .personal-footer .footer-social .icon-link:hover {
  color: #fff;
  background: #27313e;
  border-color: rgba(187, 46, 41, .65);
}

html.dark-mode body.modern .personal-footer--page {
  background: var(--refresh-surface);
  border-color: var(--refresh-border);
  border-top-color: var(--refresh-red);
}

@media (max-width: 560px) {
  body.modern .brand-row .brand::before {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    margin-right: 8px;
  }

  body.modern .personal-footer,
  body.modern .personal-footer--page {
    gap: 10px;
  }

  body.modern .personal-footer img.jpolis {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  body.modern .personal-footer .footer-social .icon-link {
    width: 29px;
    height: 29px;
    min-width: 29px;
    min-height: 29px;
  }
}
