/*
Theme Name: Ostoja
Theme URI: https://ostoja.pl
Author: Sławomir Zieliński
Description: Premium fintech theme for Ostoja — automatyczne mikro-oszczędności na IKZE. Elementor-ready (header, footer & blog handled by the theme; landing sections shipped as Elementor widgets in the companion plugin "ostoja-elementor"). Works with the free version of Elementor.
Version: 1.0.5
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ostoja
Tags: fintech, elementor, blog, custom-colors, full-width-template
*/

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ost-font);
  background: var(--ost-background);
  color: var(--ost-foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ost-primary); text-decoration: none; transition: color .15s var(--ost-ease); }
a:hover { color: var(--ost-forest); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; color: var(--ost-foreground); }

.ost-container { max-width: var(--ost-container); margin-inline: auto; padding-inline: 1.5rem; }

.ost-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.ost-skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100000;
  background: var(--ost-primary); color: var(--ost-primary-foreground);
  padding: .75rem 1.25rem; border-radius: 0 0 .75rem 0;
}
.ost-skip-link:focus { left: 0; color: var(--ost-primary-foreground); }

/* ============================================================
   Buttons (shared with widgets)
   ============================================================ */
.ost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 500; font-size: .875rem; line-height: 1; cursor: pointer;
  border-radius: 9999px; border: 1px solid transparent;
  padding: 0 1.5rem; height: 3rem; white-space: nowrap;
  transition: background-color .15s var(--ost-ease), color .15s var(--ost-ease), transform .1s var(--ost-ease);
}
.ost-btn:active { transform: scale(.985); }
.ost-btn--primary { background: var(--ost-primary); color: var(--ost-primary-foreground); box-shadow: var(--ost-shadow-soft); }
.ost-btn--primary:hover { background: var(--ost-forest); color: var(--ost-primary-foreground); }
.ost-btn--ghost { background: var(--ost-card); color: var(--ost-foreground); border-color: rgba(36,53,45,.15); box-shadow: var(--ost-shadow-soft); }
.ost-btn--ghost:hover { background: var(--ost-secondary); }
/* Flat text button — no fill/border/shadow until hover (header "Zaloguj"). */
.ost-btn--text { background: transparent; color: var(--ost-foreground); border-color: transparent; box-shadow: none; border-radius: .5rem; }
.ost-btn--text:hover { background: var(--ost-secondary); color: var(--ost-foreground); }
.ost-btn--cream { background: var(--ost-cream); color: var(--ost-foreground); }
.ost-btn--sm { height: 2rem; padding: 0 1rem; font-size: .75rem; }

/* Header action buttons match the preview: text login + green pill, both the
   SAME height (like the original, where Zaloguj and Early access are both h-8). */
.ost-header__actions .ost-btn { height: 2.25rem; font-size: .8125rem; }
.ost-header__actions .ost-btn--primary { padding-inline: 1.375rem; }
.ost-header__login { display: none; padding-inline: .875rem; } /* hidden on phones (hidden sm:inline-flex) */
@media (min-width: 640px) { .ost-header__login { display: inline-flex; } }

/* ============================================================
   Header
   ============================================================ */
.ost-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--ost-background) 70%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--ost-border) 60%, transparent);
}
.ost-header__inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.ost-brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ost-foreground); }
.ost-brand__mark {
  height: 2rem; width: 2rem; border-radius: 9999px; background: var(--ost-gradient-forest);
  display: flex; align-items: center; justify-content: center;
  color: var(--ost-cream); font-size: .875rem; font-weight: 600;
}
.ost-brand__logo { height: 2rem; width: auto; }
.ost-nav { display: none; align-items: center; gap: 2rem; font-size: .875rem; list-style: none; margin: 0; padding: 0; }
.ost-nav ul { display: flex; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; } /* covers the wp_page_menu fallback (it wraps items in <ul>) */
.ost-nav li { list-style: none; margin: 0; padding: 0; }
.ost-nav li::marker { content: ""; } /* kill default bullet on <li> flex items in engines that still draw it */
.ost-nav a { color: var(--ost-muted-foreground); text-decoration: none; }
.ost-nav a:hover, .ost-nav .current-menu-item > a { color: var(--ost-foreground); }
.ost-header__actions { display: flex; align-items: center; gap: .5rem; }
.ost-nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border: 0; background: transparent; cursor: pointer; color: var(--ost-foreground);
}
@media (min-width: 768px) {
  .ost-nav { display: flex; }
  .ost-nav-toggle { display: none; }
}
.ost-mobile-nav { display: none; padding: 1rem 1.5rem; border-bottom: 1px solid var(--ost-border); background: var(--ost-card); }
.ost-mobile-nav.is-open { display: block; }
.ost-mobile-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.ost-mobile-nav a { display: block; padding: .625rem .25rem; color: var(--ost-foreground); }

