/*
 Theme Name:   Bessly Child
 Theme URI:    https://bessly.pl
 Description:  Lekki child theme Kadence dla portalu bessly.pl — magazyny energii BESS
 Author:       bessly.pl
 Author URI:   https://bessly.pl
 Template:     kadence
 Version:      1.2.0
 License:      GPL-2.0-or-later
 Text Domain:  bessly-child
*/

/* ══════════════════════════════════════
   DESIGN TOKENS — bessly brand
   Kadence customizer handles base typography
   and layout. Here we only add what Kadence
   cannot do natively.
   ══════════════════════════════════════ */

:root {
  --bessly-navy:       #0f1e3c;
  --bessly-navy-mid:   #1a2f5a;
  --bessly-navy-light: #243a6e;
  --bessly-gold:       #c9a84c;
  --bessly-gold-light: #e2c278;
  --bessly-gold-pale:  #f5ead0;
  --bessly-cream:      #faf8f4;
  --bessly-text:       #1a1a2e;
  --bessly-text-mid:   #4a4a6a;
  --bessly-text-light: #8888aa;
  --bessly-border:     #e8e4da;
}

/* ── Utility classes for block editor ── */

.has-bessly-navy-background-color   { background-color: var(--bessly-navy) !important; }
.has-bessly-gold-background-color   { background-color: var(--bessly-gold) !important; }
.has-bessly-cream-background-color  { background-color: var(--bessly-cream) !important; }
.has-bessly-navy-color              { color: var(--bessly-navy) !important; }
.has-bessly-gold-color              { color: var(--bessly-gold) !important; }

/* ── Article cards ── */

.bessly-article-card {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--bessly-border);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.bessly-article-card:hover { opacity: 0.75; }

.bessly-article-tag {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bessly-gold);
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── Category cards ── */

.bessly-cat-card {
  background: #ffffff;
  border: 1px solid var(--bessly-border);
  border-radius: 6px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.bessly-cat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--bessly-gold);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.bessly-cat-card:hover {
  border-color: var(--bessly-gold);
  box-shadow: 0 8px 32px rgba(15,30,60,0.08);
  transform: translateY(-2px);
}

.bessly-cat-card:hover::after { transform: scaleX(1); }

/* ── Q&A items ── */

.bessly-qa-mark {
  color: var(--bessly-gold);
  font-weight: 700;
  flex-shrink: 0;
}

.bessly-qa-badge {
  background: var(--bessly-gold-pale);
  color: var(--bessly-gold);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ── Stats bar ── */

.bessly-stats-bar {
  background: var(--bessly-gold-pale);
  border-bottom: 1px solid var(--bessly-border);
  padding: 20px 0;
}

.bessly-stat-num {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--bessly-navy);
  line-height: 1;
}

.bessly-stat-label {
  font-size: 11px;
  color: var(--bessly-text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Buttons ── */

.bessly-btn-primary {
  background: var(--bessly-gold);
  color: var(--bessly-navy);
  padding: 13px 28px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, transform 0.15s;
}

.bessly-btn-primary:hover {
  background: var(--bessly-gold-light);
  transform: translateY(-1px);
}

.bessly-btn-outline {
  background: transparent;
  border: 2px solid var(--bessly-navy);
  color: var(--bessly-navy);
  padding: 10px 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}

.bessly-btn-outline:hover {
  background: var(--bessly-navy);
  color: #fff;
}

/* ── Newsletter widget ── */

.bessly-newsletter {
  background: var(--bessly-navy);
  border-radius: 6px;
  padding: 28px 24px;
  text-align: center;
}

.bessly-newsletter input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ── Section headers (editorial style) ── */

.bessly-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--bessly-navy);
}

.bessly-section-link {
  font-size: 12px;
  color: var(--bessly-gold);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.bessly-section-link:hover { color: var(--bessly-navy); }

/* ══════════════════════════════════════
   HOMEPAGE — front-page.php
   Klasy z prefiksem bessly- żeby nie
   kolidować z Kadence.
   ══════════════════════════════════════ */

/*
 * Front page: Kadence opakowuje treść w
 * <main id="inner-wrap" class="wrap kt-clear">
 * Musimy wyzerować jego margines/padding i
 * pozwolić naszym sekcjom full-width wyłamać się.
 */

/* Kadence domyślnie daje content-area margin 5rem — wyłącz na homepage */
.bessly-front-page {
  margin: 0 !important;
  padding: 0 !important;
}

/* Kadence wrap: wyzeruj max-width na stronie głównej */
#inner-wrap:has(.bessly-front-page) {
  padding: 0 !important;
  max-width: none !important;
}

