/*
Theme Name: HealthFlex — Marek Górniak (Custom)
Theme URI: https://www.marekgorniak.pl
Description: Motyw potomny (child theme) dla HealthFlex (Plethora Themes). Zmienia wygląd nagłówka, stopki, strony głównej i pojedynczych wpisów, ale NIE dotyka rejestracji typu treści "terminology" ani shortcode'u [plethora_termsindex] — te zostają obsługiwane w całości przez motyw nadrzędny i wtyczkę "Plethora Features Library", dokładnie tak jak wcześniej. Dzięki temu ta funkcjonalność nigdy się nie psuje przy aktualizacji wyglądu.
Author: dr Marek Górniak
Template: healthflex
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: mg-urolog-child

WAŻNE: pole "Template" musi być DOKŁADNIE równe nazwie folderu motywu
nadrzędnego w wp-content/themes/. Jeśli po wgraniu WordPress pokaże błąd
przy aktywacji ("Błędny motyw" / "Motyw nadrzędny nie istnieje"), sprawdź
prosze dokładną nazwę folderu (Wygląd -> Edytor plików motywu, albo FTP:
wp-content/themes/) i napisz mi ją — to jedyna linijka, którą trzeba by
było poprawić.
*/

:root{
  --ink: #1F3A3D;
  --ink-soft: #3E5C5A;
  --paper: #F6F3EC;
  --paper-alt: #ECE6D6;
  --paper-deep: #E3DCC8;
  --teal: #3D7068;
  --teal-deep: #24504A;
  --amber: #D9A441;
  --amber-deep: #B9832E;
  --line: #D9D2C0;
  --white: #FFFDF8;
  --radius: 4px;
  --max: 1180px;
}

/* Reset ograniczony do elementów, które sami renderujemy w naszych
   szablonach (header/footer/front-page/single/page/archive) — celowo
   NIE dotykamy ogólnych selektorów body/a globalnie w sposób, który
   mógłby wpłynąć na ekrany/shortcody renderowane przez wtyczkę Plethora
   Features Library (np. wewnątrz [plethora_termsindex]). Style poniżej
   są zamknięte w konkretnych klasach .mg-* i .wrap, żeby nie "wyciekać"
   na resztę strony. */

.mg-page{
  font-family:'Inter', sans-serif; font-size:16px; line-height:1.6; color: var(--ink);
  background: var(--paper);
}
.mg-page h1, .mg-page h2, .mg-page h3, .mg-page h4, .mg-page h5, .mg-page h6{
  font-family:'Fraunces', serif; font-weight:600; line-height:1.16; margin:0 0 .5em; color: var(--teal-deep);
}
.mg-page p{ margin:0 0 1em; }
.mg-page a{ color: var(--teal-deep); text-decoration:none; }
.mg-page a:hover{ text-decoration: underline; }
.mg-page img{ max-width:100%; height:auto; }
.mg-page .wrap{ max-width: var(--max); margin:0 auto; padding: 0 32px; }
@media(max-width:720px){ .mg-page .wrap{ padding: 0 20px; } }

.mg-page .eyebrow{
  display:inline-flex; align-items:center; gap:8px; font-family:'Inter', sans-serif;
  font-weight:600; font-size:12.5px; letter-spacing:.12em; text-transform:uppercase; color: var(--amber-deep);
}
.mg-page .eyebrow::before{ content:""; width:18px; height:1px; background: var(--amber-deep); }

