*, *::before, *::after { box-sizing: border-box; }
:root { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
body { margin: 0; background: #0b0f14; color: #e9eef6; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.site-header { background: #0f1621; border-bottom: 1px solid #1c2a3b; }
.brand-title { font-weight: 800; letter-spacing: 0.3px; }
.brand-sub { opacity: 0.8; font-size: 0.95rem; margin-top: 2px; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nav a { color: #cfe4ff; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.nav a:hover { background: #172235; }
.pill { border: 1px solid #2b4a73; }
.card { background: #101a26; border: 1px solid #1c2a3b; border-radius: 16px; padding: 14px; margin: 14px 0; }
h1,h2 { margin: 8px 0 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #1c2a3b; padding: 10px; text-align: left; vertical-align: top; }
th { opacity: 0.85; font-weight: 700; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #18273a; border: 1px solid #274567; font-size: 0.85rem; }
input, textarea, select { width: 100%; padding: 10px; border-radius: 12px; border: 1px solid #29435f; background: #0c131d; color: #e9eef6; }
button { padding: 10px 14px; border-radius: 12px; border: 1px solid #2b4a73; background: #13243a; color: #e9eef6; cursor: pointer; }
button:hover { background: #172c46; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px){ .grid { grid-template-columns: 1fr; } }
.site-footer { border-top: 1px solid #1c2a3b; background: #0f1621; opacity: 0.9; }
small { opacity: 0.8; }
hr { border:0; border-top:1px solid #1c2a3b; margin: 16px 0; }
.actions { display:flex; gap:8px; flex-wrap:wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.logo { height: 56px; width: auto; border-radius: 12px; border: 1px solid #1c2a3b; background: #0b0f14; padding: 6px; }
.brand { display:flex; gap:12px; align-items:center; }

/* Calendar widget */
.cal-wrap { border:1px solid #1c2a3b; background: rgba(11,15,20,.6); border-radius: 16px; padding: 12px; }
.cal-head { display:flex; align-items:center; justify-content: space-between; gap:10px; margin-bottom:10px; }
.cal-head .cal-title { font-weight:700; letter-spacing:.2px; }
.cal-head .cal-nav { display:flex; gap:8px; }
.cal-btn { cursor:pointer; border:1px solid #1c2a3b; background: rgba(14,20,30,.75); color: inherit; padding: 6px 10px; border-radius: 12px; }
.cal-grid { display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; }
.cal-dow { font-size: 12px; opacity:.75; text-align:center; padding:4px 0; }
.cal-day { border:1px solid #1c2a3b; background: rgba(14,20,30,.55); border-radius: 12px; padding: 8px 0; text-align:center; cursor:pointer; user-select:none; }
.cal-day.off { opacity:.35; cursor: default; }
.cal-day.has { outline: 2px solid rgba(0, 255, 200, .35); }
.cal-day.sel { outline: 2px solid rgba(255, 0, 200, .45); }
.cal-day:hover { filter: brightness(1.12); }
.cal-legend { display:flex; gap:10px; margin-top:10px; font-size: 12px; opacity:.8; }
.cal-dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.cal-dot.has { background: rgba(0,255,200,.6); }
.cal-dot.sel { background: rgba(255,0,200,.65); }

/* Collapsible sections */
.collap { border:1px solid #1c2a3b; background: rgba(11,15,20,.55); border-radius: 16px; overflow:hidden; }
.collap > summary { cursor:pointer; padding: 14px 16px; font-weight:700; list-style:none; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.collap > summary::-webkit-details-marker { display:none; }
.collap .collap-body { padding: 14px 16px; border-top:1px solid #1c2a3b; }
.collap .chev { opacity:.8; transition: transform .15s ease; }
.collap[open] .chev { transform: rotate(90deg); }

/* Net status highlighting */
tr.talking { outline: 2px solid rgba(255,0,200,.55); background: rgba(255,0,200,.08); }
tr.left { opacity: .55; }


/* Responsive layout */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .nav { flex-wrap: wrap; }
  table { display:block; overflow-x:auto; white-space: nowrap; }
  .card { padding: 14px; }
}

@media (max-width: 520px) {
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .pill, button { padding: 10px 12px; }
  input, select, textarea { font-size: 16px; } /* prevent iOS zoom */
  .logo { max-width: 160px; }
}


/* Cool buttons / link pills */
.actions, .quick-links { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.btn, .pill, a.pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  text-decoration:none;
  line-height: 1;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover, .pill:hover, a.pill:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.28); transform: translateY(-1px); }
.btn:active, .pill:active, a.pill:active { transform: translateY(0px); }
.btn.primary, a.pill.primary {
  border-color: rgba(255,0,200,.35);
  background: rgba(255,0,200,.10);
}
.btn.primary:hover, a.pill.primary:hover { background: rgba(255,0,200,.14); }

/* Better contrast for buttons */
.btn, .pill, a.pill { color: var(--text); }
.btn.primary, a.pill.primary { color: #fff; }
.btn.primary, a.pill.primary {
  border-color: rgba(255,79,216,.55);
  background: radial-gradient(120% 120% at 20% 20%, rgba(255,79,216,.22), rgba(124,92,255,.10));
  box-shadow: 0 0 0 1px rgba(255,79,216,.10) inset;
}
.btn:hover, .pill:hover, a.pill:hover { color:#fff; }

/* Keep homepage quick links on one line when there is room */
.quick-links { display:flex; flex-wrap:nowrap; gap:10px; align-items:center; overflow-x:auto; padding-bottom: 6px; }
.quick-links::-webkit-scrollbar { height: 8px; }
.quick-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
.quick-links .btn, .quick-links .pill { flex: 0 0 auto; }
@media (max-width: 900px) {
  .quick-links { flex-wrap:wrap; overflow-x:visible; }
}

/* Force single-row quick links on larger screens */
.quick-links { flex-wrap: nowrap !important; overflow-x: auto !important; }
.quick-links .btn, .quick-links .pill { flex: 0 0 auto; }
@media (max-width: 900px) {
  .quick-links { flex-wrap: wrap !important; overflow-x: visible !important; }
}


/* Form controls fit cards */
input, select, textarea {
  width: 100%;
  max-width: 100%;
}
form { max-width: 100%; }


/* Hard override for autofill/extensions that set fixed input widths */
.card form { width: 100%; max-width: 100%; }
.card input, .card select, .card textarea {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
.card { overflow: hidden; }

/* Brand subtitle link */
.brand-sub a { color: inherit; text-decoration: none; opacity: .85; }
.brand-sub a:hover { opacity: 1; text-decoration: underline; }


/* Gallery */
.gallery-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-item{
  text-decoration:none;
  color: inherit;
}
.gallery-item img{
  width:100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  display:block;
}
.gallery-meta{ margin-top:8px; }
.gallery-title{ font-weight: 750; }
.gallery-cap{ opacity:.85; font-size:.95rem; margin-top:2px; }

/* Simple 2-col grid helper */
.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 860px){
  .grid-2{ grid-template-columns: 1fr; }
}
.row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 860px){
  .row{ grid-template-columns: 1fr; }
}

.prose{ line-height:1.55; }
.prose p{ margin: 0 0 10px 0; }


/* WYSIWYG editor */
.wys-toolbar{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.wys-editor{
  min-height: 260px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  overflow-wrap: anywhere;
}
.wys-editor:focus{ outline: 2px solid rgba(180,120,255,.55); }

/* Modal */
.modal{ display:none; }
.modal.open{ display:block; position:fixed; inset:0; z-index:9999; }
.modal-backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.65); }
.modal-card{ position:relative; width:min(980px, 92vw); max-height: 86vh; overflow:auto; margin: 6vh auto; }
.gallery-pick{ cursor:pointer; border:1px solid rgba(255,255,255,.12); }
.gallery-pick:hover{ transform: translateY(-1px); }

.prose figure{ margin: 10px 0; }
.prose figcaption{ opacity:.85; font-size:.95rem; margin-top:4px; }


/* Inline news inserts */
.news-figure img{ width:100%; height:auto; border-radius:14px; display:block; }
.news-caption{ outline:none; padding:6px 0 0 0; }
.news-caption:empty:before{ content:"Click to edit caption…"; opacity:.6; }

.news-strip{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
}
.news-strip a{ flex:0 0 auto; display:block; }
.news-strip img{
  height: 140px;
  width: auto;
  border-radius: 12px;
  display:block;
}


/* Class-based headings inside news editor & rendered posts */
.prose .nh1, .wys-editor .nh1 { font-size: 1.7rem; font-weight: 800; margin: 10px 0; }
.prose .nh2, .wys-editor .nh2 { font-size: 1.4rem; font-weight: 800; margin: 10px 0; }
.prose .nh3, .wys-editor .nh3 { font-size: 1.15rem; font-weight: 800; margin: 10px 0; }
.prose h1, .prose h2, .prose h3 { margin: 10px 0; } /* in case older posts have real headings */

.gallery-pick[role="button"]{ cursor:pointer; }


/* News images: always fit container, never crop */
.prose img{
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}

.featured-grid img,
.featured img,
.news-card img{
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.featured-grid img{ height:auto !important; }


/* Link color contrast */
:root{
  --link: #7dd3fc;        /* sky-300 */
  --link-hover: #38bdf8;  /* sky-400 */
  --link-visited: #a78bfa;/* violet-400 */
}

a{ color: var(--link); text-decoration: none; }
a:hover{ color: var(--link-hover); text-decoration: underline; }
a:visited{ color: var(--link-visited); }
.card a{ text-decoration: underline; text-decoration-color: rgba(255,255,255,.25); }
.nav a, header a{ text-decoration: none; }

.editing td{ background: rgba(255,255,255,.04); }
.editing td input{ max-width:100%; box-sizing:border-box; }


/* Net Controller row options: stack buttons cleanly */
.row-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:stretch;
}
.row-actions button, .row-actions .pill{
  width:100%;
  box-sizing:border-box;
}
@media (min-width: 720px){
  .row-actions{
    flex-direction:row;
    flex-wrap:wrap;
    justify-content:flex-end;
    align-items:center;
  }
  .row-actions button, .row-actions .pill{
    width:auto;
  }
}


/* Slashed zero for callsigns (if font supports OpenType 'zero') */
.callsign, .mono, .badge .mono {
  font-variant-numeric: slashed-zero;
  font-feature-settings: "zero" 1;
}
.callsign{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: .3px;
}
