/* =========================
   PANOSPHERIC.COM – SITE CSS
   DRY single-source styling
   ========================= */

:root{
  --bg: #f9fafc;
  --text: #1a202c;
  --muted: #4b5563;

  --h1: #2c5282;
  --h2: #28547a;
  --h3: #1a365d;

  --link: #2563eb;
  --border: #e2e8f0;
  --tableHead: #ebf8ff;
  --card: #ffffff;

  --maxw: 900px;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* =========================
   HEADER + NAV (DESKTOP)
   ========================= */

.site-header{
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(249, 250, 252, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Logo */
.site-logo{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-logo img{
  height: 145px; /* desktop */
  width: auto;
  display: block;
}

/* Nav container */
.site-nav{
  display: flex;
  align-items: center;
}

/* Link row */
.nav-links{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Links */
.site-nav a,
.site-nav summary{
  font-size: 1.02rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.site-nav a:hover,
.site-nav summary:hover{
  background: #eef2ff;
}

/* Active underline */
.site-nav a.active,
.site-nav summary.active{
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  color: #1d4ed8;
  font-weight: 700;
}

/* Dropdown (desktop) */
details.nav-drop{
  position: relative;
}
details.nav-drop > summary::-webkit-details-marker{ display:none; }
details.nav-drop > summary::after{
  content: "▾";
  font-size: 0.95em;
  opacity: 0.85;
  margin-top: 1px;
}

.nav-dropdown{
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
  z-index: 1000;
  display: none;
}

.nav-dropdown::before{
  content:"";
  position:absolute;
  left:0; right:0;
  top:-10px;
  height:10px;
}


/* show dropdown when details open */
details.nav-drop[open] .nav-dropdown{
  display: block;
}

.nav-dropdown a{
  display: block;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  text-decoration: none;
  color: #0f172a;
}
.nav-dropdown a:hover{
  background: #f8fafc;
}

/* Hamburger hidden on desktop */
.nav-hamburger{ display: none; }

/* =========================
   PAGE / TYPOGRAPHY
   ========================= */

.page{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}

h1{
  font-size: clamp(1.7rem, 4.6vw, 2.6rem);
  line-height: 1.15;
  margin: 1.25rem 0 0.35rem;
  color: var(--h1);
}

h2{
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  line-height: 1.25;
  margin: 2.25rem 0 0.75rem;
  color: var(--h2);
}

h3{
  font-size: clamp(1.1rem, 2.6vw, 1.25rem);
  margin: 2rem 0 0.6rem;
  color: var(--h3);
}

p, li{
  font-size: 1.08rem;
  line-height: 1.7;
}

a{
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tables */
table{
  border-collapse: collapse;
  width: 100%;
  margin: 2.25rem 0;
  background: var(--card);
  box-shadow: 0 1px 4px #d1d5db33;
  overflow: hidden;
  border-radius: 10px;
}
th, td{
  border: 1px solid var(--border);
  padding: 0.8em 1.1em;
  text-align: left;
  vertical-align: top;
}
th{ background: var(--tableHead); }

/* Footer */
.footer{
  margin-top: 3rem;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.footer-logos{
  margin-top: 1rem;
  text-align: center;
}

.vr-logo{
  width: 150px;
  height: auto;
  margin-top: 1.5em;
}

/* =========================
   MOBILE (ONE BLOCK ONLY)
   Menu opens BELOW header
   ========================= */

@media (max-width: 768px){

  /* Header becomes 2-row: row1 logo+hamburger, row2 nav */
  .header-inner{
    flex-wrap: wrap;
    align-items: center;
  }

  /* Logo left */
  .site-logo{
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Mobile logo size (big but not insane) */
  .site-logo img{
    height: 145px;
  }

  /* Hamburger right */
  .nav-hamburger{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
	margin-right:5px;
  }

  /* NAV is forced onto a new row below header row */
  .site-nav{
    flex: 0 0 100%;
    width: 100%;
  }

  /* Link panel is normal flow, full width, stacked */
  .nav-links{
    display: none;              /* closed by default */
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  /* open state (your JS toggles .site-header.open) */
  .site-header.open .nav-links{
    display: flex;
  }

  .site-nav a,
  .site-nav summary{
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    font-size: 1rem;
  }

  /* Dropdown becomes stacked under the summary */
  details.nav-drop{
    width: 100%;
  }

  .nav-dropdown{
    position: static;
    display: block;
    border: none;
    box-shadow: none;
    padding: 0.35rem 0 0 12px;
    margin: 0;
    background: transparent;
  }

  .nav-dropdown a{
    border: 1px solid #eef2f7;
    background: #ffffff;
  }

  .page{
    padding: 1.25rem 0.9rem 2.25rem;
  }

  table{
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* =========================
   PANOSPHERIC TODAY – editorial helpers
   ========================= */

.page-head .subtitle{
  margin-top: 0.35rem;
  color: #334155;
}

.paper{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.25rem;
  margin-top: 1.25rem;
  box-shadow: 0 1px 4px #d1d5db33;
}

.callout{
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  margin: 1.1rem 0 1.25rem;
}

.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.chip{
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.95rem;
  color: #0f172a;
}

.grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.card{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: #ffffff;
}

.fine{
  font-size: 0.98rem;
  color: var(--muted);
}

.btnrow{
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.25rem 0 1rem;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  text-decoration: none;
}

.btn:hover{
  background: #eef2ff;
}

.hr{
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.foot{
  color: var(--muted);
  font-size: 1rem;
}

/* responsive cards */
@media (max-width: 768px){
  .grid{ grid-template-columns: 1fr; }
  .paper{ padding: 1rem; }
}

/* =========================
   WIKI DRAFT PAGES (DRY)
   ========================= */

.wiki-page{ padding-top: 1.2rem; }

.wiki-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 40px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

@media (max-width: 980px){
  .wiki-wrap{ grid-template-columns: 1fr; }
  .wiki-toc{ position: static; }
}

/* DRY: anchor targets should land BELOW sticky header */
.wiki-paper :where([id]) {
  scroll-margin-top: var(--header-offset, 160px);
}


.wiki-paper{
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 28px;
  box-shadow: 0 1px 4px #d1d5db33;
}

.wiki-h1{
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: normal;
  font-size: 2.1rem;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.wiki-tagline{
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.wiki-paper h2{
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: normal;
  font-size: 1.55rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 26px 0 10px;
}

.wiki-paper h3{
  font-weight: 600;
  font-size: 1.05rem;
  margin: 18px 0 8px;
}

.wiki-paper p{ margin: 10px 0; }

.wiki-toc{
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 10px;
  position: sticky;
  top: 14px;
  height: fit-content;
  box-shadow: 0 1px 4px #d1d5db33;
}

.wiki-toc h2{
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  margin: 0 0 8px;
  padding: 0;
}

.wiki-toc ol{
  margin: 0 0 0 18px;
  padding: 0;
  font-size: 0.95rem;
}

.wiki-toc li{ margin: 6px 0; }

.wiki-small{
  color: var(--muted);
  font-size: 0.92rem;
}

.wiki-toc-note{ margin-top: 10px; }

.wiki-infobox{
  float: right;
  width: 290px;
  margin: 6px 0 14px 18px;
  border: 1px solid var(--border);
  background: #fefefe;
  font-size: 0.92rem;
  border-radius: 10px;
  overflow: hidden;
}

@media (max-width: 760px){
  .wiki-infobox{
    float: none;
    width: 100%;
    margin: 10px 0 14px 0;
  }
}

.wiki-ibox-title{
  background: #eaecf0;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  font-weight: 700;
  text-align: center;
}

.wiki-ibox-table{
  width: 100%;
  border-collapse: collapse;
}

.wiki-ibox-table td{
  padding: 8px 10px;
  border-bottom: 1px solid #eaecf0;
  vertical-align: top;
}

.wiki-ibox-table td:first-child{
  color: var(--muted);
  width: 42%;
}

.wiki-refs{ font-size: 0.98rem; }

.wiki-refs ol{
  margin: 10px 0 0 18px;
  padding: 0;
}

.wiki-refs li{ margin: 12px 0; }

.wiki-note{
  background: #fff8db;
  border: 1px solid #f2c200;
  padding: 10px 12px;
  margin: 14px 0;
  font-size: 0.95rem;
  border-radius: 10px;
}

.wiki-foot{
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

sup.ref a{
  font-size: 0.8rem;
  vertical-align: super;
  text-decoration: none;
}