/* Linki w treści — wyraźny kontrast (bursztyn na ciemnym tekście) */
.mg-page .home-body a, .mg-page .home-notice a, .mg-page .article-body a,
.mg-page .page-wrapper .entry-content a, .mg-page .terms-list a, .mg-page .side-list a{
  color: var(--amber-deep);
  text-decoration: underline;
  text-decoration-color: var(--amber-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 700;
}
.mg-page .home-body a:hover, .mg-page .home-notice a:hover, .mg-page .article-body a:hover,
.mg-page .page-wrapper .entry-content a:hover, .mg-page .terms-list a:hover, .mg-page .side-list a:hover{
  color: var(--teal-deep);
  text-decoration-color: var(--teal-deep);
}

/* ---------- Top bar ---------- */
.mg-topbar{ background: var(--teal-deep); color: var(--paper); font-size:13.5px; }
.mg-topbar .wrap{ display:flex; justify-content:space-between; padding:9px 32px; flex-wrap:wrap; gap:16px; }
.mg-topbar a{ color: var(--paper); opacity:.92; }
.mg-topbar a:hover{ opacity:1; }

/* ---------- Header ---------- */
.mg-header{ background: var(--paper); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50; }
.mg-header .wrap{ display:flex; align-items:center; justify-content:space-between; padding:18px 32px; gap: 20px; }
.mg-brand{ display:flex; align-items:center; }
.mg-brand a{ display:flex; flex-direction:column; gap:1px; text-decoration:none; }
.mg-brand a:hover{ text-decoration:none; }
.mg-brand-name{ font-family:'Fraunces', serif; font-size:16.5px; font-weight:600; color: var(--ink); }
.mg-brand-role{ font-size:12px; color: var(--ink-soft); line-height:1.35; }

.mg-nav ul{ display:flex; align-items:center; gap:34px; list-style:none; margin:0; padding:0; }
.mg-nav a{ font-size:14.5px; font-weight:500; color: var(--ink-soft); text-decoration:none; }
.mg-nav a:hover, .mg-nav .current-menu-item > a{ color: var(--teal-deep); }

.mg-search{ display:flex; align-items:center; border:1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow:hidden; }
.mg-search input[type="search"]{
  border:none; outline:none; background:transparent; padding: 10px 12px; font-family:'Inter',sans-serif;
  font-size: 14px; color: var(--ink); width: 150px;
}
.mg-search input[type="search"]::placeholder{ color: var(--ink-soft); }
.mg-search button{
  border:none; background: var(--teal-deep); color: var(--white); width: 40px; height: 40px;
  display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;
}
.mg-search button:hover{ background: var(--ink); }
@media(max-width:1080px){ .mg-search{ display:none; } }

.mg-navtoggle{ display:none; background:none; border:none; cursor:pointer; font-size:20px; }
@media(max-width:900px){
  .mg-nav{ display:none; }
  .mg-nav.is-open{ display:block; position:absolute; top:100%; left:0; right:0; background:var(--paper); border-bottom:1px solid var(--line); padding: 12px 20px 20px; }
  .mg-nav.is-open ul{ flex-direction:column; align-items:flex-start; gap:14px; }
  .mg-navtoggle{ display:block; }
}

/* ---------- Breadcrumb ---------- */
.mg-breadcrumb{ padding: 22px 0; font-size:13.5px; color: var(--ink-soft); }
.mg-breadcrumb a{ color: var(--ink-soft); }
.mg-breadcrumb a:hover{ color: var(--teal-deep); }
.mg-breadcrumb .sep{ margin:0 6px; opacity:.5; }

/* ---------- Neutral page wrapper (WPBakery content) ---------- */
.page-wrapper{ padding: 56px 0 80px; }
.page-wrapper .page-title{ font-size: clamp(28px,3.6vw,40px); margin-bottom: 28px; }
.page-wrapper .entry-content{ font-size:16.5px; color:#2B4340; }
.page-wrapper .entry-content > * + *{ margin-top: 18px; }

/* ---------- Article head ---------- */
.article-head{ padding: 12px 0 40px; border-bottom:1px solid var(--line); }
.article-head h1{ font-size: clamp(30px,4vw,46px); margin-top:16px; max-width:22ch; letter-spacing:-.01em; }
.article-meta{ display:flex; gap:18px; flex-wrap:wrap; margin-top:22px; font-size:13.5px; color: var(--ink-soft); align-items:center; }
.article-meta .dot{ width:3px; height:3px; border-radius:50%; background: var(--ink-soft); }

.article-layout{ display:grid; grid-template-columns: 1fr 260px; gap:64px; padding:52px 0 80px; align-items:start; }
@media(max-width:980px){ .article-layout{ grid-template-columns: 1fr; } }

.article-body{ max-width:68ch; font-size:17px; }
.article-body > * + *{ margin-top:22px; }
.article-body h2{ font-size:25px; margin-top:46px; }
.article-body h3{ font-size:20px; margin-top:34px; color: var(--ink); }
.article-body p{ color:#2B4340; }
.article-body ul, .article-body ol{ padding-left:20px; color:#2B4340; }
.article-body li + li{ margin-top:8px; }
.article-body img{ border-radius: var(--radius); border:1px solid var(--line); }
.article-body blockquote{
  border-left:3px solid var(--amber); background: var(--paper-alt); padding:22px 26px;
  font-family:'Fraunces', serif; font-style:italic; font-size:17.5px; color: var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0; margin:0;
}

/* ---------- Author box ---------- */
.author-box{
  margin-top:56px; border:1px solid var(--line); border-radius: var(--radius);
  background: var(--white); padding:28px; display:flex; gap:22px; position:relative; overflow:hidden;
}
.author-box::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--amber); }
.author-photo{ flex-shrink:0; }
.author-photo img{ width:76px; height:76px; border-radius:50%; object-fit:cover; }
.author-info .k{ font-size:11.5px; text-transform:uppercase; letter-spacing:.1em; color: var(--amber-deep); font-weight:700; }
.author-info h4{ font-size:19px; margin-top:6px; margin-bottom:0; }
.author-info .role{ font-size:13.5px; color: var(--ink-soft); margin-top:2px; }
.author-info .bio{ font-size:14.5px; color:#2B4340; margin-top:12px; max-width:62ch; }
.author-window{ display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; }
.author-window span{ font-size:12px; font-weight:600; color: var(--teal-deep); background: rgba(61,112,104,.1); padding:4px 10px; border-radius:100px; }

/* ---------- Sidebar ---------- */
.side-block{ border:1px solid var(--line); border-radius: var(--radius); background: var(--white); padding:22px; }
.side-block + .side-block{ margin-top:20px; }
.side-block h4{ font-size:14px; margin-bottom:0; }
.side-list{ margin-top:14px; display:flex; flex-direction:column; gap:10px; }
.side-cta{ background: var(--teal-deep); color: var(--paper); }
.side-cta h4{ color: var(--paper); }
.side-cta p{ font-size:13.5px; opacity:.85; margin-top:8px; }
.side-cta a.btn{ margin-top:16px; background: var(--amber); color: var(--ink) !important; width:100%; justify-content:center; text-decoration:none !important; }

.btn{
  display:inline-flex; align-items:center; gap:8px; padding:11px 22px; border-radius:var(--radius);
  font-weight:600; font-size:14px; border:1px solid transparent; cursor:pointer; text-decoration:none;
}

/* ---------- Related / cards ---------- */
.related{ background: var(--paper-alt); border-top:1px solid var(--line); padding:64px 0; }
.card-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:20px; margin-top:32px; }
@media(max-width:860px){ .card-grid{ grid-template-columns:1fr; } }
.kb-card{ background: var(--white); border:1px solid var(--line); border-radius: var(--radius); padding:20px; display:block; text-decoration:none !important; }
.kb-card:hover{ border-color: var(--teal); }
.kb-card .tag{ font-size:11.5px; color: var(--amber-deep); font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.kb-card h4{ font-size:16.5px; margin-top:8px; margin-bottom:0; }
.kb-card .excerpt{ font-size:13.5px; color: var(--ink-soft); margin-top:8px; text-align: justify; }

/* ---------- Homepage ---------- */
.tiles-grid{
  display:grid; grid-template-columns: repeat(4,1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); margin-top: 28px;
}
@media(max-width:860px){ .tiles-grid{ grid-template-columns: repeat(2,1fr); } }
@media(max-width:480px){ .tiles-grid{ grid-template-columns: 1fr; } }
.tile{
  background: var(--white); padding: 30px 24px; display:flex; flex-direction:column; align-items:center;
  text-align:center; gap:6px; transition: background .15s ease; text-decoration:none !important;
}
.tile:hover{ background: var(--paper-alt); }
.tile-icon{ font-size: 26px; margin-bottom: 6px; }
.tile h4{ font-size: 16.5px; margin-bottom:0; }
.tile p{ font-size: 13.5px; color: var(--ink-soft); margin:0; }
.tile-cta{ font-size: 13px; font-weight:600; color: var(--teal-deep); margin-top: 10px; }

.home-intro{ padding: 48px 0 0; }
.home-layout{ display:grid; grid-template-columns: 1fr 280px; gap: 56px; align-items:start; }
@media(max-width:900px){ .home-layout{ grid-template-columns: 1fr; } }
.home-aside{ position: sticky; top: 90px; display:flex; flex-direction:column; gap: 20px; }
@media(max-width:900px){ .home-aside{ position:static; } }

.home-notice{
  border: 1px solid var(--line); border-left: 3px solid var(--amber);
  background: var(--white); border-radius: var(--radius);
  padding: 22px 26px; margin-top: 18px; font-weight: 500;
}
.home-notice p{ color: var(--ink); text-align: justify; }
.home-notice p + p{ margin-top: 14px; }
.home-body{ margin-top: 40px; font-size: 16.5px; color: #2B4340; }
.home-body p{ margin-bottom: 20px; text-align: justify; }
.home-links{ text-align: left !important; font-size: 17px; }

.clinic-photo{ display:block; position:relative; border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; text-decoration:none !important; }
.clinic-photo-placeholder{
  aspect-ratio: 4/3; background: var(--paper-deep); display:flex; align-items:center; justify-content:center;
  color: var(--ink-soft); font-size: 13.5px; text-align:center; padding: 20px;
}
.clinic-photo-cta{
  position:absolute; left:14px; bottom:14px; background: rgba(31,58,61,.9); color: var(--paper);
  padding: 8px 14px; border-radius: 100px; font-size: 13px; font-weight:600;
}
.qr-row{ display:flex; gap:14px; align-items:center; margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.qr-code{ border-radius: 4px; border:1px solid var(--line); flex-shrink:0; }
.qr-t{ font-size:14px; font-weight:600; }
.qr-d{ font-size:12.5px; color: var(--ink-soft); margin-top:2px; }

/* ---------- Footer ---------- */
.mg-footer{ background: var(--ink); color: var(--paper); padding:56px 0 28px; }
.mg-footer .footer-grid{ display:grid; grid-template-columns: 1.6fr 1fr; gap:40px; }
@media(max-width:720px){ .mg-footer .footer-grid{ grid-template-columns:1fr; } }
.mg-footer h4{ color: var(--paper); font-size:14px; margin-bottom:0; }
.mg-footer .mg-brand-name{ color: var(--paper); }
.mg-footer .mg-brand-role{ color: rgba(246,243,236,.6); }
.footer-links{ display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.footer-links a{ font-size:14px; color: rgba(246,243,236,.75); text-decoration:none; }
.footer-links a:hover{ color: var(--amber); }
.footer-bottom{
  margin-top:44px; padding-top:22px; border-top:1px solid rgba(246,243,236,.14);
  display:flex; justify-content:space-between; font-size:12.5px; color: rgba(246,243,236,.55); flex-wrap:wrap; gap:10px;
}

@media (prefers-reduced-motion: reduce){
  .mg-page *{ scroll-behavior:auto !important; transition:none !important; }
}
