/*
 * APIS biuroserwis — apis.az.pl
 * Modern, mobile-first rebuild of the legacy green theme.
 * Centered card layout, logo hero, accessible nav, feature cards, FAQ.
 */

:root {
  --green: #0a7d3a;
  --green-bright: #11a24c;
  --green-dark: #064e2a;
  --green-darker: #053d20;
  --ink: #1b2a20;
  --muted: #5c6f63;
  --line: #d9e6dc;
  --bg: #eaf1ea;
  --card: #ffffff;
  --link: #0a6b34;
  --link-hover: #053d20;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(5, 61, 32, 0.12);
  --maxw: 900px;
}

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

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

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(
      1200px 600px at 50% -10%,
      rgba(17, 162, 76, 0.1),
      transparent 60%
    );
  background-attachment: fixed;
}

img {
  border: 0;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  color: var(--link-hover);
}

:focus-visible {
  outline: 3px solid var(--green-bright);
  outline-offset: 2px;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 14px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---- Card layout ---- */
.page {
  max-width: var(--maxw);
  margin: 24px auto;
  padding: 0 16px;
}

.content {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---- SEO header strip (thin bar above logo, like the original) ---- */
.site-header {
  padding: 3px 10px;
  background-color: var(--green);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  line-height: 1.4;
}

.site-header h1,
.site-header h2 {
  display: inline;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: normal;
  color: inherit;
}

/* ---- Hero (logo only) ---- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(1.25rem, 4vw, 2.25rem) 1.25rem clamp(1rem, 3vw, 1.75rem);
  text-align: center;
  color: #fff;
  background:
    radial-gradient(120% 120% at 85% 0%, rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(135deg, var(--green-bright) 0%, var(--green) 45%, var(--green-darker) 100%);
}

.hero-logo {
  display: inline-block;
  line-height: 0;
}

.hero-logo img {
  width: clamp(200px, 46vw, 320px);
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.hero-tagline {
  margin: 0;
  font-size: clamp(0.78rem, 2.1vw, 0.92rem);
  color: #d3eedb;
}

/* ---- Navigation ---- */
.menu {
  background: var(--green-dark);
}

.menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: block;
  padding: 0.7rem 1.1rem;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #eafaef;
  border-bottom: 3px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.menu a:hover,
.menu a:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.menu li.active a,
.menu a[aria-current="page"] {
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  border-bottom-color: var(--green-bright);
}

/* ---- Main content ---- */
.main {
  padding: clamp(1.25rem, 4vw, 2.25rem) clamp(1rem, 4vw, 2.5rem);
}

.inner {
  max-width: 680px;
  margin: 0 auto;
}

.inner > :first-child {
  margin-top: 0;
}

.lead {
  font-size: 1.02rem;
}

.main h2 {
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  font-size: 1.25rem;
  color: var(--green-dark);
  border-bottom: 2px solid var(--line);
}

.main h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--green-dark);
}

.left {
  text-align: left;
}

/* ---- Feature cards ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-grid li {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  background: #f4faf5;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.feature-grid li b {
  color: var(--green-dark);
  font-size: 1.02rem;
}

.feature-grid li span {
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---- Service area chips ---- */
.area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.area-list li {
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--green-dark);
  background: #e7f6ec;
  border: 1px solid #c7e7d1;
  border-radius: 999px;
}

/* ---- Offer categories ---- */
.cats ul {
  padding-left: 1.1rem;
}

.cats li {
  margin: 0.35rem 0;
}

/* ---- Buttons / CTA ---- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--green-dark);
  background: #fff;
  border: 2px solid var(--green);
  border-radius: 10px;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover,
.btn:focus {
  color: var(--green-dark);
  box-shadow: 0 6px 16px rgba(10, 125, 58, 0.25);
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--green-bright), var(--green));
  border-color: var(--green);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
}

/* ---- Company block ---- */
.company {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

/* ---- FAQ ---- */
.faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0.6rem 0;
  background: #f9fcf9;
  overflow: hidden;
}

.faq summary {
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--green-dark);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  font-weight: 700;
  color: var(--green);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq details p {
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--ink);
}

/* ---- Contact table ---- */
.contact {
  margin: 0 auto 1.25rem;
  border-collapse: collapse;
}

.contact td {
  padding: 0.3rem 0.5rem;
  vertical-align: top;
}

.contact .label {
  text-align: right;
  padding-right: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.contact .value {
  text-align: left;
}

/* ---- Responsive map ---- */
.map {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Links page table ---- */
.links {
  width: 100%;
  border-collapse: collapse;
}

.links td {
  font-size: 0.9rem;
  padding: 0.5rem 0.4rem;
  border-top: 1px solid var(--line);
}

.links .linkheader {
  padding: 0.55rem 0.4rem 0.55rem 0.4rem;
  font-weight: 700;
  color: var(--green-dark);
  background: #eef8f0;
}

.links .linksL {
  width: 140px;
}

.links .linksR {
  color: var(--muted);
}

.links .linkshr {
  height: 12px;
  border-top: 0;
}

/* ---- Footer ---- */
.site-footer {
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
  text-align: center;
  color: #dff0e4;
  background: var(--green-dark);
}

.site-footer a {
  color: #fff;
}

.footer-nap {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
}

.footer-links {
  margin: 0;
  font-size: 0.85rem;
  color: #bcdcc6;
}

/* ---- Cookie bar ---- */
.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(680px, calc(100% - 24px));
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(5, 61, 32, 0.25);
}

.cookie-bar[hidden] {
  display: none;
}

.cookie-bar p {
  margin: 0;
  flex: 1;
}

.cookie-accept {
  flex: 0 0 auto;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--green-bright), var(--green));
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.cookie-accept:hover {
  filter: brightness(1.05);
}

/* ---- Utilities ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .page {
    margin: 0 auto;
    padding: 0;
  }

  .content {
    border-radius: 0;
  }

  .cta-row .btn {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* Anchor targets (e.g. #o-firmie) shouldn't land flush against the top edge. */
:target {
  scroll-margin-top: 16px;
}

/* Justified text creates ugly spacing "rivers" on narrow screens.
   Generator emits inline `style="text-align: justify"`, so override needs
   !important to win against inline specificity. */
@media (max-width: 640px) {
  [style*="justify"] {
    text-align: left !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
