/*
Theme Name: homesetup.pl Child
Theme URI: https://homesetup.pl/
Description: Child theme dla homesetup.pl — paleta marki, fonty Inter, override Kadence palette, redesign nagłówka, stopki i komponentów afiliacyjnych.
Author: homesetup.pl
Author URI: https://homesetup.pl/
Template: kadence
Version: 0.3.0
Text Domain: homesetup-child
*/

/* =========================================================
   1. PALETA — high-specificity override Kadence inline CSS
   Kadence wstrzykuje :root { --global-palette1: ... } inline
   PO załadowaniu child stylesheet, więc plain :root przegrywa.
   Łańcuch html body :root + .wp-site-blocks ma wyższą specyficzność.
   ========================================================= */
:root,
html body,
html body :root,
html body .wp-site-blocks,
html body .site,
html body .entry-content {
    --global-palette1: #2D6A4F;
    --global-palette2: #1B4332;
    --global-palette3: #1A1D23;
    --global-palette4: #5A6371;
    --global-palette5: #5A6371;
    --global-palette6: #E1E5EB;
    --global-palette7: #E1E5EB;
    --global-palette8: #F7F9FB;
    --global-palette9: #FFFFFF;
    --global-palette-highlight: #F4A261;
    --global-palette-highlight-alt: #E76F51;
    --global-palette-highlight-alt2: #F4A261;
    --global-body-text-color: #1A1D23;
    --global-body-link-color: #2D6A4F;
    --global-body-link-color-hover: #1B4332;

    --hs-primary: #2D6A4F;
    --hs-primary-dark: #1B4332;
    --hs-amber: #F4A261;
    --hs-amber-dark: #E76F51;
    --hs-text: #1A1D23;
    --hs-muted: #5A6371;
    --hs-border: #E1E5EB;
    --hs-bg-alt: #F7F9FB;
    --hs-bg: #FFFFFF;

    --hs-font-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --hs-font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --hs-container: 1200px;
    --hs-radius: 6px;
    --hs-radius-lg: 12px;
    --hs-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --hs-shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
}

/* =========================================================
   2. BASE — body, container, typografia
   ========================================================= */
