/*
 * jpis.az — responsive.css  (jpit.az ilə eyni şablon)
 * Mövcud style.css / style_.css / reset.css / owl.carousel.css-dən SONRA qoşulmalıdır:
 * <link rel="stylesheet" href="https://jpis.az/template/css/responsive.css?v=1.0">
 * <script src="https://jpis.az/template/js/responsive.js?v=1.0" defer></script>
 *
 * Qeyd: style_.css seçiciləri "div.xxx" formasındadır, ona görə burada da
 * eyni (və ya daha güclü) spesifiklik saxlanılır ki, bu fayl onları üstələsin.
 *
 * Breakpoint-lər:
 *   <= 1060px : planşet — kənar kölgələr götürülür, səhifə eni axıcı olur
 *   <=  900px : mobil — tək sütun, header şəkli miqyaslanır, menyu ☰ ilə
 *   <=  600px : kiçik telefon — məzmun tam tək sütun
 */

/* responsive.js-in əlavə etdiyi elementlər — kompüterdə gizlidir */
.menu-toggle,
.login-toggle,
.login-close,
.login-backdrop { display: none; }

/* Loqo linki (responsive.js əlavə edir): header şəklinin sahəsini tutur.
   Kompüterdə soldakı axtarış hissəsinə (305px) toxunmur. */
div.head { position: relative; }
.logo-link {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 305px;
  z-index: 1;
}

