/* ==========================================================================
   responsive-fixes.css  (added 2026-11-27)
   Layout / responsiveness fixes for the public site. Loaded LAST in
   partials/header.blade.php so it overrides 5.css / 18.css / site.css /
   inline page styles without editing those legacy files.
   To roll back: remove the <link> to this file in partials/header.blade.php.
   ========================================================================== */

/* ---------- 1. Global safety nets ---------------------------------------- */
img, video, iframe, embed, object { max-width: 100%; }
#innerContent img, .mcontent img { height: auto; }
#innerContent, .mcontent { overflow-wrap: break-word; word-wrap: break-word; }
/* Wide CMS tables get a scroll wrapper from site-fixes.js */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1em; }
.table-scroll > table { margin-bottom: 0; }

/* Visible keyboard focus everywhere (WCAG 2.4.7) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #f7931e;
  outline-offset: 2px;
}

/* "Visually hidden" must stay readable by screen readers (was display:none) */
label.visually-hidden, .visually-hidden {
  display: block !important;
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- 2. Desktop gutters (content was 3px from the screen edge) ---- */
@media only screen and (min-width: 1024px) {
  .container { padding-left: 20px; padding-right: 20px; }
  .container .container { padding-left: 0; padding-right: 0; }
}

/* ---------- 3. Main navigation between 1024 and 1279px -------------------
   Twelve top-level items do not fit on one line; they wrapped into a
   112px-high two-row bar with 56px line spacing. Keep one bar, let long
   labels wrap inside their own item.                                       */
@media only screen and (min-width: 1024px) and (max-width: 1279px) {
  #nav > li > a {
    display: flex;
    align-items: center;
    min-height: 62px;
    line-height: 18px;
    padding: 6px 5px;
    font-size: 13px;
    text-align: center;
  }
  .menuPart #nav > li.hasChild > a::after { flex: 0 0 auto; }
}

/* ---------- 4. Header on tablets & phones -------------------------------- */
@media only screen and (max-width: 800px) {
  .header-container {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
  }
  .header-container .logo { align-items: center; min-width: 0; flex: 1 1 0; }
  .header-container .logo-img { width: 56px; height: auto; flex: 0 0 auto; }
  .logo-text { font-size: 16px; line-height: 1.25; }
  .logo-subtext { font-size: 14px; }
  .header-tools { flex: 0 0 auto; }
  .icon-bar li + li::before { height: 28px; margin: 0 6px; }
  .icon-bar li img { width: 28px; height: 28px; }

  /* Search: the header box is hidden below 800px and the menu search icon
     toggled an element that does not exist. site-fixes.js now toggles
     body.mobile-search-open, which shows the real search form.          */
  .menuSearchBox { display: block !important; }
  .header-container #search_form { display: none; }
  body.mobile-search-open .header-container {
    flex-wrap: wrap;
  }
  body.mobile-search-open .header-container #search_form {
    display: block;
    order: 3;
    flex: 1 0 100%;
  }
  body.mobile-search-open .header-container .search-box {
    display: flex !important;
    margin: 4px 0 0;
  }
  body.mobile-search-open .search-box input { width: 100%; flex: 1 1 auto; padding: 10px; font-size: 16px; }
}
@media only screen and (max-width: 400px) {
  .header-container .logo-img { width: 46px; }
  .logo-text { font-size: 14px; }
  .logo-subtext { font-size: 13px; }
  .logo-text-wrapper { margin-left: 8px; }
  .icon-bar li img { width: 26px; height: 26px; }
  .icon-bar li button { padding: 3px; }
}

/* Accessibility panel must never be wider than the screen */
@media only screen and (max-width: 480px) {
  .access_panel { width: calc(100vw - 20px); max-width: 360px; right: -6px; }
  .access_panel_column { padding: 10px 6px; }
}

/* ---------- 5. Home: notice popup ----------------------------------------
   Was fixed at left:250px / width:62% (off-centre on most screens, could
   run off the bottom of short screens).                                   */
.popup#demo {
  left: 50%;
  top: 50%;
  width: 92%;
  max-width: 860px;
  transform: translate(-50%, -50%);
}
.popup#demo .popup-content {
  display: block;
  max-height: 85vh;
  overflow-y: auto;
  padding: 10px 52px 10px 20px;
}
@media only screen and (max-width: 767px) {
  .popup#demo { position: fixed; left: 50%; width: 94%; }
  .popup#demo .popup-content { padding: 44px 14px 10px; }
  .popup#demo .popup-close { top: 6px; right: 6px; }
  .popup#demo .mission p[style*="justify"] { text-align: left !important; }
}

/* ---------- 6. Home: slider caption --------------------------------------
   On phones the caption bar had a 220px min-height under a 1-2 line title
   (large empty navy block).                                               */
