/**
 * Fortema Content, Legacy Article/CPT & Header Logo Styles
 * Restores spacing, link visibility, headings, lists, quotes, tables & image alignments
 * after Tailwind Preflight resets across posts, pages and CPTs (facebook_ads, google_ads, etc.).
 *
 * @package Fortema
 */

/* ==========================================================================
   1. HEADER CUSTOM LOGO SIZE GUARD
   Ensures legacy or uploaded logos stay compact matching the default brand mark.
   ========================================================================== */
.fortema-header-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  max-height: 56px;
}

.fortema-header-logo-link .custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.fortema-header-logo-link img,
.fortema-header-logo-link .custom-logo-link img,
header#masthead .custom-logo-link img,
header#masthead img.custom-logo {
  height: 52px !important;
  max-height: 52px !important;
  width: auto !important;
  max-width: 210px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   2. ARTICLE / PAGE / CPT CONTENT BASE TYPOGRAPHY & SPACING (.post-content)
   ========================================================================== */
.post-content {
  display: flow-root;
  color: #334155;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

@media (min-width: 640px) {
  .post-content {
    font-size: 17px;
  }
}

.post-content::after {
  content: "";
  display: table;
  clear: both;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content > *:last-child {
  margin-bottom: 0;
}

.post-content p {
  margin: 0 0 1.25em;
  line-height: 1.75;
}

.post-content strong,
.post-content b {
  font-weight: 700;
  color: #0f172a;
}

.post-content em,
.post-content i:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fa) {
  font-style: italic;
}

.post-content hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 2em 0;
}

/* ==========================================================================
   3. CONTENT LINKS (Restore unmistakable clickable link styling)
   ========================================================================== */
.post-content a:not(.wp-block-button__link):not(.fortema-btn):not(.no-link-style):not(.custom-contact-button-unique):not(.button):not(.btn),
#page-content .main-page-content a:not(.nav-links a):not(.custom-contact-button-unique):not(.button):not(.btn) {
  color: #2eb35e;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.post-content a:not(.wp-block-button__link):not(.fortema-btn):not(.no-link-style):not(.custom-contact-button-unique):not(.button):not(.btn):hover,
.post-content a:not(.wp-block-button__link):not(.fortema-btn):not(.no-link-style):not(.custom-contact-button-unique):not(.button):not(.btn):focus-visible,
#page-content .main-page-content a:not(.nav-links a):not(.custom-contact-button-unique):not(.button):not(.btn):hover,
#page-content .main-page-content a:not(.nav-links a):not(.custom-contact-button-unique):not(.button):not(.btn):focus-visible {
  color: #238f4a;
  text-decoration: none;
}

/* Legacy contact CTA box & button ([kontaktai] / .custom-contact-box-unique) */
.post-content .custom-contact-box-unique,
.custom-contact-box-unique {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background-color: #2a3d44;
  color: #ffffff;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  clear: both;
}

.post-content .custom-contact-box-unique p,
.custom-contact-box-unique p {
  margin: 0;
  font-size: 16px;
  color: #ffffff;
  flex: 1;
}

