/* ==========================================================================
   Outline Button family - IP-Outline-Buttons.md (2026-09-30)
   ==========================================================================
   The ONE shared state set for every hollow (outline) control on the
   public site. Shapes and sizes stay per control (in web.css /
   flow-forms.css / contact-widget.css / the header partial); colors and
   states live here and nowhere else. NOT loaded by the admin layout -
   admin stays untouched until the owner asks (standing direction).

     State            Border (always 1px)          Fill                 Text / icon
     Default          border (#dedede)             fill (#fff)          text (ink)
     Hover            hover-border (light blue)    hover (#eef3f7)      unchanged
     Pressed          active-border (brand blue)   hover                unchanged
     Active/selected  border (unchanged)           active (#eef3f7)     active-text (blue)
       ...Map / List switcher: active-border (brand blue), ink text (section 4)
     Focus-visible    unchanged                    unchanged            2px brand-blue outline, 2px offset
       ...on dark     + 2px white inner ring (box-shadow) between control and outline
     Disabled         border                       fill                 40% opacity, no hover, not-allowed

   IP-Buttons-Color-Consistency.md (2026-10-09) is what added the hover-border / active-border steps
   and the Map / List switcher's selected look; the PL|EN segments' border stays transparent in every
   state (their track owns the border).

   Hard rules: the border WIDTH never changes (1px in every state, so nothing changes size - only
   its colour does), hover and active share the same light blue, font weight never changes, and
   hover applies on pointer devices only (@media (hover: hover)) so it never sticks after a tap
   on phones.

   Who uses it (add class="ip-outline" in markup):
     - header nav tabs Kontakt / Zaloguj się / Moje konto / Cennik /
       Dodaj wpis (.btn-default.nav-btn-light) - current page carries
       aria-current="page"
     - PL|EN language toggle segments (.ip-lang-toggle-seg + .ip-outline--seg,
       aria-pressed) - desktop and phone copies
     - Map / List / Map & List view switcher (.nav-tab, aria-pressed) on
       the dark .footer-nav band (.ip-on-dark)
     - listing-detail category/subcategory tags (.ulist li a)
     - the phone / email / website pills on the listing cards and the listing page
       (.contact-pill, web/partials/contact-links.blade.php; ip-listing-card.css keeps their shape)
     - homepage expanded subcategory rows (.category-list li a)
     - icon buttons: modal Close X (.ipflow-dialog-close), Copy
       (.contact-widget-copy-btn)
     - scroll-to-top (#back-to-top; .ip-outline--on-dark on the results
       pages where it floats over the dark band)
   Mapped here without a markup class:
     - the Button component's Tertiary variant (.btn.btn-tertiary) - it IS
       this family's button, so every Tertiary call site gets the states
       without a second class
   ========================================================================== */

