/*
Theme Name: Schronisko AZYL Cieszyn
Theme URI: https://schronisko-cieszyn.pl/
Author: Jakub Klejczyk
Author URI: https://klejczyk.pl/
Description: Custom theme dla Schroniska AZYL w Cieszynie. Siostrzana strona względem fundacjalepszyswiat.pl. Paleta i komponenty zsynchronizowane z fundacją (zob. mockup/STYL.md).
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Text Domain: schronisko
*/

:root {
    /* Paleta zaczerpnięta 1:1 ze strony Fundacji Lepszy Świat (lepszyswiat-child/style.css) */
    --c-orange: #B85C00;        /* primary-orange — CTA, akcenty, badge "do adopcji" */
    --c-orange-dark: #B24801;   /* dark-orange — hover na CTA */
    --c-orange-light: #f39c12;  /* light-orange — gradienty, footer accent */
    --c-cream: #fef9f3;         /* soft-cream — tła sekcji alternatywnych */
    --c-text: #2c3e50;          /* dark-text — tekst i nagłówki (granatowo-ciemny, nie czysta czerń) */
    --c-gray-light: #f4f6f8;    /* light-gray — boxy, tła kart */
    --c-green: #4a7c59;         /* accent-green — pomocniczy akcent dla "wolontariat" itp. */
    --c-peach: #ffb88c;         /* warm-peach — opcjonalny ciepły akcent */
    --c-footer-1: #4a4a4a;      /* footer gradient start */
    --c-footer-2: #2d2d2d;      /* footer gradient end */
    --c-red: #DC2626;           /* czerwień — TYLKO baner interwencji */
    --c-amber-bg: #FEF3C7;      /* kwarantanna — tło */
    --c-amber-text: #92400E;    /* kwarantanna — tekst */
    --c-amber-border: #FCD34D;  /* kwarantanna — border */
}

body { font-family: 'Poppins', sans-serif; color: var(--c-text); }
h1, h2, h3, h4 { font-family: 'Lato', sans-serif; font-weight: 900; letter-spacing: -0.01em; color: var(--c-text); }
.accent { color: var(--c-orange); }
.bg-accent { background-color: var(--c-orange); }
.border-accent { border-color: var(--c-orange); }

