/*
Theme Name: Aleksander Łamek - Wesoły Humor
Theme URI: https://aleksanderlamek.pl
Author: Aleksander Łamek & Wesoły Zespół
Author URI: https://aleksanderlamek.pl
Description: Wesoły, energetyczny i elegancki motyw dla oficjalnej strony Aleksandra Łamka. Zaprojektowany z myślą o Wesołych Spacerach po Warszawie, aplikacji Smile Power, książkach i terapii śmiechem. Wszystkie teksty i zdjęcia są w 100% edytowalne bezpośrednio w plikach stron i postów!
Version: 1.1.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aleksander-lamek
Tags: one-page, portfolio, bio, humor, walks, responsive, custom-colors, custom-menu, featured-images, translation-ready
*/

:root {
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-dark: #b45309;
  --secondary: #ec4899;
  --accent: #10b981;
  --bg-warm: #fffbeb;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --radius-card: 20px;
  --radius-pill: 9999px;
  --shadow-warm: 0 10px 25px -5px rgba(245, 158, 11, 0.15), 0 8px 10px -6px rgba(245, 158, 11, 0.1);
}

@charset "UTF-8";

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-warm);
  color: var(--text-dark);
  font-family: Outfit, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
}

h1, h2, h3, h4, .humor-heading {
  font-family: Fredoka, sans-serif !important;
  font-weight: 700;
  color: var(--text-dark);
}

.site-header {
  background: #ffffff;
  border-bottom: 2px solid #fef3c7;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.top-humor-ticker {
  background: linear-gradient(90deg, #f59e0b, #ec4899);
  color: white;
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.humor-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  border: 1px solid #fef3c7;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-warm);
  padding: 1rem !important; /* <--- DODANA LINIA */
}

.humor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.22);
}

.bio-hero-container {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2.5rem;
  align-items: center;
  background: #ffffff;
  border: 2px solid #fef3c7;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-warm);
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .bio-hero-container {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.75rem;
  }
}

.bio-photo-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(245, 158, 11, 0.2);
  border: 4px solid #fef3c7;
}

.bio-photo-frame img {
  width: 100%;
  height: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.reaction-btn:hover {
  background: #fde68a;
  transform: scale(1.05);
}

/* Układ dla postów w dziale Książki */
.book-cover-media {
  width: 100%;
  margin-bottom: 1.5rem;
}

.book-cover-media img,
.book-cover-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 14px rgba(245, 158, 11, 0.2);
  border: 2px solid #fef3c7;
  display: block;
}

@media (min-width: 768px) {
  .book-cover-media {
    float: left;
    width: 42%;
    max-width: 48%;
    margin-right: 2rem;
    margin-bottom: 1.5rem;
  }
}

#primary {
  max-width: 1100px !important; /* Zwiększa szerokość całkowitą */
  padding: 0 0.5rem !important; /* Zmniejsza boczny margines na małych ekranach */
}

/* Poszerzenie wewnętrznego div-a ograniczającego szerokość */
#primary > div {
  max-width: 100% !important;
}

/* Optymalizacja menu dla smartfonów i małych ekranów */
@media (max-width: 768px) {
  /* Zmniejszenie odstępu między rzędami z 1rem (16px) na 0.35rem (~5px) */
  .main-navigation {
    gap: 0.35rem 0.5rem !important;
  }

  /* Zmniejszenie pionowych marginesów w samych przyciskach/linkach menu */
  .main-navigation a {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
  }
}

/* Optymalizacja nagłówków i dużych tekstów dla smartfonów */
@media (max-width: 768px) {
  /* Tytuł główny podstrony (h1) */
  h1, .humor-card h1 {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.5rem !important;
  }

  /* Nagłówki drugiego stopnia (h2) */
  h2, .humor-card h2 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Nagłówki trzeciego stopnia (h3) */
  h3, .humor-card h3 {
    font-size: 1.15rem !important;
    line-height: 1.3 !important;
  }

  /* Duży tekst podtytułu pod h1 */
  header p, .page-content p {
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
  }

  /* Zmniejszenie górnego i dolnego odstępu nagłówka podstrony */
  article header {
    padding-bottom: 0.75rem !important;
    margin-bottom: 1rem !important;
  }
}