/*
 * CSS breakout: elementy full-width wyłamują się
 * z kontenera Kadence wrap (max-width + padding).
 */
.bessly-hero,
.bessly-statsbar {
  width: 100vw !important;
  max-width: none !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
}

/* ── Hero section ── */

.bessly-hero {
  background: var(--bessly-navy) !important;
  overflow: hidden;
  padding: 80px 32px 72px;
}

.bessly-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(201,168,76,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(201,168,76,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.bessly-hero__inner {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 64px !important;
  align-items: center;
}

.bessly-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bessly-gold) !important;
  margin-bottom: 20px;
  font-weight: 500;
}

.bessly-hero__label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--bessly-gold);
}

.bessly-hero__title {
  font-size: clamp(36px, 4vw, 52px) !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 20px !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
}

.bessly-hero__title::before {
  display: none !important;
}

.bessly-hero__title em {
  font-style: italic;
  color: var(--bessly-gold-light) !important;
}

.bessly-hero__desc {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 17px !important;
  color: rgba(255,255,255,0.65) !important;
  line-height: 1.7 !important;
  font-weight: 300;
  margin-bottom: 36px;
  max-width: 440px;
}

.bessly-hero__actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.bessly-hero__ghost {
  color: rgba(255,255,255,0.6) !important;
  font-size: 13px;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  text-decoration: none !important;
}

.bessly-hero__ghost:hover { color: #fff !important; }

/* ── Hero featured card ── */

.bessly-hero__card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  text-decoration: none !important;
  color: inherit;
  display: block;
  transition: border-color 0.2s;
}

.bessly-hero__card:hover { border-color: rgba(255,255,255,0.25); }

.bessly-hero__card-img {
  height: 200px;
  background: linear-gradient(135deg, var(--bessly-navy-mid) 0%, var(--bessly-navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bessly-hero__card-emoji {
  font-size: 64px;
  opacity: 0.6;
}

.bessly-hero__card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bessly-hero__card-body { padding: 24px; }

.bessly-hero__card-tag {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bessly-gold) !important;
  font-weight: 500;
  margin-bottom: 10px;
}

.bessly-hero__card-title {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 20px !important;
  color: #ffffff !important;
  line-height: 1.3;
  margin-bottom: 12px;
}

.bessly-hero__card-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.4) !important;
  display: flex;
  gap: 16px;
}

/* ── Stats bar ── */

.bessly-statsbar {
  background: var(--bessly-gold-pale) !important;
  border-bottom: 1px solid var(--bessly-border);
  padding: 20px 0;
}

.bessly-statsbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex !important;
  gap: 48px !important;
  justify-content: center !important;
}

.bessly-statsbar__item { text-align: center; }

.bessly-statsbar__num {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 26px !important;
  font-weight: 700 !important;
  color: var(--bessly-navy) !important;
  line-height: 1;
}