html body,
html body.wp-site-blocks,
html body .site {
    background-color: var(--hs-bg);
    color: var(--hs-text);
    font-family: var(--hs-font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html body .site-container,
html body .content-container,
html body .entry-content {
    max-width: var(--hs-container);
}

/* Czytelna szerokość treści w wpisach */
.single .entry-content > p,
.single .entry-content > h2,
.single .entry-content > h3,
.single .entry-content > h4,
.single .entry-content > ul,
.single .entry-content > ol,
.single .entry-content > blockquote,
.page .entry-content > p,
.page .entry-content > h2,
.page .entry-content > h3 {
    max-width: 720px;
}

h1, h2, h3, h4, h5, h6,
.entry-title, .site-title {
    font-family: var(--hs-font-display);
    color: var(--hs-text);
    letter-spacing: -0.015em;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 1.4em;
    margin-bottom: 0.6em;
}

h1, .entry-title { font-size: 28px; line-height: 1.2; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; font-weight: 600; }

@media (min-width: 768px) {
    html body { font-size: 17px; }
    h1, .entry-title { font-size: 44px; line-height: 1.15; }
    h2 { font-size: 32px; }
    h3 { font-size: 24px; }
    h4 { font-size: 20px; }
}

p { margin: 0 0 1em; }

a { color: var(--hs-primary); text-decoration: none; }
a:hover { color: var(--hs-primary-dark); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:focus-visible {
    outline: 2px solid var(--hs-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.entry-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

::selection { background: rgba(244, 162, 97, 0.35); color: var(--hs-text); }

/* Strona główna — ukryj domyślny tytuł "Strona główna" (mamy własny H1 w hero) */
body.page-id-7 .entry-header,
body.page-id-7 .entry-title,
body.page-id-7 header.entry-header { display: none !important; }
/* To samo dla "Blog" — lista wpisów nie potrzebuje H1 "Blog" w treści (tytuł page jest w head/title) */
body.page-id-8 .entry-header,
body.page-id-8 .entry-title { display: none !important; }

/* =========================================================
   3. HEADER — czyste białe tło + cienki shadow przy scroll
   ========================================================= */
html body .site-header,
html body #masthead {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid var(--hs-border);
    box-shadow: var(--hs-shadow-sm);
}

html body .site-header-row-container-inner {
    padding-top: 14px;
    padding-bottom: 14px;
}

html body .site-branding .site-title,
html body .site-branding a {
    color: var(--hs-text) !important;
    font-weight: 700;
    text-decoration: none;
}

html body .custom-logo,
html body .site-branding img {
    max-height: 44px;
    width: auto;
    height: auto;
}

/* Mamy logo SVG zawierające wordmark — ukryj duplikujący się tekst tytułu obok */
html body.wp-custom-logo .site-branding .site-title-wrap,
html body.wp-custom-logo .site-branding .site-title,
html body.wp-custom-logo .site-branding .site-description {
    display: none !important;
}

/* Menu */
html body .header-navigation .menu > li > a,
html body #primary-menu > li > a,
html body .site-header-item .menu > li > a {
    color: var(--hs-text) !important;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0;
    padding: 8px 14px;
    position: relative;
    transition: color 0.15s ease;
}

html body .header-navigation .menu > li > a::after,
html body #primary-menu > li > a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    background: var(--hs-primary);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.18s ease;
}
html body .header-navigation .menu > li > a:hover,
html body .header-navigation .menu > li.current-menu-item > a,
html body #primary-menu > li > a:hover,
html body #primary-menu > li.current-menu-item > a {
    color: var(--hs-primary) !important;
}
html body .header-navigation .menu > li > a:hover::after,
html body .header-navigation .menu > li.current-menu-item > a::after,
html body #primary-menu > li > a:hover::after,
html body #primary-menu > li.current-menu-item > a::after {
    transform: scaleX(1);
}

/* =========================================================
   4. CTA — buttony amber
   ========================================================= */
.button,
.wp-block-button__link,
button[type="submit"],
.kb-button,
.hs-cta {
    background-color: var(--hs-amber) !important;
    color: #1A1D23 !important;
    border-radius: var(--hs-radius);
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    padding: 12px 22px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none !important;
    display: inline-block;
}

.button:hover,
.wp-block-button__link:hover,
button[type="submit"]:hover,
.kb-button:hover,
.hs-cta:hover {
    background-color: var(--hs-amber-dark) !important;
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: var(--hs-shadow-md);
}

.button:focus-visible,
.wp-block-button__link:focus-visible,
.hs-cta:focus-visible {
    outline: 3px solid var(--hs-primary);
    outline-offset: 2px;
}

/* Wariant outline (np. dla secondary) */
.is-style-outline .wp-block-button__link {
    background: transparent !important;
    color: var(--hs-primary) !important;
    border: 2px solid var(--hs-primary) !important;
}
.is-style-outline .wp-block-button__link:hover {
    background: var(--hs-primary) !important;
    color: #FFFFFF !important;
}

/* =========================================================
   5. HERO — split layout dla strony głównej
   ========================================================= */
.hs-hero {
    padding: 48px 0 56px;
    background:
        radial-gradient(1200px 400px at 90% -20%, rgba(244,162,97,0.08), transparent 60%),
        linear-gradient(180deg, #FFFFFF 0%, var(--hs-bg-alt) 100%);
    border-bottom: 1px solid var(--hs-border);
}
.hs-hero .hs-hero-inner {
    max-width: var(--hs-container);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}
@media (min-width: 900px) {
    .hs-hero { padding: 80px 0 88px; }
    .hs-hero .hs-hero-inner { grid-template-columns: 1.1fr 1fr; gap: 56px; }
}
.hs-hero h1 {
    margin-top: 0;
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}
@media (min-width: 900px) { .hs-hero h1 { font-size: 52px; } }
.hs-hero .hs-hero-sub {
    font-size: 18px;
    color: var(--hs-muted);
    max-width: 540px;
    margin: 0 0 28px;
}
@media (min-width: 900px) { .hs-hero .hs-hero-sub { font-size: 20px; } }
.hs-hero .hs-hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--hs-radius-lg);
    box-shadow: var(--hs-shadow-md);
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* =========================================================
   6. KARTY KATEGORII — info boxy 3-kol grid
   ========================================================= */
.hs-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 0;
}
@media (min-width: 720px) {
    .hs-cards { grid-template-columns: repeat(3, 1fr); gap: 22px; }
}
.hs-card {
    display: block;
    padding: 28px 24px;
    background: #FFFFFF;
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-lg);
    text-decoration: none !important;
    color: var(--hs-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.hs-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hs-shadow-md);
    border-color: var(--hs-primary);
    color: var(--hs-text);
}
.hs-card .hs-card-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--hs-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.hs-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}
.hs-card p {
    margin: 0;
    color: var(--hs-muted);
    font-size: 15px;
    line-height: 1.55;
}
.hs-card .hs-card-arrow {
    display: inline-block;
    margin-top: 14px;
    color: var(--hs-primary);
    font-weight: 600;
    font-size: 14px;
}

