/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Description: Krupije.pro Custom Child Theme
Author: Saša Kozar
Template: generatepress
Version: 1.1.0
*/

/* ================================================== */
/* 1. TIPOGRAFIJA I DISANJE TEKSTA                    */
/* ================================================== */
h1,
.entry-title {
  font-weight: 500 !important;
  font-size: 2.5rem; /* ~(1.8)29px umesto ~42px */
}
.entry-content p {
  margin-bottom: 1.8em;
  line-height: 1.7;
}
.entry-content h2 {
  margin-top: 2.5em;
  margin-bottom: 0.8em;
  font-weight: 400;
  font-size: 2rem; /* ~(1.15)22px umesto ~32px */
}
.entry-content h3 {
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-weight: 400;
  font-size: 1.5rem; /* ~18px umesto ~24px */
}
/* Mehanika regularnih listi (sa fluidnim disanjem) */
body .entry-content ul:not(.children),
body .entry-content ol,
.entry-content .wp-block-list {
  padding-left: clamp(25px, 5vw, 2.5em) !important;
  margin-bottom: 1.8em;
  line-height: 1.7;
}

@media (max-width: 768px) {
  body .entry-content ul:not(.children),
  body .entry-content ol,
  .entry-content .wp-block-list {
    padding-left: 20px !important;
    margin-left: 0 !important;
  }
}

.krupije-round img {
  border-radius: 15px !important;
  overflow: hidden !important;
}
/* =========================================
   MOBILNA TIPOGRAFIJA - KONTROLA NASLOVA
   ========================================= */
@media (max-width: 768px) {
  /* H1 - Glavni naslov stranice */
  h1,
  .entry-title,
  .wp-block-post-title {
    font-size: 28px !important;
    line-height: 1.2 !important;
    margin-bottom: 20px !important;
  }

  /* H2 - Glavni silosi i sekcije */
  h2,
  .wp-block-heading h2 {
    font-size: 24px !important;
    line-height: 1.3 !important;
    margin-top: 25px !important;
    margin-bottom: 15px !important;
  }

  /* H3 - Podsekcije */
  h3,
  .wp-block-heading h3 {
    font-size: 20px !important;
    line-height: 1.3 !important;
    margin-top: 20px !important;
    margin-bottom: 12px !important;
  }

  /* H4, H5, H6 - Mikro arhitektura */
  h4,
  h5,
  h6 {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }
}

/* ================================================== */
/* 2. KOMPONENTE ZA ČLANKE (Insajderski markeri)      */
/* ================================================== */
.krupije-stat {
  border-left: 3px solid #cca352;
  padding: 8px 0 8px 15px;
  margin: 1.5em 0 1em 0;
  font-size: 1.05em;
  font-weight: bold;
  color: #0b101e;
  line-height: 1.4;
}

.krupije-tech {
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 18px 20px;
  margin: 1.2em 0 1.5em 0;
}
.krupije-tech p {
  margin-bottom: 0.6em !important;
}
.krupije-tech p:last-child,
.krupije-tech ul {
  margin-bottom: 0 !important;
}

.krupije-komentar {
  border-left: 3px solid #cca352;
  padding: 12px 0 12px 18px;
  margin: 1.2em 0 2em 0;
  font-style: italic;
  color: #444;
  line-height: 1.7;
}
.krupije-komentar strong {
  font-style: normal;
  color: #0b101e;
  display: block;
  margin-bottom: 0.3em;
}

.krupije-sep {
  border: none;
  border-top: 1px solid #cca352;
  margin: 2.5em auto;
  width: 60%;
  opacity: 0.5;
}

.krupije-toc {
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 18px 22px;
  margin: 1.5em 0 2.5em 0;
}
.krupije-toc p {
  margin: 0 0 8px 0 !important;
  font-weight: bold;
  color: #0b101e;
  font-size: 0.95em;
}
.krupije-toc ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
}
.krupije-toc li {
  padding: 4px 0;
  font-size: 0.95em;
}
.krupije-toc li::before {
  content: "■";
  color: #cca352;
  font-size: 8px;
  margin-right: 10px;
  vertical-align: middle;
}
.krupije-toc a {
  color: #444;
  text-decoration: none;
  transition: color 0.2s ease;
}
.krupije-toc a:hover {
  color: #cca352;
}

@media (max-width: 768px) {
  .krupije-tech {
    padding: 14px 15px;
  }
  .krupije-komentar {
    padding-left: 14px;
  }
  .krupije-sep {
    width: 80%;
  }
}

/* ================================================== */
/* 3. MEHANIKA NAVIGACIJE (Main Menu & Silosi)        */
/* ================================================== */

