/*
Theme Name: Agency Panel
Theme URI: https://panelwlascicielski.pl/
Author: Strony WWW Pomorze Aleksander Szypryt
Description: Lekki motyw Panelu Właścicielskiego. Nie ma własnych kolorów ani ustawień wyglądu - wszystko bierze z wtyczki "Agency - Konfigurator wyglądu". Zastępuje motywy budowane w Nicepage.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: agency-panel
*/

/* =====================================================================
   Wszystkie kolory pochodzą ze zmiennych --ca-*, które wstawia
   konfigurator wyglądu. Wartości po przecinku to tylko awaryjne domyślne,
   gdyby wtyczka była wyłączona - motyw ma wtedy nadal wyglądać sensownie.
   ===================================================================== */

:root{
  --ap-bg:        var(--ca-bg, #111827);
  --ap-surface:   var(--ca-surface, #1a2332);
  --ap-text:      var(--ca-text, #f3f4f6);
  --ap-muted:     var(--ca-muted, #9ca3af);
  --ap-primary:   var(--ca-primary, #c59c6c);
  --ap-on-primary:var(--ca-on-primary, #ffffff);
  --ap-accent:    var(--ca-accent, #e07a3f);
  --ap-radius:    var(--ca-radius, 16px);
  --ap-font:      var(--ca-font, system-ui, -apple-system, 'Segoe UI', sans-serif);
  --ap-line:      rgba(127,127,127,.22);
  --ap-width:     1100px;
}

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

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

body{
  margin:0;
  background:var(--ap-bg);
  color:var(--ap-text);
  font-family:var(--ap-font);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

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

a{ color:var(--ap-primary); }
a:hover{ color:var(--ap-accent); }

:focus-visible{ outline:2px solid var(--ap-accent); outline-offset:2px; }

/* ---------- szkielet ---------- */
.ap-shell{ flex:1 0 auto; width:100%; }
.ap-wrap{
  width:100%;
  max-width:var(--ap-width);
  margin:0 auto;
  padding:0 16px;
}

/* ---------- górny pasek ---------- */
.ap-header{
  background:var(--ap-surface);
  border-bottom:1px solid var(--ap-line);
}
.ap-header.is-sticky{ position:sticky; top:0; z-index:50; }
.ap-header-inner{
  display:flex; align-items:center; gap:16px;
  min-height:64px; padding-top:8px; padding-bottom:8px;
}
.ap-brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; margin-right:auto; }
.ap-brand img{ display:block; max-height:44px; width:auto; }
.ap-brand span{ font-weight:700; font-size:17px; letter-spacing:-.01em; }

.ap-nav ul{ display:flex; align-items:center; gap:4px; list-style:none; margin:0; padding:0; }
.ap-nav a{
  display:block; padding:9px 14px; border-radius:calc(var(--ap-radius) - 6px);
  color:var(--ap-text); text-decoration:none; font-size:15px; font-weight:500;
  transition:background-color .15s ease, color .15s ease;
}
.ap-nav a:hover{ background:rgba(127,127,127,.12); color:var(--ap-text); }
.ap-nav .current-menu-item > a,
.ap-nav .current_page_item > a{ background:var(--ap-primary); color:var(--ap-on-primary); }

.ap-user{ display:flex; align-items:center; gap:10px; font-size:14px; color:var(--ap-muted); white-space:nowrap; }
.ap-btn{
  display:inline-block; background:var(--ap-primary); color:var(--ap-on-primary);
  border:1px solid var(--ap-primary); border-radius:var(--ap-radius);
  padding:9px 16px; font-size:14px; font-weight:600; text-decoration:none; cursor:pointer;
  font-family:inherit; transition:filter .15s ease;
}
.ap-btn:hover{ filter:brightness(.92); color:var(--ap-on-primary); }
.ap-btn-ghost{ background:transparent; color:var(--ap-text); border-color:var(--ap-line); }
.ap-btn-ghost:hover{ background:rgba(127,127,127,.12); color:var(--ap-text); }

/* przycisk hamburgera - widoczny tylko na wąskich ekranach */
.ap-burger{
  display:none; background:transparent; border:1px solid var(--ap-line);
  border-radius:calc(var(--ap-radius) - 8px); padding:8px 10px; cursor:pointer;
  color:var(--ap-text);
}
.ap-burger span{ display:block; width:20px; height:2px; background:currentColor; margin:4px 0; border-radius:2px; }

/* ---------- treść ---------- */
.ap-main{ padding:28px 0 40px; }
.ap-page-title{
  font-size:clamp(1.5rem, 4vw, 2.2rem); line-height:1.15; margin:0 0 20px;
  font-weight:700; text-wrap:balance;
}
.ap-entry > *:first-child{ margin-top:0; }
.ap-entry h2{ font-size:1.5rem; margin:1.8em 0 .6em; }
.ap-entry h3{ font-size:1.2rem; margin:1.6em 0 .5em; }
.ap-entry p{ margin:0 0 1em; }
.ap-entry ul,.ap-entry ol{ margin:0 0 1em; padding-left:1.3em; }
.ap-entry table{ width:100%; border-collapse:collapse; margin:1em 0; }
.ap-entry th,.ap-entry td{ padding:8px 10px; border-bottom:1px solid var(--ap-line); text-align:left; }
.ap-entry blockquote{
  margin:1.2em 0; padding:12px 18px; border-left:3px solid var(--ap-primary);
  background:var(--ap-surface); border-radius:0 var(--ap-radius) var(--ap-radius) 0;
}
.ap-entry code, .ap-entry pre{
  background:var(--ap-surface); border-radius:6px;
  font-family:ui-monospace, Menlo, Consolas, monospace; font-size:.9em;
}
.ap-entry code{ padding:2px 6px; }
.ap-entry pre{ padding:14px; overflow-x:auto; }

/* Panel właściciela sam dba o swój układ - motyw ma mu tylko nie przeszkadzać */
.ap-entry #ca-panel{ padding-left:0; padding-right:0; }

/* =====================================================================
   SEKCJE TREŚCI
   Prosty zestaw klas do składania stron informacyjnych bez buildera.
   Używa się ich wprost w treści strony (edytor HTML).
   ===================================================================== */
.ap-hero{
  background:var(--ap-surface); border:1px solid var(--ap-line);
  border-radius:var(--ap-radius); padding:clamp(28px,5vw,56px);
  margin:0 0 28px; text-align:center;
}
.ap-hero .ap-eyebrow{
  font-size:12px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--ap-primary); font-weight:700; margin:0 0 12px;
}
.ap-hero h1{
  font-size:clamp(1.8rem,5vw,2.8rem); line-height:1.12; margin:0 0 14px;
  font-weight:700; text-wrap:balance;
}
.ap-hero p{ margin:0 auto 20px; max-width:60ch; color:var(--ap-muted); font-size:17px; }
.ap-hero .ap-btn{ margin:4px 6px 0; }

.ap-section{ margin:0 0 32px; }
.ap-section > h2{
  font-size:clamp(1.3rem,3vw,1.8rem); margin:0 0 6px; font-weight:700; text-wrap:balance;
}
.ap-section > .ap-lead{ margin:0 0 20px; color:var(--ap-muted); max-width:66ch; }

.ap-grid{ display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
.ap-card{
  background:var(--ap-surface); border:1px solid var(--ap-line);
  border-radius:var(--ap-radius); padding:22px 24px;
}
.ap-card h3{ margin:0 0 8px; font-size:1.05rem; font-weight:700; }
.ap-card p{ margin:0; color:var(--ap-muted); font-size:15px; line-height:1.65; }
.ap-card .ap-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:50%; margin-bottom:12px;
  background:var(--ap-primary); color:var(--ap-on-primary); font-weight:700; font-size:15px;
}

/* opinie */
.ap-quote{
  background:var(--ap-surface); border:1px solid var(--ap-line);
  border-top:3px solid var(--ap-primary);
  border-radius:var(--ap-radius); padding:22px 24px;
}
.ap-quote p{ margin:0 0 14px; font-size:15px; line-height:1.7; }
.ap-quote cite{ color:var(--ap-primary); font-style:normal; font-weight:700; font-size:14px; }

/* pasek zachęty */
.ap-cta{
  background:var(--ap-primary); color:var(--ap-on-primary);
  border-radius:var(--ap-radius); padding:clamp(24px,4vw,40px);
  text-align:center; margin:0 0 28px;
}
.ap-cta h2{ margin:0 0 10px; font-size:clamp(1.3rem,3.2vw,1.9rem); font-weight:700; }
.ap-cta p{ margin:0 auto 18px; max-width:56ch; opacity:.92; }
.ap-cta .ap-btn{
  background:var(--ap-on-primary); color:var(--ap-primary); border-color:var(--ap-on-primary);
}
.ap-cta .ap-btn:hover{ filter:brightness(.95); color:var(--ap-primary); }

/* dane kontaktowe */
.ap-contact-list{ list-style:none; margin:0; padding:0; }
.ap-contact-list li{
  display:flex; gap:12px; align-items:flex-start; padding:12px 0;
  border-bottom:1px solid var(--ap-line);
}
.ap-contact-list li:last-child{ border-bottom:0; }
.ap-contact-list b{ display:block; font-size:13px; color:var(--ap-muted); font-weight:600; }
.ap-contact-list a{ font-size:16px; text-decoration:none; }
.ap-contact-list a:hover{ text-decoration:underline; }

/* ---------- stopka ---------- */
.ap-footer{
  flex:0 0 auto;
  background:var(--ap-surface);
  border-top:1px solid var(--ap-line);
  padding:24px 0;
  margin-top:auto;
}
.ap-footer-inner{
  display:flex; flex-wrap:wrap; gap:12px 24px; align-items:center;
  justify-content:space-between; font-size:14px; color:var(--ap-muted);
}
.ap-footer a{ color:var(--ap-muted); }
.ap-footer a:hover{ color:var(--ap-primary); }
.ap-footer-note{ font-size:12px; opacity:.8; }

/* =====================================================================
   EKRAN LOGOWANIA
   Układ dzielony: po lewej panel z marką, po prawej sam formularz.
   Bez menu i bez rozpraszaczy - właściciel ma się zalogować i przejść dalej.
   ===================================================================== */
body.ap-auth{ display:block; }

.ap-auth-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  min-height:100vh;
}

.ap-auth-side{
  background:var(--ap-primary);
  background-size:cover; background-position:center;
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  padding:48px 40px;
}
.ap-auth-side-inner{ max-width:420px; }
.ap-auth-brand{ display:inline-block; text-decoration:none; color:inherit; margin-bottom:28px; }
.ap-auth-brand img{ display:block; max-height:64px; width:auto; }
.ap-auth-brand span{ font-size:22px; font-weight:700; }
.ap-auth-headline{
  font-size:clamp(1.6rem,2.6vw,2.4rem); line-height:1.2; margin:0 0 12px;
  font-weight:700; text-wrap:balance;
}
.ap-auth-subtext{ margin:0; font-size:16px; line-height:1.6; opacity:.9; }

.ap-auth-main{
  background:var(--ap-bg);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:48px 24px 28px;
}
.ap-auth-box{ width:100%; max-width:400px; }
.ap-auth-stopka{
  margin:28px 0 0; font-size:12px; color:var(--ap-muted); text-align:center;
}
.ap-auth-stopka a{ color:var(--ap-muted); }

/* tytuł strony logowania chowamy - panel boczny mówi już, gdzie jesteśmy */
body.ap-auth .ap-page-title{ display:none; }

/* ---------- formularz Theme My Login ---------- */
body.ap-auth .tml{ margin:0; }
/* Theme My Login zawsze wypisuje kontener na komunikaty, także pusty -
   bez tego nad formularzem wisi sierocy prostokąt. */
body.ap-auth .tml-alerts:empty,
body.ap-auth .tml-errors:empty,
body.ap-auth .tml-messages:empty{ display:none !important; }

body.ap-auth .tml-alerts,
body.ap-auth .tml-error,
body.ap-auth .tml-message{
  background:var(--ap-surface); border:1px solid var(--ap-line);
  border-left:3px solid var(--ap-accent);
  border-radius:calc(var(--ap-radius) - 8px);
  padding:12px 14px; margin:0 0 18px; font-size:14px; color:var(--ap-text);
}
body.ap-auth .tml form{
  background:var(--ap-surface);
  border:1px solid var(--ap-line);
  border-radius:var(--ap-radius);
  padding:28px 26px;
  box-shadow:0 18px 40px rgba(0,0,0,.22);
}
body.ap-auth .tml-field-wrap{ margin:0 0 16px; }
body.ap-auth .tml label,
body.ap-auth .tml-label{
  display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--ap-text);
}
body.ap-auth .tml input[type=text],
body.ap-auth .tml input[type=email],
body.ap-auth .tml input[type=password]{
  width:100%; box-sizing:border-box;
  background:var(--ap-bg); color:var(--ap-text);
  border:1px solid var(--ap-line);
  border-radius:calc(var(--ap-radius) - 6px);
  padding:13px 14px;
  font-size:16px; /* 16px = telefon nie przybliża pola */
  font-family:inherit;
  transition:border-color .15s ease, box-shadow .15s ease;
}
body.ap-auth .tml input[type=text]:focus,
body.ap-auth .tml input[type=email]:focus,
body.ap-auth .tml input[type=password]:focus{
  border-color:var(--ap-primary); outline:none;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--ap-primary) 28%, transparent);
}
body.ap-auth .tml-rememberme-wrap{
  display:flex; align-items:center; gap:8px; margin:0 0 18px; font-size:14px;
}
body.ap-auth .tml-rememberme-wrap label{ margin:0; font-weight:400; }
body.ap-auth .tml-rememberme-wrap input{ accent-color:var(--ap-primary); width:16px; height:16px; }
body.ap-auth .tml-submit-wrap{ margin:0; }
body.ap-auth .tml input[type=submit],
body.ap-auth .tml-button{
  width:100%; cursor:pointer;
  background:var(--ap-primary); color:var(--ap-on-primary);
  border:1px solid var(--ap-primary); border-radius:var(--ap-radius);
  padding:13px 20px; font-size:16px; font-weight:600; font-family:inherit;
  transition:filter .15s ease;
}
body.ap-auth .tml input[type=submit]:hover,
body.ap-auth .tml-button:hover{ filter:brightness(.92); }
body.ap-auth .tml-links{
  list-style:none; margin:18px 0 0; padding:0;
  display:flex; flex-wrap:wrap; gap:6px 16px; justify-content:center;
}
body.ap-auth .tml-links a{ font-size:13px; color:var(--ap-muted); text-decoration:none; }
body.ap-auth .tml-links a:hover{ color:var(--ap-primary); text-decoration:underline; }

@media (max-width:900px){
  .ap-auth-grid{ grid-template-columns:1fr; min-height:0; }
  .ap-auth-side{ padding:32px 24px; text-align:center; }
  .ap-auth-side-inner{ margin:0 auto; }
  .ap-auth-brand{ margin-bottom:16px; }
  .ap-auth-headline{ font-size:1.4rem; }
  .ap-auth-subtext{ font-size:15px; }
  .ap-auth-main{ padding:28px 18px 24px; min-height:auto; }
}

/* ---------- telefon ---------- */
@media (max-width:860px){
  .ap-burger{ display:block; }
  .ap-nav{
    display:none; position:absolute; left:0; right:0; top:100%;
    background:var(--ap-surface); border-bottom:1px solid var(--ap-line);
    padding:8px 16px 14px; box-shadow:0 12px 24px rgba(0,0,0,.18);
  }
  .ap-header{ position:relative; }
  .ap-header.is-open .ap-nav{ display:block; }
  .ap-nav ul{ flex-direction:column; align-items:stretch; gap:2px; }
  .ap-nav a{ padding:12px 12px; font-size:16px; }
  .ap-user .ap-user-name{ display:none; }
  .ap-header-inner{ min-height:56px; }
  .ap-brand img{ max-height:36px; }
  .ap-main{ padding:18px 0 28px; }
}

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

/* ---------- drobiazgi WordPressa ---------- */
.screen-reader-text{
  border:0; clip:rect(1px,1px,1px,1px); clip-path:inset(50%);
  height:1px; width:1px; margin:-1px; overflow:hidden; padding:0; position:absolute;
}
.alignleft{ float:left; margin:0 1.2em 1em 0; }
.alignright{ float:right; margin:0 0 1em 1.2em; }
.aligncenter{ display:block; margin:0 auto 1em; }
.wp-caption{ max-width:100%; }
.wp-caption-text{ font-size:13px; color:var(--ap-muted); }
