/*
Theme Name: PANSA Quiz
Theme URI: https://pansa.pl/
Author: PANSA
Author URI: https://pansa.pl/
Description: Lekki, szybki motyw KLASYCZNY (PHP) zoptymalizowany pod SEO i dostępność (WCAG 2.1 AA). Nagłówek, stopka i szablony działają klasycznie (template hierarchy), a treść stron tworzysz w edytorze bloków (Gutenberg). Bez bibliotek zewnętrznych, czcionki systemowe. Pod stronę z quizami (wtyczka QuizPansa).
Requires at least: 6.1
Tested up to: 6.7
Requires PHP: 7.4
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pansa-quiz
Tags: blog, education, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, accessibility-ready
*/

/* ===========================================================
   Zmienne
   =========================================================== */
:root {
    --pq-primary: #0f304d;
    --pq-primary-dark: #0a2438;
    --pq-accent: #1c6fb8;
    --pq-text: #14202e;
    --pq-muted: #56616f;
    --pq-bg: #ffffff;
    --pq-surface: #f4f7fb;
    --pq-border: #dbe2ec;

    --pq-wide: 1100px;
    --pq-content: 760px;
    --pq-pad: clamp(1rem, 4vw, 2rem);

    --pq-font:
        system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
}

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

body {
    margin: 0;
    font-family: var(--pq-font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--pq-text);
    background: var(--pq-bg);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

a {
    color: var(--pq-primary);
}

a:hover {
    color: var(--pq-primary-dark);
}

h1,
h2,
h3,
h4 {
    line-height: 1.25;
    color: var(--pq-text);
}

.site-main {
    flex: 1 0 auto;
}

/* Kontener (szeroki) */
.site-container {
    max-width: var(--pq-wide);
    margin-inline: auto;
    padding-inline: var(--pq-pad);
}

/* Treść artykułu/strony używa tej samej wstęgi co nagłówek (1100 px),
   dzięki czemu jej lewa krawędź jest wyrównana do logo, a kolumna jest szersza.
   Aby wrócić do węższej, czytelnej kolumny, zmień var( --pq-wide ) na var( --pq-content ). */
.entry-header.site-container,
.entry-thumbnail.site-container,
.entry-content.site-container {
    max-width: var(--pq-wide);
}

/* ===========================================================
   Nagłówek
   =========================================================== */
.site-header {
    background: var(--pq-primary);
    color: #fff;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}

.site-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.site-logo-svg {
    height: 34px;
    width: auto;
    display: block;
}

/* Menu główne */
.site-nav .site-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.site-nav .site-menu a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    transition: border-color 0.15s;
}

.site-nav .site-menu a:hover,
.site-nav .site-menu a:focus,
.site-nav .site-menu .current-menu-item > a {
    border-bottom-color: #4f9fdc;
    color: #fff;
}

/* ===========================================================
   Treść / wpisy
   =========================================================== */
.entry-header {
    margin-top: var(--pq-pad);
}

.entry-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin: 0 0 0.5rem;
}

.entry-header--center {
    text-align: center;
}

.entry-meta {
    color: var(--pq-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.entry-thumbnail {
    margin-block: 1.5rem;
}

.entry-thumbnail img {
    border-radius: 4px;
    width: 100%;
}

.entry-content {
    margin-block: 1.5rem 3rem;
}

.entry-content > * {
    margin-block: 0 1.1rem;
}

.entry-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
}

.entry-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
}

/* Wyrównania bloków Gutenberga w kolumnie treści */
.entry-content .alignwide {
    width: min(var(--pq-wide), 94vw);
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.entry-content .alignfull {
    width: 100vw;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.entry-content .aligncenter {
    margin-inline: auto;
}

.entry-content .alignleft {
    float: left;
    margin: 0.25rem 1.5rem 1rem 0;
}

.entry-content .alignright {
    float: right;
    margin: 0.25rem 0 1rem 1.5rem;
}

/* ===========================================================
   Listingi (blog / archiwa / wyszukiwanie)
   =========================================================== */
.page-title {
    font-size: clamp(1.6rem, 4vw, 2rem);
    margin: var(--pq-pad) 0 1.25rem;
}

.archive-header {
    margin-top: var(--pq-pad);
}

.post-list {
    display: grid;
    gap: 1.5rem;
}

.entry-card {
    border: 1px solid var(--pq-border);
    border-left: 3px solid var(--pq-primary);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    background: #fff;
}

.entry-card__title {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
}

.entry-card__title a {
    text-decoration: none;
}

.entry-card__title a:hover {
    text-decoration: underline;
}

.entry-card__meta {
    color: var(--pq-muted);
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}

/* Paginacja */
.pagination {
    margin: 2.5rem 0;
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--pq-border);
    border-radius: 3px;
    text-decoration: none;
    color: var(--pq-primary);
}

.pagination .page-numbers.current {
    background: var(--pq-primary);
    color: #fff;
    border-color: var(--pq-primary);
}

/* ===========================================================
   Przyciski i formularze
   =========================================================== */
.button,
.wp-block-button__link,
.search-submit {
    display: inline-block;
    background: var(--pq-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.7rem 1.5rem;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
}

.button:hover,
.wp-block-button__link:hover,
.search-submit:hover {
    background: var(--pq-primary-dark);
    color: #fff;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.search-field {
    flex: 1 1 240px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--pq-border);
    border-radius: 3px;
    font-size: 1rem;
}

.error-404__home {
    margin-top: 1.5rem;
}

/* ===========================================================
   Stopka (granat, białe linki)
   =========================================================== */
.site-footer {
    flex-shrink: 0;
    background: var(--pq-primary);
    color: #fff;
    margin-top: 4.5rem;
    padding-top: 3rem;
    padding-bottom: 2rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.footer-brand .site-logo-svg {
    height: 30px;
}

.footer-quizzes__title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.6rem;
    color: #a9c4de;
}

.footer-quizzes__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-quizzes__list a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.footer-quizzes__list a:hover,
.footer-quizzes__list a:focus {
    border-bottom-color: #4f9fdc;
}

.site-footer__bottom {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-copyright {
    text-align: center;
    font-size: 0.85rem;
    margin: 0;
    color: #c5d4e4;
}

/* ===========================================================
   Dostępność (WCAG)
   =========================================================== */
.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 !important;
    word-wrap: normal !important;
}

.skip-link.screen-reader-text {
    background-color: #fff;
    color: var(--pq-primary);
    border: 2px solid var(--pq-primary);
    border-radius: 0 0 6px 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    position: absolute !important;
    left: 6px;
    top: 6px;
    z-index: 100000;
    text-decoration: none;
    font-weight: 700;
}

.skip-link.screen-reader-text:focus {
    clip: auto !important;
    clip-path: none;
    height: auto;
    width: auto;
    padding: 12px 20px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--pq-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

#content:focus {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===========================================================
   Responsywność
   =========================================================== */
@media (max-width: 640px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .site-nav .site-menu {
        gap: 0.85rem 1rem;
    }

    .site-logo-svg {
        height: 26px;
    }
}
