/* ============================================================================
   responsive-fixes.css  —  TAL website
   Custom overrides loaded AFTER application.min(-en).css.
   Keep all hand-written responsive corrections here so the 457 KB minified
   theme file is never edited directly.

   Created 2026-06-25 — Fix: mobile hamburger menu would not open.
   ----------------------------------------------------------------------------
   Cause: tapping the hamburger correctly adds `-responsive-menu-active` to
   <body>, and the theme JS populates the `.responsive-menu` drawer, but the
   drawer's open-state CSS was broken:
     - tablet widths: drawer stayed parked off-screen (right:-300px, no rule
       ever moved it to right:0);
     - phone widths : drawer was on-screen but its inner wrapper collapsed to
       height:1px, so nothing was visible.
   This restores a proper full-height slide-in drawer below the breakpoint
   where the hamburger appears (61.25em / 980px).
   ========================================================================== */

/* Hide the mega-menu's decorative top-left corner arc (+ its shadow). At
   intermediate widths (~960–1050px) the top nav bar wraps and drops
   "Faire carrière au TAL" onto a second row directly above this corner, so the
   white arc pokes up into that cell. Hiding only this one corner removes the
   glitch; the search-box and other corners are untouched. */
.main-menu > .border-svg.-top.-left {
  display: none !important;
}

/* Close the 981–999px "dead band": the theme only shows the desktop top bar
   (.piv.second — Accueil / À propos / … / Bail électronique / English) at
   ≥62.5em (1000px), while the hamburger only appears at ≤61.25em (980px). That
   leaves 981–999px with no top navigation at all (the mega-menu still shows).
   Re-apply the desktop top-bar layout across that gap only. The theme's own
   ≥62.5em rules take over at 1000px, so this block is bounded to <62.5em. */
@media screen and (min-width: 61.3125em) and (max-width: 62.4375em) {
  .piv.second { display: block; }
  .piv.second .links { display: inline-block; }
  .piv.second .links li {
    display: inline-block;
    padding: .625em 1em;
    border-right: 2px solid #fff;
    margin-right: -0.25em;
  }
  .piv.second .language { display: inline-block; text-align: right; }
  .piv.second .social-media-logo {
    display: inline-block;
    width: 1.5625em;
    height: auto;
    vertical-align: middle;
    margin-left: .625em;
  }
}