/* ---- 1. Base ------------------------------------------------------------ */
.ip-outline,
.btn.btn-tertiary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--button-outline-border, #dedede);
  background: var(--button-outline-fill, #ffffff);
  color: var(--button-outline-text, #44555b);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
/* Weight is fixed on the generic control (the language toggle's bold
   active segment is what this rule retires). .btn.btn-tertiary is left
   out on purpose: the Button component sets its own weight per size and
   Tertiary must match Primary/Secondary beside it. */
.ip-outline {
  font-weight: 400;
}
/* Segment inside a bordered track (PL|EN toggle): the track owns the
   border, the segment keeps a transparent one so it stays the same size
   in every state like everything else in the family. */
.ip-outline--seg {
  border-color: transparent;
  background: transparent;
}

/* ---- 2. Hover (pointer devices only) ------------------------------------ */
@media (hover: hover) {
  .ip-outline:hover,
  .btn.btn-tertiary:hover {
    background: var(--button-outline-hover, #eef3f7);
    border-color: var(--button-outline-hover-border, var(--info-border));
    color: var(--button-outline-text, #44555b);
    text-decoration: none;
  }
  /* The PL|EN segments sit in a bordered track: their own border stays transparent. */
  .ip-outline--seg:hover {
    border-color: transparent;
  }
}

/* ---- 3. Pressed (mouse down / touch) ------------------------------------ */
.ip-outline:active,
.btn.btn-tertiary:active {
  background: var(--button-outline-hover, #eef3f7);
  border-color: var(--button-outline-active-border, var(--brand-blue));
  color: var(--button-outline-text, #44555b);
  text-decoration: none;
}
.ip-outline--seg:active {
  border-color: transparent;
}
/* Plain (non-visible) focus, e.g. right after a click: keep the resting
   look - the sitewide a:focus / a:hover link rules would otherwise leak
   their link color + underline onto the <a>-based controls. The same
   sitewide rule sets `transition: all`, which would animate the focus
   outline (and the white inner ring) in over 200ms on the <a>-based
   controls - restated here so only fill and text ever transition. */
.ip-outline:hover,
.ip-outline:focus,
.ip-outline:active,
.btn.btn-tertiary:hover,
.btn.btn-tertiary:focus,
.btn.btn-tertiary:active {
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.ip-outline:focus,
.btn.btn-tertiary:focus {
  color: var(--button-outline-text, #44555b);
  text-decoration: none;
}

/* ---- 4. Active / selected ----------------------------------------------- */
/* After hover/pressed/focus in the cascade on purpose: a selected item
   keeps its blue text while hovered or pressed. */
.ip-outline.is-active,
.ip-outline[aria-pressed="true"],
.ip-outline[aria-current="page"],
.btn.btn-tertiary.is-active,
.btn.btn-tertiary[aria-pressed="true"],
.btn.btn-tertiary[aria-current="page"] {
  background: var(--button-outline-active, #eef3f7);
  color: var(--button-outline-active-text, #3270a2);
}
/* The Map / List / Map & List switcher (the only .nav-tab) is the exception (IP-Buttons-Color-Consistency.md): its
   selected view looks like the pressed state - light blue fill, brand-blue border - and its text and icon stay ink,
   like in every other state. Longer selector on purpose: beats the rule above and the hover rule. */
.nav-tab.ip-outline[aria-pressed="true"] {
  border-color: var(--button-outline-active-border, var(--brand-blue));
  color: var(--button-outline-text, #44555b);
}

/* ---- 5. Focus-visible --------------------------------------------------- */
.ip-outline:focus-visible,
.btn.btn-tertiary:focus-visible {
  outline: 2px solid var(--focus-ring, #3270a2);
  outline-offset: 2px;
}
/* On a dark band the 2px outline-offset gap is filled with a white ring
   so the blue outline still reads (focus-ring alone is under 3:1 on
   surface-inverse). .ip-on-dark goes on the band; .ip-outline--on-dark on
   a lone control that floats over one. */
.ip-on-dark .ip-outline:focus-visible,
.ip-outline--on-dark:focus-visible {
  box-shadow: 0 0 0 2px var(--focus-ring-inner, #ffffff);
}

/* ---- 5b. The three round icon buttons: ONE size, ONE focus (owner 2026-11-27) ---------------------------------------------------------
   The modal Close X (.ipflow-dialog-close), the Copy e-mail button (.contact-widget-copy-btn) and the scroll-to-top (#back-to-top) are the same button:
   32 x 32, a circle, an 18px icon, the family's colours and states above - and ONE focus line. The generic focus ring is a 2px outline 2px AWAY from the
   border, which on a small circle reads as two rings (the grey border and, apart from it, the blue line; on the dark band even a third, the white
   one). Here the border itself turns blue and gets a 1px blue edge: a single 2px blue line, no gap (the text fields' focus, web.css). The transparent
   outline is only for Windows high-contrast mode, which drops box-shadow. A pressed Copy button has no legacy inset shadow (.btn:active) and no system focus ring: the same
   pressed look as the other two. */
/* While the mouse is held on a button, Bootstrap's `.btn:active:focus { outline: 5px auto -webkit-focus-ring-color }` draws the system's own focus ring - on a Mac a double ring - round the Copy button (the
   scroll-to-top is not a .btn and never had it). None of the three shows it: pressed is the family's pressed look (the brand-blue border) and nothing else. Before the focus-visible rule below on purpose,
   so a keyboard focus that is also pressed keeps its one blue line. */
.ipflow-dialog-close:active:focus,
.contact-widget-card .contact-widget-row .contact-widget-copy-btn:active:focus,
.listing-share-card .listing-share-card__icon-btn:active:focus,
#back-to-top:active:focus {
  outline: none;
}
.contact-widget-card .contact-widget-row .contact-widget-copy-btn:active,
.listing-share-card .listing-share-card__icon-btn:active {
  box-shadow: none;
}
.ipflow-dialog-close:focus-visible,
.contact-widget-card .contact-widget-row .contact-widget-copy-btn:focus-visible,
.listing-share-card .listing-share-card__icon-btn:focus-visible,
#back-to-top:focus-visible,
#back-to-top.ip-outline--on-dark:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 0;
  border-color: var(--focus-ring, #3270a2);
  box-shadow: 0 0 0 1px var(--focus-ring, #3270a2);
}
/* The scroll-to-top floats, so it keeps its elevation shadow under the focus line. */
#back-to-top:focus-visible {
  box-shadow: 0 0 0 1px var(--focus-ring, #3270a2), var(--elevation-3, 0 8px 16px rgba(68, 85, 91, 0.18));
}
#back-to-top.ip-outline--on-dark:focus-visible {
  box-shadow: 0 0 0 1px var(--focus-ring, #3270a2), var(--elevation-on-dark, 0 4px 8px rgba(0, 0, 0, 0.25));
}

/* ---- 6. Disabled (last: beats hover/pressed at equal specificity) ------- */
.ip-outline:disabled,
.ip-outline.is-disabled,
.ip-outline[aria-disabled="true"],
.btn.btn-tertiary:disabled,
.btn.btn-tertiary[disabled],
.btn.btn-tertiary.disabled {
  opacity: .4;
  cursor: not-allowed;
  background: var(--button-outline-fill, #ffffff);
  border-color: var(--button-outline-border, #dedede);
  color: var(--button-outline-text, #44555b);
}
