/* ============================================================
   Criterio Venezolano — Stylesheet
   ============================================================ */

:root {
  --navy: #0d2a63;
  --blue: #1b4fbf;
  --gold: #f4b400;
  --ink: #14213d;
  --paper: #f6f8fc;
  --line: #dbe3f2;
}

/* ---------- Global overflow safety ---------- */
html {
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  max-width: 100%;
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  /* Google Translate shifts the body down by 40px when active */
  top: 0 !important;
}

img,
svg,
video,
iframe,
canvas {
  max-width: 100%;
  height: auto;
}

/* Long unbreakable strings (URLs, code) inside cards / articles */
.card-post h3,
.article .body,
.editor,
.mini a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
.brand {
  font-family: "Merriweather", Georgia, serif;
  color: var(--navy);
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  color: var(--navy);
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn-gold {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  border: 0;
}
.btn-gold:hover {
  background: #ffc928;
  color: var(--navy);
}
.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover {
  background: var(--blue);
  color: #fff;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
}

/* ---------- Ticker ---------- */
.ticker {
  background: var(--gold);
  color: var(--navy);
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
  position: relative;
  width: 100%;
  max-width: 100%;
}
.ticker .container {
  overflow: hidden;
}
.ticker-in {
  display: inline-block;
  padding-left: 100%;
  animation: tick 40s linear infinite;
}
.ticker:hover .ticker-in {
  animation-play-state: paused;
}
.ticker-in a {
  color: var(--navy);
  margin-right: 3rem;
}
@keyframes tick {
  to {
    transform: translateX(-100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-in {
    animation: none;
    padding: 0;
  }
}

/* ---------- Navbar ---------- */
.navbar-cv {
  background: #fff;
  border-bottom: 4px solid var(--navy);
}
.navbar-cv .brand {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.navbar-cv .nav-link {
  color: var(--navy);
  font-weight: 600;
}
.navbar-cv .nav-link:hover,
.navbar-cv .nav-link.active {
  color: var(--blue);
  box-shadow: inset 0 -3px var(--gold);
}

/* ---------- Cards / thumbnails ---------- */
.thumb {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  background-size: cover;
  background-position: center;
  display: block;
  position: relative;
}
.thumb .cat {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
}
.cat-badge {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

/* ---------- Carousel ---------- */
.carousel,
.carousel-inner,
.carousel-item {
  max-width: 100%;
  overflow: hidden;
}
.slide {
  height: 440px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  width: 100%;
}
.slide .cap {
  background: linear-gradient(transparent, rgba(13, 42, 99, 0.95));
  width: 100%;
  padding: 3rem 2rem 2rem;
}
.slide h2 {
  color: #fff;
  font-size: clamp(1.4rem, 3.4vw, 2.4rem);
}

.card-post {
  border: 0;
  border-top: 3px solid var(--navy);
  background: #fff;
  height: 100%;
  transition: transform 0.15s;
}
.card-post:hover {
  transform: translateY(-3px);
}
.card-post h3 {
  font-size: 1.1rem;
}
.meta {
  font-size: 0.82rem;
  color: #64708a;
}

/* ---------- Sidebar widgets ---------- */
.widget {
  background: #fff;
  border-top: 3px solid var(--gold);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.widget h4 {
  font-size: 1.05rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.mini {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  min-width: 0;
}
.mini .thumb {
  width: 76px;
  height: 64px;
  flex: none;
}
.mini > div {
  min-width: 0;
}

/* ---------- Section titles ---------- */
.sec-title {
  font-size: 1.4rem;
  border-left: 6px solid var(--gold);
  padding-left: 0.75rem;
  margin: 2rem 0 1rem;
}

/* ---------- Article ---------- */
.article {
  background: #fff;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.article .body {
  font-size: 1.15rem;
  font-family: "Merriweather", serif;
  line-height: 1.85;
}
.article img,
.editor img {
  max-width: 100%;
  height: auto;
}
.article blockquote,
.editor blockquote {
  border-left: 5px solid var(--gold);
  padding-left: 1rem;
  color: var(--blue);
  font-style: italic;
}

/* ---------- Footer ---------- */
footer.site {
  background: var(--navy);
  color: #cfd9f2;
  margin-top: 3rem;
}
footer.site h5 {
  color: #fff;
}
footer.site a {
  color: #cfd9f2;
}

/* ---------- Admin ---------- */
.stat {
  background: #fff;
  border-left: 5px solid var(--gold);
  padding: 1.25rem;
}
.stat b {
  font-size: 2rem;
  color: var(--navy);
  display: block;
}

.sidebar-admin {
  background: var(--navy);
  min-height: 100vh;
  width: 240px;
  flex: none;
}
.sidebar-admin a {
  display: block;
  color: #cfd9f2;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
}
.sidebar-admin a.active,
.sidebar-admin a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 4px 0 var(--gold);
}

/* The admin wrapper uses d-flex — keep it from pushing the page */
body > .d-flex,
.admin-wrap {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 991px) {
  .sidebar-admin {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar-admin.open {
    transform: none;
  }
}

.editor {
  min-height: 420px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.25rem;
  font-family: "Merriweather", serif;
  overflow-wrap: anywhere;
}
.toolbar {
  background: #eef2fb;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.toolbar .btn {
  padding: 0.25rem 0.55rem;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  display: grid;
  place-items: center;
  padding: 1rem;
}

/* ---------- Google Translate cleanup ---------- */
.skiptranslate iframe,
.goog-te-banner-frame {
  display: none !important;
}
.goog-tooltip,
.goog-text-highlight {
  box-shadow: none !important;
  background: none !important;
}
#google_translate_element {
  display: none !important;
}

/* ---------- Masthead / brand ---------- */
.masthead-logo {
  height: clamp(90px, 16vw, 140px);
  width: auto;
  max-width: 100%;
}
.navbar-cv .brand {
  font-size: 1.25rem;
}
@media (min-width: 992px) {
  .masthead + .navbar .navbar-brand,
  .masthead + .navbar #brand {
    display: none !important;
  }
}

/* ---------- Masthead vs. navbar brand ----------
   Desktop : show the big centered masthead, hide the navbar brand
   Mobile  : hide the masthead, keep the sticky navbar brand visible
   ------------------------------------------------- */

/* Mobile & tablet: hide the masthead */
@media (max-width: 991.98px) {
  .masthead {
    display: none !important;
  }
}

/* Desktop: hide the navbar brand (masthead already shows the logo) */
@media (min-width: 992px) {
  .masthead + .navbar .navbar-brand,
  .masthead + .navbar #brand {
    display: none !important;
  }
}

/* Navbar brand logo (visible only on mobile/tablet — masthead hides it on desktop) */
.navbar-cv .navbar-logo {
  height: 60px;
  width: auto;
  display: block;
}

/* Slightly larger on tablet, where there's more room */
@media (min-width: 576px) {
  .navbar-cv .navbar-logo {
    height: 34px;
  }
}

/* ---------- Pagination ---------- */
.pagination .page-link {
  color: var(--navy);
}
.pagination .active .page-link {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Ticker: clip the animation track on its own layer */
.ticker-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}
.ticker-in {
  display: inline-block;
  padding-left: 100%;
  animation: tick 40s linear infinite;
  will-change: transform;
}

/* Footer: keep columns from ever pushing the viewport */
footer.site .container,
footer.site .row {
  max-width: 100%;
}
footer.site .row {
  margin-left: 0;
  margin-right: 0;
}