@media only screen and (max-width: 61.25em) {

  /* Reveal the populated mobile drawer when the menu is toggled open */
  .-responsive-menu-active .responsive-menu {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 320px !important;
    max-width: 90vw !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    z-index: 9999 !important;
  }

  /* The theme collapses these inner containers to ~1px; let them grow so the
     menu items are actually visible and the drawer can scroll. */
  .-responsive-menu-active .responsive-menu > div,
  .-responsive-menu-active .responsive-menu-wrapper {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
  }

  /* The markup is duplicated and renders TWO drawers; responsive-fixes.js
     marks the empty/duplicate one so only the populated drawer shows. */
  .-responsive-menu-active .responsive-menu.talfix-hide {
    display: none !important;
  }

  /* Close (X) button pinned to the top of the open drawer (added by
     responsive-fixes.js). On phones the drawer covers the header toggle, so
     this gives a reliable way to close the menu. */
  .responsive-menu .talfix-close {
    position: sticky;
    top: 0;
    z-index: 20;
    display: block;
    margin: 0 0 0 auto;       /* right-aligned */
    width: 56px;
    height: 48px;
    padding: 0;
    border: 0;
    background: #095797;
    color: #fff;
    font-size: 30px;
    line-height: 46px;
    text-align: center;
    cursor: pointer;
  }
  .responsive-menu .talfix-close:hover,
  .responsive-menu .talfix-close:focus {
    background: #08416f;
  }

  /* --- Align the search block and language link with the other menu rows. ---
     The theme's desktop search form (inline label + a submit icon that drops to
     its own line, looking like a stray "+") and the language link's inline 1em
     indent don't fit the drawer. We reuse the rows' existing 20px indent for
     alignment, and keep every WIDTH fluid (flex / % / box-sizing) so the drawer
     stays responsive at any width. */
  .responsive-menu .search-engine-block {
    box-sizing: border-box;
    padding-left: 20px;   /* same indent as the other menu rows */
    padding-right: 20px;
  }
  /* The theme treats the search row (li.main-menu-links-0) like a main menu
     item and paints decorative border SVGs and an expander "+" handle on it.
     The search row has no submenu, so suppress all of that — the only control
     is our magnifier submit button below. */
  .responsive-menu .search-engine-block svg,
  .responsive-menu .search-engine-block .btn,
  .responsive-menu .search-engine-block [class*="handle"],
  .responsive-menu .search-engine-block [data-js*="handle"] {
    display: none !important;
  }
  .responsive-menu .search-engine-block .search-form-block {
    display: flex;
    align-items: flex-end;   /* submit icon lines up with the input, not the label */
    width: 100%;
  }
  .responsive-menu .search-engine-block .search-form-block-input-wrapper {
    flex: 1 1 auto;
    min-width: 0;            /* allow the input to shrink instead of overflow */
  }
  .responsive-menu .search-engine-block label {
    display: block;
    margin: 0 0 0.35em;
    padding: 0;
  }
  .responsive-menu .search-engine-block .form-item {
    margin: 0;
  }
  .responsive-menu .search-engine-block input[type="text"],
  .responsive-menu .search-engine-block input:not([type]) {
    width: 100%;
    box-sizing: border-box;
  }
  /* Submit button: the theme renders it as a bare icon-font glyph that, in the
     drawer, looks exactly like the menu's "+" expanders. Make it an unmistakable
     search button — a small blue square with a magnifier drawn as a background
     SVG (no icon-font dependency). The inner glyph is kept (its click submits)
     but made invisible so the stray "+" disappears. */
  .responsive-menu .search-engine-block .search-form-block-submit {
    flex: 0 0 auto;
    margin: 0 0 0 0.5em;
    width: 2.6em;
    height: 2.6em;
    padding: 0;
    border: 0;
    cursor: pointer;
    position: relative;   /* sit above any theme decoration in this row */
    z-index: 1;
    overflow: hidden;     /* clip anything the theme overflows into this box */
    background: #095797
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E")
      center / 1.3em no-repeat;
  }
  .responsive-menu .search-engine-block .search-form-block-submit:hover,
  .responsive-menu .search-engine-block .search-form-block-submit:focus-within {
    background-color: #08416f;
  }
  /* Remove the inner icon-font glyph entirely; the <button type="submit"> still
     submits on click, so the glyph element is purely decorative. */
  .responsive-menu .search-engine-block .search-form-block-submit .icon,
  .responsive-menu .search-engine-block .search-form-block-submit [class*="icon"] {
    display: none !important;
  }

  /* Language link sits at the same 20px indent (its inline pad is also stripped
     in responsive-fixes.js; this is the stylesheet backstop). */
  .responsive-menu .responsive-language-menu a {
    padding-left: 0 !important;
  }

  /* Logement/Avocats are collapsed to plain links by responsive-fixes.js
     (flattenSingleLevel). Mirror the sibling top-level buttons EXACTLY: they
     use margin:0 24px (box runs 24px..-24px), no padding, a 50px row and a
     1px #e4dde0 bottom border (the row divider). We also force navy/bold — the
     theme paints a plain <a> maroon (#530f32), so colour must be overridden. */
  .responsive-menu .responsive-main-menu > li.talfix-flattened > a,
  .responsive-menu .responsive-header-menu > li.talfix-flattened > a {
    display: flex !important;
    align-items: center;
    box-sizing: border-box;
    min-height: 50px;
    margin: 0 24px !important;
    padding: 0 !important;
    text-indent: 0 !important;
    color: #13315c !important;
    font-weight: 700;
    text-decoration: none !important;
    border-bottom: 1px solid #e4dde0 !important;
  }
  /* Belt-and-braces: kill any theme leading pseudo/icon on the flattened link
     that could push the text right of the 24px indent. */
  .responsive-menu .responsive-main-menu > li.talfix-flattened > a::before,
  .responsive-menu .responsive-header-menu > li.talfix-flattened > a::before {
    content: none !important;
    display: none !important;
  }

  /* Breathing room between the last menu divider (Formulaires et avis) and the
     "Recherche" search block — they were flush against each other. rem keeps it
     proportional across device sizes. */
  .responsive-menu .responsive-main-menu > li.search-engine-block {
    margin-top: 1.25rem;
  }

  /* Separate the header links (… "Faire carrière au TAL" / "Careers at the
     TAL") from the footer links ("Plan du site" / "Site map" …): the two lists
     ran together with nothing between them. Reuse the drawer's own group
     divider — the 1px #e4dde0 full-width line the theme already draws around
     the language block (.responsive-menu .language). Putting it on the first
     footer <li> (instead of the <ul>) means no stray line if the footer list
     is ever empty; moving the list's 20px pad onto that item keeps the line
     evenly spaced — 20px above (the last header row's margin) and 20px below.
     Same markup/classes in FR and EN, so this one rule covers both. */
  .responsive-menu .responsive-footer-menu {
    padding-top: 0;
  }
  .responsive-menu .responsive-footer-menu > li:first-child {
    border-top: 1px solid #e4dde0;
    padding-top: 1.25rem;
  }
}

