/*
Theme Name: TKR Fi Child
Theme URI: https://www.tkr.lt/
Description: Child theme for tkr.lt – tkr.fi-style CSS. Enqueues tkrfi-style.css.
Author: TKR
Template: tkr-theme
Version: 1.0.1-debug
Text Domain: tkr-fi-child
*/

/* Base layout minimal; main styling in assets/css/tkrfi-style.css */
body.page-template-page-methodology .content-and-sidebar,
body.page-template-page-methodology-php .content-and-sidebar,
body.page-template-page-full-content-php.page-id-25 .content-and-sidebar,
body.page-id-25 .content-and-sidebar,
body.page-template-page-methodology .component--page-alternating-columns,
body.page-template-page-methodology-php .component--page-alternating-columns,
body.page-template-page-full-content-php.page-id-25 .component--page-alternating-columns,
body.page-id-25 .component--page-alternating-columns {
  padding-left: 20px;
  padding-right: 20px;
}

body.page-template-page-methodology .component--page-alternating-columns .row,
body.page-template-page-methodology-php .component--page-alternating-columns .row,
body.page-template-page-full-content-php.page-id-25 .component--page-alternating-columns .row,
body.page-id-25 .component--page-alternating-columns .row {
  padding-left: 20px;
  padding-right: 20px;
}

@media (min-width: 768px) {

  body.page-template-page-methodology .content-and-sidebar,
  body.page-template-page-methodology-php .content-and-sidebar,
  body.page-template-page-full-content-php.page-id-25 .content-and-sidebar,
  body.page-id-25 .content-and-sidebar,
  body.page-template-page-methodology .component--page-alternating-columns,
  body.page-template-page-methodology-php .component--page-alternating-columns,
  body.page-template-page-full-content-php.page-id-25 .component--page-alternating-columns,
  body.page-id-25 .component--page-alternating-columns {
    padding-left: 60px;
    padding-right: 60px;
  }

  body.page-template-page-methodology .component--page-alternating-columns .row,
  body.page-template-page-methodology-php .component--page-alternating-columns .row,
  body.page-template-page-full-content-php.page-id-25 .component--page-alternating-columns .row,
  body.page-id-25 .component--page-alternating-columns .row {
    padding-left: 60px;
    padding-right: 60px;
  }
}

/* Reduce gap between hero and content on products/methodology pages */
body.archive.post-type-archive-products main#primary,
body.single-products main#primary,
body.page-template-page-full-content-php main#primary,
body.page-template-page-methodology-php main#primary {
  padding-top: 0;
  background-color: var(--white-color);
}

body.archive.post-type-archive-products,
body.single-products,
body.page-template-page-full-content-php,
body.page-template-page-methodology-php {
  background-color: var(--white-color);
}

body.archive.post-type-archive-products main#primary .wrapper,
body.single-products main#primary .wrapper,
body.page-template-page-full-content-php main#primary .wrapper,
body.page-template-page-methodology-php main#primary .wrapper {
  padding-top: 0;
}

body.archive.post-type-archive-products main#primary .component--singular-content,
body.single-products main#primary .component--singular-content,
body.page-template-page-full-content-php main#primary .component--singular-content,
body.page-template-page-methodology-php main#primary .component--singular-content {
  margin-top: 0;
  /* No overlap - white content sits normally below hero */
  position: relative;
  min-height: calc(100vh - 200px);
  background-color: var(--white-color);
}

@media (min-width: 768px) {

  body.archive.post-type-archive-products main#primary .component--singular-content,
  body.single-products main#primary .component--singular-content,
  body.page-template-page-full-content-php main#primary .component--singular-content,
  body.page-template-page-methodology-php main#primary .component--singular-content {
    margin-top: 0;
  }
}

/* Remove vertical gaps around hero and content blocks */
body.archive.post-type-archive-products .component--hero-block,
body.single-products .component--hero-block,
body.page-template-page-full-content-php .component--hero-block,
body.page-template-page-methodology-php .component--hero-block {
  margin-bottom: 0;
  position: relative;
  /* Position context for absolute hero image */
  z-index: 10;
}

