/* Базова змінна висоти навбару: мобільні/десктоп */
:root { --finap-nav: 56px; }
@media (min-width: 992px) { :root { --finap-nav: 72px; } }
/*
Theme Name: FinAP Theme
Theme URI: https://example.com/
Author: Your Name
Author URI: https://example.com/
Description: WordPress theme generated from static index.html (FinAP).
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: finap
Tags: bootstrap, landing-page
*/

/* Descriptive color variables */
:root {
  /* Global/background */
  --color-background: #ffffff; /* бекграунт */
  --color-background-gradient-start: #0c1633;
  --color-background-gradient-end: #0a1530;
  --color-text: #212529;
  --color-border: #e9ecef;
  
  /* Header/Nav */
  --color-header-bg: #0a0a23;
  
  /* Links */
  --color-link: #007aff;
  --color-link-hover: #0066d6;
  --color-link-active: #0056b3;
  
  /* Buttons */
  --color-button-primary: var(--color-link);
  --color-button-primary-hover: var(--color-link-hover);
  --color-button-primary-active: var(--color-link-active);
  --color-button-contrast: #ffffff;
  
  /* Footer */
  --color-footer-text: #ffffff;
  --color-footer-link: #ffffff;
  
  /* Intro card */
  --color-intro-bg: #f8fbff;
  --color-intro-border: #dee2e6;
  --color-intro-text: #1b1b4f;
  
  /* Hero overlay text on images */
  --color-hero-overlay-from: rgba(10,10,35,.7);
  --color-hero-overlay-mid: rgba(10,10,35,.25);
  --color-hero-overlay-to: rgba(10,10,35,0);
  
  /* Grays scale */
  --gray-900: #212529;
  --gray-800: #343a40;
  --gray-700: #495057;
  --gray-600: #6c757d;
  --gray-500: #adb5bd;
  --gray-400: #ced4da;
  --gray-300: #dee2e6;
  --gray-200: #e9ecef;
  --gray-100: #f8f9fa;
  
  /* Backward compatible aliases (old vars point to new names) */
  --finap-brand: var(--color-header-bg);
  --finap-accent: var(--color-link);
  --finap-accent-2: #14213d; /* secondary brand */
  --finap-text: var(--color-text);
  --finap-accent-hover: var(--color-link-hover);
  --finap-accent-focus: var(--color-link-active);
  --finap-accent-weak: #e6f0ff;
  --finap-accent-contrast: var(--color-button-contrast);
  --border-color: var(--color-border);
  --body-bg: var(--color-background);
  --muted-text: var(--gray-600);
  --footer-text: var(--color-footer-text);
  --footer-link: var(--color-footer-link);
}

body { font-family: 'Manrope', 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: var(--color-text); background: linear-gradient(135deg, var(--color-background-gradient-start), var(--color-background-gradient-end)) fixed; }

