/*
Theme Name: BIP SP63 Szczecin
Theme URI: https://sp63.szczecin.pl
Author: SP63 Szczecin
Author URI: https://sp63.szczecin.pl
Description: Szablon BIP dla Szkoły Podstawowej nr 63 z Oddziałami Integracyjnymi im. Związku Zawodowego Marynarzy i Portowców w Szczecinie. Spełnia wymogi WCAG 2.1 oraz ustawy o dostępie do informacji publicznej.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bip-sp63
Tags: accessibility-ready, custom-menu, custom-logo, bip, education
*/

/* =====================================================
   ZMIENNE CSS
   ===================================================== */
:root {
    --navy:        #1A3055;
    --navy-dark:   #0F1E35;
    --navy-mid:    #243F6A;
    --gold:        #B8860B;
    --gold-light:  #D4A017;
    --gold-pale:   #FBF3DC;
    --white:       #FFFFFF;
    --off-white:   #F7F8FA;
    --gray-light:  #E8EAED;
    --gray-mid:    #9AA3AE;
    --gray-dark:   #4A5568;
    --ink:         #1A1A2E;
    --text:        #2D3748;
    --link:        #1A3055;
    --link-hover:  #B8860B;
    --border:      #D1D9E0;
    --focus:       #005FCC;
    --error:       #C0392B;
    --success:     #1A7A4A;

    --font-serif:  'Crimson Pro', 'Georgia', serif;
    --font-sans:   'DM Sans', 'Helvetica Neue', Arial, sans-serif;

    --sidebar-w:   260px;
    --content-max: 820px;
    --radius:      3px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.10);
    --shadow-md:   0 4px 12px rgba(0,0,0,.12);
    --transition:  0.18s ease;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--off-white);
    min-height: 100vh;
}

/* Fokus — WCAG 2.1 */
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

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

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

ul, ol {
    padding-left: 1.5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    color: var(--navy);
}

/* =====================================================
   SKIP TO CONTENT — WCAG
   ===================================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--focus);
    color: var(--white);
    padding: .6rem 1.2rem;
    font-size: .9rem;
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
    top: 0;
}

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
    background: var(--navy);
    color: var(--white);
    border-bottom: 3px solid var(--gold);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo BIP */
.bip-logo-wrap {
    flex-shrink: 0;
}
.bip-logo-wrap img {
    height: 60px;
    width: auto;
}
.bip-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 60px;
    background: var(--gold);
    color: var(--navy-dark);
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .05em;
    border-radius: var(--radius);
}

/* Divider */
.header-divider {
    width: 2px;
    height: 56px;
    background: rgba(255,255,255,.2);
    flex-shrink: 0;
}

/* School info */
.site-branding {
    flex: 1;
}
.site-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.25;
    text-decoration: none;
    display: block;
}
.site-name:hover {
    color: var(--gold-light);
}
.site-tagline {
    font-size: .75rem;
    color: rgba(255,255,255,.6);
    margin-top: .25rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Search */
.header-search {
    margin-left: auto;
    flex-shrink: 0;
}
.header-search form {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.header-search input[type="search"] {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
    color: var(--white);
    padding: .45rem .8rem;
    font-size: .875rem;
    font-family: var(--font-sans);
    width: 200px;
    transition: background var(--transition), border-color var(--transition);
}
.header-search input[type="search"]::placeholder {
    color: rgba(255,255,255,.5);
}
.header-search input[type="search"]:focus {
    background: rgba(255,255,255,.18);
    border-color: var(--gold-light);
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}
.header-search button {
    background: var(--gold);
    color: var(--navy-dark);
    border: none;
    border-radius: var(--radius);
    padding: .45rem .8rem;
    cursor: pointer;
    font-size: .875rem;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: background var(--transition);
}
.header-search button:hover {
    background: var(--gold-light);
}

/* Metadata strip */
.header-meta {
    background: var(--navy-dark);
    padding: .35rem 1.5rem;
    font-size: .75rem;
    color: rgba(255,255,255,.55);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}
.header-meta a {
    color: rgba(255,255,255,.55);
}
.header-meta a:hover {
    color: var(--gold-light);
}

/* =====================================================
   LAYOUT WRAPPER
   ===================================================== */
.site-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Breadcrumb */
.breadcrumb-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: .6rem 1.5rem;
}
.breadcrumb-bar nav {
    max-width: 1200px;
    margin: 0 auto;
    font-size: .8rem;
    color: var(--gray-dark);
}
.breadcrumb-bar a {
    color: var(--navy);
}
.breadcrumb-bar span {
    margin: 0 .4rem;
    color: var(--gray-mid);
}

/* Main layout */
.layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.site-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
}