/* Wymuszenie 4 kolumn w sekcji projektów */
.projects-grid, 
.humor-cards-container, 
 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important; /* Zmniejszenie przerwy między kartami */
}

/* Dostosowanie wewnętrznych odstępów samych kart projektów */
.projects-grid .humor-card,
.humor-cards-container .humor-card {
    padding: 1.25rem 0.85rem !important;
}

/* Wersja mobilna/tabletowa - zachowanie czytelności na małych ekranach */
@media (max-width: 1024px) {
    .projects-grid, 
    .humor-cards-container, 
    div:has(> .humor-card) {
        grid-template-columns: repeat(2, 1fr) !important; /* 2x2 na tabletach */
    }
}

@media (max-width: 640px) {
    .projects-grid, 
    .humor-cards-container, 
    div:has(> .humor-card) {
        grid-template-columns: 1fr !important; /* 1 kolumna na telefonach */
    }
}

/* Naprawa widgetu / przycisku Uśmiech dla Aleksandra */
.usmiech-dla-aleksandra,
a[href*="usmiech"],
.btn-usmiech,
div:has(> a[href*="aleksand"]) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 580px !important; /* Odpowiednia szerokość, by tekst nie był ściśnięty */
  margin: 1.5rem auto !important;
  padding: 0.85rem 1.5rem !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  text-decoration: none !important;
  text-align: center !important;
}

/* Wymuszenie klikalności wewnętrznych elementów i estetyki tekstu */
.usmiech-dla-aleksandra *,
a[href*="usmiech"] * {
  pointer-events: auto !important;
  white-space: normal !important;
  line-height: 1.3 !important;
}

/* Przywrócenie prawidłowej szerokości dla podstron i wpisów na komputerach */
.site,
#page,
.site-content,
.container,
main#primary,
article.page,
article.post {
  width: 100% !important;
  max-width: 1200px !important; /* Standardowa czytelna szerokość podstron */
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Wewnętrzna treść wpisów i podstron */
.entry-content,
.page-content {
  width: 100% !important;
  max-width: 100% !important;
}

/* Zabezpieczenie dla układu mobilnego (zachowanie elastyczności) */
@media (max-width: 1240px) {
  .site,
  #page,
  .site-content,
  .container,
  main#primary,
  article.page,
  article.post {
    max-width: 95% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* 1. Odblokowanie pełnej szerokości dla podstron i pojedynczych wpisów */
main#primary,
article,
.entry-content,
.page-content,
body.page main,
body.single main {
  display: block !important; /* Wyłączenie siatki grid dla głównych kontenerów strony */
  grid-template-columns: none !important;
  width: 100% !important;
  max-width: 1200px !important;
}

/* 2. Ograniczenie układu 4-kolumnowego WYŁĄCZNIE do sekcji z projektami */
.projects-grid,
.humor-cards-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.25rem !important;
  width: 100% !important;
}

/* Rysowanie kart w pełnej szerokości wewnątrz ich własnej siatki */
.projects-grid .humor-card,
.humor-cards-container .humor-card {
  width: 100% !important;
}

/* Poprawka dla okładek książek na komputerze i smartfonie */
.single .post-thumbnail img,
.single .featured-image img,
article.post img.wp-post-image,
.entry-content img.wp-post-image {
    object-fit: contain !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 1.5rem auto !important;
    display: block !important;
}

/* Dedykowane dopasowanie do małych ekranów (smartfony) */
@media (max-width: 768px) {
    .single .post-thumbnail img,
    .single .featured-image img,
    article.post img.wp-post-image,
    .entry-content img.wp-post-image {
        width: 100% !important;
        max-height: 70vh !important; /* Maksymalnie 70% wysokości ekranu telefonu */
        object-fit: contain !important;
    }
}