/* === BUTTONY (zaokrąglone CTA jak na stronie fundacji) === */
.btn-primary {
    background: var(--c-orange);
    color: white;
    padding: 14px 28px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(184, 92, 0, 0.35);
    transition: all .25s ease;
}
.btn-primary:hover {
    background: var(--c-orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(184, 92, 0, 0.45);
}

.btn-outline {
    border: 2px solid var(--c-text);
    color: var(--c-text);
    padding: 12px 26px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 50px;
    transition: all .2s ease;
    background: white;
}
.btn-outline:hover {
    background: var(--c-text);
    color: white;
}

/* Pattern łapek na tle kremowym — sygnatura tablicy schroniska, subtelny */
.paw-bg {
    background: var(--c-cream);
    background-image:
        radial-gradient(circle at 8% 18%, rgba(184, 92, 0, 0.05) 12px, transparent 13px),
        radial-gradient(circle at 22% 65%, rgba(184, 92, 0, 0.05) 14px, transparent 15px),
        radial-gradient(circle at 80% 8%, rgba(184, 92, 0, 0.05) 10px, transparent 11px),
        radial-gradient(circle at 92% 78%, rgba(184, 92, 0, 0.05) 16px, transparent 17px);
}

/* === HEXAGON HONEYCOMB (HERO) — iter. 3 + iter. 8 (trzeci rząd) ===
   Klasyczny plaster miodu pointy-top: drugi rząd przesunięty w prawo o 50% szerokości heksa,
   trzeci rząd wraca na linię pierwszego (offset 0%); rzędy nachodzą na siebie 75% wysokości —
   krawędzie się dotykają, brak przerw.
   --hex-w steruje skalą; wysokość = w * 1.1547 (2/√3).
   Suma rzędów: 1 (full) + 0.75 (r2 offset) + 0.75 (r3 offset) = 2.5. */
.honeycomb {
    --hex-w: 150px;
    position: relative;
    width: calc(var(--hex-w) * 3.5);
    height: calc(var(--hex-w) * 1.1547 * 2.5 + 1px);
    margin: 0 auto;
}
.hex-cell {
    position: absolute;
    width: var(--hex-w);
    height: calc(var(--hex-w) * 1.1547);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    overflow: hidden;
    background: var(--c-gray-light);
}
.hex-cell img { width: 100%; height: 100%; object-fit: cover; }
.hex-cell.hex-accent { background: var(--c-orange); display: flex; align-items: center; justify-content: center; }
.hex-cell.hex-stat {
    background: var(--c-text);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 14%;
}
.hex-cell.hex-stat .num {
    font-family: 'Lato', sans-serif;
    font-weight: 900;
    font-size: calc(var(--hex-w) * 0.22);
    line-height: 1;
    color: var(--c-orange-light);
}
.hex-cell.hex-stat .lbl {
    font-size: calc(var(--hex-w) * 0.078);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-top: 0.4em;
    opacity: 0.9;
}
/* Pozycjonowanie: 3+3+3, druga rzędówka offset X = 50% w prawo, trzecia wraca do 0%; Y rośnie o 75% h */
.hex-cell.r1c1 { left: 0;                              top: 0; }
.hex-cell.r1c2 { left: var(--hex-w);                   top: 0; }
.hex-cell.r1c3 { left: calc(var(--hex-w) * 2);         top: 0; }
.hex-cell.r2c1 { left: calc(var(--hex-w) * 0.5);       top: calc(var(--hex-w) * 1.1547 * 0.75); }
.hex-cell.r2c2 { left: calc(var(--hex-w) * 1.5);       top: calc(var(--hex-w) * 1.1547 * 0.75); }
.hex-cell.r2c3 { left: calc(var(--hex-w) * 2.5);       top: calc(var(--hex-w) * 1.1547 * 0.75); }
.hex-cell.r3c1 { left: 0;                              top: calc(var(--hex-w) * 1.1547 * 1.5); }
.hex-cell.r3c2 { left: var(--hex-w);                   top: calc(var(--hex-w) * 1.1547 * 1.5); }
.hex-cell.r3c3 { left: calc(var(--hex-w) * 2);         top: calc(var(--hex-w) * 1.1547 * 1.5); }

@media (max-width: 1100px) { .honeycomb { --hex-w: 130px; } }
@media (max-width: 900px)  { .honeycomb { --hex-w: 110px; } }
@media (max-width: 768px)  {
    .honeycomb { --hex-w: 92px; width: calc(var(--hex-w) * 2.5); }
    .hex-cell.r1c3, .hex-cell.r2c3, .hex-cell.r3c3 { display: none; } /* 2+2+2 na wąskich */
}

/* Pulsujący alert (baner interwencji) */
.alert-pulse { animation: pulse 2s infinite; }
@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
    50%     { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
}

/* === KARTY PSÓW === */
.dog-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all .25s ease;
}
.dog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(44,62,80,0.10);
    border-color: var(--c-orange);
}
.dog-card:hover .dog-img { transform: scale(1.04); }
.dog-img { transition: transform .35s ease; }

.meta-row { border-bottom: 1px solid #f1f3f5; }
.meta-row:last-child { border-bottom: 0; }

.gallery-thumb { cursor: pointer; border: 2px solid transparent; transition: all .15s; border-radius: 8px; overflow: hidden; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--c-orange); }

/* === STATUS BADGE === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.status-adoption { background: var(--c-orange); color: white; }
.status-quarantine { background: var(--c-amber-bg); color: var(--c-amber-text); border: 1px solid var(--c-amber-border); }

/* === NAWIGACJA: nav-link + linki zewnętrzne (chevron arrow-up-right) === */
.nav-link {
    position: relative;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 0;
    color: var(--c-text);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nav-link::after {
    content: '';
    position: absolute; left: 0; bottom: 0;
    width: 0; height: 2px; background: var(--c-orange);
    transition: width .2s;
}
.nav-link:hover { color: var(--c-orange); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--c-orange); }