.sidebar-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-heading {
    background: var(--navy);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .6rem 1rem;
}

/* Primary navigation */
.primary-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.primary-nav li {
    border-bottom: 1px solid var(--gray-light);
}
.primary-nav li:last-child {
    border-bottom: none;
}
.primary-nav a {
    display: block;
    padding: .65rem 1rem;
    font-size: .875rem;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), padding-left var(--transition);
    border-left: 3px solid transparent;
}
.primary-nav a:hover,
.primary-nav li.current-menu-item > a,
.primary-nav li.current-page-ancestor > a {
    background: var(--gold-pale);
    color: var(--navy);
    padding-left: 1.2rem;
    border-left-color: var(--gold);
}

/* Sub-menu */
.primary-nav .sub-menu {
    background: var(--off-white);
    border-top: 1px solid var(--gray-light);
}
.primary-nav .sub-menu li {
    border-bottom: 1px solid var(--gray-light);
}
.primary-nav .sub-menu a {
    padding-left: 1.5rem;
    font-size: .825rem;
    color: var(--gray-dark);
}
.primary-nav .sub-menu a::before {
    content: '›';
    margin-right: .4rem;
    color: var(--gold);
}

/* Sidebar info block */
.sidebar-info {
    padding: .75rem 1rem;
    font-size: .8rem;
    color: var(--gray-dark);
    line-height: 1.6;
}
.sidebar-info strong {
    color: var(--navy);
    display: block;
    margin-bottom: .2rem;
}
.sidebar-info a {
    color: var(--navy);
    font-size: .8rem;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.site-main {
    flex: 1;
    min-width: 0;
    margin-left: 1.5rem;
}

/* Page / article */
.entry {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-sm);
}

.entry-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.entry-title {
    font-size: 1.6rem;
    color: var(--navy);
    line-height: 1.25;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    margin-top: .6rem;
    font-size: .78rem;
    color: var(--gray-dark);
}
.entry-meta span {
    display: flex;
    align-items: center;
    gap: .3rem;
}
.entry-meta .meta-icon {
    color: var(--gold);
    font-size: .85rem;
}

.entry-content {
    font-size: .975rem;
    line-height: 1.75;
}
.entry-content h2 {
    font-size: 1.25rem;
    margin: 1.75rem 0 .6rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--gray-light);
}
.entry-content h3 {
    font-size: 1.1rem;
    margin: 1.4rem 0 .5rem;
    color: var(--navy-mid);
}
.entry-content p {
    margin-bottom: 1rem;
}
.entry-content ul,
.entry-content ol {
    margin-bottom: 1rem;
}
.entry-content li {
    margin-bottom: .3rem;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}
.entry-content th {
    background: var(--navy);
    color: var(--white);
    padding: .6rem .8rem;
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: .8rem;
}
.entry-content td {
    padding: .5rem .8rem;
    border-bottom: 1px solid var(--gray-light);
}
.entry-content tr:nth-child(even) td {
    background: var(--off-white);
}
.entry-content a[href$=".pdf"]::after,
.entry-content a[href$=".doc"]::after,
.entry-content a[href$=".docx"]::after {
    content: ' ↓';
    font-size: .75em;
    color: var(--gold);
}

/* Update info */
.entry-updated {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
    font-size: .78rem;
    color: var(--gray-dark);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
}

/* =====================================================
   FRONT PAGE — lista działów
   ===================================================== */
.front-intro {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.front-intro p {
    font-size: .95rem;
    color: var(--gray-dark);
    margin: 0;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.section-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    gap: .4rem;
    border-top: 3px solid var(--navy);
}
.section-card:hover, .section-card:focus {
    box-shadow: var(--shadow-md);
    border-color: var(--gold);
    border-top-color: var(--gold);
    transform: translateY(-2px);
    color: var(--navy);
}
.section-card-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.25;
}
.section-card-desc {
    font-size: .8rem;
    color: var(--gray-dark);
    line-height: 1.5;
}
.section-card-arrow {
    margin-top: auto;
    font-size: .8rem;
    color: var(--gold);
    font-weight: 600;
}

