/*
 Theme Name: SPOFUR Child
 Description: Child theme z responsywną nawigacją (hamburger), białymi kartami, sekcją „Zarząd Klubu” i dopracowanym wyglądem na mobile.
 Version: 1.4.0
 Template: twentytwentyfour
 Text Domain: spofur-child
*/

:root{
  --sp-primary:#0047ab;
  --sp-primary-600:#184ed6;
  --sp-on-primary:#ffffff;
  --sp-text:#0f172a;
  --sp-muted:#475569;
  --sp-surface:#ffffff;
  --sp-border:#e2e8f0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
  color: var(--sp-text);
  background: #f8fafc;
  line-height: 1.6;
}

.container { width: min(1200px, 92vw); margin: 0 auto; padding: 0 1rem; }

/* Sticky blue header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: linear-gradient(0deg, var(--sp-primary-600), var(--sp-primary));
  color: var(--sp-on-primary);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

/* Branding */
.site-branding { display: flex; align-items: center; gap: .75rem; min-width: 0; margin-left: 30px; }
.custom-logo { height: 42px; width: auto; border-radius: .5rem; display: block; }
.site-title-link { text-decoration: none; font-weight: 800; font-size: 1.125rem; letter-spacing: .2px; color: var(--sp-on-primary); white-space: nowrap; }

/* Mobile menu button (hidden on desktop) */
.menu-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  color: var(--sp-on-primary);
  border-radius: .75rem;
  padding: .6rem .8rem;
  font-weight: 700;
  line-height: 1;
}
.menu-toggle:focus { outline: 2px solid rgba(255,255,255,.7); outline-offset: 2px; }

