/*
Theme Name: e-KIRP
Theme URI: https://code.oirpwarszawa.pl/kirp/ekirp/theme
Author: KIRP
Author URI: https://kirp.pl
Description: Motyw WordPress portalu e-KIRP (Krajowa Izba Radców Prawnych) przygotowany na podstawie wizualizacji aplikacji (website-template-ekirp). Warstwa wizualna portalu — treść (pulpit, profil, logowanie, formularze) renderuje wtyczka kirp_user_login_management.
Version: 2.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ekirp
Tags: portal, full-width, custom-menu, translation-ready
*/

/* =========================================================
   1. Zmienne (paleta z wizualizacji website-template-ekirp,
      wartości oklch z app/globals.css przeliczone na hex)
   ========================================================= */
:root {
  --background: #f6f9fb;
  --foreground: #141b24;
  --card: #ffffff;
  --card-foreground: #141b24;
  --primary: #143058;
  --primary-foreground: #f6f9fb;
  --secondary: #eaeff5;
  --secondary-foreground: #143058;
  --muted: #eff2f6;
  --muted-foreground: #5c646f;
  --accent: #ddeaf5;
  --accent-foreground: #143058;
  --destructive: #cc272e;
  --destructive-foreground: #ffffff;
  --border: #d9dfe5;
  --input: #d9dfe5;
  --ring: #143058;
  --brand: #0a254d;
  --success: #298646;
  --warning: #cd9130;
  --warning-foreground: #311d03;
  --info: #2784d5;

  --radius: 0.5rem;
  --radius-sm: 0.3rem;
  --radius-md: 0.4rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.7rem;

  --font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;

  --container: 80rem; /* max-w-7xl */

  /* Aliasy legacy (używane przez arkusze wtyczki KULM: placeholder.css,
     kulm-greetings.css itd. — nie usuwać) */
  --kirp-navy: var(--primary);
  --kirp-navy-dark: var(--brand);
  --kirp-blue: var(--primary);
  --kirp-blue-light: var(--info);
  --kirp-warning: var(--warning);
  --kirp-success: var(--success);
}

/* =========================================================
   2. Reset / podstawy
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

.site {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow-x: hidden;
}

.site-main {
  flex: 1 1 auto;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: 2rem;
  }
}

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

/* =========================================================
   3. Header (sticky, biały, border-b)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.brand-logo {
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo img {
  height: 100%;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

/* Fallback bez logo: kwadrat z ikoną wagi + wordmark */
.brand-mark {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 1.25rem;
  height: 1.25rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0.2rem;
}

.brand-text .brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
  white-space: nowrap;
}

.brand-text .brand-name .brand-tld {
  color: var(--muted-foreground);
}

.brand-text .brand-sub {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  white-space: nowrap;
}

@media (max-width: 479px) {
  .brand-text .brand-sub {
    display: none;
  }
}

.main-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .main-nav {
    display: flex;
  }
}

.main-nav a {
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.main-nav a.is-active {
  background-color: var(--accent);
  color: var(--primary);
}

/* Pastylka „PROFIL: XX-YYYY" */
.header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1024px) {
  .header-actions {
    display: flex;
  }
}

.header-actions a {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.header-actions a strong {
  color: var(--foreground);
  font-weight: 600;
}

.header-actions a:hover,
.header-actions a.is-active {
  border-color: var(--primary);
  color: var(--primary);
}

/* Mobile nav (pasek przewijany pod nagłówkiem) */
.mobile-nav {
  border-top: 1px solid var(--border);
  overflow-x: auto;
  background: var(--card);
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav-inner {
  display: flex;
  gap: 0.25rem;
  padding: 0.375rem 1rem;
}

.mobile-nav a {
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  white-space: nowrap;
  color: var(--muted-foreground);
  text-transform: uppercase;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-nav a:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.mobile-nav a.is-active {
  background-color: var(--accent);
  color: var(--primary);
}

/* =========================================================
   4. Hero / PageBanner (granatowy pas, tytuł serif)
   ========================================================= */
.hero {
  background-color: var(--primary);
  padding-block: 2.5rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-style: normal;
  color: var(--primary-foreground);
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 2.25rem;
  }
}

/* =========================================================
   5. Sekcja treści
   ========================================================= */
.page-section {
  padding-block: 1.5rem 4rem;
}

/* =========================================================
   7. Cards / content panels
   ========================================================= */
.panel {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(20, 48, 88, 0.05);
  padding: 1.5rem;
}

.prose {
  max-width: none;
  font-size: 0.95rem;
  color: var(--foreground);
}

.prose h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 1.25rem 0 0.75rem;
  color: var(--primary);
}

.prose h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 1rem 0 0.5rem;
  color: var(--primary);
}

.prose p {
  margin: 0 0 1rem;
}

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

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

/* =========================================================
   9. Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-transform: uppercase;
  line-height: 1.25;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: var(--brand);
}

/* =========================================================
   10. Footer (granatowy, brand serif, copyright z linią)
   ========================================================= */
.site-footer {
  background-color: var(--primary);
  color: var(--primary-foreground);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-block: 3rem 0;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.footer-brand-logo {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.footer-brand-logo svg {
  width: 1.5rem;
  height: 1.5rem;
}

.footer-brand-logo img {
  max-height: 2.75rem;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  font-style: normal;
  line-height: 1.25;
  color: var(--primary-foreground);
  margin: 0;
  white-space: nowrap;
}

.footer-contact address {
  font-style: normal;
  font-size: 0.875rem;
  line-height: 1.625;
  color: rgba(255, 255, 255, 0.85);
}

.footer-contact address p {
  margin: 0 0 0.25rem;
}

.footer-contact address a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
}

.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-copyright {
  margin-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-copyright p {
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  padding-block: 1.5rem 2rem;
  margin: 0;
}

/* =========================================================
   11. Utilities
   ========================================================= */
.text-center { text-align: center; }