/* =====================================================
   POST LIST (archive)
   ===================================================== */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.post-list-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.5rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.post-list-item:hover {
    border-color: var(--gold);
}
.post-list-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
}
.post-list-title a {
    color: var(--navy);
    text-decoration: none;
}
.post-list-title a:hover {
    color: var(--gold);
    text-decoration: underline;
}
.post-list-meta {
    font-size: .78rem;
    color: var(--gray-dark);
}
.post-list-excerpt {
    font-size: .875rem;
    color: var(--gray-dark);
    margin-top: .2rem;
}

/* =====================================================
   PAGINACJA
   ===================================================== */
.pagination {
    display: flex;
    gap: .4rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .5rem;
    font-size: .875rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--navy);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}
.pagination a:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.pagination .current {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    font-weight: 700;
}

/* =====================================================
   WYSZUKIWANIE
   ===================================================== */
.search-results-heading {
    font-size: 1rem;
    color: var(--gray-dark);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--gray-light);
}
.search-results-heading strong {
    color: var(--navy);
}

/* =====================================================
   404
   ===================================================== */
.error-404-wrap {
    text-align: center;
    padding: 3rem 1rem;
}
.error-404-code {
    font-family: var(--font-serif);
    font-size: 5rem;
    font-weight: 700;
    color: var(--navy);
    opacity: .15;
    line-height: 1;
}
.error-404-title {
    font-size: 1.4rem;
    margin-bottom: .75rem;
}
.error-404-wrap p {
    color: var(--gray-dark);
    margin-bottom: 1.5rem;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
    background: var(--navy-dark);
    color: rgba(255,255,255,.7);
    border-top: 3px solid var(--gold);
    padding: 1.75rem 1.5rem 1rem;
    margin-top: 2rem;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 3rem;
    align-items: flex-start;
}
.footer-col h3 {
    font-family: var(--font-sans);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: .6rem;
}
.footer-col p,
.footer-col address {
    font-size: .8rem;
    line-height: 1.7;
    font-style: normal;
}
.footer-col a {
    color: rgba(255,255,255,.7);
    font-size: .8rem;
}
.footer-col a:hover {
    color: var(--gold-light);
}

.footer-bottom {
    max-width: 1200px;
    margin: 1.25rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .75rem;
    color: rgba(255,255,255,.4);
}
.footer-bottom a {
    color: rgba(255,255,255,.4);
    font-size: .75rem;
}
.footer-bottom a:hover {
    color: var(--gold-light);
}

/* Accessibility statement */
.wcag-bar {
    background: var(--navy-mid);
    text-align: center;
    padding: .4rem 1rem;
    font-size: .72rem;
    color: rgba(255,255,255,.5);
}
.wcag-bar a {
    color: rgba(255,255,255,.6);
    font-size: .72rem;
}

/* =====================================================
   RESPONSYWNOŚĆ
   ===================================================== */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }
    .site-sidebar {
        width: 100%;
        position: static;
    }
    .site-main {
        margin-left: 0;
    }
    .primary-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
    }
    .primary-nav li {
        border-bottom: none;
        border-right: 1px solid var(--gray-light);
    }
    .primary-nav a {
        padding: .5rem .85rem;
        font-size: .82rem;
    }
    .primary-nav .sub-menu {
        display: none;
    }
}

@media (max-width: 640px) {
    .header-top {
        flex-wrap: wrap;
        padding: .8rem 1rem;
    }
    .header-search {
        width: 100%;
        margin-left: 0;
    }
    .header-search input[type="search"] {
        width: 100%;
        flex: 1;
    }
    .entry {
        padding: 1.25rem 1rem;
    }
    .entry-title {
        font-size: 1.3rem;
    }
    .sections-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-inner {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 400px) {
    .sections-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
    .site-sidebar,
    .header-search,
    .site-footer,
    .wcag-bar,
    .pagination { display: none !important; }
    .layout { display: block; }
    .site-main { margin: 0; }
    body { color: #000; background: #fff; }
    a { color: #000; }
    a[href]::after { content: " (" attr(href) ")"; font-size: .75em; }
}