/* Hero block container needs overflow visible to allow image to extend */
.component--hero-block .hero-block-component--item {
  position: relative;
  overflow: visible !important;
}

/* Hero overlay image - absolutely positioned to extend beyond hero */
/* IMPORTANT: These rules override conflicting parent theme (tkrfi-style.css) */
.hero-overlay-image {
  position: absolute !important;
  bottom: -50px !important;
  /* Extends down safely just over the edge */
  left: 50% !important;
  transform: translateX(-50%) !important;
  right: auto !important;
  top: auto !important;
  /* Override parent theme calc() */
  max-width: 50vw !important;
  width: auto !important;
  height: auto !important;
  z-index: 100 !important;
  /* Override parent theme z-index: 1 */
  pointer-events: none;
}

@media (min-width: 768px) {
  .hero-overlay-image {
    bottom: -80px !important;
    max-width: 45vw !important;
  }
}

@media (min-width: 1280px) {
  .hero-overlay-image {
    bottom: -100px !important;
    max-width: 600px !important;
  }
}

body.archive.post-type-archive-products main#primary,
body.single-products main#primary,
body.page-template-page-full-content-php main#primary,
body.page-template-page-methodology-php main#primary {
  padding-bottom: 0;
}

body.archive.post-type-archive-products main#primary .component--singular-content,
body.single-products main#primary .component--singular-content,
body.page-template-page-full-content-php main#primary .component--singular-content,
body.page-template-page-methodology-php main#primary .component--singular-content {
  margin-bottom: 0;
}

/* Preview tweaks: wrapper + hero spacing adjustments */
div.wrapper {
  background-color: unset;
  background: unset;
  border-color: rgba(0, 0, 0, 0);
  border-image: none;
  left: auto;
  top: auto;
}

div.component-background-image {
  height: 200px;
  border-color: rgba(0, 0, 0, 0);
  border-image: none;
}

div.component--block {
  padding-top: 0;
  padding-bottom: 0;
}

main#primary {
  padding-top: 0px !important;
  padding-bottom: 0px !important;
}

div.component--block.background--white-color.text-theme-light.component--singular-content {
  /* Removed hardcoded height - was causing footer overlay */
  min-height: auto;
}

/* CRITICAL FIX: Force proper containment of floated product rows */
.component--page-alternating-columns {
  display: block !important;
  width: 100%;
}

.component--page-alternating-columns::after {
  content: "";
  display: table;
  clear: both;
}

.component--page-alternating-columns .row {
  display: block !important;
  width: 100%;
  margin-bottom: 2em;
}

.component--page-alternating-columns .row::after {
  content: "";
  display: table;
  clear: both;
}

/* Ensure footer never overlaps content */
footer#mastfoot {
  clear: both !important;
  position: relative !important;
}

/* Increase spacing between topbar links and social media icons */
.header-top .some-icons {
  margin-left: 30px;
}

/* Sidebar Styling */
.sidebar {
  background-color: rgb(245, 245, 245);
  padding: 2.5em;
}

.sidebar h3 {
  font-family: 'Lufga', sans-serif;
  font-size: 29px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 25px;
  margin-top: 0;
}