/* === DROPDOWN / SUBMENU (iter. 6) ===
   Pozycja "Fundacja" w głównym menu jest jednocześnie linkiem do strony fundacji
   ORAZ triggerem rozwijającym submenu. Desktop: czysty CSS hover. Mobile: akordeon JS. */
.nav-list { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.submenu-chevron {
    display: inline-block;
    width: 12px; height: 12px;
    margin-left: 2px;
    transition: transform .2s;
    color: var(--c-text);
    opacity: 0.7;
}
.nav-item:hover .submenu-chevron,
.nav-item.is-open > .nav-link .submenu-chevron { transform: rotate(180deg); color: var(--c-orange); opacity: 1; }

.submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: -14px;
    min-width: 260px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(44,62,80,0.12);
    padding: 8px;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 60;
}
/* "Most" niewidocznego paddingu między triggerem a submenu — żeby kursor mógł przejść bez zamknięcia */
.submenu::before {
    content: '';
    position: absolute;
    top: -10px; left: 0; right: 0; height: 10px;
}
.nav-item:hover > .submenu,
.nav-item:focus-within > .submenu,
.nav-item.is-open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.submenu-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--c-text);
    text-transform: none;
    letter-spacing: 0;
    border-radius: 8px;
    transition: background .15s, color .15s;
    position: relative;
}
.submenu-link:hover {
    background: var(--c-cream);
    color: var(--c-orange);
}
/* === MOBILE MENU (iter. 6) ===
   Drawer pod headerem; ukryty domyślnie, .open dodaje JS po kliknięciu hamburgera.
   Submenu w środku to akordeon (aria-expanded). */
.mobile-menu {
    display: none;
    border-top: 1px solid #e5e7eb;
    background: white;
    padding: 8px 16px 16px;
}
.mobile-menu.open { display: block; }
.mobile-nav-list { list-style: none; margin: 0; padding: 0; }
.mobile-nav-item { border-bottom: 1px solid #f1f3f5; }
.mobile-nav-item:last-child { border-bottom: 0; }
.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 4px;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text);
    background: none; border: none; text-align: left; cursor: pointer;
}
.mobile-nav-link:hover, .mobile-nav-link:focus { color: var(--c-orange); }
.mobile-submenu-trigger .chev {
    transition: transform .2s;
    width: 16px; height: 16px;
}
.mobile-nav-item.is-open .mobile-submenu-trigger .chev { transform: rotate(180deg); color: var(--c-orange); }
.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.mobile-nav-item.is-open .mobile-submenu { max-height: 400px; }
.mobile-submenu .mobile-nav-link { padding: 12px 4px; font-size: 14px; text-transform: none; letter-spacing: 0; }

@media (min-width: 1024px) {
    .mobile-menu { display: none !important; } /* na desktop nigdy nie pokazuj drawera */
}

/* === FILTRY (pillsy) === */
.filter-pill {
    padding: 8px 18px;
    border: 1.5px solid #e5e7eb;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    background: white;
    border-radius: 50px;
}
.filter-pill:hover { border-color: var(--c-orange); color: var(--c-orange); }
.filter-pill.active {
    background: var(--c-orange);
    color: white;
    border-color: var(--c-orange);
}

/* === HERO + SEKCJE === */
.hero-headline {
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.05;
    font-weight: 900;
}

.section-title {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    color: var(--c-orange); /* tytuły sekcji w pomarańczu jak na stronie fundacji */
}

.alert-banner {
    background: var(--c-text);
    color: white;
}

/* === KAFLE "JAK POMÓC" === */
.help-card {
    background: white;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all .25s ease;
}
.help-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(44,62,80,0.10);
    border-color: var(--c-orange);
}
.help-icon {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}
.help-icon-orange { background: var(--c-orange); color: white; }
.help-icon-green { background: var(--c-green); color: white; }
.help-icon-dark { background: var(--c-text); color: white; }

/* === SEKCJA PITAX (gradient pomarańczowy) === */
.pitax-section {
    background: linear-gradient(135deg, var(--c-orange) 0%, var(--c-orange-light) 100%);
    color: white;
}

/* Details/summary bez domyślnego markera */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

@media (max-width: 768px) {
    .mobile-hide { display: none; }
}