/* ---------- Planşet ---------- */
@media (max-width: 1060px) {
  html, body { overflow-x: hidden; }

  div.body { width: auto; margin: 0; }

  div.m_shadow_l,
  div.m_shadow_b {
    width: auto;
    min-height: 0;
    margin: 0;
    background: none;
  }

  div.main {
    width: auto;
    min-height: 0;
    margin: 0;
  }
  div.main_t { min-height: 0; }

  div.main_c { width: auto; padding-right: 20px; }
  div.head,
  div.section,
  div.bottom-banner-wrap { width: auto; }

  div.sec_r {
    width: calc(100% - 191px);
    box-sizing: border-box;
  }

  /* Ana səhifə: "Current number" və məqalə siyahısı yan-yana.
     Diqqət: c_l_d-nin içində ikinci c_l_d var — o tam enli qalmalıdır. */
  div.content_d { width: auto; display: flow-root; }
  div.content_d > div.c_l_d { width: 48%; }
  div.content_d > div.c_r_d { width: 48%; }
  div.c_l_d div.c_l_d { float: none; width: auto; }

  /* İndeksləmə loqoları (DOAJ, EBSCO, Scilit...) — səliqəli şəbəkə */
  div.bottom-banner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    align-items: center;
  }
  div.bottom-banner > a { display: block; text-align: center; }
  div.bottom-banner img {
    display: block;
    max-width: 100%;
    max-height: 48px;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
  }

  div.footer { width: auto; padding-right: 20px; box-sizing: border-box; }
  div.footer div.copy {
    float: none;
    width: auto;
    height: auto;
    margin-left: 53px;
    overflow: hidden;
  }
  div.lsn { width: auto; }

  div.sec_r img,
  div.sec_r iframe,
  div.sec_r video { max-width: 100%; height: auto; }
  div.sec_r table { max-width: 100%; }
  div.sec_r a { overflow-wrap: anywhere; }
}

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  /* Kitab "cild" fonunu sadə ağ vərəqlə əvəz edirik */
  div.body { background: none; }
  div.main,
  div.main_t { background: #fff; }

  div.main_c,
  div.az_main_c,
  div.en_main_c,
  div.ru_main_c {
    margin: 0;
    padding: 0 14px;
  }

  /* Header şəkli (ISSN + başlıq) div.head-in fonudur — konteynerin eninə görə miqyaslanır.
     Saytda "div.en_main_c .head" (az/ru üçün də) qaydası var — ondan güclü seçici lazımdır. */
  div.main_c div.head {
    height: auto;
    background-size: 100% auto;
    background-position: 0 14px;
  }
  div.head_t {
    position: relative;
    height: 0;
    margin: 0;
    /* 746x179 header şəklinin nisbəti (179/746) + yuxarı boşluq */
    padding: calc(23.99% + 14px) 0 0;
  }
  /* Mobildə link bütün header şəklini tutur (axtarış onun altındadır) */
  .logo-link { top: 14px; left: 0; }

  /* Axtarış + Submission + ☰ eyni sətirdə */
  div.head_l {
    float: none;
    width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  div.search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    width: auto;
    height: 40px;
    margin: 0;
    box-sizing: border-box;
    border-radius: 4px;
    background: #fff;
  }
  div.search > div { display: flex; align-items: center; flex: 1; min-width: 0; }
  div.search input {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 38px;
    font-size: 16px; /* iOS avtomatik zoom etməsin */
    box-sizing: border-box;
  }
  div.search .src-btn { flex: none; margin: 0 4px 0 0; }
  div.search button:not(.src-btn) { display: none; } /* markup-dakı boş artıq düymə */

  /* Sıra: menyu -> məzmun -> giriş paneli */
  div.section {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
  }
  div.sec_l { display: contents; }

  .menu-toggle {
    flex: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 4px;
    background: #022144;
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform .2s, opacity .2s;
  }
  body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Skript yüklənibsə menyu bağlı başlayır, düymə ilə açılır.
     Skript yüklənməsə menyu açıq qalır. */
  body.has-menu-toggle:not(.menu-open) div.menu_pl { display: none; }
  div.menu_pl {
    order: 1;
    width: auto;
    margin: 10px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
  }
  div.menu_pl a,
  div.menu_pl a:first-child {
    display: flex;
    align-items: center;
    width: auto;
    min-height: 42px;
    margin: 0;
    padding: 6px 10px;
    box-sizing: border-box;
    list-style: none;
    font-size: 13px;
    letter-spacing: 0;
    line-height: 1.3;
    background: #eef3f8;
    border: 0;
    border-left: 3px solid #022144;
    border-radius: 4px;
  }
  div.menu_pl a:hover,
  div.menu_pl a:focus { background: #dce7f2; }

  div.sec_r {
    order: 2;
    float: none;
    width: auto;
    padding: 24px 0 0;
  }

  div.user_pl {
    order: 3;
    width: 100%;
    max-width: 380px;
    margin: 28px auto 0;
    background: none;
  }
  div.user_pl_l,
  div.user_pl_r { width: auto; background: none; }
  div.user_pl_b {
    background: #f7f9fb;
    border: 1px solid #d5dbe1;
    border-radius: 6px;
    padding: 14px;
  }
  div.fr_t input {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
    font-size: 16px;
  }

  /* Giriş / Submission: düymə + popup */
  .login-toggle {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #022144;
    border-radius: 4px;
    background: #fff;
    color: #022144;
    font: bold 14px Tahoma, sans-serif;
    cursor: pointer;
  }
  .login-toggle:hover,
  .login-toggle:focus-visible { background: #eef3f8; }

  body.has-login-toggle:not(.login-open) div.user_pl { display: none; }

  body.login-open { overflow: hidden; } /* arxa fon sürüşməsin */
  body.login-open div.user_pl {
    position: fixed;
    z-index: 1001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 380px;
    max-height: calc(100% - 32px);
    overflow-y: auto;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  }
  body.login-open div.user_pl_b {
    position: relative;
    background: #fff;
    border: 0;
    border-radius: 8px;
    padding: 18px 18px 20px;
  }
  body.login-open .login-backdrop {
    display: block;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(2, 33, 68, .55);
  }
  body.login-open .login-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef3f8;
    color: #022144;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  /* Çox dar ekranda düymədə yalnız ikon qalsın */
  @media (max-width: 360px) {
    .login-toggle span { display: none; }
  }

  /* Məzmun */
  div.content_d,
  div.content,
  div.c_l_d,
  div.item,
  div.art { font-size: 14px; line-height: 1.5; }
  div.item,
  div.item div,
  div.item a { text-align: left; } /* dar ekranda justify böyük boşluqlar yaradır */
  div.item div a { font-size: 13px; line-height: 1.4; }
  div.art h1 { font-size: 19px; line-height: 1.35; }
  div.art h2 { font-size: 16px; }
  div.sec_r p,
  div.sec_r div[style*="justify"] { text-align: left !important; } /* inline justify-u üstələyir */
  div.content_d > div.c_l_d > img { display: block; margin: 10px auto; }
  div.sec_r table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Formlar (qeydiyyat, axtarış) */
  .form-item { flex-wrap: wrap; }
  .form-item label { float: none; width: 100%; margin-bottom: 4px; }
  .form-item input[type="text"],
  .form-item input[type="password"],
  .form-item select { float: none; width: 100%; box-sizing: border-box; }
  .adv_search input,
  .adv_search select,
  .adv_search button { width: 100%; margin: 0 0 8px; box-sizing: border-box; }

  /* İndeksləmə loqoları */
  div.bottom-banner-wrap { margin: 0 0 10px; }
  div.bottom-banner { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }

  /* Footer */
  div.footer {
    margin: 0 14px;
    padding: 20px 0 24px;
  }
  div.footer div.ict_logo { float: none; margin: 0 auto 10px; }
  div.footer div.copy { margin: 0; padding: 8px; line-height: 1.6; text-align: center; }
  div.footer div.copy span,
  div.footer div.copy span + span { float: none; display: block; }
  div.lsn { margin-top: 12px; line-height: 1.5; }
}

/* ---------- Kiçik telefon ---------- */
@media (max-width: 600px) {
  div.content_d > div.c_l_d,
  div.content_d > div.c_r_d,
  div.c_l_d,
  div.c_r_d { float: none; width: auto; }
  div.c_r_d { margin-top: 24px; }
}