/* Nuklearni fix: skrivanje menija kad nije aktiviran */
@media (max-width: 500px) {
  .main-navigation:not(.toggled) .main-nav > ul {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  .main-navigation.toggled .main-nav > ul {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
  }
  .main-navigation.toggled .main-nav > ul > li {
    display: block !important;
    width: 100% !important;
  }
}

/* Uvlačenje pod-linkova udesno na mobilnom meniju */
@media (max-width: 768px) {
  .main-navigation.toggled .main-nav ul ul {
    margin-left: 20px !important;
    border-left: 1px solid #333;
    padding-left: 10px !important;
  }
}

/* Krupije Silos Panel (Desktop) */
.entry-content .wp-block-buttons.krupije-silos-nav {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  width: 100% !important;
  gap: 15px !important;
  margin-bottom: 30px !important;
}
.entry-content .wp-block-buttons.krupije-silos-nav .wp-block-button {
  width: 100% !important;
  margin: 0 !important;
  flex-basis: auto !important;
  flex-grow: 1 !important;
}
.entry-content .wp-block-buttons.krupije-silos-nav .wp-block-button__link,
.entry-content .wp-block-buttons.krupije-silos-nav .wp-block-button a {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  text-align: center !important;
  padding: 16px 10px !important;
  font-size: 15px !important;
  font-weight: bold !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100% !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  background-color: #fff !important;
  color: #2c2c2c !important;
  border: 2px solid #c5a059 !important;
  border-radius: 3px !important;
  transition: all 0.25s ease !important;
  letter-spacing: 0.3px !important;
}
.entry-content .wp-block-buttons.krupije-silos-nav .wp-block-button__link:hover,
.entry-content .wp-block-buttons.krupije-silos-nav .wp-block-button a:hover {
  background-color: #c5a059 !important;
  color: #fff !important;
  border-color: #c5a059 !important;
}

/* Krupije Silos Panel (Mobilni 2x2) */
@media (max-width: 768px) {
  .entry-content .wp-block-buttons.krupije-silos-nav {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .entry-content .wp-block-buttons.krupije-silos-nav .wp-block-button__link,
  .entry-content .wp-block-buttons.krupije-silos-nav .wp-block-button a {
    font-size: 13px !important;
    padding: 12px 6px !important;
    white-space: normal !important;
    word-break: keep-all !important;
    hyphens: none !important;
    min-height: 48px !important;
  }
}

/* ================================================== */
/* 4. MAPA SAJTA (Sitemap)                            */
/* ================================================== */
.krupije-sitemap ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 20px;
}

/* Nivo 1: Hubovi */
.krupije-sitemap > ul > li {
  font-size: 22px;
  font-weight: bold;
  color: #0b101e;
  margin-bottom: 40px;
  padding-bottom: 10px;
  border-bottom: 2px solid #cca352;
}
.krupije-sitemap > ul > li > a {
  color: #0b101e;
  text-decoration: none;
}

/* Nivo 2: Silosi */
.krupije-sitemap > ul > li > ul.children > li {
  font-size: 18px;
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 15px;
  border-bottom: none;
  padding-bottom: 0;
}
.krupije-sitemap > ul > li > ul.children > li > a {
  color: #cca352;
  text-decoration: none;
}

/* Nivo 3: Tekstovi */
.krupije-sitemap > ul > li > ul.children > li > ul.children {
  margin-top: 10px;
  padding-left: 0;
}
.krupije-sitemap > ul > li > ul.children > li > ul.children > li {
  font-size: 16px;
  font-weight: normal;
  margin-bottom: 12px;
  position: relative;
  padding-left: 20px;
}
.krupije-sitemap > ul > li > ul.children > li > ul.children > li::before {
  content: "■";
  color: #cca352;
  font-size: 10px;
  position: absolute;
  left: 0;
  top: 6px;
}
.krupije-sitemap > ul > li > ul.children > li > ul.children > li > a {
  color: #444;
  text-decoration: none;
  transition: color 0.2s ease;
}
.krupije-sitemap > ul > li > ul.children > li > ul.children > li > a:hover {
  color: #cca352;
}

@media (max-width: 768px) {
  .krupije-sitemap ul {
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
  .krupije-sitemap ul.children {
    padding-left: 8px !important;
  }
  .krupije-sitemap > ul > li {
    font-size: 18px !important;
  }
}

/* ================================================== */
/* 5. FOOTER MEHANIKA (Zakucavanje za dno i E-E-A-T)  */
/* ================================================== */
body {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
}
#page {
  flex: 1 0 auto !important;
  width: 100% !important;
}

.site-info {
  padding: 20px 0;
  line-height: 1.5;
  background-color: #060911;
  color: #999;
  font-size: 14px;
}
.footer-warning {
  color: #b30000;
  font-weight: bold;
}

.site-footer {
  clear: both !important;
  display: block !important;
  width: 100% !important;
  flex-shrink: 0 !important;
}
#footer-widgets .widget_nav_menu ul {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  column-gap: 30px !important;
  list-style: none !important;
  margin: 0 auto !important;
  padding: 15px 0 !important;
}
#footer-widgets .widget_nav_menu ul li a {
  color: #c5a059 !important;
  font-size: 17px !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
}
#footer-widgets .widget_nav_menu ul li a:hover {
  color: #e0b668 !important;
}
#footer-widgets .widget-title,
.footer-widgets .widget-title {
  display: none !important;
}
/* ================================================== */
/* 6. MEHANIKA MATEMATIČKIH FORMULA (Skrol i Izolacija)*/
/* ================================================== */