.bessly-statsbar__label {
  font-size: 11px;
  color: var(--bessly-text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

.bessly-statsbar__divider {
  width: 1px;
  background: var(--bessly-border);
  align-self: stretch;
}

/* ── Home main content area ── */

.bessly-home {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 32px;
}

/* ── Categories grid ── */

.bessly-categories {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin-bottom: 72px;
}

.bessly-cat-card {
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

.bessly-cat-card__count {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  color: var(--bessly-text-light);
  letter-spacing: 0.06em;
}

.bessly-cat-card__icon { font-size: 32px; margin-bottom: 14px; display: block; }

.bessly-cat-card__name {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--bessly-navy);
  margin-bottom: 6px;
}

.bessly-cat-card__desc { font-size: 13px; color: var(--bessly-text-light); line-height: 1.5; }

/* ── Articles + Sidebar layout ── */

.bessly-articles-layout {
  display: grid !important;
  grid-template-columns: 2fr 1fr !important;
  gap: 48px !important;
  margin-bottom: 72px;
}

.bessly-article-card__tag {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bessly-gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.bessly-article-card__title {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--bessly-navy);
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.bessly-article-card__excerpt {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 14px;
  color: var(--bessly-text-mid);
  line-height: 1.65;
  font-weight: 300;
  margin-bottom: 12px;
}

.bessly-article-card__meta {
  font-size: 11px;
  color: var(--bessly-text-light);
  display: flex;
  gap: 12px;
  letter-spacing: 0.04em;
}

.bessly-article-card__thumb {
  border-radius: 4px;
  background: linear-gradient(135deg, var(--bessly-navy-light) 0%, var(--bessly-navy-mid) 100%);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  opacity: 0.7;
  flex-shrink: 0;
  align-self: start;
  overflow: hidden;
}

.bessly-article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

/* ── Sidebar widgets ── */

.bessly-sidebar-widget {
  background: #fff;
  border: 1px solid var(--bessly-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.bessly-sidebar-widget__header {
  background: var(--bessly-navy);
  padding: 14px 20px;
}

.bessly-sidebar-widget__title {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--bessly-gold-light) !important;
  letter-spacing: 0.04em;
}

.bessly-sidebar-widget__body { padding: 20px; }

.bessly-qa-item { padding: 14px 0; border-bottom: 1px solid var(--bessly-border); }
.bessly-qa-item:last-child { border-bottom: none; }

.bessly-qa-item__question { font-size: 13px; font-weight: 500; color: var(--bessly-navy); line-height: 1.4; margin-bottom: 6px; }
.bessly-qa-item__question a { color: inherit !important; text-decoration: none !important; }

.bessly-qa-item__meta { font-size: 11px; color: var(--bessly-text-light); display: flex; justify-content: space-between; }

/* ── Q&A section ── */

.bessly-qa-section {
  background: #fff;
  border: 1px solid var(--bessly-border);
  border-radius: 8px;
  padding: 40px;
  margin-bottom: 72px;
}

.bessly-qa-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 24px !important;
  margin-top: 32px;
}

.bessly-qa-full-item {
  border: 1px solid var(--bessly-border);
  border-radius: 6px;
  padding: 24px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.bessly-qa-full-item:hover { border-color: var(--bessly-gold); }

.bessly-qa-full-item__q {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 16px;
  color: var(--bessly-navy);
  line-height: 1.4;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.bessly-qa-full-item__a {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 14px;
  color: var(--bessly-text-mid);
  line-height: 1.65;
  font-weight: 300;
  padding-left: 24px;
}

.bessly-qa-submit {
  margin-top: 32px;
  background: var(--bessly-gold-pale);
  border-radius: 6px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.bessly-qa-submit__text { flex: 1; }

.bessly-qa-submit__title {
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 16px;
  color: var(--bessly-navy);
  margin-bottom: 4px;
}

.bessly-qa-submit__desc { font-size: 13px; color: var(--bessly-text-mid); }

/* ── Newsletter button ── */

.newsletter-btn {
  width: 100%;
  background: var(--bessly-gold);
  color: var(--bessly-navy);
  border: none;
  padding: 11px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--global-body-font-family, 'Nunito', sans-serif);
  transition: background 0.2s;
}

.newsletter-btn:hover { background: var(--bessly-gold-light); }

/* ── Homepage responsive ── */

@media (max-width: 900px) {
  .bessly-hero__inner { grid-template-columns: 1fr !important; gap: 32px !important; }
  .bessly-categories { grid-template-columns: 1fr 1fr !important; }
  .bessly-articles-layout { grid-template-columns: 1fr !important; }
  .bessly-qa-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
  .bessly-hero { padding: 48px 20px 40px; }
  .bessly-categories { grid-template-columns: 1fr !important; }
  .bessly-statsbar__inner { flex-wrap: wrap; gap: 24px !important; }
  .bessly-qa-submit { flex-direction: column; text-align: center; }
  .bessly-qa-section { padding: 24px; }
  .bessly-home { padding: 32px 16px; }
}

/* ══════════════════════════════════════
   PAGE TITLE BANNER (Kadence entry-hero)
   Ciemny baner tytułowy na podstronach
   ══════════════════════════════════════ */

section.entry-hero {
  padding: 32px 0 28px !important;
  margin-bottom: 0 !important;
  position: relative !important;
}

/* Tło strony — lekko cieplejsze kremowe */
body {
  background-color: #faf8f4 !important;
}

/* Odstęp pod banerem — Kadence domyślnie daje 5rem */
.content-area {
  margin-top: 2rem !important;
  margin-bottom: 2rem !important;
}


article.single-entry {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

section.entry-hero .hero-section-overlay {
  background-color: var(--bessly-navy) !important;
  background-image:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(201,168,76,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(201,168,76,0.05) 0%, transparent 60%);
  opacity: 1 !important;
}

section.entry-hero .entry-title,
section.entry-hero .page-title {
  color: #ffffff !important;
  font-family: var(--global-heading-font-family, 'Bitter', serif);
  font-size: 42px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

/* Nadtytuł + złota kreska — jeden ::before dla wszystkich wariantów */
section.entry-hero .entry-hero-container-inner h1::before {
  content: '— Niezależnie o bateryjnych magazynach energii';
  display: block;
  font-family: var(--global-body-font-family, 'Nunito', sans-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bessly-gold);
  margin-bottom: 14px;
}

/* Tytuł archiwum — wyrównanie do lewej (jak podstrony) */
section.entry-hero.post-archive-hero-section,
section.entry-hero.post-archive-hero-section .hero-container,
section.entry-hero.post-archive-hero-section .entry-header,
section.entry-hero.post-archive-hero-section .page-title,
section.entry-hero .entry-header.post-archive-title,
.post-archive-hero-section h1.page-title,
.post-archive-hero-section h1.archive-title {
  text-align: left !important;
}

/* Breadcrumbs w banerze */
section.entry-hero .kadence-breadcrumbs,
section.entry-hero .kadence-breadcrumb-wrap {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

section.entry-hero .kadence-breadcrumbs a,
section.entry-hero .kadence-breadcrumb-wrap a {
  color: var(--bessly-gold-light);
  text-decoration: none;
}

section.entry-hero .kadence-breadcrumbs a:hover,
section.entry-hero .kadence-breadcrumb-wrap a:hover {
  color: #ffffff;
}

/* ══════════════════════════════════════
   ARTICLE CONTENT TYPOGRAPHY
   ══════════════════════════════════════ */

/* Pierwszy H2 bez górnego marginesu */
.entry-content h2.wp-block-heading:first-child,
.entry-content > h2:first-child,
.single-content > h2:first-child,
.entry-content .wp-block-heading:first-child {
  margin-top: 0 !important;
}

.single-content h2.wp-block-heading,
.entry-content h2.wp-block-heading,
.entry-content h2 {
  font-family: var(--global-heading-font-family, 'Bitter', serif) !important;
  color: var(--bessly-navy) !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  margin-top: 48px !important;
  margin-bottom: 16px !important;
  padding-bottom: 12px !important;
  border-bottom: 2px solid var(--bessly-border) !important;
}

.single-content h3.wp-block-heading,
.entry-content h3.wp-block-heading,
.entry-content h3 {
  font-family: var(--global-heading-font-family, 'Bitter', serif) !important;
  color: var(--bessly-navy-mid) !important;
  font-size: 19px !important;
  font-weight: 600 !important;
  margin-top: 32px !important;
  margin-bottom: 12px !important;
}

.entry-content p {
  color: var(--bessly-text) !important;
  line-height: 1.75 !important;
  font-size: 15px !important;
}

.entry-content strong {
  color: var(--bessly-navy) !important;
  font-weight: 600 !important;
}

/* ══════════════════════════════════════
   TOPBAR (Kadence)
   ══════════════════════════════════════ */

.kadence-top-header-row,
#masthead .kadence-top-bar {
  background-color: var(--bessly-navy) !important;
  color: var(--bessly-gold-light) !important;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.kadence-top-header-row a,
#masthead .kadence-top-bar a {
  color: var(--bessly-gold-light) !important;
}

.kadence-top-header-row a:hover,
#masthead .kadence-top-bar a:hover {
  color: #ffffff !important;
}