/* Sidebar Columns Layout (for Documents section) */
.sidebar-columns {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-columns .column {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.sidebar-columns .columns--icon {
  flex-shrink: 0;
  width: 55px;
}

.sidebar-columns .columns--icon img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sidebar-columns .columns--content {
  flex-grow: 1;
  background-color: transparent !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

.sidebar-columns .columns--content p {
  margin: 0;
  font-family: 'Config', sans-serif;
  font-size: 18px;
  font-weight: 300;
  color: #666666;
  line-height: 1.4;
}

.sidebar-columns .columns--content a.bold-link {
  font-family: 'Config', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #2C2C2C;
  text-decoration: none;
  line-height: 1.2;
  display: block;
  margin-bottom: 5px;
}

/* Arrow icon after link */
.bold-link.fa--after::after {
  content: "→";
  margin-left: 8px;
  color: var(--secondary-color, #07954b);
  font-weight: 700;
  display: inline-block;
}


/* Mobile Menu Fixes */
@media (max-width: 1024px) {

  /* Strong ID override to force hide desktop menu */
  #masthead #header-navigation,
  .main-menu-container,
  #header-navigation {
    display: none !important;
  }

  /* Force show mobile toggle */
  body .header-middle-right .header-items-container .mobilenav-button-container .open-mobile-menu-button,
  .open-mobile-menu-button {
    display: block !important;
  }
}

/* ================================================
/* ================================================
   Footer Structural Fixes - Flexbox Sticky Footer
   ================================================ */

html {
  height: 100%;
}

/* Make body a flex container - High Specificity */
html body {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100% !important;
  margin: 0 !important;
}

/* Header stays at top */
header#masthead {
  flex-shrink: 0;
}

/* Main content grows to fill space */
main#primary {
  flex: 1 0 auto !important;
  overflow: visible;
  display: block;
  width: 100%;
}

/* Clear floats in main content */
main#primary::after {
  content: "";
  display: table;
  clear: both;
}

/* Ensure wrappers don't hide content */
main#primary .wrapper {
  overflow: visible;
}

main#primary .component--singular-content {
  overflow: visible;
  min-height: auto;
}

/* Footer stays at bottom */
footer#mastfoot {
  flex-shrink: 0;
  clear: both !important;
  display: block !important;
  width: 100%;
  position: relative !important;
  margin-top: auto;
  z-index: 10;
}

/* ================================================
   Sidebar / Documents Section Styling
   ================================================ */

/* Specific styling for the Documents sidebar to match reference */
.content-and-sidebar .sidebar {
  background-color: #f5f5f5 !important;
  padding: 30px !important;
  border-radius: 4px;
  /* Slight rounding like reference */
}

/* Heading */
.content-and-sidebar .sidebar h3 {
  font-family: 'Lufga', sans-serif;
  font-size: 22px;
  /* Slightly smaller for balance */
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 20px;
  color: #000;
  text-transform: uppercase;
  /* Match reference style often used */
  letter-spacing: 0.5px;
}

/* Documents List Items */
.sidebar-columns {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-columns .column {
  display: flex !important;
  align-items: center;
  /* Align icon vertically */
  gap: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 15px;
}

.sidebar-columns .column:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Icons - Smaller and more contained */
.sidebar-columns .columns--icon {
  flex-shrink: 0;
  width: 40px;
  /* Reduced from 55px */
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-columns .columns--icon img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.sidebar-columns .columns--content {
  flex-grow: 1;
}

.sidebar-columns .columns--content p {
  margin: 0;
  font-size: 15px;
  /* Slightly smaller */
  line-height: 1.3;
  color: #555;
  font-weight: 400;
}

/* Link Styling */
.sidebar-columns .columns--content a.bold-link {
  font-weight: 700;
  color: #222;
  text-decoration: none;
  display: block;
  font-size: 16px;
  margin-bottom: 3px;
  transition: color 0.2s ease;
}

.sidebar-columns .columns--content a.bold-link:hover {
  color: #07954b;
}

/* Arrow Icon - Make it look like reference */
.bold-link.fa--after::after {
  content: "\f061";
  /* FontAwesome arrow-right unicode */
  font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", sans-serif;
  margin-left: 8px;
  color: #07954b;
  /* Green color match */
  font-weight: 900;
  font-size: 0.9em;
  display: inline-block;
  vertical-align: middle;
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  .content-and-sidebar {
    display: flex;
    flex-direction: column;
  }

  .content-and-sidebar .sidebar {
    width: 100% !important;
    margin-top: 30px;
    order: 2;
    /* Ensure it stays below content if flex is active */
  }

  .content-and-sidebar .content-wrapper {
    width: 100% !important;
    order: 1;
  }
}

/* Force display footer widgets on home page */
.home .site-footer .footer-left-widgets {
  display: block !important;
}