/* ============================================================
   Footer
   ============================================================ */
.ost-footer { border-top: 1px solid var(--ost-border); }
.ost-footer__inner {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 3rem; font-size: .875rem; color: var(--ost-muted-foreground);
}
.ost-footer__brand { display: flex; align-items: center; gap: .5rem; }
.ost-footer__brand .ost-brand__mark { height: 1.75rem; width: 1.75rem; border-radius: 9999px; font-size: .75rem; }
.ost-footer__links { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.ost-footer__links ul { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.ost-footer__links li { list-style: none; margin: 0; padding: 0; }
.ost-footer__links li::marker { content: ""; }
.ost-footer__links a { color: var(--ost-muted-foreground); text-decoration: none; }
.ost-footer__links a:hover { color: var(--ost-foreground); }
@media (min-width: 640px) { .ost-footer__inner { flex-direction: row; } }

/* ============================================================
   Page title (archives / non-Elementor pages)
   ============================================================ */
.ost-page-hero { background: var(--ost-gradient-hero); position: relative; overflow: hidden; }
.ost-page-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--ost-grain); background-size: 24px 24px; opacity: .6; pointer-events: none; }
.ost-page-hero__inner { position: relative; padding-block: 5rem 3rem; text-align: center; }
.ost-eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .18em; color: color-mix(in oklab, var(--ost-primary) 80%, transparent); margin-bottom: 1rem; }
.ost-page-hero h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
.ost-page-hero p { margin-top: 1rem; color: var(--ost-muted-foreground); max-width: 42rem; margin-inline: auto; }

/* ============================================================
   Default page template (page.php)
   ============================================================ */
.ost-page__header { padding-block: 3.5rem 1.5rem; }
.ost-page__title { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0; }
/* Normal content pages (polityka, regulamin, formularze) align to the SAME
   1280px column as the header/footer, with matching side padding — so nothing
   bleeds out of line. Elementor landing pages should use the "Ostoja — Pełna
   szerokość" or "Canvas" page template instead (those bypass this wrapper and
   render edge-to-edge). */