@media only screen and (max-width: 1023px) {
  /* Slide images have different aspect ratios (1440x550, 1170x500, 800x278..)
     so every slide had a different height and the banner showed blank space.
     Use one ratio and a fixed caption height (title clamped to 3 lines). */
  .indexBanner .sliderImg, .indexBanner .sliderImg img { min-height: 0 !important; }
  .indexBanner .sliderImg img { width: 100%; height: auto; aspect-ratio: 1440 / 550; object-fit: cover; }
  .indexBanner .contentWidthSlider .sliderText {
    min-height: 0 !important; max-height: none;
    height: 108px; overflow: hidden;
    padding: 12px 0 34px;
  }
  .indexBanner .contentWidthSlider .sliderText .title {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    overflow: hidden;
  }
}

/* ---------- 7. Home: blocks on tablets/phones ---------------------------- */
@media only screen and (max-width: 800px) {
  .contentleftBlocknew { padding-right: 0; }
  .contentRightBlock, .meaInfoBlock .contentRightBlock {
    float: none;
    clear: both;
    width: auto !important;
    margin: 10px 0 0 !important;
  }
  .contentRightBlock_1 { float: none; clear: both; width: auto; margin: 10px 0 0; }

  /* Important links: bullets were outside the box, text centred */
  .impHomeLinks { margin: 0; padding: 0 10px; width: auto; text-align: left; }
  .impHomeLinks li { float: none; width: auto; margin: 0 0 3px; text-align: left; }

  /* Quick-link tiles: ran 5px off the left and 29px off the right edge */
  div.resTabIcons { margin: 15px 0 0; width: auto; }
  .resTabIcons .iconBox { width: 50%; padding: 0 6px; }
  .resTabIcons .iconBox:nth-child(odd) { padding-left: 0; }
  .resTabIcons .iconBox:nth-child(even) { padding-right: 0; }

  /* Partner logos: four tiny tiles in a row */
  .card-main { flex-wrap: wrap; gap: 10px; }
  .card-main .card { flex: 1 1 calc(50% - 10px); margin: 0; }
}

/* India Perspectives: the cards column was cut off (max-height + overflow) */
@media only screen and (max-width: 1024px) {
  .india-perspectives-wrapper { max-height: none !important; }
}
@media only screen and (max-width: 640px) {
  .india-perspectives-wrapper .ip-left-panel { flex: 1 1 100%; min-height: 300px; }
  .india-perspectives-wrapper .ip-right-col { flex: 1 1 100%; min-width: 0; }
  .india-perspectives-wrapper .ip-card-img-panel { width: 96px; }
  .india-perspectives-wrapper .ip-card-img { max-width: 80px; }
  .india-perspectives-wrapper .ip-archive-img { width: 70px; height: 90px; }
}

/* Fixed heights left an empty navy area under the e-Arrival image */
.imp-bg--home { height: auto !important; padding-bottom: 6px; }
.botimgnew1 .imp-links-box { height: auto; min-height: 194px; }

/* Commercial representative e-mail overflowed on phones */
.info-text, .info-text-top { overflow-wrap: anywhere; }

/* ---------- 8. Inner pages ----------------------------------------------- */
@media only screen and (max-width: 767px) {
  /* Justified text leaves large word gaps on narrow screens */
  #innerContent p[style*="justify"], #innerContent div[style*="justify"],
  .mcontent p[style*="justify"], #innerContent [align="justify"] { text-align: left !important; }

  /* Form controls: consistent full-width, 44px touch targets, 16px text
     (stops iOS zooming into the field)                                  */
  #innerContent input[type="text"], #innerContent input[type="email"],
  #innerContent input[type="tel"], #innerContent input[type="number"],
  #innerContent input[type="password"], #innerContent input[type="date"],
  #innerContent select, #innerContent textarea {
    max-width: 100%;
    min-height: 40px;
    font-size: 16px;
  }

  /* Table-based forms (e.g. /Registration): label column + input column did
     not fit; inputs ran off the screen. Stack label above field. */
  #innerContent form table, #innerContent form tbody,
  #innerContent form tr, #innerContent form td {
    display: block;
    width: 100% !important;
  }
  #innerContent form td { padding: 2px 0 !important; }
  #innerContent form td input[type="text"], #innerContent form td input[type="email"],
  #innerContent form td input[type="tel"], #innerContent form td input[type="date"],
  #innerContent form td select, #innerContent form td textarea { width: 100% !important; }
}

/* ---------- 9. Footer ---------------------------------------------------- */
/* .footerRight_number is now a <div> (was an unclosed <label>); 18.css gave it
   a fixed 60px height that only had no effect while it was inline. */
.footerRight_number { display: block; height: auto !important; }
.footerRight_number p { margin: 0 0 6px; }
