/* =========================================================
   main.css (single combined file)
   - Global top-nav hiding rules (site-wide)
   - 3-column layout (ONLY on pages that use .layout-3col)
   - Topbar (breadcrumbs + mark read) styling (ONLY .layout-3col)
   ========================================================= */

/* ---------- Global: safer sizing ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

/* =========================================================
   GLOBAL: Hide items in top nav everywhere
   ========================================================= */
#nav-main li#quick-links,
#nav-main li#nav-faq,
#nav-main li#nav-acp,
#nav-main li#nav-mcp,
#nav-main li.faq,
#nav-main a[href*="faq"],
#nav-main a[href*="adm/index"],
#nav-main a[href*="mcp"],
#nav-main a[href*="mode=login"],
#nav-main a[href*="mode=logout"],
#nav-main li#nav-login,
#nav-main li#nav-logout{
  display: none !important;
}

/* Optional: remove leftover spacing/gaps */
#nav-main { gap: 0 !important; }


/* =========================================================
   3-COLUMN LAYOUT (ONLY pages that wrap content in .layout-3col)
   Use:
   <div class="layout-3col">
     <aside class="layout-left">...</aside>
     <main class="layout-middle">...</main>
     <aside class="layout-right">...</aside>
   </div>
   ========================================================= */
.layout-3col{
  display: grid;
  grid-template-columns: minmax(0, 20%) minmax(0, 60%) minmax(0, 20%);
  gap: 12px;
  margin-top: 10px;
  grid-auto-flow: row;
}

.layout-3col > *{ min-width: 0; }