/* =========================================================
   7. SEKCJE STRONY GŁÓWNEJ
   ========================================================= */
.hs-section {
    padding: 56px 20px;
    max-width: var(--hs-container);
    margin: 0 auto;
}
.hs-section-narrow {
    max-width: 720px;
}
.hs-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
}
.hs-section .hs-section-lead {
    color: var(--hs-muted);
    font-size: 17px;
    margin-bottom: 32px;
    max-width: 640px;
}

.hs-mission {
    background: var(--hs-bg-alt);
    border-top: 1px solid var(--hs-border);
    border-bottom: 1px solid var(--hs-border);
}
.hs-mission .hs-section { padding: 56px 20px; }

/* =========================================================
   7b. LATEST POSTS na stronie głównej — karty redakcyjne
   Default wp-block-latest-posts wygląda jak surowa lista — zamieniamy
   na grid kart 1/2/3 kolumny zależnie od szerokości.
   ========================================================= */
.wp-block-latest-posts.wp-block-latest-posts__list {
    list-style: none;
    padding: 0 !important;
    margin: 32px 0 0 !important;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}
@media (min-width: 720px)  { .wp-block-latest-posts.wp-block-latest-posts__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .wp-block-latest-posts.wp-block-latest-posts__list { grid-template-columns: repeat(3, 1fr); } }

.wp-block-latest-posts.wp-block-latest-posts__list > li {
    background: #FFFFFF;
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-lg);
    padding: 0;
    margin: 0 !important;
    width: auto !important;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
}
.wp-block-latest-posts.wp-block-latest-posts__list > li:hover {
    transform: translateY(-3px);
    box-shadow: var(--hs-shadow-md);
    border-color: var(--hs-primary);
}

/* Thumbnail — pełna szerokość karty, proporcja 16:10, nie alignleft */
.wp-block-latest-posts__featured-image {
    margin: 0 !important;
    float: none !important;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--hs-bg-alt);
}
.wp-block-latest-posts__featured-image a,
.wp-block-latest-posts__featured-image {
    display: block !important;
    width: 100%;
    height: 100%;
}
.wp-block-latest-posts__featured-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    display: block;
}

/* Treść karty */
.wp-block-latest-posts.wp-block-latest-posts__list > li > .wp-block-latest-posts__post-title,
.wp-block-latest-posts.wp-block-latest-posts__list > li > a.wp-block-latest-posts__post-title {
    display: block;
    font-family: var(--hs-font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--hs-text);
    text-decoration: none;
    padding: 18px 20px 8px;
    transition: color 0.15s ease;
}
.wp-block-latest-posts.wp-block-latest-posts__list > li:hover > .wp-block-latest-posts__post-title,
.wp-block-latest-posts.wp-block-latest-posts__list > li:hover > a.wp-block-latest-posts__post-title {
    color: var(--hs-primary);
}

.wp-block-latest-posts__post-date {
    display: block;
    font-size: 13px;
    color: var(--hs-muted);
    padding: 0 20px 18px;
    margin: 0;
    letter-spacing: 0.02em;
}

.wp-block-latest-posts__post-excerpt {
    font-size: 15px;
    color: var(--hs-muted);
    line-height: 1.55;
    padding: 0 20px 18px;
    margin: 0 0 4px;
}