/* On small phones make the drawer full-width for easier tapping */
@media only screen and (max-width: 30em) {
  .-responsive-menu-active .responsive-menu {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ============================================================================
   Fix: Info-offices "Important notice" — round appointment icons drift out of
   line with their labels when the text wraps.
   Added 2026-07-09.

   The note content (#contenuNote / .important-note-content) is authored in the
   office DB record as two small tables (round icon cell | link/label cell).
   The label cell carries inline `vertical-align:top; height:45px`, while the
   icon cell defaults to middle — so once "Make an appointment online" /
   "Prendre un rendez-vous en ligne" wraps to 2–3 lines the icon no longer
   lines up with it, and the two rows don't even align the same way (the online
   row is top-aligned, the phone row middle-aligned).

   Center both cells and drop the fixed height so the icon stays vertically
   centred on its label at any viewport width, in both EN and FR. Not inside a
   media query: the label can wrap (and misalign) at any width, not just mobile.
   ========================================================================== */
/* The appointment block is authored in the office DB record as TWO separate
   one-row tables (round icon | wrapping label). Because they are separate
   tables the label columns can't share a width, and the two icons are authored
   at different sizes (pointer 2em, phone 1.3em) with different top/middle
   alignment — so the icons don't form a column, the labels start at different
   x, and the icon drifts off its label when the text wraps.

   Re-lay each row out with flexbox and a FIXED icon column. This makes the icon
   column identical on both rows (labels always start at the same x), stacks the
   two icons in a centred vertical column, and keeps the icon centred on its
   label however many lines it wraps to — at any viewport width, in EN and FR.
   The note content is only this block plus paragraphs, so retyping its tables
   to block/flex is safe. */
.important-note-content table,
.important-note-content tbody,
.important-note-content tr,
.important-note-content td {
  display: block;
  border: 0 !important;
  overflow: visible !important;   /* the inline overflow:hidden clips the circle */
}
.important-note-content tr {
  display: flex;
  align-items: center;            /* icon centred on the (wrapping) label */
  padding: 4px 0;                 /* vertical room so the circles never touch/cut */
}
.important-note-content td:first-child {
  flex: 0 0 2em;                  /* fixed icon column -> labels line up */
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto !important;
  padding: 0 8px 0 0 !important;  /* small, even gap before the label */
}
.important-note-content td:last-child {
  flex: 1 1 auto;
  min-width: 0;                   /* let the label wrap instead of overflow */
  height: auto !important;
  padding: 0 !important;
}
/* one size for both round icons so the two circles match */
.important-note-content .icon-rounded-pointer,
.important-note-content .icon-rounded-phone {
  font-size: 1.7em !important;
  line-height: 1 !important;
}