/* White sections over dark site background */
.finap-intro { background: transparent; }
.products { background: transparent; }
.products .section-title { color: #fff; }
.news-list { background: #fff; }

/* Product cards on dark backgrounds stay white */
.product-card { background: #fff; border: 1px solid var(--border-color); }

.navbar.bg-dark { background-color: var(--color-header-bg) !important; }
.navbar { margin-top: 0 !important; }
.navbar.fixed-top { top: 0; }
.navbar .navbar-brand { font-weight: 800; letter-spacing: .2px; }
.navbar .nav-link { font-weight: 600; }

/* Main menu colors: only Home and Contacts are blue, others white */
.navbar .nav-link { color: #ffffff !important; }
/* Home item */
.navbar .menu-item-home > .nav-link,
.navbar .menu-item-home > .nav-link:hover { color: var(--color-link) !important; }
/* Contacts item by URL match (robust for different slugs) */
.navbar a.nav-link[href*="/contact"],
.navbar a.nav-link[href*="/kontakty"],
.navbar a.nav-link[href*="/kontakti"],
.navbar a.nav-link[href*="/contacts"] { color: var(--color-link) !important; }
.navbar a.nav-link[href*="/contact"]:hover,
.navbar a.nav-link[href*="/kontakty"]:hover,
.navbar a.nav-link[href*="/kontakti"]:hover,
.navbar a.nav-link[href*="/contacts"]:hover { color: var(--color-link-hover) !important; }
/* Active/current menu item white */
.navbar .nav-item.current-menu-item > .nav-link,
.navbar .nav-item.current_page_item > .nav-link,
.navbar .nav-item.current_page_parent > .nav-link,
.navbar .nav-item.current-menu-ancestor > .nav-link,
.navbar .nav-link.active, .navbar .show > .nav-link { color: #ffffff !important; }

.btn-primary { background-color: var(--color-button-primary); border-color: var(--color-button-primary); color: var(--color-button-contrast); }
.btn-primary:hover { background-color: var(--color-button-primary-hover); border-color: var(--color-button-primary-hover); }
.btn-primary:focus, .btn-primary:active { background-color: var(--color-button-primary-active); border-color: var(--color-button-primary-active); }
.btn-outline-primary { color: var(--color-button-primary); border-color: var(--color-button-primary); }
.btn-outline-primary:hover { background-color: var(--color-button-primary); border-color: var(--color-button-primary); color: var(--color-button-contrast); }

.hero {
  background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)), var(--color-header-bg);
  color: white;
  padding: 120px 0;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: .3px; }
.hero .lead { font-size: 1.1rem; max-width: 860px; margin: 0 auto; }

/* Products */
.section-title { font-weight: 800; }
.product-card { transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.product-card .card-title { font-weight: 700; }
.product-card .stretched-link { text-decoration: none; }

/* News list */
.news-list .news-item { border-bottom: 1px solid var(--border-color); }
.news-list .news-item:last-child { border-bottom: 0; }
.news-list .news-date { width: 56px; text-align: center; }
.news-list .news-date .day { font-size: 1.15rem; }
.news-list .news-title { color: var(--color-link); text-decoration: none; font-weight: 600; }
.news-list .news-title:hover { text-decoration: underline; color: var(--color-link-hover); }

footer.site-footer { background: var(--color-header-bg); color: var(--color-footer-text); }
footer.site-footer p,
footer.site-footer h1,
footer.site-footer h2,
footer.site-footer h3,
footer.site-footer h4,
footer.site-footer h5,
footer.site-footer h6,
footer.site-footer li,
footer.site-footer .text-muted { color: var(--color-footer-text) !important; }
footer.site-footer a { color: var(--color-footer-link); text-decoration: none; }
footer.site-footer a:hover { text-decoration: underline; }

/* Social icons */
.social-links .social-link { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); transition: background-color .2s ease, transform .2s ease, color .2s ease; }
.social-links .social-link:hover { background: rgba(255,255,255,.2); text-decoration: none; transform: translateY(-1px); }
.social-links .bi { font-size: 1.25rem; color: var(--color-footer-link); line-height: 1; }

/* Recent list styling */
.recent-list .list-group-item { background: transparent; border: 0; border-bottom: 1px dashed var(--border-color); }
.recent-list .list-group-item:last-child { border-bottom: 0; }
.recent-list a { color: var(--color-text); }
.recent-list a:hover { color: var(--color-link-hover); }

/* Sidebar spacing for categories and archives */
.widget-cats li, .widget-archives li,
.card .cat-item, .card .page_item, .card .archive-item { margin-bottom: .5rem; }
.card .cat-item a, .card .archive-item a { display: inline-block; padding: .125rem 0; }
.card .cat-item + .cat-item, .card .archive-item + .archive-item { margin-top: .35rem; }

/* Зображення у картках постів */
.object-fit-cover {
  -o-object-fit: cover;
  object-fit: cover;
}

/* Завжди коректно враховуємо WordPress admin bar */
body.admin-bar .navbar.fixed-top { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .navbar.fixed-top { top: 46px; }
}

/* Компенсуємо висоту fixed-top для контенту */
main.site-main { padding-top: var(--finap-nav) !important; }
body.admin-bar:not(.admin-scrolled) main.site-main { padding-top: var(--finap-nav) + 0px) !important; }
@media screen and (max-width: 782px) {
  body.admin-bar:not(.admin-scrolled) main.site-main { padding-top: calc(var(--finap-nav) + 46px) !important; }
}


/* Оформлення повної новини */
.post-hero .post-hero-media {
  height: 0;
  padding-top: 42.85%; /* ~21:9 */
  position: relative;
}
.post-hero { margin-bottom: 1rem; }
.post-hero .post-hero-media > img {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
.post-hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.35));
}
.post-meta { color: rgba(255,255,255,.9); }
.post-content img { max-width: 100%; height: auto; }
.posts-grid .card-title a { text-decoration: none; }