.ost-page__content {
  max-width: var(--ost-container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
/* Comfortable vertical rhythm for editor / CF7 content. */
.ost-page__content > * { margin-block: 0 1.25rem; }
.ost-page__content > :last-child { margin-bottom: 0; }
.ost-page__content > h2 { margin-top: 2.5rem; }
.ost-page__content > h3 { margin-top: 2rem; }
/* Pagelinks already carry .ost-container in markup; keep them flush, not doubly inset. */
.ost-page__content > .ost-page__pagelinks { padding-inline: 0; }
.ost-page__pagelinks { margin-block: 2rem; display: flex; gap: .5rem; }

/* ============================================================
   Search form (widget + get_search_form) — pill field + green pill button
   ============================================================ */
.ost-search { display: flex; align-items: center; gap: .6rem; }
.ost-search__field {
  flex: 1 1 auto;
  min-width: 0;
  height: 3rem;
  padding: 0 1.25rem;
  border-radius: 9999px;
  border: 1px solid var(--ost-input);
  background: var(--ost-card);
  color: var(--ost-foreground);
  font-family: inherit;
  font-size: .95rem;
}
.ost-search__field::placeholder { color: var(--ost-muted-foreground); }
.ost-search__field:focus { outline: 2px solid color-mix(in oklab, var(--ost-primary) 50%, transparent); outline-offset: 2px; }
.ost-search__submit {
  flex: 0 0 auto;
  height: 3rem;
  padding: 0 1.5rem;
  border-radius: 9999px;
  border: 0;
  background: var(--ost-primary);
  color: var(--ost-primary-foreground);
  font-family: inherit;
  font-weight: 500;
  font-size: .95rem;
  cursor: pointer;
  transition: background-color .15s var(--ost-ease);
}
.ost-search__submit:hover { background: var(--ost-forest); }

/* Fallback: block-based Search widget/block (.wp-block-search) */
.wp-block-search .wp-block-search__inside-wrapper { display: flex; align-items: center; gap: .6rem; border: 0; }
.wp-block-search .wp-block-search__input {
  height: 3rem; padding: 0 1.25rem;
  border-radius: 9999px;
  border: 1px solid var(--ost-input);
  background: var(--ost-card);
  color: var(--ost-foreground);
  font-family: inherit; font-size: .95rem;
}
.wp-block-search .wp-block-search__input:focus { outline: 2px solid color-mix(in oklab, var(--ost-primary) 50%, transparent); outline-offset: 2px; }
.wp-block-search .wp-block-search__button {
  margin: 0;
  height: 3rem; padding: 0 1.5rem;
  border-radius: 9999px; border: 0;
  background: var(--ost-primary); color: var(--ost-primary-foreground);
  font-weight: 500; cursor: pointer;
  transition: background-color .15s var(--ost-ease);
}
.wp-block-search .wp-block-search__button:hover { background: var(--ost-forest); }

/* ============================================================
   Back-to-top button
   ============================================================ */
.ost-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: var(--ost-primary);
  color: var(--ost-primary-foreground);
  box-shadow: var(--ost-shadow-card);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s var(--ost-ease), transform .2s var(--ost-ease), background-color .15s var(--ost-ease), visibility .2s;
}
.ost-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.ost-to-top:hover { background: var(--ost-forest); color: var(--ost-primary-foreground); }
.ost-to-top:active { transform: scale(.94); }
.ost-to-top svg { width: 1.25rem; height: 1.25rem; }
@media (prefers-reduced-motion: reduce) {
  .ost-to-top { transition: opacity .2s, visibility .2s; transform: none; }
}

/* ============================================================
   App-download modal (smart "Pobierz aplikację" buttons)
   ============================================================ */
.ost-appmodal[hidden] { display: none; }
.ost-appmodal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.ost-appmodal__backdrop {
  position: absolute; inset: 0;
  background: rgba(36, 53, 45, .45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.ost-appmodal__dialog {
  position: relative; z-index: 1;
  width: 100%; max-width: 24rem;
  background: var(--ost-card); color: var(--ost-foreground);
  border-radius: var(--ost-radius); box-shadow: var(--ost-shadow-card);
  padding: 2.25rem 1.75rem 2rem; text-align: center;
  animation: ost-fade-up .2s var(--ost-ease);
}
.ost-appmodal__close {
  position: absolute; top: .75rem; right: .75rem;
  width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ost-muted-foreground);
  border-radius: 9999px; cursor: pointer;
  transition: background-color .15s var(--ost-ease), color .15s var(--ost-ease);
}
.ost-appmodal__close:hover { background: var(--ost-secondary); color: var(--ost-foreground); }
.ost-appmodal__title { font-size: 1.375rem; margin: 0 0 .5rem; }
.ost-appmodal__text { margin: 0 0 1.5rem; color: var(--ost-muted-foreground); font-size: .95rem; }
.ost-appmodal__actions { display: grid; gap: .75rem; }
.ost-appmodal__btn { width: 100%; }
.ost-appmodal__btn[data-empty] { opacity: .5; cursor: not-allowed; }
.ost-appmodal__soon { margin: 1.25rem 0 0; font-size: .8125rem; color: var(--ost-muted-foreground); }
@media (prefers-reduced-motion: reduce) {
  .ost-appmodal__dialog { animation: none; }
}

/* ============================================================
   Hover tooltip ("dymek") — add class .ost-tip to any button/link.
   Text comes from the data-ost-tip attribute; when absent, the default
   below is used (so an Elementor button only needs the class).
   ============================================================ */
.ost-tip { position: relative; }
.ost-tip::before,
.ost-tip::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s var(--ost-ease), transform .15s var(--ost-ease), visibility .15s;
  z-index: 60;
}
/* Bubble */
.ost-tip::after {
  content: attr(data-ost-tip);
  top: calc(100% + .6rem);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 14rem;
  padding: .5rem .75rem;
  border-radius: .6rem;
  background: var(--ost-foreground);
  color: var(--ost-cream);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  box-shadow: var(--ost-shadow-card);
}
.ost-tip:not([data-ost-tip])::after { content: "Bez instalacji – zacznij w 30 sekund."; }
/* Arrow */
.ost-tip::before {
  content: "";
  top: calc(100% + .25rem);
  transform: translateX(-50%) translateY(4px) rotate(45deg);
  width: .6rem; height: .6rem;
  background: var(--ost-foreground);
  border-radius: .1rem;
}
.ost-tip:hover::after,
.ost-tip:focus-visible::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.ost-tip:hover::before,
.ost-tip:focus-visible::before { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0) rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  .ost-tip::before, .ost-tip::after { transition: opacity .15s, visibility .15s; }
}