/* Primary nav */
.site-navigation { margin-left: auto; }
.primary-nav { display: flex; align-items: center; gap: .25rem; margin: 0; padding: 0; list-style: none; margin-right: 50px; }
.primary-nav > li { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.primary-nav a { display: inline-flex; align-items: center; text-decoration: none; padding: .6rem .9rem; border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--sp-on-primary); line-height: 1; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-page-ancestor > a { background: rgba(255,255,255,.18); text-decoration: none; }

/* Content */
.site-content { padding: 2rem 0; }

/* Grids */
.posts-grid { display: block; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.post-card { border: 1px solid var(--sp-border); border-radius: 1rem; padding: 1rem; background: var(--sp-surface); transition: transform .2s ease, box-shadow .2s ease; margin-bottom: 20px; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.post-card h2 { margin: 0 0 .4rem; font-size: 1.15rem; }
.post-meta { font-size: .9rem; color: var(--sp-muted); margin-bottom: .5rem; }

.board-section { margin-top: 3rem; padding: 2rem; border: 1px solid var(--sp-border); border-radius: 1rem; background: var(--sp-surface); }
.board-section h2 { margin: 0 0 1rem 0; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.board-card { padding: 1rem; border: 1px solid var(--sp-border); border-radius: 1rem; text-align: center; background: #fff; }
.board-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 999px; margin-bottom: .5rem; }

/* Content card for pages/singles */
.content-card { background: #ffffff; border-radius: 1rem; border: 1px solid var(--sp-border); padding: 2rem; box-shadow: 0 8px 24px rgba(0,0,0,.05); margin-bottom: 2rem; }
.content-card h1 { margin-top: 0; margin-bottom: 1rem; }
.content-card .wp-block-table table { width: 100%; }
.content-card .wp-block-table td, .content-card .wp-block-table th { padding: .5rem .75rem; border-color: var(--sp-border); }

/* Footer */
.site-footer { border-top: 1px solid #e6e6e6; color: var(--sp-muted); text-align: center; }

/* -------------------- Responsive -------------------- */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 900px) {
  .header-inner { min-height: 64px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: .5rem; margin-right: 20px; }
  .site-navigation {
    position: absolute;
    left: 0; right: 0; top: 64px;
    display: none;
    background: linear-gradient(0deg, var(--sp-primary-600), var(--sp-primary));
    padding: .5rem;
    border-bottom: 1px solid rgba(255,255,255,.15);
  }
  .site-navigation.is-open { display: block; }
  .primary-nav { flex-direction: column; align-items: stretch; gap: .4rem; }
  .primary-nav a { padding: .9rem 1rem; font-size: 1rem; background: rgba(255,255,255,.08); border-radius: .75rem; }
  .primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-page-ancestor > a { background: rgba(255,255,255,.22); }
  .site-title-link { font-size: 1rem; }
  .custom-logo { height: 36px; }
  .site-content { padding-top: 1.5rem; }
}

@media (max-width: 640px) {
  .container { width: min(700px, 94vw); }
  .posts-grid { grid-template-columns: 1fr; }
  .board-grid { grid-template-columns: 1fr 1fr; }
  .content-card { padding: 1.25rem; border-radius: .75rem; }
}
@media (max-width: 420px) {
  .board-grid { grid-template-columns: 1fr; }
}

/* Active/pressed state for current page in the nav */
.primary-nav .current-menu-item > a,
.primary-nav .current-page-ancestor > a,
.primary-nav a[aria-current="page"] {
  background: #ffffff;
  color: var(--sp-primary);
  box-shadow: inset 0 2px 0 rgba(0,0,0,.06);
}

/* Mouse press feedback */
.primary-nav a:active {
  transform: translateY(1px);
}

/* Focus ring for accessibility */
.primary-nav a:focus-visible, .menu-toggle:focus-visible {
  outline: 3px solid rgba(255,255,255,.8);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(24,78,214,.35);
}

/* Mobile pressed state keeps contrast on blue background */
@media (max-width: 900px) {
  .primary-nav .current-menu-item > a,
  .primary-nav .current-page-ancestor > a,
  .primary-nav a[aria-current="page"] {
    background: rgba(255,255,255,.95);
    color: var(--sp-primary-600);
  }
}


/* ---------- Zarząd Klubu (custom HTML block) ---------- */
/* Ulepszona karta sekcji */
.board-section {
  background: #ffffff;
  border: 1px solid var(--sp-border);
  border-radius: 1.25rem;
  box-shadow: 0 12px 30px rgba(31,94,255,.06);
  padding: clamp(1rem, 3vw, 2rem);
}

/* Nagłówki w sekcji */
.board-section h2 {
  color: var(--sp-primary);
  text-align: center;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
}

/* Główny kontener „board” z edytora */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
  align-items: start;
  justify-items: center;
  margin: 1rem 0 2rem 0;
  padding: .25rem;
}

/* Pojedynczy członek */
.board .member {
  text-align: center;
  padding: .75rem;
  max-width: 360px;
}

/* Avatar z niebieską ramką i cieniami */
.board .member .avatar {
  display: inline-block;
  border-radius: 999px;
  padding: 6px;
  background: radial-gradient(100% 100% at 50% 0%, #ecf2ff 0%, #e6eeff 100%);
  box-shadow: 0 2px 8px rgba(31,94,255,.15) inset, 0 6px 18px rgba(0,0,0,.06);
  margin-bottom: .65rem;
}
.board .member .avatar img {
  display: block;
  width: clamp(140px, 16vw, 180px);
  height: clamp(140px, 16vw, 180px);
  object-fit: cover;
  border-radius: 999px;
  box-shadow: 0 0 0 4px #e8f1ff, 0 0 0 6px rgba(31,94,255,.35);
}

/* Imię i znak */
.board .member .name {
  margin: .25rem 0 0;
  font-weight: 800;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
}
.board .member .name .callsign {
  color: var(--sp-primary);
  font-weight: 800;
  letter-spacing: .2px;
  margin-left: .35rem;
  white-space: nowrap;
}

/* Rola */
.board .member .role {
  margin: .25rem 0 0;
  color: var(--sp-muted);
  font-weight: 600;
}

/* Podsekcja „Członkowie Klubu” pod spodem */
.board-section .members-list h2 {
  color: var(--sp-primary);
  text-align: center;
  font-weight: 800;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  margin-top: 1.5rem;
}

/* Responsywność */
@media (max-width: 1024px) {
  .board { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .board { grid-template-columns: 1fr; }
  .board .member .avatar img { width: 160px; height: 160px; }
}

/* Spójne style dla treści stron/wpisów */
.content-card h1, 
.content-card h2, 
.content-card h3 {
  color: var(--sp-primary);
  font-weight: 400;
  line-height: 1.2;
  margin-top: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.content-card h1 { font-size: clamp(1.8rem, 3vw, 2.25rem); font-weight: 600; }
.content-card h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin-top: 1.5rem; }
.content-card h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); margin-top: 1.25rem; }

.content-card p {
  color: var(--sp-text);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.btn-read-more {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: #0073aa; /* kolor WordPress */
  color: #fff;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.btn-read-more:hover {
  background-color: #005177;
}

/* Formularz kontaktowy (.contact) */
.contact {
  display: flex;
  flex-direction: column;
}

.contact label {
  font-weight: 600;
  color: var(--sp-text);
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
}

.contact input[type="text"],
.contact input[type="email"],
.contact select,
.contact textarea {
  border: 1px solid var(--sp-border);
  border-radius: .6rem;
  padding: .7rem .9rem;
  font-size: 1rem;
  line-height: 1.5;
  background: #fff;
  color: var(--sp-text);
  transition: border-color .2s, box-shadow .2s;
}

.contact input:focus,
.contact textarea:focus,
.contact select:focus {
  outline: none;
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 3px rgba(31,94,255,.15);
}

.contact textarea {
  resize: vertical;
  min-height: 140px;
}

.contact input[type="submit"],
.contact button[type="submit"],
input.contact[type="submit"] {
  background: var(--sp-primary);
  border: none;
  border-radius: 4px;
  padding: .8rem 1.6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background .2s;
}

.contact input[type="submit"]:hover,
.contact button[type="submit"]:hover,
input.contact[type="submit"]:hover {
  background: var(--sp-primary-600);
}

/* Wiadomości Contact Form 7 */
.wpcf7 form .wpcf7-response-output {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-radius: .6rem;
  font-size: .95rem;
  font-weight: 500;
}

/* Sukces (wiadomość wysłana) */
.wpcf7 form .wpcf7-mail-sent-ok,
.wpcf7 form .wpcf7-response-output.wpcf7-mail-sent-ok {
  background: #e6f6ed;
  border: 1px solid #16a34a;
  color: #166534;
}

/* Błąd (np. problem z wysyłką) */
.wpcf7 form .wpcf7-mail-sent-ng,
.wpcf7 form .wpcf7-response-output.wpcf7-mail-sent-ng {
  background: #fef2f2;
  border: 1px solid #dc2626;
  color: #991b1b;
}

/* Błędy walidacji (np. brak pola) */
.wpcf7 form .wpcf7-validation-errors,
.wpcf7 form .wpcf7-response-output.wpcf7-validation-errors {
  background: #fff7ed;
  border: 1px solid #f97316;
  color: #9a3412;
}

/* Wiadomość informacyjna */
.wpcf7 form .wpcf7-spam-blocked,
.wpcf7 form .wpcf7-response-output.wpcf7-spam-blocked {
  background: #fefce8;
  border: 1px solid #eab308;
  color: #854d0e;
}

/* Kalendarz wydarzeń */
table.calendar {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--sp-border);
  border-radius: .4rem;
  overflow: hidden;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.04);
}

/* Nagłówki */
table.calendar thead th {
  background: var(--sp-primary);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: .9rem .75rem;
  font-size: 1rem;
}

/* Komórki */
table.calendar td {
  border-top: 1px solid var(--sp-border);
  padding: .75rem;
  color: var(--sp-text);
}

/* Hover na wierszu */
table.calendar tbody tr:hover {
  background: #f8fafc;
}

/* Linki w szczegółach */
table.calendar td a {
  color: var(--sp-primary);
  font-weight: 600;
  text-decoration: none;
  padding: .2rem .6rem;
  border-radius: .4rem;
  background: rgba(31,94,255,.08);
  transition: background .2s, color .2s;
}

table.calendar td a:hover {
  background: var(--sp-primary-600);
  color: #fff;
}

/* Responsywność – przewijanie w bok na małych ekranach */
@media (max-width: 640px) {
  table.calendar {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.static-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.static-file-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--sp-border);
}
.static-file-list li:last-child {
  border-bottom: 0;
}
.static-file-list .sfl-icon {
  display: block;
}
.static-file-list a {
  font-weight: 600;
  color: var(--sp-text);
  text-decoration: none;
}
.static-file-list a:hover {
  text-decoration: underline;
}
.static-file-list .sfl-meta {
  margin-left: auto;
  color: var(--sp-muted);
  font-size: .9rem;
}

/* Sekcja komentarzy jako karta */
.comments.content-card,
.comment-respond {
  background: #fff;
  border: 1px solid var(--sp-border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}

/* Nagłówki i meta */
.comments h2,
.comment-respond h3#reply-title { 
  margin-top: 0;
  color: var(--sp-primary);
  font-weight: 800;
}

/* Teksty pomocnicze */
.comment-notes,
.logged-in-as {
  color: var(--sp-muted);
  font-size: .95rem;
}

/* Pola formularza */
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  border: 1px solid var(--sp-border);
  border-radius: .6rem;
  padding: .7rem .9rem;
  font-size: 1rem;
  line-height: 1.5;
  background: #fff;
  color: var(--sp-text);
  transition: border-color .2s, box-shadow .2s;
}

.comment-form textarea:focus,
.comment-form input:focus {
  outline: none;
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 3px rgba(31,94,255,.15);
}

/* Etykiety */
.comment-form label {
  font-weight: 600;
  margin-top: .5rem;
  display: inline-block;
}

/* Przycisk */
.form-submit .submit {
  background: var(--sp-primary);
  border: none;
  border-radius: 999px;
  padding: .8rem 1.6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}
.form-submit .submit:hover {
  background: var(--sp-primary-600);
}

/* Lista komentarzy */
.comment-list {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
}
.comment-list > li {
  border-bottom: 1px solid var(--sp-border);
  padding: 1rem 0;
}
.comment-list > li:last-child { border-bottom: 0; }

/* Odstęp nad formularzem, gdy jest pod wpisem */
#respond { margin-top: 1rem; }

/* Siatka 2 kolumny dla formularza kontaktowego */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;           /* mobile: 1 kolumna */
  gap: 1rem 2rem;
}

.contact-grid .col-left,
.contact-grid .col-right,
.contact-grid .col-full { width: 100%; }

@media (min-width: 960px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;     /* desktop: 2 kolumny */
    align-items: start;
  }
  .contact-grid .col-left  { grid-column: 1; }
  .contact-grid .col-right { grid-column: 2; }
  .contact-grid .col-full  { grid-column: 1 / -1; } /* przycisk przez całą szerokość */
}

/* Spraw, by textarea ładnie wypełniała kolumnę */
.contact-grid .col-right textarea {
  min-height: 250px;     /* możesz dostosować */
}

/* Drobna kosmetyka nagłówka strony kontakt */
.content-card h1 { margin-bottom: .75rem; }