/* Single article aesthetics */
.single-meta { color: var(--muted-text); font-size: .9rem; }
.single-share { border-top:1px solid var(--border-color); border-bottom:1px solid var(--border-color); padding: .75rem 0; margin: 1.25rem 0; }
.single-share .usocial { display:inline-block; }
.single-tags a { display:inline-block; margin:.125rem .25rem; padding:.25rem .5rem; background: var(--gray-100); border-radius:.25rem; font-size:.85rem; text-decoration:none; }
.single-tags a:hover { background: var(--gray-200); }
.post-content h2, .post-content h3, .post-content h4 { margin-top: 1.25rem; font-weight: 700; }
.post-content p { line-height: 1.75; }

/* Hero carousel */
.hero-image { max-height: 700px; object-fit: cover; }
.hero .carousel-caption { background: rgba(10,10,35,.55); padding: 1.25rem 1.5rem; border-radius: .5rem; backdrop-filter: blur(2px); }
.hero .carousel-control-prev-icon, .hero .carousel-control-next-icon { filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }

/* News visuals */
.news-list .news-item { border-bottom: 1px solid var(--border-color); }
.news-list .news-item:hover { background: var(--gray-100); }
.news-list .news-title { color: var(--color-link); text-decoration: none; font-weight: 700; }
.news-list .news-title:hover { color: var(--color-link-hover); text-decoration: underline; }

/* Links */
a { color: var(--color-link); }
a:hover { color: var(--color-link-hover); }

@media (max-width: 575.98px) {
  .hero .container { padding-left: 1rem; padding-right: 1rem; }
  .hero .card-title { font-size: 1rem; }
  .hero .card-text { font-size: .9rem; }
  .hero-image { max-height: 420px; }
}