/* Nagłówek "Najnowsze poradniki" — większy, z amber underline */
.entry-content > h2.hs-section,
body.home h2.hs-section {
    font-size: 28px;
    margin-top: 64px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    position: relative;
}
.entry-content > h2.hs-section::after,
body.home h2.hs-section::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    background: var(--hs-amber);
    margin-top: 14px;
}

/* =========================================================
   8. KOMPONENTY AFILIACYJNE — stuby pod Fazę 4
   ========================================================= */
.hs-product-card {
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius-lg);
    padding: 24px;
    background: #FFFFFF;
    margin: 24px 0;
}
.hs-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}
.hs-comparison-table th,
.hs-comparison-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--hs-border);
    text-align: left;
}
.hs-comparison-table th {
    background: var(--hs-bg-alt);
    font-weight: 600;
}
@media (max-width: 720px) {
    .hs-comparison-table { display: block; overflow-x: auto; }
}

.hs-cta-inline {
    display: block;
    background: var(--hs-bg-alt);
    border: 1px solid var(--hs-border);
    border-left: 4px solid var(--hs-amber);
    color: var(--hs-text);
    padding: 16px 20px;
    border-radius: var(--hs-radius);
    margin: 28px 0;
}
.hs-cta-inline p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--hs-text);
}
.hs-cta-inline a,
.entry-content .hs-cta-inline a {
    color: var(--hs-primary-dark);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--hs-amber);
    text-underline-offset: 4px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.hs-cta-inline a:hover,
.entry-content .hs-cta-inline a:hover {
    color: var(--hs-amber-dark);
    text-decoration-color: var(--hs-amber-dark);
}
.hs-cta-inline a:focus-visible {
    outline: 2px solid var(--hs-amber);
    outline-offset: 2px;
    border-radius: 2px;
}

.hs-pros-cons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
}
@media (min-width: 600px) { .hs-pros-cons { grid-template-columns: 1fr 1fr; } }
.hs-pros, .hs-cons {
    padding: 18px 20px;
    border-radius: var(--hs-radius);
    border: 1px solid var(--hs-border);
}
.hs-pros { background: rgba(45, 106, 79, 0.06); border-color: rgba(45,106,79,0.25); }
.hs-cons { background: rgba(231, 111, 81, 0.06); border-color: rgba(231,111,81,0.25); }

.hs-disclosure {
    background: var(--hs-bg-alt);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius);
    padding: 14px 18px;
    font-size: 14px;
    color: var(--hs-muted);
    margin: 24px 0;
}
.hs-disclosure strong { color: var(--hs-text); }

/* =========================================================
   9. FOOTER — własny ciemnozielony, wstrzykiwany przez wp_footer
   ========================================================= */
html body .site-footer,
html body #colophon {
    /* Ukrywamy domyślny Kadence footer, używamy własnego .hs-footer */
    display: none !important;
}

.hs-footer {
    background: var(--hs-primary-dark);
    color: #DCE5DC;
    padding: 56px 20px 28px;
    margin-top: 64px;
    font-size: 15px;
    line-height: 1.6;
}
.hs-footer-inner {
    max-width: var(--hs-container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 768px) {
    .hs-footer-inner { grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
}
.hs-footer h4 {
    color: #FFFFFF;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px;
    font-weight: 700;
}
.hs-footer a {
    color: #DCE5DC;
    text-decoration: none;
}
.hs-footer a:hover {
    color: var(--hs-amber);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.hs-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hs-footer ul li { margin-bottom: 8px; }
.hs-footer-about p {
    margin: 0 0 12px;
    max-width: 360px;
    color: #C7D5C7;
}
.hs-footer-bottom {
    max-width: var(--hs-container);
    margin: 40px auto 0;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.12);
    color: #A6B6A6;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* =========================================================
   10. UTIL / OBRAZY / FOCUS
   ========================================================= */
img { max-width: 100%; height: auto; }

figure.wp-block-image img { border-radius: var(--hs-radius); }

/* skip-link visible on focus */
.skip-link:focus {
    background: var(--hs-amber);
    color: var(--hs-text);
    z-index: 9999;
}

/* Tytuł strony domyślny — schowaj na froncie (mamy własne hero) */
body.home .entry-header,
body.page-template-default.home .entry-header { display: none; }
