/* =========================================================
Modern light theme (teal/blue/green/gold) – cleaned version
========================================================= */

/* -------------------------
Fonts (self-hosted Inter)
Put files in: /appcore/static/fonts/
------------------------- */
@font-face{
  font-family: "Inter";
  src: url("/static/fonts/Inter_18pt-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Inter";
  src: url("/static/fonts/Inter_18pt-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face{
  font-family: "Inter";
  src: url("/static/fonts/Inter_18pt-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Inter";
  src: url("/static/fonts/Inter_18pt-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Inter";
  src: url("/static/fonts/Inter_18pt-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* -------------------------
Design tokens (single :root)
Palette inspired by your logo:
- teal/green base (books/grass)
- blue accent (graduation cap)
- warm gold highlight (ribbon/pen)
------------------------- */
:root{
  /* Brand */
  --brand-teal: #1b6f6a;
  --brand-blue: #2563eb;
  --brand-green: #2f9e44;
  --brand-gold: #f0b429;

  --brand-soft: rgba(27,111,106,0.12);
  --blue-soft: rgba(37,99,235,0.10);
  --green-soft: rgba(47,158,68,0.10);
  --gold-soft: rgba(240,180,41,0.14);

  /* Neutrals */
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 10px 30px rgba(2, 8, 23, 0.06);

  /* Status */
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.12);

  /* Radii */
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;

  /* Spacing */
  --pad: 18px;

  /* Font stack */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Form sizing */
  --control-h: 44px;
  --control-font: 1rem;

  /* Additional spacing / layout tokens */
  --pad-header-y: 0.9rem;
  --pad-header-x: 1.25rem;
  --pad-footer-y: 2rem;
  --pad-footer-x: 1rem;
  --pad-nav-item-y: 0.35rem;
  --pad-nav-item-x: 0.6rem;

  /* Common gaps */
  --gap-nav: 16px;
  --gap-form: 14px;
  --gap-small: 6px;

  /* Common borders / radii */
  --border-subtle: 1px solid rgba(15, 23, 42, 0.10);
}

/* -------------------------
Reset & base
------------------------- */
*{
  box-sizing: border-box;
}
html{
  -webkit-text-size-adjust: 100%;
}

body{
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  position: relative;
}

body::before{
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 420px; /* only top area */
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 320px at 18% 0%, var(--brand-soft), transparent 60%),
    radial-gradient(900px 320px at 82% 0%, var(--blue-soft), transparent 60%),
    radial-gradient(900px 340px at 50% 15%, var(--gold-soft), transparent 68%);
}

a{
  color: var(--brand-blue);
}
a:hover{
  text-decoration: underline;
}

h1,
h2,
h3{
  margin-top: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1{
  font-size: 1.55rem;
}
h2{
  font-size: 1.25rem;
}

/* -------------------------
Layout
------------------------- */
header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: var(--pad-header-y) var(--pad-header-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

main{
  max-width: 980px;
  margin: 1.25rem auto;
  padding: 0 1rem;
}

footer{
  text-align: center;
  padding: var(--pad-footer-y) var(--pad-footer-x);
  color: var(--muted);
  font-size: 0.92rem;
}

/* -------------------------
Navigation
------------------------- */

/* Header nav container */
nav.nav{
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* Left + right groups */
.nav-left{
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  flex: 1;
}

/* RIGHT SIDE: keep it aligned to the right edge */
.nav-right{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

/* Put language selector at the FAR RIGHT, auth link left of it */
.nav-lang{
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
}

/* Shared "nav item" look (works for links and logout) */
.nav a,
.nav .nav-link{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;

  text-decoration: none;
  color: var(--text);

  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.1;

  padding: var(--pad-nav-item-y) var(--pad-nav-item-x);
  border-radius: 999px;

  background: none;
  border: 1px solid transparent;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remove old hover background/border */
.nav a:hover,
.nav .nav-link:hover{
  background: none;
  border-color: transparent;
  text-decoration: none;
}

/* Gradient underline hover */
.nav a::after,
.nav .nav-link::after{
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  height: 2px;

  background: linear-gradient(
    90deg,
    var(--brand-teal),
    var(--brand-blue),
    var(--brand-gold),
    var(--brand-green)
  );

  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.nav a:hover::after,
.nav .nav-link:hover::after{
  transform: scaleX(1);
}

/* Logout form should not change layout */
.nav-logout{
  margin: 0;
  display: inline-flex;
  align-items: center;
}

/* Make logout button render EXACTLY like a nav link */
.nav-link-btn{
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 1px solid transparent;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;

  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-align: inherit;
}

/* Dropdown wrapper */
.nav-dropdown{
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* hover bridge so menu doesn't close when moving mouse */
.nav-dropdown::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}

/* Dropdown label */
.nav-parent{
  font-weight: 700;
  color: var(--brand-teal);
}

/* Dropdown menu */
.nav-dropdown-content{
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 180px;
  background: #ffffff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 8px;
  z-index: 30;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown-content:hover{
  display: block;
}

/* Dropdown items: simple hover, NO underline */
.nav-dropdown-content a{
  display: block;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 0;
  background: none;
  border: 0;
}

.nav-dropdown-content a:hover{
  background: var(--blue-soft);
}

.nav-dropdown-content a::after{
  display: none !important;
}

/* Language select */
.nav-lang select{
  padding: 0.35rem 0.6rem;
  font-size: 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;

  appearance: none;
  -webkit-appearance: none;
}

/* -------------------------
Logo in body (below header)
------------------------- */
.site-logo{
  display: flex;           /* flex centers the img inside */
  justify-content: center;
  align-items: center;
  width: 100%;             /* full width so auto margins work */
  margin: 12px 0 16px 0;
  text-decoration: none;
}

.site-logo img{
  height: 88px;
  width: auto;
  display: block;
  transition: transform .15s ease, opacity .15s ease;
}

@media (max-width: 768px){
  .site-logo{
    margin: 10px 0 14px 0;
  }
  .site-logo img{
    height: 64px;
  }
}

@media (max-width: 480px){
  .site-logo{
    margin: 8px 0 12px 0;
  }
  .site-logo img{
    height: 52px;
  }
}

/* -------------------------
Nav responsiveness (single consolidated block)
------------------------- */
@media (max-width: 1100px){
  nav.nav{
    flex-wrap: wrap;
    align-items: center;
    row-gap: 10px;
  }

  .nav-left{
    flex: 1 1 100%;
    justify-content: center;
  }

  .nav-right{
    flex: 1 1 100%;
    justify-content: center;
    margin-left: 0; /* disable the desktop push-right */
  }
}

@media (max-width: 900px){
  header{
    padding: 0.6rem 0.8rem;
  }

  nav.nav{
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .nav-left{
    order: 1;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    flex: unset;
  }

  .nav-right{
    order: 2;
    gap: 6px;
    justify-content: center;
    margin-left: 0;
    flex-shrink: unset;
  }

  .nav a,
  .nav .nav-link{
    font-size: 0.88rem;
    padding: 0.25rem 0.4rem;
    text-align: center;
  }

  .nav-lang{
    margin-left: 0;
  }

  .nav-lang select{
    width: auto;
    height: 34px;              /* smaller than 44px */
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;

    border-radius: 999px;      /* force rounded pill */
    border: 1px solid var(--border);
    background: #fff;

    appearance: none;
    -webkit-appearance: none;
  }
}

@media (max-width: 480px){
  .nav a,
  .nav .nav-link{
    font-size: 0.82rem;
    padding: 0.22rem 0.35rem;
  }

  footer{
    padding: 1.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* -------------------------
Card
------------------------- */
.card{
  background: var(--card);
  border-radius: var(--r-lg);
  padding: var(--pad);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

@media (max-width: 768px){
  .card{
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  .card .card{
    padding: 14px;
    margin: 0;
  }

  .card h1{ font-size: 1.4rem; }
  .card h2{ font-size: 1.1rem; }

  .card .actions{
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .card .actions a,
  .card .btn-small{
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px){
  .card{ padding: 14px; }
  .card .card{ padding: 12px; }
}

/* -------------------------
Utilities
------------------------- */
ul{
  padding-left: 1.2rem;
}
li{
  margin: 0.2rem 0;
}

.hint{
  margin-top: 6px;
  font-size: 0.92em;
  color: var(--muted);
}

.actions{
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.grid-2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

@media (max-width: 900px){
  .grid-2{
    grid-template-columns: 1fr;
  }
}

/* -------------------------
Messages
------------------------- */
.messages {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid rgba(15,23,42,0.15);
  background: #f1f5f9;
}

/* Success */
.message.success {
  background: #e6f7ec;
  border-color: #a3d9b1;
}

/* Error */
.message.error {
  background: #fde8e8;
  border-color: #f5b5b5;
}

/* Warning */
.message.warning {
  background: #fff4e5;
  border-color: #f5d3a3;
}

/* -------------------------
Buttons
------------------------- */
.btn,
.btn:link,
.btn:visited,
.btn:hover,
.btn:active{
  text-decoration: none;
}

button{
  border: none;
  background: none;
}
button:active{
  transform: translateY(1px);
}

.btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(27,111,106,0.28);
}

.btn{
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn:hover{
  transform: translateY(-1px);
}

.btn-primary{
  background: var(--brand-teal);
  color: white;
}

.btn-primary:hover{
  background: #155c57;
}

.btn-secondary{
  background: rgba(37,99,235,0.10);
  color: #1e3a8a;
  border: 1px solid rgba(37,99,235,0.20);
}

.btn-secondary:hover{
  background: rgba(37,99,235,0.14);
}

.btn-danger{
  background: rgba(185,28,28,0.10);
  color: var(--danger);
  border: 1px solid rgba(185,28,28,0.20);
}

.btn-danger:hover{
  background: rgba(185,28,28,0.14);
}

.btn-outline{
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-disabled{
  opacity: 0.55;
}

.btn-active{
  box-shadow: 0 0 0 3px rgba(27,111,106,0.20);
}

/* Save CTA */
.btn-save{
  background: var(--brand-teal);
  color: white;
  border: 1px solid transparent;
}

.btn-save:hover{
  background: #155c57;
}

/* --- User admin: compact buttons --- */
.ua-table .btn.btn-small{
  padding: 6px 10px;      /* smaller than global .btn */
  font-size: 0.85rem;
  line-height: 1.15;
}

.ua-table .ua-btn{
  min-width: 0;           /* stop forcing big width */
  padding: 6px 10px;      /* same as above */
}

.ua-table .action-row{
  gap: 6px;
  margin-bottom: 6px;
}

/* -------------------------
Badges
------------------------- */
.badge{
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 800;
  vertical-align: middle;
  margin-left: 8px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.03);
  color: var(--text);
}

.badge-full{
  border-color: rgba(185,28,28,0.25);
  background: rgba(185,28,28,0.10);
  color: var(--danger);
}

.badge-wait{
  border-color: rgba(217,119,6,0.25);
  background: rgba(217,119,6,0.10);
  color: #92400e;
}

/* -------------------------
Forms (global)
Ensures inputs are not “tiny”
------------------------- */

/* Apply consistent sizing even if a field doesn't have .input class */
/* Base typography */
input,
select,
textarea {
  font-family: inherit;
  font-size: var(--control-font);
  line-height: 1.4;
},
button {
  font-family: inherit;
  font-size: var(--control-font);
  line-height: 1.4;
}

/* Text-like controls */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select {
  width: 100%;
  height: var(--control-h);
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #fff;
}

/* Textareas */
textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #fff;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus{
  outline: none;
  border-color: rgba(27,111,106,0.45);
  box-shadow: 0 0 0 4px rgba(27,111,106,0.14);
}

.error{
  margin-top: 6px;
  font-size: 0.92em;
  font-weight: 700;
  color: var(--danger);
}

/* Optional helper if you use .input in templates/forms */
.input{
  font-size: var(--control-font);
  font-family: inherit;
}

/* -------------------------
Events page spacing helper
------------------------- */
.events-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.event-form .form-row{ margin-bottom:18px; }
.event-form .grid-2{ gap:22px; }
.event-form .form-row .label{ margin-bottom:8px; display:block; }

/* -------------------------
News cards
------------------------- */
.news-stack{
  display: grid;
  gap: 12px;
}

.news-card{
  background: #fff;
  border: 1px solid rgba(2, 8, 23, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.06);
}

.news-card--subtle{
  box-shadow: none;
}

.news-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.news-title{
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.news-date{
  font-size: 0.9rem;
  opacity: 0.7;
  white-space: nowrap;
}

.news-body{
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.92;
}

.news-older summary{
  cursor: pointer;
  user-select: none;
}

/* Markdown helper toolbar */
.md-toolbar{
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.md-toolbar button{
  border: 1px solid rgba(2,8,23,0.15);
  background: white;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
}

.md-toolbar button:hover{
  background: rgba(2,8,23,0.05);
}

/* Preview truncation */
.news-preview{
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-preview p{
  margin: 0 0 6px 0;
}

.news-preview p:last-child{
  margin-bottom: 0;
}

/* =========================================
PROFILE – Visual Hierarchy Upgrade
========================================= */

/* Stronger section separation */
.profile-form h2{
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 30px 0 12px 0;
  padding-top: 18px;
  border-top: 1px solid rgba(15,23,42,0.08);
}

.profile-form h2:first-of-type{
  border-top: none;
  padding-top: 0;
  margin-top: 14px;
}

/* Improve spacing rhythm */
.profile-form .form-grid{
  display: grid;
  gap: var(--gap-form);
}

.profile-form .form-row{
  display: flex;
  flex-direction: column;
  gap: var(--gap-small);
}

/* Improve label styling */
.profile-form .label{
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Improve input appearance consistency */
.profile-form input,
.profile-form select,
.profile-form textarea{
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Normalize date input */
.profile-form input[type="date"]{
  appearance: none;
  -webkit-appearance: none;
}

/* Focus state consistent with other inputs */
.profile-form input[type="date"]:focus{
  outline: none;
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(27,111,106,0.12);
}

/* Remove extra inner chrome (Chrome/Safari) */
.profile-form input[type="date"]::-webkit-datetime-edit{
  font-family: inherit;
  color: inherit;
}

.profile-form .form-row:has(input[type="checkbox"]){
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px){
  .profile-form .form-grid{
    grid-template-columns: 1fr !important; /* single column */
    gap: 12px !important;
  }
  
  .profile-form .grid-2{
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .profile-form h2{
    margin: 24px 0 10px 0 !important; /* tighter */
  }
}

.section-sep{
  border: 0;
  border-top: 1px solid rgba(15,23,42,0.10);
  margin: 12px 0 6px 0;
}

/* =========================================
CHECKBOX POLISH (active_member)
========================================= */
.checkbox-input{
  width: 18px;
  height: 18px;
  accent-color: var(--brand-teal);
  cursor: pointer;
}

.checkbox-row{
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.profile-form .form-row:has(.checkbox-input){
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.profile-form .form-row:has(.checkbox-input) .label{
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text);
}

/* =========================================
VISUAL DEPTH IMPROVEMENT
========================================= */
.profile-card{
  box-shadow: 0 12px 30px rgba(2,8,23,0.05);
}

/* Slightly more breathing room between grid columns */
.profile-form .grid-2{
  gap: 18px;
}

.form-actions{
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}



/* =========================
Formal Markdown Document
Wrap rendered markdown in: .md-doc
========================= */

.md-doc{
  max-width: 900px;
  margin: 0 auto;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
}

/* Use a slightly more “document-like” rhythm */
.md-doc > * + *{
  margin-top: 0.9rem;
}

/* Headings */
.md-doc h1,
.md-doc h2,
.md-doc h3,
.md-doc h4{
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 1.2rem 0 0.55rem 0;
}

.md-doc h1{
  font-size: 1.55rem;
  font-weight: 800;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.md-doc h2{
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 1.4rem;
}

.md-doc h3{
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
}

.md-doc h4{
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--muted);
}

/* Paragraphs + emphasis */
.md-doc p{
  margin: 0.65rem 0;
}

.md-doc strong{
  font-weight: 800;
}

.md-doc em{
  font-style: italic;
}

/* Horizontal rules (your markdown uses separators a lot) */
.md-doc hr{
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 1.2rem 0;
}

/* Links – formal, subtle */
.md-doc a{
  color: var(--brand-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.md-doc a:hover{
  text-decoration-thickness: 2px;
}

.md-doc a[target="_blank"]::after{
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.6;
}

/* Lists */
.md-doc ul,
.md-doc ol{
  margin: 0.55rem 0 0.85rem 1.25rem;
  padding: 0;
}

.md-doc li{
  margin: 0.25rem 0;
}

.md-doc ul li::marker{
  color: rgba(15, 118, 110, 0.85); /* subtle teal marker */
}

.md-doc ol{
  counter-reset: item;
}

.md-doc ol li::marker{
  font-weight: 800;
  color: rgba(15, 23, 42, 0.75);
}

/* Blockquotes (if used) */
.md-doc blockquote{
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid rgba(14,165,164,0.45);
  background: rgba(14,165,164,0.06);
  border-radius: 10px;
  color: var(--muted);
}

/* Code (usually not in statutes, but safe) */
.md-doc code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(2,8,23,0.04);
  border: 1px solid rgba(2,8,23,0.08);
  padding: 0.12rem 0.35rem;
  border-radius: 8px;
}

.md-doc pre{
  overflow: auto;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(2,8,23,0.04);
  border: 1px solid rgba(2,8,23,0.08);
}

.md-doc pre code{
  background: transparent;
  border: 0;
  padding: 0;
}

/* Tables (if any) */
.md-doc table{
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.98rem;
}

.md-doc th,
.md-doc td{
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

.md-doc th{
  background: rgba(14,165,164,0.06);
  font-weight: 800;
  text-align: left;
}

/* “Document card” look if you want it inside your .card */
.md-doc.is-doc-card{
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}

/* Board page */
.board-list{
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.board-row{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.7);
}

.board-role{
  font-weight: 800;
  color: var(--text);
}

.board-name{
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 700px){
  .board-row{
    grid-template-columns: 1fr !important; /* single column */
    padding: 12px !important;
    gap: 8px !important;
  }
  .board-name{
    color: var(--text);
  }
  .board-role{
    font-size: 1rem !important;
  }
}

.board-photo img{
  width: 100%;
  max-width: 820px;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* =========================================
Members page
========================================= */
.member-list{
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.member-row{
  width: 100%;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.member-row:hover{
  box-shadow: var(--shadow);
}
.member-name{
  font-weight: 800;
  color: var(--text);
}

/* Dialog */
.member-dialog{
  border: 0;
  border-radius: 16px;
  width: min(720px, calc(100vw - 24px));
  padding: 0;
  box-shadow: 0 24px 70px rgba(2,8,23,0.25);
}
.member-dialog::backdrop{
  background: rgba(15,23,42,0.55);
}
.member-dialog-inner{
  padding: 16px 16px 18px 16px;
}
.member-dialog-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.member-dialog-title{
  margin: 0;
  font-size: 1.1rem;
}
.member-block{
  margin-top: 10px;
}
.member-label{
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.ordination-address {
  margin-top: 6px;   /* adjust to taste: 6–10px works well */
}

textarea::placeholder {
  color: rgba(15,23,42,0.45);
  font-style: italic;
}

/* =========================================
TOOLTIP POLISH (checkbox help)
========================================= */

/* Tooltip for checkbox help */
.tooltip{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;
  margin-left: 6px;

  font-size: 0.75rem;
  font-weight: 700;

  border-radius: 50%;
  background: var(--brand-teal);
  color: white;

  cursor: pointer;
}

.tooltip-text{
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);

  min-width: 220px;
  padding: 8px 10px;

  border-radius: 8px;
  background: #1f2937;
  color: white;
  font-size: 0.8rem;
  line-height: 1.4;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;

  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 50;
}

.tooltip:hover .tooltip-text{
  opacity: 1;
}

/* =========================
Sponsors page
========================= */

.sponsor-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 24px;
}

/* Each card */
.sponsor-cell{
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* important */
  align-items: center;

  min-height: 240px; /* forces equal height */
  padding: 28px 20px;

  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.75);

  transition: transform .2s ease, box-shadow .2s ease;
}

.sponsor-cell:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* Logo wrapper area */
.sponsor-cell img{
  max-width: 200px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;

  margin: auto 0 20px 0; /* centers logo vertically */
}

/* Sponsor name */
.sponsor-name{
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}

.sponsor-name:hover{
  text-decoration: underline;
}

/* Make entire card clickable if wrapped in <a> */
.sponsor-cell a{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

/* Mobile */
@media (max-width: 800px){
  .sponsor-grid{
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .sponsor-cell{
    min-height: auto !important;
    padding: 20px 16px !important;
  }
}

/* Catch-all for other grids */
@media (max-width: 768px){
  .grid-2{
    grid-template-columns: 1fr !important;
  }
  
  .news-stack{
    gap: 10px !important;
  }
}

@media (max-width: 768px){
  main{
    margin: 1rem auto !important; /* tighter */
    padding: 0 0.75rem !important;
  }
}

/* =========================
   User administration table
   ========================= */

.ua-head{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.ua-subtitle{
  margin: 0;
}

.ua-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.65);
}

.ua-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px; /* keeps columns readable before scrolling kicks in */
}

.ua-table thead th{
  text-align: left;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--muted);
  padding: 12px 12px;
  background: rgba(14,165,164,0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
  white-space: nowrap;
}

.ua-table tbody td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: middle;
}

.ua-row:hover td{
  background: rgba(37, 99, 235, 0.04);
}

.ua-usercell{
  min-width: 240px;
}
.ua-name{
  font-weight: 800;
  line-height: 1.2;
}
.ua-email{
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-word;
}

.ua-username code{
  font-size: 0.92rem;
  white-space: nowrap;
}

.ua-status{
  min-width: 120px;
  white-space: nowrap;
}

.ua-role{
  min-width: 190px;
}
.ua-role-select{
  width: 100%;
  height: 40px;
  border-radius: 999px; /* consistent with your UI */
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  background: #fff;
  font-weight: 700;
}

/* Actions: two clean rows */
.ua-actions-col{
  min-width: 260px;
}

.user-actions{
  min-width: 260px;
}

.user-actions .action-row{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.user-actions .danger-row{
  margin-bottom: 0;
}

.user-actions form{
  margin: 0;
}

.ua-btn{
  min-width: 120px; /* makes buttons align nicely */
  justify-content: center;
  text-align: center;
}

/* Mobile/tablet tightening */
@media (max-width: 900px){
  .ua-table{
    min-width: 760px;
  }
  .ua-actions-col,
  .user-actions{
    min-width: 220px;
  }
  .ua-btn{
    min-width: 110px;
  }
}

.invitees-list {
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 12px;
  padding: 12px;
  max-height: 280px;
  overflow: auto;
  background: #fff;
}

.invitees-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px 16px;
}

.invitees-list li label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
}

.invitees-list li label:hover {
  background: rgba(15,23,42,0.04);
}

.site-footer {
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}