.post-content a.custom-contact-button-unique,
.custom-contact-box-unique a.custom-contact-button-unique,
a.custom-contact-button-unique {
  display: inline-block;
  background-color: #2eb35e;
  color: #ffffff !important;
  padding: 10px 20px;
  text-decoration: none !important;
  border-radius: 5px;
  font-weight: 700;
  border: 1px solid #2eb35e;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.post-content a.custom-contact-button-unique:hover,
.post-content a.custom-contact-button-unique:focus-visible,
.custom-contact-box-unique a.custom-contact-button-unique:hover,
.custom-contact-box-unique a.custom-contact-button-unique:focus-visible,
a.custom-contact-button-unique:hover,
a.custom-contact-button-unique:focus-visible {
  background-color: #269c51;
  color: #ffffff !important;
  border-color: #ffffff;
  text-decoration: none !important;
}

@media (max-width: 600px) {
  .post-content .custom-contact-box-unique,
  .custom-contact-box-unique {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-content a.custom-contact-button-unique,
  .custom-contact-box-unique a.custom-contact-button-unique,
  a.custom-contact-button-unique {
    margin-top: 4px;
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   4. LEGACY HEADINGS (Matching Funden / Fortema XML CSS)
   ========================================================================== */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 1.65em;
  margin-bottom: 0.8em;
}

.post-content h2 {
  font-size: 26px;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
}

body.fortema-article-h2-style .post-content h2,
body.single-post .post-content h2,
body.single-google-ads .post-content h2,
body.single-google_ads .post-content h2,
body.single-facebook-ads .post-content h2,
body.single-facebook_ads .post-content h2,
body.single-zodynas .post-content h2,
body.post-type-archive-google-ads .post-content h2,
body.post-type-archive-google_ads .post-content h2,
body.post-type-archive-facebook-ads .post-content h2,
body.post-type-archive-facebook_ads .post-content h2,
body.post-type-archive-zodynas .post-content h2 {
  margin-top: 1.75em;
  margin-bottom: 20px;
  padding: 10px 14px;
  background-color: #f1f5f8;
  border-top: 1px solid #e8ecef;
  border-right: 1px solid #e8ecef;
  border-bottom: 1px solid #e8ecef;
  border-left: 5px solid #2eb35e;
  border-radius: 0 4px 4px 0;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
}

body.fortema-article-h2-style .post-content h2::before,
body.single-post .post-content h2::before,
body.single-google-ads .post-content h2::before,
body.single-google_ads .post-content h2::before,
body.single-facebook-ads .post-content h2::before,
body.single-facebook_ads .post-content h2::before,
body.single-zodynas .post-content h2::before,
body.post-type-archive-google-ads .post-content h2::before,
body.post-type-archive-google_ads .post-content h2::before,
body.post-type-archive-facebook-ads .post-content h2::before,
body.post-type-archive-facebook_ads .post-content h2::before,
body.post-type-archive-zodynas .post-content h2::before {
  content: "\203A";
  margin-right: 6px;
  color: #2eb35e;
  font-weight: 800;
}

body.fortema-article-h2-style .post-content h1::after,
body.fortema-article-h2-style .post-content h2::after,
body.single-post .post-content h1::after,
body.single-post .post-content h2::after,
body.single-google-ads .post-content h1::after,
body.single-google-ads .post-content h2::after,
body.single-google_ads .post-content h1::after,
body.single-google_ads .post-content h2::after,
body.single-facebook-ads .post-content h1::after,
body.single-facebook-ads .post-content h2::after,
body.single-facebook_ads .post-content h1::after,
body.single-facebook_ads .post-content h2::after,
body.single-zodynas .post-content h1::after,
body.single-zodynas .post-content h2::after,
body.post-type-archive-google-ads .post-content h1::after,
body.post-type-archive-google-ads .post-content h2::after,
body.post-type-archive-google_ads .post-content h1::after,
body.post-type-archive-google_ads .post-content h2::after,
body.post-type-archive-facebook-ads .post-content h1::after,
body.post-type-archive-facebook-ads .post-content h2::after,
body.post-type-archive-facebook_ads .post-content h1::after,
body.post-type-archive-facebook_ads .post-content h2::after,
body.post-type-archive-zodynas .post-content h1::after,
body.post-type-archive-zodynas .post-content h2::after {
  content: "";
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

.post-content h3 {
  font-size: 22px;
}

.post-content h4 {
  font-size: 20px;
}

.post-content h5 {
  font-size: 18px;
}

.post-content h6 {
  font-size: 16px;
}

/* ==========================================================================
   5. LEGACY ORDERED & UNORDERED LISTS (fortema-facebook-ads / google-ads)
   ========================================================================== */
.post-content ol {
  counter-reset: li;
  list-style: none !important;
  padding: 0;
  margin: 1.25em 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.post-content ol > li {
  position: relative;
  display: flow-root;
  padding: 8px 14px;
  margin: 0 0 8px 2.6em;
  background: #f1f5f8;
  border-radius: 0 4px 4px 0;
  text-decoration: none;
  transition: all 0.3s ease-out;
  line-height: 1.6;
}

.post-content ol > li:hover {
  background: #e9eff4;
}

.post-content ol > li::before {
  content: counter(li);
  counter-increment: li;
  position: absolute;
  left: -2.5em;
  top: 50%;
  margin-top: -1em;
  background: #2eb35e;
  color: #ffffff;
  font-weight: 700;
  height: 2em;
  width: 2em;
  line-height: 2em;
  text-align: center;
  border-radius: 2px;
}

.post-content ol > li::after {
  position: absolute;
  content: "";
  border: 0.5em solid transparent;
  left: -0.5em;
  top: 50%;
  margin-top: -0.5em;
  transition: all 0.3s ease-out;
  border-left-color: #2eb35e;
}

.post-content ol > li:hover::after {
  left: -1em;
}

.post-content ul:not(.blocks-gallery-grid):not(.wp-block-social-links):not(.wp-block-post-template) {
  list-style-type: none !important;
  padding: 0;
  margin: 1.25em 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.post-content ul:not(.blocks-gallery-grid):not(.wp-block-social-links):not(.wp-block-post-template) > li {
  position: relative;
  display: flow-root;
  padding: 8px 14px;
  margin: 0 0 8px 2.6em;
  background: #f1f5f8;
  border-radius: 0 4px 4px 0;
  text-decoration: none;
  transition: all 0.3s ease-out;
  line-height: 1.6;
}

.post-content ul:not(.blocks-gallery-grid):not(.wp-block-social-links):not(.wp-block-post-template) > li:hover {
  background: #e9eff4;
}

.post-content ul:not(.blocks-gallery-grid):not(.wp-block-social-links):not(.wp-block-post-template) > li::before {
  content: "\002B";
  position: absolute;
  left: -2.5em;
  top: 50%;
  margin-top: -1em;
  background: #2a3d44;
  color: #ffffff;
  font-weight: 700;
  height: 2em;
  width: 2em;
  line-height: 2em;
  text-align: center;
  border-radius: 2px;
}

.post-content ul:not(.blocks-gallery-grid):not(.wp-block-social-links):not(.wp-block-post-template) > li::after {
  position: absolute;
  content: "";
  border: 0.5em solid transparent;
  left: -0.5em;
  top: 50%;
  margin-top: -0.5em;
  transition: all 0.3s ease-out;
  border-left-color: #2a3d44;
}

.post-content ul:not(.blocks-gallery-grid):not(.wp-block-social-links):not(.wp-block-post-template) > li:hover::after {
  left: -1em;
}

.post-content li ol,
.post-content li ul {
  margin-top: 8px;
  margin-bottom: 4px;
}

/* ==========================================================================
   6. BLOCKQUOTES, PRE, SHORT_INFO & TABLES
   ========================================================================== */
.post-content blockquote {
  display: flow-root;
  background: #f1f5f8;
  border-left: 5px solid #2eb35e;
  padding: 22px 25px;
  margin: 1.5em 0;
  font-style: italic;
  color: #1e293b;
  border-radius: 0 6px 6px 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content pre {
  display: flow-root;
  border-left: 5px solid #2a3d44;
  background: #f2f5f8;
  font-size: 17px;
  font-style: italic;
  padding: 12px 20px;
  margin: 0 0 20px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border-radius: 0 6px 6px 0;
  font-family: inherit;
}

.post-content .short_info {
  background-color: #fafafa;
  border-left: 5px solid #c1dfc6;
  border-radius: 5px;
  padding: 15px 20px;
  margin: 25px 0;
  display: flow-root;
}

.post-content .twrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.5em 0;
  clear: both;
}

.post-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
  clear: both;
}

.post-content .twrap > table {
  margin: 0;
}

.post-content table th,
.post-content table td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

.post-content table th {
  background-color: #f1f5f8;
  font-weight: 700;
  color: #0f172a;
}

.post-content table tr:nth-child(even) {
  background-color: #fafafa;
}

.post-content table tr:nth-child(odd) {
  background-color: #ffffff;
}

/* ==========================================================================
   7. CLASSIC WORDPRESS IMAGE ALIGNMENTS, FLOATS & CAPTIONS
   ========================================================================== */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-content .alignleft,
.post-content img[align="left"],
.post-content .wp-block-image img[align="left"] {
  float: left !important;
  text-align: left;
  margin: 6px 25px 15px 0;
  display: inline-block;
  position: relative;
  z-index: 2;
}

.post-content .alignright,
.post-content img[align="right"],
.post-content .wp-block-image img[align="right"] {
  float: right !important;
  text-align: right;
  margin: 6px 0 15px 25px;
  display: inline-block;
  position: relative;
  z-index: 2;
}

.post-content .aligncenter {
  display: block;
  clear: both;
  margin: 20px auto;
  text-align: center;
}

.post-content .aligncenter img {
  margin-left: auto;
  margin-right: auto;
}

.post-content .alignnone {
  display: inline-block;
  margin: 8px 0;
}

.post-content .wp-caption {
  max-width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 1.25em;
}

.post-content .wp-caption img {
  display: block;
  max-width: 100%;
  height: auto;
}

.post-content .wp-caption-text,
.post-content figure figcaption {
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
  margin-top: 8px;
  margin-bottom: 0;
  text-align: center;
}

.post-content .wp-block-image {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.post-content .wp-block-image .alignleft {
  float: left;
  margin: 6px 25px 15px 0;
}

.post-content .wp-block-image .alignright {
  float: right;
  margin: 6px 0 15px 25px;
}

.post-content .wp-block-image .aligncenter {
  display: block;
  margin: 20px auto;
  text-align: center;
}

@media (max-width: 640px) {
  .post-content .alignleft,
  .post-content img[align="left"],
  .post-content .wp-block-image img[align="left"] {
    margin-right: 15px;
    max-width: 55%;
  }
  .post-content .alignright,
  .post-content img[align="right"],
  .post-content .wp-block-image img[align="right"] {
    margin-left: 15px;
    max-width: 55%;
  }
}

/* ==========================================================================
   8. LEGACY CPT ARCHIVE TEMPLATES (#page-content for facebook-ads / google-ads)
   ========================================================================== */
#page-content {
  padding: 2rem 1rem 3.5rem;
  background-color: #ffffff;
}

body.fortema-article-h2-style #page-content .main-page-content h2,
body.single-google-ads #page-content .main-page-content h2,
body.single-google_ads #page-content .main-page-content h2,
body.single-facebook-ads #page-content .main-page-content h2,
body.single-facebook_ads #page-content .main-page-content h2,
body.single-zodynas #page-content .main-page-content h2,
body.post-type-archive-google-ads #page-content .main-page-content h2,
body.post-type-archive-google_ads #page-content .main-page-content h2,
body.post-type-archive-facebook-ads #page-content .main-page-content h2,
body.post-type-archive-facebook_ads #page-content .main-page-content h2,
body.post-type-archive-zodynas #page-content .main-page-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 1.5rem 0 0.75rem;
  padding: 8px 12px;
  background: #f1f5f8;
  border-left: 4px solid #2eb35e;
  overflow: hidden;
}

#page-content .main-page-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin: 1rem 0 0.5rem;
}

#page-content .custom-post-link {
  text-decoration: none !important;
  color: #1e293b !important;
  padding: 8px 15px !important;
  transition: color 0.15s ease, background-color 0.15s ease;
}

#page-content .custom-post-link:hover {
  color: #2eb35e !important;
  background-color: #f0fdf4 !important;
}

/* ==========================================================================
   9. PORTFOLIO HTML5 BANNERS & EMBED SHOWCASE RESPONSIVE LAYOUT
   ========================================================================== */
.fortema-embed-showcase {
  width: 100%;
  box-sizing: border-box;
}

.fortema-html5-banners-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.fortema-html5-banners-grid iframe {
  display: block;
  border: none;
  overflow: hidden;
  border-radius: 10px;
  background-color: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.fortema-iframe-scale-wrap {
  position: relative;
  display: block;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  background-color: #ffffff;
  flex-shrink: 0;
}

.fortema-iframe-scale-wrap > iframe {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Keep existing .full-width-summary-table layout/styling intact; only ensure its heading is white */
.post-content .full-width-summary-table h2,
.post-content .full-width-summary-table h3,
.post-content .full-width-summary-table h4,
.post-content .full-width-summary-table h5,
.full-width-summary-table h4 {
  color: #ffffff;
}