.layout-3col .layout-left{
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layout-3col .layout-middle{
  grid-column: 2;
  min-width: 0;
}

.layout-3col .layout-right{
  grid-column: 3;
  min-width: 0;
}

/* Optional: push “bottom blocks” down in the left column */
.layout-3col .layout-left-bottom{ margin-top: auto; }

/* Mobile: stack cleanly */
@media (max-width: 900px){
  .layout-3col{
    grid-template-columns: 1fr;
    grid-template-areas:
      "middle"
      "left"
      "right";
  }
  .layout-3col .layout-middle{ grid-area: middle; }
  .layout-3col .layout-left{ grid-area: left; }
  .layout-3col .layout-right{ grid-area: right; }

  .layout-3col .layout-left,
  .layout-3col .layout-middle,
  .layout-3col .layout-right{
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    position: static !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* =========================================================
   NAVBAR
   ========================================================= */
   
body.section-index #nav-main > li > a[href*="index.php"]{
  color: inherit;
  background: none !important;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.layout-3col .page-topbar{
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  /* Uses theme vars if present, safe fallbacks if not */
  background: var(--bg3, #e9e9e9);
  border: 1px solid var(--border-color, #d6d6d6);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 12px 0;
}

.layout-3col .page-topbar-left{
  flex: 1 1 auto;
  min-width: 0;
}

.layout-3col .page-topbar-right{
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: 12px;
}

/* Breadcrumbs should behave nicely in a flex row */
.layout-3col .page-topbar-left .navlinks,
.layout-3col .page-topbar-left #nav-breadcrumbs{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0;
}

/* Mark-read link: nicer “action chip” */
.layout-3col .mark-read-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
}
.layout-3col .mark-read-link:hover{
  background: var(--bg2, rgba(0,0,0,0.06));
}

/* =========================================================
   VIEWPOST stuff
   ========================================================= */
   
/* VIEWTOPIC: pārliek postera profila bloku (avatar + stats) uz kreiso pusi */
.post.has-profile > .inner {
  display: flex;
  align-items: stretch;
}

/* profilam: noņem tēmas "pa labi" uzvedību */
.post.has-profile > .inner > dl.postprofile {
  order: 0;
  float: none;
  position: static;
  left: auto;
  right: auto;

  flex: 0 0 220px;   /* pielāgo platumu pēc vajadzības */
  margin: 0 12px 0 0;
}

/* posta saturs otrajā kolonnā */
.post.has-profile > .inner > .postbody {
  order: 1;
  flex: 1 1 auto;
  float: none;
}

/* mobilajā: saliek kolonnās (profils virs satura) */
@media (max-width: 700px) {
  .post.has-profile > .inner {
    flex-direction: column;
  }
  .post.has-profile > .inner > dl.postprofile {
    flex: 0 0 auto;
    margin: 0 0 12px 0;
  }
}

/* =========================================================
   VIEWPOST stuff PROFILE BOX
   ========================================================= */
   
/* Default avatar styling in postprofile */
.postprofile .avatar.avatar-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  text-decoration: none;
}

.postprofile .avatar.avatar-default .icon {
  font-size: 28px;
}

/* Center avatar + username in viewtopic postprofile */
.postprofile dt {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* avatar block centered */
.postprofile dt .avatar-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 6px;
}

/* keep the avatar itself centered */
.postprofile dt .avatar,
.postprofile dt .avatar-default {
  margin: 0 auto;
}

/* username line centered */
.postprofile dt strong,
.postprofile dt a.username,
.postprofile dt a.username-coloured,
.postprofile dt span.username {
  display: inline-block;
  text-align: center;
}

/* Ensure avatar + username stack */
.postprofile dt {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Rank/title (e.g. "Site Admin") centered under nickname */
.postprofile dd.profile-rank {
  text-align: center;
  margin-top: 4px;
}

/* If the theme floats/offsets rank, neutralize it */
.postprofile dd.profile-rank,
.postprofile dd.profile-rank * {
  float: none;
}

/* VIEWTOPIC: move the vertical separator from left of postprofile to its right */
.post.has-profile > .inner > dl.postprofile {
  border-left: 0 !important;
  border-right: 1px solid rgba(0,0,0,0.12) !important; /* adjust if you want */
  padding-right: 12px;
  margin-right: 12px;  /* space between line and post text */
}

/* ensure post text doesn't have leftover border/padding from original layout */
.post.has-profile > .inner > .postbody {
  border-left: 0 !important;
}

/* mobile: stacked layout, remove the right separator */
@media (max-width: 700px) {
  .post.has-profile > .inner > dl.postprofile {
    border-right: 0 !important;
    padding-right: 0;
    margin-right: 0;
  }
}

/* Viewtopic: 3 bloki vienā rindā: postprofile | postbody | back2top */
.post.has-profile > .inner {
  display: flex;
  align-items: stretch;
}

/* postbody lai aizņem visu vidu */
.post.has-profile > .inner > .postbody {
  flex: 1 1 auto;
  min-width: 0;
}

/* back2top uz labo malu, centrēts vertikāli */
.post.has-profile > .inner > .back2top {
  flex: 0 0 auto;
  margin-left: 12px;
  align-self: center;

  position: static !important;
  float: none !important;
}

/* ja tēma mēģina pozicionēt linku */
.post.has-profile > .inner > .back2top > a.top {
  position: static !important;
}

/* mobilajā: paslēp vai liec apakšā */
@media (max-width: 700px) {
  .post.has-profile > .inner > .back2top {
    display: none;
  }
}

/* Divider between author/time and post content, ending mid-post */
.post.has-profile .postbody p.author {
  position: relative;
  margin-bottom: 12px;   /* spacing before content */
  padding-bottom: 10px;  /* spacing above the line */
}

.post.has-profile .postbody p.author::after {
  content: "";
  display: block;
  height: 1px;
  width: 55%;            /* "ends in the middle" - adjust 40-70% */
  margin-top: 10px;
  background: rgba(0,0,0,0.12);  /* match your separator line */
}

/* =========================================================
   overall_header banner
   ========================================================= */

/* Header zona tikai bannerim */
#page-header .headerbar,
#page-header .headerbar-container {
  background: #fff !important;     
  box-shadow: none !important;
}

#page-header .headerbar .inner {
  padding: 0 !important;
}

/* Banner bloks */
.site-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 180px;                 
  overflow: hidden;               
}

/* Banner attēls (procentos no zonas augstuma) */
.site-banner-img {
  max-height: 100%;
  max-width: 30%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  margin: 0 auto;
}

/* =========================================================
   footers
   ========================================================= */

/* Center footer links (Contact us / the team / Members / etc.) */
#page-footer .navbar,
#page-footer .navbar .linklist {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  text-align: center;
}

/* Remove theme floats that prevent centering */
#page-footer .navbar .linklist > li {
  float: none !important;
  display: inline-flex;
}

/* Center the social icons bar (blue bar) */
#page-footer .socialbar,
#page-footer .socialbar ul {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}