.ev-mehanika-kontejner {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important; /* KLJUČNO: Ubija rastezanje kontejnera izazvano formulom */
    overflow-x: auto !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    padding: 15px 0 !important;
    margin-bottom: 1.5em !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Osigurava da se MathJax ne deformiše unutar skrol trake */
.ev-mehanika-kontejner mjx-container {
    display: inline-block !important;
    min-width: max-content !important; 
    margin: 0 !important;
}

/* Stilizacija skrol trake u krupije.pro bojama */
.ev-mehanika-kontejner::-webkit-scrollbar {
    height: 4px;
}

.ev-mehanika-kontejner::-webkit-scrollbar-track {
    background: transparent;
}

.ev-mehanika-kontejner::-webkit-scrollbar-thumb {
    background: #cca352;
    border-radius: 4px;
}
/* ================================================== */
/* 8. CALC - MEHANIKA EDGE-TO-EDGE WIDGETA NA MOBILNOM       */
/* ================================================== */

@media (max-width: 768px) {
  .krupije-calc-wrapper {
    /* Probijanje kontejnera na punu širinu ekrana */
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    max-width: 100vw !important;
    width: 100vw !important;
    
    /* Uklanjanje radijusa i bočnih ivica radi stapanja sa ekranom */
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    
    /* Optimizacija unutrašnjeg prostora za uže ekrane */
    padding: 20px 15px !important; 
  }
}
/* ===========================================
   MOBILE CARD PATTERN ZA TABELE
   Koristi: dodaj klase "cards-mobile cards-comparison" 
   (ili cards-glossary / cards-math) u Block sidebar
   =========================================== */
@media (max-width: 768px) {
  /* === BAZNI CARD PATTERN — važi za sve cards-mobile tabele === */
  .wp-block-table.cards-mobile table,
  .wp-block-table.cards-mobile tbody,
  .wp-block-table.cards-mobile tr,
  .wp-block-table.cards-mobile td {
    display: block;
    width: 100% !important;
  }
  
  .wp-block-table.cards-mobile thead { display: none; }
  
  .wp-block-table.cards-mobile tr {
    margin-bottom: 1.5em;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75em;
    background: #fafafa;
  }
  
  .wp-block-table.cards-mobile td {
    border: none !important;
    padding: 0.5em 0;
    text-align: left !important;
  }
  
  .wp-block-table.cards-mobile td:first-child {
    font-weight: 700;
    font-size: 1.05em;
    border-bottom: 2px solid #c9a961;
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
  }
  
  .wp-block-table.cards-mobile td:nth-of-type(2)::before,
  .wp-block-table.cards-mobile td:nth-of-type(3)::before,
  .wp-block-table.cards-mobile td:nth-of-type(4)::before {
    display: block;
    font-weight: 600;
    color: #666;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25em;
  }
  
  /* === VARIJANTA: 3-kolonska comparison (insajder, fizika, akademija) === */
  .wp-block-table.cards-comparison td:nth-of-type(2)::before { content: "Karakteristika:"; }
  .wp-block-table.cards-comparison td:nth-of-type(3)::before { content: "Efekat:"; }
  
  /* === VARIJANTA: 2-kolonska glosarna (pojam → definicija) === */
  .wp-block-table.cards-glossary td:nth-of-type(2)::before { content: "Definicija:"; }
  
  /* === VARIJANTA: 4-kolonska matematička (broj → isplata → verovatnoća → EV) === */
  .wp-block-table.cards-math td:nth-of-type(2)::before { content: "Isplata:"; }
  .wp-block-table.cards-math td:nth-of-type(3)::before { content: "Verovatnoća:"; }
  .wp-block-table.cards-math td:nth-of-type(4)::before { content: "Očekivana vrednost:"; }
}
}