/* Carousel dots optional spacing */
.carousel-indicators [data-bs-target] { background-color: rgba(255,255,255,.75); }
.carousel-indicators .active { background-color: #fff; }

/* Admin bar-aware sticky behavior */
body.admin-bar .navbar.fixed-top { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .navbar.fixed-top { top: 46px; }
}
body.admin-bar.admin-scrolled .navbar.fixed-top { top: 0; }
body.admin-bar.admin-scrolled main.site-main { padding-top: var(--finap-nav); }
@media screen and (max-width: 782px) {
  body.admin-bar.admin-scrolled main.site-main { padding-top: var(--finap-nav); }
}

/* Ensure navbar is above content */
.navbar { z-index: 1040; }

/* Mobile-specific compensation under fixed navbar */
@media (max-width: 991.98px) {
  main.site-main { padding-top: calc(var(--finap-nav) + 24px) !important; }
}
@media (max-width: 991.98px) and (max-width: 782px) {
  body.admin-bar:not(.admin-scrolled) main.site-main { padding-top: calc(var(--finap-nav) + 46px + 24px) !important; }
}

/* Intro block palette */
:root {
  --intro-bg: var(--color-intro-bg);
  --intro-border: var(--color-intro-border);
  --intro-text: var(--color-intro-text);
}

.finap-intro .intro-card { background: var(--intro-bg); border-color: var(--intro-border); color: var(--intro-text); }
.finap-intro .intro-card h2 { color: var(--color-header-bg); }
.finap-intro .intro-card p { font-size:large; margin-bottom: 0; line-height: 1.7; }

/* Hero cards responsiveness */
@media (max-width: 575.98px) {
  .hero .row > [class*="col-"] { padding-left: .5rem; padding-right: .5rem; }
  .hero .card-title { font-size: 1rem; }
  .hero .card-text { font-size: .9rem; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .hero .card-title { font-size: 1.05rem; }
}

/* Over-image hero captions */
.hero-card .hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--color-hero-overlay-from) 0%, var(--color-hero-overlay-mid) 55%, var(--color-hero-overlay-to) 100%); }
.hero-card .hero-title { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.hero-card .hero-excerpt { color: rgba(255,255,255,.85); }
.hero-card .ratio { border-radius: .5rem; }

/* Single post light content over dark site background */
.single .post-content { background: #fff; color: var(--color-text); border: 1px solid var(--border-color); border-radius: .5rem; padding: 1.25rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.single .post-content a { color: var(--color-link); }
.single .post-content a:hover { color: var(--color-link-hover); }
.single .post-content h1, .single .post-content h2, .single .post-content h3, .single .post-content h4, .single .post-content h5, .single .post-content h6 { color: var(--color-text); }
.single .post-content .wp-block-image img, .single .post-content img { border-radius: .25rem; }
.single .post-content table { width: 100%; border-collapse: collapse; }
.single .post-content table td, .single .post-content table th { border: 1px solid var(--border-color); padding: .5rem .75rem; }
.single .single-meta { color: var(--muted-text); }
.single .d-flex.border-top { border-top: 1px solid var(--border-color) !important; }

/* Center media and headings in product cards */
.products .product-card .card-body { text-align: JUSTIFY;color:#1b1b4f!important; }
.products .product-card .card-title { text-align: center; }
.products .product-card img { display: block; margin: 0 auto 12px; max-width: 100%; height: auto; object-fit: contain; }

/* Page content light card */
.page .page-content { background: #fff; color: var(--color-text); border: 1px solid var(--border-color); border-radius: .5rem; padding: 1.25rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.page .page-content a { color: var(--color-link); }
.page .page-content a:hover { color: var(--color-link-hover); }

.history-content {
  /* Узгоджений вигляд для великого імпортованого HTML */
  font-size: 1.05rem;
  line-height: 1.8;
}
.history-content .pdf-page,
.history-content .page,
.history-content .sheet {
  /* Нормалізація контейнерів після pdf2htmlEX */
  position: static !important;
  width: auto !important;
  height: auto !important;
  box-shadow: none !important;
  background: transparent !important;
}
.history-content [style*="position:absolute"],
.history-content [style*="position: fixed"] {
  position: static !important;
}
.history-content [style*="font-size:10px"],
.history-content [style*="font-size:9px"],
.history-content [style*="font-size:8px"],
.history-content [style*="font-size:7px"],
.history-content [style*="font-size:6px"],
.history-content [style*="font-size:5px"] {
  font-size: 16px !important;
}
.history-content .text,
.history-content span,
.history-content div {
  color: var(--color-text);
}
.history-content a { text-decoration: none; }
.history-content a:hover { text-decoration: underline; }

.history-content h1,
.history-content h2,
.history-content h3,
.history-content h4,
.history-content h5 {
  color: var(--color-text);
  font-weight: 800;
  margin-top: 1.5rem;
}
.history-content p { margin-bottom: 1rem; }
.history-content img { max-width: 100%; height: auto; border-radius: .25rem; }
.history-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.history-content table td,
.history-content table th { border: 1px solid var(--border-color); padding: .5rem .75rem; }
.history-content blockquote { border-left: 4px solid var(--color-link); padding-left: 1rem; color: var(--gray-700); }

.finap-timeline .timeline {
  position: relative;
  padding-left: 2.25rem;
}
.finap-timeline .timeline:before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-link), var(--color-header-bg));
  border-radius: 2px;
}
.finap-timeline .timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}
.finap-timeline .timeline-marker {
  position: absolute;
  left: -0.1rem;
  top: .25rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-header-bg);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.finap-timeline .timeline-card {
  margin-left: 2.25rem;
  border: 1px solid var(--border-color);
}
@media (max-width: 576px) {
  .finap-timeline .timeline { padding-left: 2rem; }
  .finap-timeline .timeline-marker { width: 2.5rem; height: 2.5rem; font-size: .9rem; }
}

.timeline-card-img {
  width: 300px !important;
  object-fit: cover; /* пропорційно обрізає */
}

/* News Cards Styles */
.news-cards-container {
  padding: 2rem 0;
}

.news-cards-container .row {
  margin-bottom: 0;
}

.news-cards-container .row:not(:last-child) {
  margin-bottom: 1.5rem;
}

.news-cards-container .col-12.col-md-6.col-lg-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin-bottom: 1.5rem;
}

.news-card {
  background: var(--color-header-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0; /* Забезпечуємо однакові відступи */
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.news-card-image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.news-card-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .card-image {
  transform: scale(1.05);
}

.news-card-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-category {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-title {
  margin-bottom: 1rem;
  flex-grow: 1;
}

.news-title a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  display: block;
}

.news-title a:hover {
  text-decoration: underline;
}

.news-meta {
  display: flex;
  align-items: center;
  color: #ccc;
  font-size: 0.85rem;
  margin-top: auto;
}

.news-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.news-meta i {
  font-size: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .news-card-image {
    height: 160px;
  }
  
  .news-card-content {
    padding: 1rem;
  }
  
  .news-title a {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .news-cards-container {
    padding: 1rem 0;
  }
  
  .news-card-image {
    height: 140px;
  }
  
  .news-card-content {
    padding: 0.875rem;
  }

}

@media (max-width: 400px) {
  .t {font-size: large;}
 .slu {width: 150px;}
}