/* === KARTY AKTUALNOŚCI (iter. 5) ===
   Spójne z .dog-card i .help-card — białe tło, border 1px, radius 12px,
   hover: translateY -4px + cień. Zdjęcie u góry 16:9, badge daty
   pomarańczowy w lewym górnym rogu, tytuł Lato granat, lead Poppins szary,
   link "Czytaj więcej" w pomarańczu. Klikalna cała karta (block <a>). */
.news-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .25s ease;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(44,62,80,0.10);
    border-color: var(--c-orange);
}
.news-card:hover .news-img { transform: scale(1.04); }
.news-card .news-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--c-gray-light);
    overflow: hidden;
}
.news-card .news-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .35s ease;
}
.news-card .news-date {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--c-orange);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(184, 92, 0, 0.35);
}
.news-card .news-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.news-card .news-title {
    font-size: 1.25rem;
    line-height: 1.25;
    margin-bottom: 0.6rem;
    color: var(--c-text);
}
.news-card .news-lead {
    color: #5a6776;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card .news-more {
    color: var(--c-orange);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}
.news-card:hover .news-more { text-decoration: underline; }

/* === PAGINACJA (aktualnosci.html, placeholder w fazie 1) === */
.pager {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pager .page-btn,
.pager a.page-numbers,
.pager span.page-numbers {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e5e7eb;
    background: white;
    color: var(--c-text);
    font-weight: 600;
    font-size: 14px;
    border-radius: 50%;
    transition: all .15s ease;
    cursor: pointer;
    text-decoration: none;
}
.pager .page-btn:hover,
.pager a.page-numbers:hover {
    border-color: var(--c-orange);
    color: var(--c-orange);
}
.pager .page-btn.active,
.pager span.page-numbers.current {
    background: var(--c-orange);
    border-color: var(--c-orange);
    color: white;
}
.pager .page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pager .page-ellipsis,
.pager span.dots {
    color: #5a6776;
    padding: 0 4px;
    border: none;
    background: none;
}

/* Prev / Next — pill-shaped (numery zostają okrągłe). „Następna" / „Poprzednia"
   nie zmieściłyby się w 40×40px, więc poszerzamy szerokość i zmniejszamy radius. */
.pager .prev.page-numbers,
.pager .next.page-numbers {
    width: auto;
    padding: 0 18px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 12px;
}

/* === ARTYKUŁ (aktualnosc.html — single news) === */
.article-content p {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #4a5568;
    margin-bottom: 1.25rem;
}
.article-content p:first-child {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--c-text);
    line-height: 1.55;
}
.article-content h2 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--c-text);
}
.article-content blockquote {
    border-left: 4px solid var(--c-orange);
    background: var(--c-cream);
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    font-style: italic;
    color: var(--c-text);
    border-radius: 0 8px 8px 0;
}
.article-content strong { color: var(--c-text); }

/* Galeria w artykule */
.article-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 1.75rem 0;
}
.article-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: var(--c-gray-light);
}
@media (max-width: 640px) {
    .article-gallery { grid-template-columns: 1fr 1fr; }
}

/* === COOKIE BANNER ===
   Sticky pasek na dole, granatowe tło z paletą schroniska, pomarańczowy CTA.
   Ukrywa się po kliknięciu „Akceptuję" + zapisuje localStorage. */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--c-text);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 9999;
    flex-wrap: wrap;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cookie-banner.hidden { display: none; }
.cookie-banner p {
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0;
    flex: 1;
    min-width: 240px;
    color: rgba(255,255,255,0.92);
}
.cookie-banner p a {
    color: var(--c-orange-light);
    text-decoration: underline;
}
.cookie-banner p a:hover { color: white; }

/* Nawigacja prev/next pod artykułem */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.article-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem 1.25rem;
    border: 1.5px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    transition: all .15s ease;
    min-height: 88px;
}
.article-nav-link:hover {
    border-color: var(--c-orange);
    transform: translateY(-2px);
}
.article-nav-link .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5a6776;
    font-weight: 600;
}
.article-nav-link .title {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: var(--c-text);
    font-size: 0.95rem;
    line-height: 1.3;
}
.article-nav-link.next { text-align: right; }
.article-nav-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}
