/*
Theme Name: KRP – Kartoteka Rzadkich Ptaków
Theme URI: https://rzadkieptaki.pl
Description: Motyw potomny Dwadzieścia Dwadzieścia-Pięć dla Kartoteki Rzadkich Ptaków: paleta zieleń/bursztyn, nagłówki Literata, karty, interaktywna lista gatunków.
Author: Kartoteka Rzadkich Ptaków
Template: twentytwentyfive
Version: 1.1.0
Requires at least: 6.6
Tested up to: 7.1
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: krp
*/

/* =========================================================
   Zmienne pomocnicze
   ========================================================= */
:root {
  --krp-radius: 8px;
  --krp-border: var(--wp--preset--color--accent-6, #e2e8f0);
  --krp-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px rgba(15, 23, 42, 0.03);
  --krp-green: var(--wp--preset--color--accent-1, #1e3a2b);
  --krp-green-2: var(--wp--preset--color--accent-5, #2d5a3f);
  --krp-amber: var(--wp--preset--color--accent-3, #c87d20);
  --krp-muted: var(--wp--preset--color--accent-4, #475569);
  --krp-surface: var(--wp--preset--color--accent-2, #f1f5f2);
}

/* =========================================================
   Typografia pomocnicza
   ========================================================= */
.krp-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--krp-muted);
  margin-bottom: 0.4rem !important;
}
.krp-on-dark .krp-eyebrow,
.krp-eyebrow.krp-on-dark { color: rgba(255, 255, 255, 0.72); }

.krp-lead { font-size: 1.1rem; line-height: 1.6; }
.krp-on-dark .krp-lead { color: rgba(255, 255, 255, 0.88); }

em.krp-latin, .krp-latin {
  font-family: var(--wp--preset--font-family--literata, Georgia, serif);
  font-style: italic;
  font-weight: 400;
}

/* =========================================================
   Karty
   ========================================================= */
.krp-card {
  background: var(--wp--preset--color--base, #fff);
  border: 1px solid var(--krp-border);
  border-radius: var(--krp-radius);
  box-shadow: var(--krp-shadow);
  padding: 1.6rem 1.6rem 1.4rem;
  height: 100%;
  box-sizing: border-box;
}
.krp-card > * + * { margin-top: 0.7rem; }
.krp-card h3, .krp-card h4 { margin-top: 0; }
.krp-card .krp-card__link { font-weight: 600; font-size: 0.9rem; }
.krp-card .krp-card__link a { text-decoration: none; }
.krp-card .krp-card__link a:hover { text-decoration: underline; }

/* kolumny z kartami: równa wysokość */
.krp-cards > .wp-block-column { display: flex; flex-direction: column; }
.krp-cards > .wp-block-column > .krp-card { flex: 1; }

/* =========================================================
   Hero
   ========================================================= */
.krp-hero { position: relative; overflow: hidden; }
.krp-hero h1 { color: #fff; }
.krp-hero .wp-block-image img { border-radius: var(--krp-radius); display: block; }
.krp-hero .wp-block-image figcaption { color: rgba(255, 255, 255, 0.7); text-align: right; }

.krp-stats { gap: 0.8rem; }
.krp-stat {
  flex: 1 1 calc(25% - 0.6rem);
  min-width: 130px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.9rem 1rem 0.8rem;
}
.krp-stat__num {
  font-family: var(--wp--preset--font-family--literata, Georgia, serif);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  margin: 0 0 0.3rem !important;
  color: #fff;
}
.krp-stat__label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 !important;
}

/* przycisk bursztynowy */
.wp-block-button.krp-btn-amber .wp-block-button__link {
  background-color: var(--krp-amber);
  color: #fff;
}
.wp-block-button.krp-btn-amber .wp-block-button__link:hover {
  background-color: #b45309;
  color: #fff;
}
/* przycisk obrysowy na ciemnym tle */
.krp-on-dark .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.krp-on-dark .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

/* =========================================================
   Nagłówek sekcji z linkiem po prawej
   ========================================================= */
.krp-section-head { align-items: flex-end; row-gap: 0.5rem; }
.krp-section-head h2 { margin: 0; }
.krp-section-head .krp-more { font-weight: 600; font-size: 0.9rem; margin: 0; }
.krp-section-head .krp-more a { text-decoration: none; }
.krp-section-head .krp-more a:hover { text-decoration: underline; }

/* =========================================================
   Aktualności – karty wpisów (pętla zapytań)
   ========================================================= */
.krp-news .wp-block-post { display: flex; }
.krp-news .krp-card { display: flex; flex-direction: column; padding: 1rem 1rem 1.2rem; }
.krp-news .wp-block-post-featured-image { margin: 0 0 0.9rem; }
.krp-news .wp-block-post-featured-image img { border-radius: 6px; }
.krp-news .wp-block-post-date { margin: 0 0 0.35rem; }
.krp-news .wp-block-post-title { margin: 0 0 0.5rem; font-size: 1.15rem; line-height: 1.3; }
.krp-news .wp-block-post-excerpt { margin: 0; color: var(--krp-muted); }
.krp-news .wp-block-post-excerpt__more-text { margin-top: 0.6rem; font-weight: 600; }
.krp-news .wp-block-post-excerpt__more-link { text-decoration: none; color: var(--krp-green-2); }
.krp-news .wp-block-post-excerpt__more-link:hover { text-decoration: underline; }

/* =========================================================
   Stopka
   ========================================================= */
.krp-footer { font-size: 0.92rem; }
.krp-footer h3 {
  font-family: var(--wp--preset--font-family--manrope, sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.9rem;
}
.krp-footer .krp-footer__brand {
  font-family: var(--wp--preset--font-family--literata, Georgia, serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}
.krp-footer p { color: rgba(255, 255, 255, 0.82); }
.krp-footer ul { list-style: none; padding: 0; margin: 0; }
.krp-footer li { margin: 0 0 0.45rem; }
.krp-footer a { color: #fff; text-decoration: none; }
.krp-footer a:hover { text-decoration: underline; }
.krp-footer .krp-footer__logos { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch; }
.krp-footer .krp-logo-box {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}
.krp-footer .krp-logo-box img { display: block; height: 80px; width: auto; }
.krp-footer hr { border-color: rgba(255, 255, 255, 0.18) !important; opacity: 1; margin: 2.2rem 0 1.2rem; }
.krp-footer .krp-footer__bottom { font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); }

/* =========================================================
   Nagłówek strony
   ========================================================= */
.krp-header { border-bottom: 1px solid var(--krp-border); background: var(--wp--preset--color--base, #fff); }
.krp-header .wp-block-site-title a { text-decoration: none; }
.krp-header .wp-block-navigation a { text-decoration: none; }
.krp-header .wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.krp-header .wp-block-site-logo img { display: block; }

/* =========================================================
   Podstrony – pas tytułu na całą szerokość
   ========================================================= */
.krp-page-head h1 { margin: 0; }

/* =========================================================
   Interaktywna lista gatunków
   ========================================================= */
.krp-species { margin: 1.5rem 0 2rem; }
.krp-species__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.krp-species__tabs { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.krp-species__tab {
  appearance: none;
  border: 1px solid var(--krp-border);
  background: #fff;
  color: var(--krp-green);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font: 600 0.85rem/1.2 var(--wp--preset--font-family--manrope, sans-serif);
  cursor: pointer;
}
.krp-species__tab:hover { background: var(--krp-surface); }
.krp-species__tab[aria-pressed="true"] {
  background: var(--krp-green);
  border-color: var(--krp-green);
  color: #fff;
}
.krp-species__search {
  flex: 1 1 260px;
  max-width: 420px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font: 400 0.95rem/1.3 var(--wp--preset--font-family--manrope, sans-serif);
  color: var(--wp--preset--color--contrast, #111);
  background: #fff;
}
.krp-species__search:focus { outline: 2px solid var(--krp-green-2); outline-offset: 1px; border-color: var(--krp-green-2); }
.krp-species__count { font-size: 0.85rem; color: var(--krp-muted); margin: 0 0 0.6rem; }

.krp-species__wrap {
  overflow-x: auto;
  border: 1px solid var(--krp-border);
  border-radius: var(--krp-radius);
  background: #fff;
  box-shadow: var(--krp-shadow);
}
.krp-species table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}
.krp-species thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--krp-border);
  white-space: nowrap;
}
.krp-species tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
}
.krp-species tbody tr:last-child td { border-bottom: 0; }
.krp-species tbody tr:hover td { background: var(--krp-surface); }
.krp-species tr[hidden] { display: none; }
.krp-species .krp-species__name { font-weight: 600; white-space: nowrap; }
.krp-species .krp-species__name .krp-latin {
  display: block;
  font-weight: 400;
  color: var(--krp-muted);
  font-size: 0.95em;
  white-space: nowrap;
}
.krp-species .krp-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.krp-species .krp-muted { color: var(--krp-muted); }
.krp-species .krp-species__empty td { text-align: center; color: var(--krp-muted); padding: 1.6rem; }

.krp-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.krp-pill--legowy { background: #dcfce7; color: #15803d; }
.krp-pill--nielegowy { background: #fef3c7; color: #b45309; }

.krp-species__note { font-size: 0.85rem; color: var(--krp-muted); margin: 0.8rem 0 0; }

/* kolumny zbędne w danej zakładce */
.krp-species:not([data-group="all"]) .krp-col-status { display: none; }
.krp-species[data-group="nielegowe"] .krp-col-okres { display: none; }

/* etykieta pola wyszukiwania tylko dla czytników ekranu (zapasowo, WP ma własną regułę) */
.krp-species .screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); margin: -1px;
}

@media (max-width: 640px) {
  .krp-species .krp-species__name,
  .krp-species .krp-species__name .krp-latin { white-space: normal; }
  .krp-species thead th, .krp-species tbody td { padding-left: 0.6rem; padding-right: 0.6rem; }
  .krp-species__search { max-width: none; }
}

/* =========================================================
   Drobiazgi
   ========================================================= */
.krp-section { scroll-margin-top: 90px; }
.wp-block-image.krp-rounded img { border-radius: var(--krp-radius); }
