/* Organizatorul — mobile navigation (≤ 1140px; full menu only from 1141px). Built from the WordPress primary menu by mobile-nav.js. */
.orgnav-panel, .orgnav-backdrop, .orgnav-open-btn { display: none; }

@media (max-width: 1140px) {
  /* Replace the theme's small hamburger + floating dropdown */
  /* Only once mobile-nav.js has built the new menu (body.orgnav-ready) — if the script fails, the theme menu stays. */
  body.orgnav-ready .site-header .menu-toggle,
  body.orgnav-ready .site-header .main-navigation .main-nav,
  body.orgnav-ready #mobile-menu-control-wrapper { display: none !important; }

  .orgnav-open-btn {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 14px; margin-left: auto;
    border: 1.5px solid #DDE3EE; border-radius: 12px; background: #fff;
    font: 700 14px/1 'Sora', system-ui, sans-serif; color: #0D2B4E; cursor: pointer;
  }
  .orgnav-open-btn svg { width: 20px; height: 20px; }
  body.orgnav-ready .site-header .inside-header { display: flex; align-items: center; flex-wrap: nowrap; padding-top: 10px; padding-bottom: 10px; }
  .site-header .site-logo img, .site-header .header-image { max-height: 40px; width: auto; }

  /* Keep the header (and the Meniu button) pinned while scrolling.
     The theme sets overflow-x:hidden on html/body, which silently disables position:sticky;
     overflow-x:clip prevents sideways scrolling just the same without breaking it. */
  html, body.orgnav-ready { overflow-x: clip !important; }
  body.orgnav-ready .site-header { position: sticky !important; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(13, 43, 78, .06); }

  /* Full-screen panel */
  .orgnav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 100001; /* above the cookie banner and WP admin bar (99999) */
    background: rgba(13, 43, 78, .45); opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .orgnav-panel {
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0; bottom: 0; width: min(92vw, 420px); z-index: 100002;
    background: #F7F9FC; transform: translateX(100%); transition: transform .25s ease, visibility 0s linear .25s;
    visibility: hidden; box-shadow: none; /* closed: no shadow spilling into view */
  }
  body.orgnav-open .orgnav-backdrop { opacity: 1; pointer-events: auto; }
  body.orgnav-open .orgnav-panel { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; box-shadow: -10px 0 30px rgba(13, 43, 78, .18); }
  body.orgnav-open { overflow: hidden; }

  .orgnav-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: #0D2B4E; color: #fff;
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .orgnav-head strong { font: 800 17px/1 'Sora', system-ui, sans-serif; }
  .orgnav-close {
    width: 44px; height: 44px; border-radius: 12px; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; line-height: 1;
  }
  .orgnav-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 32px; flex: 1; }

  .orgnav-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .orgnav-quick a {
    display: flex; flex-direction: column; gap: 6px; min-height: 76px; padding: 12px;
    background: #fff; border: 1px solid #DDE3EE; border-radius: 14px; text-decoration: none;
    font: 700 13.5px/1.25 'Sora', system-ui, sans-serif; color: #0D2B4E;
  }
  .orgnav-quick a span { font-size: 20px; line-height: 1; }
  .orgnav-quick a.orgnav-hot { grid-column: 1 / -1; min-height: 60px; flex-direction: row; align-items: center; gap: 10px; background: #FFF4E0; border: 2px solid #F5A623; }
  .orgnav-quick a:active { background: #EEF4FF; }

  .orgnav-label { font: 700 11px/1 'Sora', system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #6B7280; margin: 4px 4px 10px; }
  .orgnav-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #DDE3EE; border-radius: 14px; overflow: hidden; }
  .orgnav-list > li + li { border-top: 1px solid #EEF2F7; }
  .orgnav-row { display: flex; align-items: stretch; }
  .orgnav-row > a, .orgnav-row > button {
    display: flex; align-items: center; min-height: 54px; padding: 0 16px;
    font: 700 15.5px/1.25 'Sora', system-ui, sans-serif; color: #0D2B4E; text-decoration: none;
    background: none; border: 0; text-align: left; cursor: pointer; flex: 1;
  }
  .orgnav-row > button .orgnav-chev { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; background: #F1F5F9; display: inline-flex; align-items: center; justify-content: center; transition: transform .2s ease; }
  .orgnav-row > button[aria-expanded="true"] .orgnav-chev { transform: rotate(180deg); background: #FFF4E0; }
  .orgnav-sub { list-style: none; margin: 0; padding: 0 0 8px; background: #FAFBFD; display: none; }
  .orgnav-sub.is-open { display: block; }
  .orgnav-sub a {
    display: flex; align-items: center; min-height: 46px; padding: 0 16px 0 28px;
    font: 500 14.5px/1.3 'Sora', system-ui, sans-serif; color: #1F2937; text-decoration: none;
  }
  .orgnav-sub a:active, .orgnav-row > a:active { background: #EEF4FF; }
  .orgnav-sub .orgnav-all a { color: #1565C0; font-weight: 700; }
  .orgnav-list a[aria-current="page"] { color: #1565C0; box-shadow: inset 3px 0 0 #F5A623; }
  .orgnav-foot { margin-top: 18px; font: 500 12px/1.5 'Sora', system-ui, sans-serif; color: #6B7280; text-align: center; }

}

@media (prefers-reduced-motion: reduce) {
  .orgnav-panel, .orgnav-backdrop { transition: none !important; }
}

/* Desktop menu (≥1141px): must fit in the ~800px beside the logo.
   "Acasă" is hidden here — the logo already links home (it stays in the mobile menu). */
@media (min-width: 1141px) {
  .main-navigation .main-nav > ul > li.menu-item-home { display: none; }
  .main-navigation .main-nav > ul > li > a { padding-left: 11px; padding-right: 11px; }
  .main-navigation .main-nav > ul > li > a[href$="/oferte-speciale/"] {
    color: #B45309 !important; font-weight: 800;
  }
  .main-navigation .main-nav > ul > li > a[href$="/oferte-speciale/"]::before { content: '🔥 '; }
}

@media (max-width: 600px) {
  /* Homepage hero stats: three on one row; columns size to their content so "De partea ta" fits */
  .org-hero-stats { grid-template-columns: auto auto auto !important; justify-content: space-between !important; gap: 12px !important; overflow-wrap: normal !important; }
  .org-hero-stats strong { font-size: clamp(16px, 5.2vw, 22px) !important; white-space: nowrap; }
  .org-hero-stats span { font-size: 10px !important; letter-spacing: .02em !important; line-height: 1.3; display: block; max-width: 12ch; hyphens: none; word-break: normal; }
}

/* Homepage "Ce vrei să faci?" tiles: 2 per row on phones (inline style), 4 on wide screens.
   (The site's global CSS forces any repeat(auto-fit…) grid to one column on phones, so the tiles avoid it.) */
@media (min-width: 900px) {
  .org-tasks { grid-template-columns: 1fr 1fr 1fr 1fr !important; }
}
.org-task:hover { border-color: #F5A623 !important; box-shadow: 0 4px 14px rgba(13, 43, 78, .08); }

/* ---- Homepage layout (body.home) — one even rhythm, aligned columns ---- */
.home .entry-content > div { display: flex; flex-direction: column; gap: 20px; }
.home .entry-content > div > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.home .entry-content > div > div:last-child > div { display: flex !important; flex-direction: column !important; gap: 18px !important; }
.home .entry-content > div > div:last-child > div > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.home .entry-content > div > div:last-child > div > style,
.home .entry-content > div > div:last-child > div > script { display: none; }
/* Exchange-rate strip: EUR, USD, GBP, CHF + gold */
.entry-content .org-fx-grid.org-fx-grid { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 10px !important; }
@media (max-width: 900px) { .entry-content .org-fx-grid.org-fx-grid { grid-template-columns: 1fr 1fr !important; } .entry-content .org-fx-grid.org-fx-grid > :last-child { grid-column: 1 / -1; } }
@media (max-width: 600px) {
  .site-content { padding-left: 16px !important; padding-right: 16px !important; }
  .home .entry-content > div { padding-left: 0 !important; padding-right: 0 !important; }
  .org-fx-grid > div { padding: 12px 8px !important; }
  .org-fx-grid [id^="fx-"]:not([id$="c"]) { font-size: 21px !important; }
}

.org-chg.org-up { color: #DC2626; } .org-chg.org-down { color: #16A34A; } .org-chg.org-flat { color: #6B7280; }
/* Tablet (601–900px, where the homepage collapses to one column): sidebar boxes 2×2, equal heights per row */
@media (min-width: 601px) and (max-width: 900px) {
  .home .entry-content > div > div:last-child > div:last-child { display: grid !important; grid-template-columns: 1fr 1fr; gap: 18px !important; align-items: stretch; }
}
/* Desktop: both homepage columns end on the same line — the sidebar stretches and "Știai că?" takes up the difference */
@media (min-width: 901px) {
  .home .entry-content > div > div:last-child { align-items: stretch !important; }
  .home .entry-content > div > div:last-child > div:last-child > .orgfact { flex: 1 1 auto; display: flex; flex-direction: column; }
  .home .orgfact .orgfact-stage { flex: 1; }
}
