/* ==========================================================================
   QUBIT.MK — global.css
   Loaded on every page.
   ========================================================================== */

/* ==========================================================================
   1) TOKENS
   ========================================================================== */
:root{
  /* Qubit palette */
  --qubit-1: #004D81; /* blue */
  --qubit-2: #047101; /* green */
  --qubit-3: #B51700; /* red */
  --qubit-4: #FF9400; /* yellow */

  --brand-black: #000;

  /* Layout */
  --header-h: 80px;
  --header-border: 2px;
  --header-offset: calc(var(--header-h) + var(--header-border));

  --container-max: 1240px;
  --narrow-max: 800px;

  /* Hero image sizing (used by template-home_page) */
  --hero-img-h: 351px;
  --hero-img-w: 849px;

  /* Corner cuts */
  --cut: 18px;
}

/* ==========================================================================
   2) BASE / DOCUMENT
   ========================================================================== */
html, body{
  height: 100%;
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body{
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #fff;
  color: #000;

  /* sticky footer */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout wrappers */
#page-wrapper,
#page.site{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#content.site-content{ flex: 1 0 auto; }

.site-main,
main.site-main{
  flex: 1 0 auto;
  padding-top: var(--header-offset);
  padding-bottom: 2rem;
}

.site-footer,
footer.site-footer{
  margin-top: auto;
}

/* Global links */
a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: none; }

/* Prevent scroll when overlays are open */
body.menu-open,
body.search-open{
  overflow: hidden;
}

/* Your JS uses menu-open to lock body (keep it, but avoid weird width jumps) */
body.menu-open{
  position: fixed !important;
  width: 100%;
}

/* Bootstrap containers: cap at 1240 on large screens */
@media (min-width: 1200px){
  .container,
  .container-lg,
  .container-xl,
  .container-xxl{
    max-width: var(--container-max) !important;
  }
}

.skip-link.screen-reader-text{
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link.screen-reader-text:focus{
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  overflow: visible;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 2px solid #fff;
}

/* ==========================================================================
   3) UTILITY — ANGLED CORNERS (top-left + bottom-right)
   Uses inset shadow for a consistent "stroke"
   ========================================================================== */
.hp-card,
.hp-pill,
.hp-details{
  --stroke: 1px;
  --hp-border: #000;

  position: relative;
  border: 0;
  box-shadow: inset 0 0 0 var(--stroke) var(--hp-border);
  overflow: hidden;

  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%,
    0 var(--cut)
  );
}

/* Smaller cuts for pills */
.hp-pill{ --cut: 12px; }

/* Top-left wedge */
.hp-card::before,
.hp-pill::before,
.hp-details::before{
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: var(--cut);
  height: var(--cut);
  background: var(--hp-border);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: none;
}

/* Bottom-right wedge */
.hp-card::after,
.hp-pill::after,
.hp-details::after{
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: var(--cut);
  height: var(--cut);
  background: var(--hp-border);
  clip-path: polygon(100% 100%, 0 100%, 100% 0);
  pointer-events: none;
}

/* ==========================================================================
   4) HEADER (fixed + translucent)
   ========================================================================== */
.site-header{
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1030;

  background: rgba(255,255,255,.85) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.site-header .navbar{
  background: transparent !important;
  border-bottom: var(--header-border) solid #000;
  padding: 0;
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  min-height: var(--header-h);
  position: relative;
}

/* Brand / Logo */
.navbar-brand{
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
}

.custom-logo{
  display: block;
  width: auto;
  height: auto;
  max-height: 70px !important;
  transition: max-height .3s;
}
.site-header.shrink .custom-logo{ max-height: 38px; }

/* Desktop menu wrapper */
@media (min-width: 992px){
  .main-menu{
    margin-left: auto;
    margin-right: 40px;
  }
}

/* Menu list + links (DESKTOP) */
.site-header .navbar-nav{
  display: flex;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header .navbar-nav > li > a,
.site-header .navbar-nav > li > a:visited{
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .65rem;

  font-size: 1rem;
  font-weight: 400;
  color: var(--brand-black) !important;
  transition: background .18s ease, color .18s ease;
}

/* Hover + active + focus */
.site-header .navbar-nav > li:hover > a,
.site-header .navbar-nav > li.current-menu-item > a,
.site-header .navbar-nav > li.current-menu-ancestor > a,
.site-header .navbar-nav > li:hover > a:visited{
  background: #000;
  color: #fff !important;
}

.site-header .navbar-nav > li.current-menu-item > a,
.site-header .navbar-nav > li.current-menu-ancestor > a{
  font-weight: 700;
}

.site-header .navbar-nav > li > a:focus-visible{
  outline: 2px solid #000;
  outline-offset: 3px;
  background: #000;
  color: #fff !important;
}

/* Random qubit icon next to menu label */
.qubit-menu-icon i{
  font-size: 1.05em;
  line-height: 1;
}
.qubit-menu-label{ display: inline-block; }

/* Header actions */
.header-actions{
  display: flex;
  align-items: center;
  margin-left: auto;
}

.search-toggle{
  display: flex;
  align-items: center;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--brand-black);
  font-size: 1.5rem;
}

/* ==========================================================================
   5) SEARCH OVERLAY (full screen)
   ========================================================================== */
.search-overlay{
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;

  background: rgba(255,255,255,.98);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
}

.search-overlay .search-form{
  width: min(720px, 92vw);
}

.search-overlay .search-form input{
  width: 100%;
  border: 0;
  border-bottom: 2px solid #222;
  font-size: clamp(1.6rem, 4vw, 3rem);
  outline: none;
  background: transparent;
  color: #000;
  text-align: center;
  padding: 12px 8px;
}

.search-close{
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: 0;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ==========================================================================
   6) OFFCANVAS (mobile menu)
   ========================================================================== */
.main-offcanvas{
  --bs-offcanvas-width: min(420px, 100vw);
  --bs-offcanvas-bg: #fff;
  --bs-offcanvas-transition: transform .45s cubic-bezier(.22,.61,.36,1);

  box-shadow: -16px 0 40px rgba(0,0,0,.12);
  border-left: 0;
  will-change: transform;
}

/* Slide-in animation */
.main-offcanvas.offcanvas-end{
  right: 0;
  left: auto;
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
}
.main-offcanvas.offcanvas-end.show{ transform: translateX(0); }

/* Backdrop animation */
.offcanvas-backdrop.fade{ transition: opacity .45s cubic-bezier(.22,.61,.36,1); }
.offcanvas-backdrop.show{ opacity: .25; }

/* Offcanvas header branding */
.main-offcanvas .offcanvas-header{ padding: 18px 20px; }
.main-offcanvas .offcanvas-brand{
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.main-offcanvas .qubit-offcanvas-logo{
  max-height: 44px;
  width: auto;
  height: auto;
  display: block;
}
.main-offcanvas .qubit-offcanvas-logo-text{
  font-weight: 700;
  letter-spacing: .02em;
}

/* Mobile menu structure */
.main-offcanvas .mobile-main-menu .navbar-nav{
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-offcanvas .mobile-main-menu a,
.main-offcanvas .mobile-main-menu a:visited{
  color: #111 !important;
  font-family: inherit;
}

/* Top-level links */
.main-offcanvas .mobile-main-menu .navbar-nav > li > a{
  display: block;
  text-align: left;
  padding: 1rem 1.25rem 1rem 1.5rem;

  font-size: 1.08rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;

  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* Active state (no purple visited) */
.main-offcanvas .mobile-main-menu .navbar-nav > li.current-menu-item > a,
.main-offcanvas .mobile-main-menu .navbar-nav > li.current-menu-ancestor > a{
  color: #000 !important;
}

/* Submenu */
.main-offcanvas .mobile-main-menu .navbar-nav .sub-menu{
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-offcanvas .mobile-main-menu .navbar-nav .sub-menu > li > a{
  display: block;
  text-align: left;
  padding: .8rem 1.25rem .8rem 2.35rem;

  font-size: .98rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;

  color: #111 !important;
  border-bottom: 1px solid #f0f0f0;
}

/* Items with children indicator */
.main-offcanvas .mobile-main-menu .navbar-nav > li.menu-item-has-children > a{
  position: relative;
  padding-right: 3rem;
}
.main-offcanvas .mobile-main-menu .navbar-nav > li.menu-item-has-children > a::after{
  content: "▾";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  color: #999;
}

/* ==========================================================================
   13) FOOTER
   ========================================================================== */
.site-footer,
.frontpage-footer{
  font-size: 1.2em;
  background: #fff;
  color: #000;
  border-top: 1px solid #ccc;
  padding: 1rem 0;
  width: 100%;
}

/* FULL WIDTH like navbar (no max-width cap) */
.footer-inner{
  width: 100%;
  margin: 0;
  padding: 0 1.5rem; /* match navbar side padding */
}

/* ONE ROW (desktop): left (footer page content) | right (footer menu links) */
.footer-row{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
}

.footer-left{
  justify-self: start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.footer-right{
  justify-self: end;
  display: flex;
  justify-content: flex-end;
}

/* Footer editor content */
.footer-text > *:last-child{ margin-bottom: 0; }

/* Footer Menu (Disclaimer / Privacy Policy) */
.footer-menu{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-menu a,
.footer-menu a:visited{
  display: inline-block;
  padding: .35rem .85rem;
  text-decoration: none;
  background: transparent;
  color: #000 !important;
  line-height: 1.2;
}

.footer-menu a:hover,
.footer-menu a:focus,
.footer-menu a:hover:visited,
.footer-menu a:focus:visited{
  background: #000;
  color: #fff !important;
}

.footer-menu .current-menu-item > a,
.footer-menu .current_page_item > a,
.footer-menu .current-menu-item > a:visited,
.footer-menu .current_page_item > a:visited{
  background: #000;
  color: #fff !important;
}

/* Socials */
.footer-social{
  display: flex;
  gap: 14px;
  align-items: center;
}

.footer-social-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000 !important;
  text-decoration: none;
}

.footer-social-link i{
  font-size: 1.5rem;
  line-height: 1;
}

/* Mobile: two rows, centered */
@media (max-width: 576px){
  .footer-row{
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .footer-left,
  .footer-right{
    justify-self: center;
  }

  .footer-right{
    justify-content: center;
    margin-top: .5rem;
  }

  .footer-menu{ justify-content: center; }
}

/* ==========================================================================
   14) PAGINATION
   ========================================================================== */
nav.pagination{
  text-align: center;
  margin: 2rem 0;
}

nav.pagination ul.pagination{
  margin: 0;
  padding: 0;
  list-style: none;
  display: inline-flex;
  gap: .5rem;
}

nav.pagination ul.pagination .page-item{ margin: 0; }

nav.pagination ul.pagination .page-link{
  display: inline-block;
  padding: .5rem .75rem;
  border: 2px solid #000;
  background: transparent;
  color: #000;
  text-decoration: none;
  font-weight: 400;
  line-height: 1;
  border-radius: 0;
}

nav.pagination ul.pagination .page-link:hover{
  background: #000;
  color: #fff;
}

nav.pagination ul.pagination .page-link.current,
nav.pagination ul.pagination .page-link.current:hover{
  background: #000;
  color: #fff;
  font-weight: 600;
  cursor: default;
}

nav.pagination ul.pagination .page-link:focus{
  box-shadow: none;
  outline: none;
}

/* ==========================================================================
   POST CARDS — shared between home, category, tag, and author pages
   ========================================================================== */

/* Card shell */
.home-post-card{ position: relative; }

/* Click area */
.home-thumb-link{ display: block; text-decoration: none; }

/* Square cover */
.home-thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eaeaea;
}

/* Cover image */
.home-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform .25s ease;
}
.home-thumb-link:hover .home-thumb img{ transform: scale(1.03); }

/* Overlay (bubble only behind text) */
.home-thumb-overlay{
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;

  display: flex;
  justify-content: flex-start;
  align-items: flex-end;

  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.home-thumb-overlay-inner{
  display: inline-block;
  max-width: 100%;
  background: rgba(255,255,255,.85);
  padding: 10px 12px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.home-thumb-link:hover .home-thumb-overlay,
.home-thumb-link:focus-visible .home-thumb-overlay{
  opacity: 1;
  transform: translateY(0);
}

.home-thumb-title{
  font-weight: 700;
  color: #000;
  font-size: 1.2rem;
  line-height: 1.2;
  margin-bottom: 6px;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-thumb-meta{
  font-size: .9rem;
  line-height: 1.2;
  color: #000;
  opacity: .85;

  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.home-thumb-sep{ opacity: .6; }
