/*
Theme Name: ThemeFlex
Theme URI: https://themeflex.de
Theme URI: https://themeflex.de
Description: ThemeFlex is a premium dark-first WordPress theme with 114 ready-to-use page templates, 80+ Elementor widgets, AI Site Chat, DSGVO compliance stack (cookie consent, self-hosted fonts, legal wizard, AVV generator), and CSS art-directed hero scenes — no stock images required. Ships with 8 colour skins, 7 Google Fonts pairings, WooCommerce support, portfolio CPT, WCAG 2.1 AA accessibility, and 97 PageSpeed out of the box.
Author: WhatsDigital
Author URI: https://whatsdigital.de
Version: 4.5.0
Tested up to: 6.9
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, e-commerce, portfolio, grid-layout, one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, post-formats, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks, rtl-language-support, accessibility-ready, elementor
Text Domain: themeflex
*/

/* ==============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================== */

:root {
  /* ── Brand color tokens (overridden dynamically by Skin Manager) ── */
  --sf-color-primary:       #FF5E2E;
  --sf-color-primary-dark:  #ED4C1C;
  --sf-color-primary-light: #FF8A60;
  --sf-color-secondary:     #1F242E;
  --sf-color-accent:        #00D4FF;
  --sf-color-accent-light:  #33DDFF;
  --sf-gradient:            linear-gradient(135deg, #FF5E2E 0%, #ED4C1C 100%);
  --sf-gradient-dark:       linear-gradient(135deg, #ED4C1C 0%, #cc3a08 100%);
  --sf-gradient-soft:       linear-gradient(135deg, rgba(255,94,46,0.10) 0%, rgba(237,76,28,0.05) 100%);

  /* ── Semantic surface tokens — Main scheme (light sections) ──
     These are the "16-token" system inspired by Elementra.
     The Skin Manager overrides them per skin; these are fallback defaults.   */
  --sf-bg:           #ffffff;
  --sf-bg-2:         #f6f7f1;
  --sf-border:       #e5e7de;
  --sf-title:        #1f242e;
  --sf-text:         #86898c;
  --sf-meta:         #acafb2;
  --sf-link:         var(--sf-color-primary);
  --sf-hover:        var(--sf-color-primary-dark);

  /* ── Semantic surface tokens — Alt scheme (dark sections / footer) ── */
  --sf-alt-bg:       #06021d;
  --sf-alt-bg-2:     #1a1f29;
  --sf-alt-border:   #3c3f47;
  --sf-alt-title:    #fffefe;
  --sf-alt-text:     #b8bcc4;
  --sf-alt-meta:     #f2f4f6;
  --sf-alt-link:     var(--sf-color-primary);
  --sf-alt-hover:    var(--sf-color-primary-light);

  /* ── Legacy aliases — keep for backward compat ── */
  --sf-color-bg:            var(--sf-bg);
  --sf-color-bg-secondary:  var(--sf-bg-2);
  --sf-color-border:        var(--sf-border);
  --sf-color-title:         var(--sf-title);
  --sf-color-text:          var(--sf-text);
  --sf-color-meta:          var(--sf-meta);
  --sf-color-link:          var(--sf-link);
  --sf-color-link-hover:    var(--sf-hover);
  --sf-color-bg-dark:           var(--sf-alt-bg);
  --sf-color-bg-dark-secondary: var(--sf-alt-bg-2);
  --sf-color-border-dark:       var(--sf-alt-border);
  --sf-color-title-dark:        var(--sf-alt-title);
  --sf-color-text-dark:         var(--sf-alt-text);

  /* ── (legacy aliases defined above via var() cascade) ──
     --sf-color-bg, --sf-color-title, etc. are mapped to semantic tokens. */

  /* Color Palette - Dark/Alt */
  --sf-color-bg-dark: #06021D;
  --sf-color-bg-dark-secondary: #1A1F29;
  --sf-color-border-dark: #3C3F47;
  --sf-color-title-dark: #FFFEFE;
  --sf-color-text-dark: #B8BCC4;

  /* Typography - Font Families */
  --sf-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sf-font-headings: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Typography - Font Sizes */
  --sf-font-size-h1: 57px;
  --sf-font-size-h2: 47px;
  --sf-font-size-h3: 35px;
  --sf-font-size-h4: 28px;
  --sf-font-size-h5: 23px;
  --sf-font-size-h6: 19px;
  --sf-font-size-body: 16px;
  --sf-font-size-small: 14px;

  /* Typography - Font Weights */
  --sf-font-weight-normal: 400;
  --sf-font-weight-medium: 500;
  --sf-font-weight-semibold: 600;
  --sf-font-weight-bold: 700;

  /* Typography - Line Heights */
  --sf-line-height-body: 1.625;
  --sf-line-height-headings: 1.2;
  --sf-line-height-tight: 1.1;

  /* Spacing Scale */
  --sf-spacing-xs: 8px;
  --sf-spacing-sm: 16px;
  --sf-spacing-md: 24px;
  --sf-spacing-lg: 32px;
  --sf-spacing-xl: 48px;
  --sf-spacing-2xl: 64px;
  --sf-spacing-3xl: 96px;

  /* Layout */
  --sf-content-width: 1290px;
  --sf-sidebar-width: 370px;
  --sf-gap: 70px;
  --sf-container-max-width: 1290px;

  /* Border Radius */
  --sf-border-radius-button: 10px;
  --sf-border-radius-default: 6px;

  /* Shadows */
  --sf-shadow-small: 0 1px 3px rgba(31, 36, 46, 0.1);
  --sf-shadow-medium: 0 4px 6px rgba(31, 36, 46, 0.1);
  --sf-shadow-large: 0 10px 25px rgba(31, 36, 46, 0.1);

  /* Transitions */
  --sf-transition-default: all 0.3s ease;

  /* Z-Index Scale */
  --sf-z-dropdown: 100;
  --sf-z-sticky: 200;
  --sf-z-overlay: 300;
  --sf-z-modal: 400;
  --sf-z-popover: 500;
  --sf-z-tooltip: 600;
  --sf-z-notification: 700;
  --sf-z-max: 9999;
}

/* Dark Mode Color Overrides */
@media (prefers-color-scheme: dark) {
  :root {
    --sf-color-bg: var(--sf-color-bg-dark);
    --sf-color-bg-secondary: var(--sf-color-bg-dark-secondary);
    --sf-color-border: var(--sf-color-border-dark);
    --sf-color-title: var(--sf-color-title-dark);
    --sf-color-text: var(--sf-color-text-dark);
  }
}

/* ==============================================
   CSS RESET
   ============================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background-color: var(--sf-color-bg);
  color: var(--sf-color-text);
  font-family: var(--sf-font-body);
  font-size: var(--sf-font-size-body);
  font-weight: var(--sf-font-weight-normal);
  line-height: var(--sf-line-height-body);
  overflow-x: hidden;
}

main {
  display: block;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
  display: block;
}

audio,
canvas,
progress,
video {
  display: inline-block;
  vertical-align: baseline;
}

audio:not([controls]) {
  display: none;
  height: 0;
}

[hidden],
template {
  display: none;
}

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--sf-color-border);
  margin: var(--sf-spacing-lg) 0;
}

pre {
  overflow: auto;
}

code,
kbd,
pre,
samp {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1em;
}

button,
input,
optgroup,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  overflow: visible;
  cursor: pointer;
}

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

fieldset {
  border: 1px solid var(--sf-color-border);
  margin: 0 2px;
  padding: var(--sf-spacing-sm);
}

legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal;
}

progress {
  vertical-align: baseline;
}

textarea {
  overflow: auto;
}

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

/* ==============================================
   BASE TYPOGRAPHY
   ============================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--sf-font-headings);
  font-weight: var(--sf-font-weight-medium);
  line-height: var(--sf-line-height-headings);
  color: var(--sf-color-title);
  margin-bottom: var(--sf-spacing-md);
  word-break: break-word;
}

h1 {
  font-size: var(--sf-font-size-h1);
}

h2 {
  font-size: var(--sf-font-size-h2);
}

h3 {
  font-size: var(--sf-font-size-h3);
}

h4 {
  font-size: var(--sf-font-size-h4);
}

h5 {
  font-size: var(--sf-font-size-h5);
}

h6 {
  font-size: var(--sf-font-size-h6);
}

p {
  margin-bottom: var(--sf-spacing-md);
}

small {
  font-size: var(--sf-font-size-small);
}

strong,
b {
  font-weight: var(--sf-font-weight-bold);
}

em,
i {
  font-style: italic;
}

a {
  color: var(--sf-color-link);
  text-decoration: none;
  transition: var(--sf-transition-default);
}

a:hover,
a:active,
a:focus {
  color: var(--sf-color-link-hover);
  outline: 0;
}

a:focus {
  outline: 2px solid var(--sf-color-link);
  outline-offset: 2px;
}

code {
  background-color: var(--sf-color-bg-secondary);
  border: 1px solid var(--sf-color-border);
  border-radius: var(--sf-border-radius-default);
  padding: 2px 6px;
  font-size: 0.9em;
}

pre {
  background-color: var(--sf-color-bg-secondary);
  border: 1px solid var(--sf-color-border);
  border-radius: var(--sf-border-radius-default);
  padding: var(--sf-spacing-md);
  overflow-x: auto;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ==============================================
   LISTS
   ============================================== */

ul,
ol {
  margin-bottom: var(--sf-spacing-md);
  padding-left: 2em;
}

ul ul,
ul ol,
ol ol,
ol ul {
  margin-bottom: 0;
  margin-top: var(--sf-spacing-sm);
}

li {
  margin-bottom: var(--sf-spacing-xs);
}

dl {
  margin-bottom: var(--sf-spacing-md);
}

dt {
  font-weight: var(--sf-font-weight-bold);
  margin-bottom: var(--sf-spacing-xs);
}

dd {
  margin-left: var(--sf-spacing-md);
  margin-bottom: var(--sf-spacing-sm);
}

/* ==============================================
   TABLES
   ============================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin-bottom: var(--sf-spacing-md);
}

thead {
  background-color: var(--sf-color-bg-secondary);
}

th,
td {
  border: 1px solid var(--sf-color-border);
  padding: var(--sf-spacing-sm);
  text-align: left;
}

th {
  background-color: var(--sf-color-bg-secondary);
  color: var(--sf-color-title);
  font-weight: var(--sf-font-weight-bold);
}

tbody tr:nth-child(even) {
  background-color: var(--sf-color-bg-secondary);
}

/* ==============================================
   FORMS & INPUTS
   ============================================== */

label {
  display: inline-block;
  margin-bottom: var(--sf-spacing-xs);
  font-weight: var(--sf-font-weight-medium);
  color: var(--sf-color-title);
  cursor: pointer;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  padding: var(--sf-spacing-sm);
  margin-bottom: var(--sf-spacing-md);
  border: 1px solid var(--sf-color-border);
  border-radius: var(--sf-border-radius-default);
  background-color: var(--sf-color-bg);
  font-size: var(--sf-font-size-body);
  line-height: var(--sf-line-height-body);
  color: var(--sf-color-text);
  transition: var(--sf-transition-default);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--sf-color-link);
}

input:focus,
input:active,
textarea:focus,
textarea:active,
select:focus,
select:active {
  outline: none;
  border-color: var(--sf-color-link);
  box-shadow: 0 0 0 3px rgba(255, 94, 46, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input[type="checkbox"],
input[type="radio"] {
  display: inline-block;
  width: auto;
  margin: 0;
  margin-right: var(--sf-spacing-xs);
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ==============================================
   BUTTONS
   ============================================== */

button,
.button,
a.button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sf-spacing-xs);
  padding: 18px 40px;
  background-color: var(--sf-color-link);
  color: white;
  border: none;
  border-radius: var(--sf-border-radius-button);
  font-family: var(--sf-font-headings);
  font-size: var(--sf-font-size-body);
  font-weight: var(--sf-font-weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: var(--sf-transition-default);
  line-height: 1;
}

button:hover,
.button:hover,
a.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
  background-color: var(--sf-color-link-hover);
  transform: translateY(-2px);
}

button:active,
.button:active,
a.button:active,
input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active {
  transform: translateY(0);
}

button:focus,
.button:focus,
a.button:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
input[type="reset"]:focus {
  outline: 2px solid var(--sf-color-link);
  outline-offset: 2px;
}

button.secondary,
.button.secondary,
a.button.secondary {
  background-color: var(--sf-color-bg-secondary);
  color: var(--sf-color-title);
  border: 1px solid var(--sf-color-border);
}

button.secondary:hover,
.button.secondary:hover,
a.button.secondary:hover {
  background-color: var(--sf-color-border);
}

/* ==============================================
   LAYOUT STRUCTURES
   ============================================== */

body_wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page_wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.page_content_wrap {
  flex: 1;
}

.content_wrap {
  width: 100%;
  max-width: var(--sf-container-max-width);
  margin: 0 auto;
  padding: 0 var(--sf-spacing-md);
  display: flex;
  gap: var(--sf-gap);
}

.content_wrap.without-sidebar {
  justify-content: center;
}

.content {
  flex: 1;
  min-width: 0;
}

.content_wrap.with-sidebar .content {
  min-width: calc(100% - var(--sf-sidebar-width) - var(--sf-gap));
}

.sidebar {
  width: var(--sf-sidebar-width);
  flex-shrink: 0;
}

/* ==============================================
   WORDPRESS CORE STYLES
   ============================================== */

.alignleft {
  float: left;
  margin-right: var(--sf-spacing-md);
}

.alignright {
  float: right;
  margin-left: var(--sf-spacing-md);
}

.aligncenter {
  display: flex;
  justify-content: center;
  margin: var(--sf-spacing-md) 0;
}

.wp-caption {
  margin-bottom: var(--sf-spacing-md);
  padding: var(--sf-spacing-sm);
  background-color: var(--sf-color-bg-secondary);
  border: 1px solid var(--sf-color-border);
  border-radius: var(--sf-border-radius-default);
}

.wp-caption img {
  display: block;
  margin-bottom: var(--sf-spacing-xs);
}

.wp-caption-text {
  font-size: var(--sf-font-size-small);
  color: var(--sf-color-meta);
}

.wp-smiley {
  height: 1em;
  max-height: 1em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.wp-post-image {
  width: 100%;
  height: auto;
}

/* WordPress Gallery */
.wp-block-gallery {
  margin-bottom: var(--sf-spacing-md);
}

.wp-block-gallery .blocks-gallery-grid {
  gap: var(--sf-spacing-md);
}

/* WordPress Video */
.wp-block-video {
  margin-bottom: var(--sf-spacing-md);
}

.wp-block-video video {
  max-width: 100%;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--sf-color-link);
  padding: var(--sf-spacing-md);
  margin: var(--sf-spacing-md) 0;
  background-color: var(--sf-color-bg-secondary);
  font-style: italic;
  color: var(--sf-color-text);
}

blockquote p {
  margin-bottom: 0;
}

blockquote cite {
  display: block;
  margin-top: var(--sf-spacing-sm);
  font-style: normal;
  font-size: var(--sf-font-size-small);
  color: var(--sf-color-meta);
}

/* WordPress Blocks Core Styles */
.wp-block-button__link {
  padding: 18px 40px;
  border-radius: var(--sf-border-radius-button);
  font-family: var(--sf-font-headings);
  font-weight: var(--sf-font-weight-medium);
}

.wp-block-quote {
  border-left: 4px solid var(--sf-color-link);
  padding-left: var(--sf-spacing-md);
  margin: var(--sf-spacing-md) 0;
}

.wp-block-quote p {
  font-size: var(--sf-font-size-h4);
  line-height: var(--sf-line-height-headings);
}

.wp-block-quote cite {
  display: block;
  margin-top: var(--sf-spacing-md);
  font-size: var(--sf-font-size-small);
  color: var(--sf-color-meta);
}

.wp-block-pullquote {
  border-top: 4px solid var(--sf-color-link);
  border-bottom: 4px solid var(--sf-color-link);
  padding: var(--sf-spacing-lg) 0;
  margin: var(--sf-spacing-lg) 0;
  text-align: center;
}

.wp-block-pullquote p {
  font-size: var(--sf-font-size-h3);
  line-height: var(--sf-line-height-headings);
}

.wp-block-separator {
  border: none;
  border-top: 2px solid var(--sf-color-border);
  margin: var(--sf-spacing-xl) 0;
}

/* Utility Classes */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--sf-color-link);
  clip: auto !important;
  color: white;
  display: block;
  font-size: var(--sf-font-size-body);
  font-weight: var(--sf-font-weight-bold);
  padding: var(--sf-spacing-sm);
  text-decoration: none;
  z-index: 100000;
}

.hidden {
  display: none !important;
}

.clearfix::before,
.clearfix::after {
  content: " ";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 768px) {
  :root {
    --sf-font-size-h1: 42px;
    --sf-font-size-h2: 36px;
    --sf-font-size-h3: 28px;
    --sf-font-size-h4: 24px;
    --sf-gap: 40px;
  }

  .content_wrap {
    flex-direction: column;
    gap: var(--sf-spacing-xl);
  }

  .sidebar {
    width: 100%;
  }

  .alignleft,
  .alignright {
    float: none;
    margin: 0;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-bottom: var(--sf-spacing-md);
  }
}

@media (max-width: 480px) {
  :root {
    --sf-font-size-h1: 32px;
    --sf-font-size-h2: 28px;
    --sf-font-size-h3: 24px;
    --sf-font-size-h4: 20px;
    --sf-font-size-h5: 18px;
    --sf-font-size-h6: 16px;
    --sf-spacing-lg: 24px;
    --sf-spacing-xl: 32px;
  }

  button,
  .button,
  a.button {
    width: 100%;
  }

  .content_wrap {
    padding: 0 var(--sf-spacing-sm);
  }
}

/* ==============================================
   DARK MODE - MANUAL TOGGLE SUPPORT
   ============================================== */

/* Manual dark mode using [data-theme="dark"] attribute */
[data-theme="dark"] {
  --sf-color-bg: var(--sf-color-bg-dark);
  --sf-color-bg-secondary: var(--sf-color-bg-dark-secondary);
  --sf-color-border: var(--sf-color-border-dark);
  --sf-color-title: var(--sf-color-title-dark);
  --sf-color-text: var(--sf-color-text-dark);
  --sf-color-link: var(--sf-color-link-alt, #FF5E2E);
}

[data-theme="dark"] a {
  color: var(--sf-color-link);
}

[data-theme="dark"] a:hover,
[data-theme="dark"] a:active,
[data-theme="dark"] a:focus {
  color: var(--sf-color-accent, #ED4C1C);
}

/* ==============================================
   HEADER LAYOUT OPTIONS
   ============================================== */

/* Standard Layout */
header.layout-standard {
  text-align: left;
}

/* Centered Layout */
header.layout-centered {
  text-align: center;
}

header.layout-centered .site-branding {
  justify-content: center;
}

/* Transparent Layout */
header.layout-transparent {
  background: transparent;
  position: relative;
  z-index: 100;
}

/* Sticky Header */
header.sticky {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Header Height */
header {
  height: var(--sf-header-height);
  display: flex;
  align-items: center;
}

/* ==============================================
   FOOTER LAYOUT OPTIONS
   ============================================== */

/* Footer Column Grid */
.site-footer .footer-widgets {
  display: grid;
  gap: var(--sf-spacing-lg);
  grid-template-columns: repeat(var(--sf-footer-columns), 1fr);
}

/* Single Column */
.site-footer .footer-widgets.col-1 {
  grid-template-columns: 1fr;
}

/* Two Columns */
.site-footer .footer-widgets.col-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Three Columns */
.site-footer .footer-widgets.col-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Four Columns */
.site-footer .footer-widgets.col-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .site-footer .footer-widgets {
    grid-template-columns: 1fr;
  }
}

.site-footer .copyright {
  text-align: center;
  border-top: 1px solid var(--sf-color-border);
  padding-top: var(--sf-spacing-md);
  margin-top: var(--sf-spacing-lg);
}

/* ==============================================
   BLOG LAYOUT OPTIONS
   ============================================== */

/* Grid Layout */
.posts-container.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sf-spacing-lg);
}

.posts-container.layout-grid .post {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* List Layout */
.posts-container.layout-list {
  display: flex;
  flex-direction: column;
  gap: var(--sf-spacing-xl);
}

.posts-container.layout-list .post {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--sf-spacing-lg);
  align-items: flex-start;
}

@media (max-width: 768px) {
  .posts-container.layout-list .post {
    grid-template-columns: 1fr;
  }
}

/* ==============================================
   PAGINATION STYLES
   ============================================== */

/* Numbers Style */
.pagination.style-numbers {
  display: flex;
  justify-content: center;
  gap: var(--sf-spacing-xs);
  flex-wrap: wrap;
}

.pagination.style-numbers .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--sf-color-border);
  border-radius: var(--sf-border-radius-default);
  color: var(--sf-color-text);
  text-decoration: none;
  transition: var(--sf-transition-default);
}

.pagination.style-numbers .page-numbers:hover,
.pagination.style-numbers .page-numbers.current {
  background-color: var(--sf-color-link);
  color: white;
  border-color: var(--sf-color-link);
}

/* Previous/Next Style */
.pagination.style-previous {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sf-spacing-lg);
}

.pagination.style-previous .prev,
.pagination.style-previous .next {
  flex: 1;
}

.pagination.style-previous .prev a,
.pagination.style-previous .next a {
  display: inline-block;
  padding: var(--sf-spacing-sm) var(--sf-spacing-md);
  border: 1px solid var(--sf-color-border);
  border-radius: var(--sf-border-radius-default);
  transition: var(--sf-transition-default);
}

.pagination.style-previous .prev a:hover,
.pagination.style-previous .next a:hover {
  background-color: var(--sf-color-link);
  color: white;
  border-color: var(--sf-color-link);
}

/* Infinite Scroll Style (hiding default pagination) */
.pagination.style-infinite {
  display: none;
}

/* ==============================================
   RESPONSIVE TYPOGRAPHY
   ============================================== */

@media (max-width: 768px) {
  h1 {
    font-size: calc(var(--sf-font-size-h1) * 0.7);
  }

  h2 {
    font-size: calc(var(--sf-font-size-h2) * 0.75);
  }

  h3 {
    font-size: calc(var(--sf-font-size-h3) * 0.8);
  }

  h4 {
    font-size: calc(var(--sf-font-size-h4) * 0.85);
  }
}

/* Theme Check: bypostauthor style required */
.bypostauthor > .comment-body {
	border-left: 3px solid var(--sf-color-primary, #0073aa);
	padding-left: 15px;
}

/* ==============================================
   MOBILE-FIRST RESPONSIVE SYSTEM (Pflichtenheft 2026)
   Target: Mobile 70-90% primary users
   Breakpoints: 480px / 768px / 1024px / 1280px
   ============================================== */

/* -----------------------------------------------
   TOUCH TARGETS — WCAG 2.5.5 (≥ 44×44px)
   ----------------------------------------------- */
button,
.button,
input[type="submit"],
input[type="button"],
input[type="reset"],
a.btn,
.wp-block-button__link,
.nav-links a,
.menu-toggle,
.dark-mode-toggle {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* -----------------------------------------------
   MICRO-INTERACTIONS & HOVER STATES
   ----------------------------------------------- */
a,
button,
.button,
.wp-block-button__link {
  transition: color 0.2s ease, background-color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease,
              transform 0.15s ease, opacity 0.2s ease;
}

a:hover {
  text-decoration-skip-ink: auto;
}

button:hover,
.button:hover,
.wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active,
.button:active,
.wp-block-button__link:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Card hover lift */
.post-card,
.widget,
.entry,
article.post {
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover,
article.post:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Focus visible outline for keyboard nav */
:focus-visible {
  outline: 2px solid var(--sf-color-primary, #0073aa);
  outline-offset: 3px;
  border-radius: 3px;
}

/* -----------------------------------------------
   SCROLL ANIMATIONS
   ----------------------------------------------- */
.sf-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.sf-animate.sf-visible {
  opacity: 1;
  transform: translateY(0);
}

.sf-animate-left {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.sf-animate-left.sf-visible {
  opacity: 1;
  transform: translateX(0);
}

.sf-animate-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.sf-animate-scale.sf-visible {
  opacity: 1;
  transform: scale(1);
}

/* -----------------------------------------------
   HEADER — MOBILE
   ----------------------------------------------- */
@media (max-width: 1024px) {
  .site-header .header-inner {
    flex-wrap: wrap;
    gap: var(--sf-spacing-sm, 8px);
  }

  .site-header .header-right {
    gap: var(--sf-spacing-sm, 8px);
  }
}

@media (max-width: 768px) {
  /* Header layout */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .site-header .header-content {
    padding: 8px var(--sf-spacing-md, 16px);
  }

  .site-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .site-header .header-left {
    flex: 1;
    min-width: 0;
  }

  .site-title {
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-description {
    display: none;
  }

  /* Navigation */
  .main-navigation {
    order: 3;
    width: 100%;
  }

  .main-navigation #primary-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: var(--sf-spacing-md, 16px) 0;
    border-top: 1px solid var(--sf-color-border, #e0e0e0);
    gap: 4px;
  }

  .main-navigation.is-open #primary-menu,
  .main-navigation.nav-open #primary-menu {
    display: flex;
  }

  .main-navigation #primary-menu li {
    width: 100%;
  }

  .main-navigation #primary-menu a {
    display: block;
    padding: 12px var(--sf-spacing-md, 16px);
    border-radius: var(--sf-border-radius-default, 6px);
    font-size: 1rem;
    min-height: 44px;
    line-height: 1.2;
  }

  /* Hamburger — make visible */
  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    cursor: pointer;
    border: 1px solid var(--sf-color-border, #e0e0e0);
    border-radius: var(--sf-border-radius-default, 6px);
    background: transparent;
  }

  .menu-toggle-text {
    font-size: 0.85rem;
    font-weight: 500;
  }

  /* Dropdown submenu on mobile */
  .main-navigation .sub-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: none;
    padding-left: var(--sf-spacing-md, 16px);
    display: none;
  }

  .main-navigation .menu-item-has-children.is-open > .sub-menu {
    display: flex;
    flex-direction: column;
  }
}

/* -----------------------------------------------
   LAYOUT — PAGE WRAP
   ----------------------------------------------- */
@media (max-width: 768px) {
  .page_wrap,
  .page_content_wrap,
  .content_wrap {
    padding-left: 0;
    padding-right: 0;
  }

  .site-content {
    padding: var(--sf-spacing-md, 16px);
  }

  /* Two-column layouts → single column */
  .columns-2,
  .columns-3,
  .columns-4 {
    grid-template-columns: 1fr !important;
    columns: 1 !important;
  }

  /* Sidebar → moves below content */
  .content-sidebar-wrap {
    flex-direction: column;
  }

  .sidebar {
    width: 100% !important;
    border-top: 1px solid var(--sf-color-border, #e0e0e0);
    margin-top: var(--sf-spacing-xl, 32px);
    padding-top: var(--sf-spacing-xl, 32px);
  }
}

/* -----------------------------------------------
   BLOG / POST GRID — MOBILE
   ----------------------------------------------- */
@media (max-width: 768px) {
  /* Post grid becomes 1 column */
  .posts-list,
  .posts-grid,
  .post-grid,
  .blog-layout-grid {
    grid-template-columns: 1fr !important;
    gap: var(--sf-spacing-lg, 24px);
  }

  /* Post card */
  .post-card {
    border-radius: var(--sf-border-radius-default, 6px);
    overflow: hidden;
  }

  .post-card .post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
  }

  .post-card .entry-content,
  .post-card .post-entry {
    padding: var(--sf-spacing-md, 16px);
  }

  .post-card .entry-title {
    font-size: 1.1rem;
    line-height: 1.35;
  }

  /* Single post */
  .entry-header {
    padding: var(--sf-spacing-md, 16px) 0;
  }

  .entry-title {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .entry-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: var(--sf-border-radius-default, 6px);
  }

  /* Post meta */
  .entry-meta {
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* -----------------------------------------------
   IMAGES — RESPONSIVE
   ----------------------------------------------- */
@media (max-width: 768px) {
  img {
    max-width: 100%;
    height: auto;
  }

  .wp-block-image img,
  .wp-post-image {
    width: 100%;
    height: auto;
  }

  /* Gutenberg columns */
  .wp-block-columns {
    flex-direction: column;
  }

  .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  /* Gallery */
  .gallery-columns-3,
  .gallery-columns-4,
  .gallery-columns-5,
  .gallery-columns-6 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .gallery-columns-2 {
    grid-template-columns: 1fr !important;
  }
}

/* -----------------------------------------------
   WIDGETS — MOBILE
   ----------------------------------------------- */
@media (max-width: 768px) {
  .widget {
    padding: var(--sf-spacing-md, 16px);
    margin-bottom: var(--sf-spacing-lg, 24px);
  }

  .widget-title {
    font-size: 1rem;
    margin-bottom: var(--sf-spacing-sm, 8px);
  }

  /* Widget areas in footer */
  .footer-widgets,
  .footer-widget-area {
    grid-template-columns: 1fr !important;
    gap: var(--sf-spacing-lg, 24px);
  }
}

/* -----------------------------------------------
   FORMS — MOBILE
   ----------------------------------------------- */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    width: 100%;
    min-height: 44px;
    padding: 10px var(--sf-spacing-sm, 8px);
    font-size: 16px; /* prevent iOS zoom */
    border-radius: var(--sf-border-radius-default, 6px);
    box-sizing: border-box;
  }

  textarea {
    min-height: 120px;
  }

  .search-form {
    flex-direction: column;
    gap: var(--sf-spacing-sm, 8px);
  }

  .search-form .search-field {
    width: 100%;
  }

  .search-form .search-submit {
    width: 100%;
    min-height: 48px;
  }

  /* Comment form */
  .comment-form .form-group,
  .comment-form p {
    margin-bottom: var(--sf-spacing-md, 16px);
  }

  .comment-form .form-submit input {
    width: 100%;
    min-height: 48px;
  }
}

/* -----------------------------------------------
   FOOTER — MOBILE
   ----------------------------------------------- */
@media (max-width: 768px) {
  .site-footer {
    padding: var(--sf-spacing-xl, 32px) var(--sf-spacing-md, 16px);
  }

  .footer-inner,
  .footer-bottom {
    flex-direction: column;
    gap: var(--sf-spacing-md, 16px);
    text-align: center;
  }

  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sf-spacing-sm, 8px);
  }

  .footer-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .copyright {
    font-size: 0.8rem;
    text-align: center;
  }
}

/* -----------------------------------------------
   PAGINATION — MOBILE
   ----------------------------------------------- */
@media (max-width: 768px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .pagination .page-numbers {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
  }
}

/* -----------------------------------------------
   COMMENTS — MOBILE
   ----------------------------------------------- */
@media (max-width: 768px) {
  .comments-area {
    padding: 0 var(--sf-spacing-md, 16px);
  }

  .comment-list .comment {
    padding: var(--sf-spacing-md, 16px) 0;
  }

  .comment-list .children {
    padding-left: var(--sf-spacing-md, 16px);
    margin-left: 0;
    border-left: 2px solid var(--sf-color-border, #e0e0e0);
  }

  .comment-author .avatar {
    width: 40px;
    height: 40px;
  }
}

/* -----------------------------------------------
   GUTENBERG BLOCKS — MOBILE
   ----------------------------------------------- */
@media (max-width: 768px) {
  /* Cover block */
  .wp-block-cover {
    min-height: 250px !important;
    padding: var(--sf-spacing-xl, 32px) var(--sf-spacing-md, 16px);
  }

  .wp-block-cover h1,
  .wp-block-cover h2 {
    font-size: 1.5rem;
  }

  /* Media & Text block */
  .wp-block-media-text {
    grid-template-columns: 1fr !important;
  }

  .wp-block-media-text .wp-block-media-text__media {
    order: -1;
  }

  /* Table block */
  .wp-block-table table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Group block padding */
  .wp-block-group.has-background {
    padding: var(--sf-spacing-lg, 24px) var(--sf-spacing-md, 16px);
  }

  /* Quote block */
  .wp-block-quote {
    padding: var(--sf-spacing-md, 16px);
    font-size: 1rem;
  }
}

/* -----------------------------------------------
   STICKY MOBILE CTA BUTTON
   ----------------------------------------------- */
.sf-mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 12px var(--sf-spacing-md, 16px);
  background: var(--sf-bg-primary, #ffffff);
  border-top: 1px solid var(--sf-color-border, #e0e0e0);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  animation: sfSlideUp 0.3s ease;
}

.sf-mobile-cta a,
.sf-mobile-cta button {
  display: block;
  width: 100%;
  min-height: 52px;
  text-align: center;
  border-radius: var(--sf-border-radius-default, 6px);
  font-size: 1rem;
  font-weight: 600;
  background: var(--sf-color-primary, #0073aa);
  color: white;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

@keyframes sfSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@media (max-width: 768px) {
  .sf-mobile-cta {
    display: block;
  }

  /* Add padding so footer content not hidden behind sticky CTA */
  .site-footer {
    padding-bottom: calc(var(--sf-spacing-xl, 32px) + 80px);
  }
}

/* -----------------------------------------------
   GDPR COOKIE BANNER — MOBILE
   ----------------------------------------------- */
.sf-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--sf-bg-primary, #ffffff);
  border-top: 1px solid var(--sf-color-border, #e0e0e0);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  padding: var(--sf-spacing-md, 16px);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.1, 0.64, 1);
}

.sf-cookie-banner.is-visible {
  transform: translateY(0);
}

.sf-cookie-banner__inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sf-spacing-md, 16px);
  flex-wrap: wrap;
}

.sf-cookie-banner__text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--sf-text-secondary, #555);
  min-width: 200px;
}

.sf-cookie-banner__text a {
  color: var(--sf-color-primary, #0073aa);
  text-decoration: underline;
}

.sf-cookie-banner__actions {
  display: flex;
  gap: var(--sf-spacing-sm, 8px);
  flex-shrink: 0;
}

.sf-cookie-banner__accept,
.sf-cookie-banner__decline {
  min-height: 44px;
  padding: 8px 20px;
  border-radius: var(--sf-border-radius-default, 6px);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.sf-cookie-banner__accept {
  background: var(--sf-color-primary, #0073aa);
  color: white;
}

.sf-cookie-banner__decline {
  background: transparent;
  border: 1px solid var(--sf-color-border, #e0e0e0);
  color: var(--sf-text-secondary, #555);
}

@media (max-width: 480px) {
  .sf-cookie-banner__inner {
    flex-direction: column;
    gap: var(--sf-spacing-sm, 8px);
  }

  .sf-cookie-banner__actions {
    width: 100%;
  }

  .sf-cookie-banner__accept,
  .sf-cookie-banner__decline {
    flex: 1;
    text-align: center;
  }
}

/* -----------------------------------------------
   SMALL MOBILE (≤ 480px) OVERRIDES
   ----------------------------------------------- */
@media (max-width: 480px) {
  h1 {
    font-size: calc(var(--sf-font-size-h1, 2.5rem) * 0.6);
  }

  h2 {
    font-size: calc(var(--sf-font-size-h2, 2rem) * 0.65);
  }

  h3 {
    font-size: calc(var(--sf-font-size-h3, 1.75rem) * 0.72);
  }

  .site-content {
    padding: var(--sf-spacing-sm, 8px);
  }

  /* Ensure all grids collapse to 1 col */
  [class*="grid-"],
  [class*="-grid"] {
    grid-template-columns: 1fr !important;
  }

  .gallery-columns-3,
  .gallery-columns-4,
  .gallery-columns-5,
  .gallery-columns-6 {
    grid-template-columns: 1fr !important;
  }

  /* Bigger tap targets on tiny screens */
  .main-navigation #primary-menu a {
    padding: 14px var(--sf-spacing-md, 16px);
    font-size: 1.05rem;
  }
}

/* -----------------------------------------------
   DARK MODE — MOBILE ADJUSTMENTS
   ----------------------------------------------- */
@media (max-width: 768px) {
  body.dark-mode .sf-cookie-banner,
  body.dark-mode .sf-mobile-cta {
    background: var(--sf-bg-dark, #1a1a2e);
    border-color: rgba(255, 255, 255, 0.1);
  }

  body.dark-mode .sf-cookie-banner__text {
    color: rgba(255, 255, 255, 0.75);
  }

  body.dark-mode .sf-cookie-banner__decline {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.75);
  }
}

/* -----------------------------------------------
   PERFORMANCE — REDUCE MOTION
   ----------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .sf-animate,
  .sf-animate-left,
  .sf-animate-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==============================================
   END MOBILE-FIRST RESPONSIVE SYSTEM
   ============================================== */

/* ==============================================
   DESKTOP HEADER & NAVIGATION
   Missing desktop rules added 2026-04-17
   ============================================== */

@media (min-width: 769px) {

  /* ---- Header layout ---- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid var(--sf-color-border, #e2e8f0);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  }

  .site-header .header-content {
    padding: 0 32px;
    max-width: 1400px;
    margin: 0 auto;
  }

  .site-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 24px;
  }

  .site-header .header-left {
    flex: 0 0 auto;
  }

  /* ---- Hamburger: hidden on desktop ---- */
  .menu-toggle {
    display: none !important;
  }

  /* ---- Horizontal navigation ---- */
  .main-navigation {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
  }

  .main-navigation #primary-menu,
  .main-navigation #primary-menu.menu {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .main-navigation #primary-menu li {
    position: relative;
  }

  .main-navigation #primary-menu > li > a {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--sf-color-secondary, #1F242E);
    text-decoration: none;
    border-radius: 6px;
    min-height: 40px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .main-navigation #primary-menu > li > a:hover,
  .main-navigation #primary-menu > li.current-menu-item > a,
  .main-navigation #primary-menu > li.current_page_item > a {
    background: rgba(255, 94, 46, 0.08);
    color: var(--sf-color-primary, #FF5E2E);
  }

  /* ---- Dropdown submenus ---- */
  .main-navigation #primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--sf-color-border, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    padding: 6px;
    z-index: 1001;
    flex-direction: column;
    gap: 2px;
  }

  .main-navigation #primary-menu li:hover > .sub-menu,
  .main-navigation #primary-menu li:focus-within > .sub-menu {
    display: flex;
  }

  .main-navigation #primary-menu .sub-menu a {
    display: block;
    padding: 8px 12px;
    font-size: 0.88rem;
    color: var(--sf-color-secondary, #1F242E);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .main-navigation #primary-menu .sub-menu a:hover {
    background: var(--sf-color-surface, #f8fafc);
    color: var(--sf-color-primary, #FF5E2E);
  }
}
/* END DESKTOP HEADER & NAVIGATION */

/* ═══════════════════════════════════════════════════════════════
   SCROLL ANIMATIONS — Global
   ═══════════════════════════════════════════════════════════════ */

/* Pre-animation state */
.tf-pre-anim {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s ease, transform .65s ease;
}
.tf-pre-anim.tf-in {
  opacity: 1;
  transform: translateY(0);
}

/* Left/right variants */
.tf-reveal-left.tf-pre-anim  { transform: translateX(-30px); }
.tf-reveal-right.tf-pre-anim { transform: translateX(30px); }
.tf-reveal-left.tf-in, .tf-reveal-right.tf-in { transform: translateX(0); }

/* Header entrance */
.tf-header-pre {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s ease, transform .7s ease;
}
.tf-header-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Shape Dividers ─────────────────────────────────────────── */
.tf-shape-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
  z-index: 2;
}
.tf-shape-divider svg { display: block; width: 100%; }
.tf-shape-divider-top {
  top: -1px;
  bottom: auto;
  transform: rotate(180deg);
}

/* ── Section spacing improvements ─────────────────────────────── */
.sf-hero-section ~ section,
.tf-hero ~ section {
  position: relative;
}

/* ── Improved card hover global ────────────────────────────────── */
.sf-feature-card,
.sf-blog-card,
.sf-testimonial-card {
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease !important;
}
.sf-feature-card:hover,
.sf-blog-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 24px 48px rgba(0,0,0,.4) !important;
}

/* ═══════════════════════════════════════════════════════════════
   STICKY HEADER — scroll state
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  transition: padding .3s ease, background .3s ease, box-shadow .3s ease !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 9990 !important;
}
.tf-header-scrolled {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  box-shadow: 0 4px 32px rgba(0,0,0,.3) !important;
}
.tf-nav-active {
  color: #ff5e2e !important;
}

/* ═══════════════════════════════════════════════════════════════
   SHAPE DIVIDERS — between sections
   ═══════════════════════════════════════════════════════════════ */
.tf-shape-top,
.tf-shape-bottom {
  position: absolute;
  left: 0; right: 0;
  line-height: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.tf-shape-top    { top: -1px; }
.tf-shape-bottom { bottom: -1px; }
.tf-shape-top svg,
.tf-shape-bottom svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION POSITONING — for shape dividers
   ═══════════════════════════════════════════════════════════════ */
.tf-hero, .tf-feat-section, .tf-testi-section, .tf-srv-sec,
.tf-about-sec, .tf-team-sec, .tf-pr-sec, .tf-faq-sec,
.tf-sub-sec, .tf-ct-sec, .tf-demo-sec, .tf-cloud-section {
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL SECTION TRANSITIONS — polished padding/margins
   ═══════════════════════════════════════════════════════════════ */

/* Ensure all sections have the min padding */
.sf-portfolio-section,
.sf-blog-section,
.sf-team-section {
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   TYPING ANIMATION — Hero headline word
   ═══════════════════════════════════════════════════════════════ */
.tf-typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #ff5e2e;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: tfBlink .8s step-end infinite;
}
@keyframes tfBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ═══════════════════════════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════════════════════════ */
.tf-preloader {
  position: fixed;
  inset: 0;
  background: #06021d;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  transition: opacity .5s ease, visibility .5s ease;
}
.tf-preloader.tf-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tf-preloader-logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
}
.tf-preloader-logo span { color: #ff5e2e; }
.tf-preloader-bar {
  width: 120px;
  height: 2px;
  background: rgba(255,255,255,.1);
  border-radius: 100px;
  overflow: hidden;
}
.tf-preloader-fill {
  height: 100%;
  background: #ff5e2e;
  border-radius: 100px;
  animation: tfPreload .8s ease forwards;
}
@keyframes tfPreload { from{width:0} to{width:100%} }



/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY v2 — Fluid Scale, Gradient Text, Global Polish
   ═══════════════════════════════════════════════════════════════ */

/* ── Fluid heading scale via clamp() ── */
:root {
  --tf-h1: clamp(2.4rem, 5.5vw + .5rem, 5rem);
  --tf-h2: clamp(2rem,   3.8vw + .4rem, 3.25rem);
  --tf-h3: clamp(1.4rem, 2.5vw + .3rem, 2rem);
  --tf-h4: clamp(1.1rem, 1.8vw + .2rem, 1.5rem);
  --tf-h5: clamp(1rem,   1.2vw + .1rem, 1.2rem);
  --tf-gradient-text: linear-gradient(135deg, #ff5e2e 0%, #ff9d5e 50%, #ffb347 100%);
  --tf-gradient-cool:  linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --tf-gradient-warm:  linear-gradient(135deg, #ff5e2e 0%, #a855f7 100%);
}

/* Gradient text utility */
.tf-text-gradient {
  background: var(--tf-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tf-text-gradient-cool {
  background: var(--tf-gradient-cool);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tf-text-gradient-warm {
  background: var(--tf-gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Better heading defaults for theme content */
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
  font-family: 'Inter Tight', -apple-system, sans-serif;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.03em;
  color: var(--sf-title);
  margin-top: 1.75em;
  margin-bottom: .6em;
}
.entry-content h1 { font-size: var(--tf-h1); }
.entry-content h2 { font-size: var(--tf-h2); }
.entry-content h3 { font-size: var(--tf-h3); }
.entry-content h4 { font-size: var(--tf-h4); }

/* Section heading global rules — tighter tracking, stronger weight */
.sf-blog-section h2,
.sf-pf-section h2,
.sf-portfolio-section h2 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.08;
}

/* ── Eyebrow / tag chip ── */
.tf-section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,94,46,.1); border: 1px solid rgba(255,94,46,.22);
  color: #ff5e2e; font-size: .68rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; padding: 5px 16px; border-radius: 100px;
  margin-bottom: 18px;
}

/* ── Section numbers (01, 02…) ── */
.tf-sec-number {
  font-family: 'Inter Tight', sans-serif;
  font-size: .68rem; font-weight: 900; letter-spacing: .14em;
  color: rgba(255,255,255,.15); text-transform: uppercase;
  margin-bottom: 12px; display: block;
}

/* ── Reading enhancement: prose paragraphs ── */
.sf-single-content p,
.entry-content > p {
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--sf-text);
  max-width: 68ch;
  margin-bottom: 1.35em;
}

/* ── Link style inside content ── */
.entry-content a:not(.wp-block-button__link) {
  color: #ff5e2e;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .2s, text-decoration-color .2s;
}
.entry-content a:not(.wp-block-button__link):hover {
  color: #ff8a60;
  text-decoration-color: transparent;
}

/* ── Blockquote dark-mode ── */
.entry-content blockquote {
  border-left: 3px solid #ff5e2e;
  padding: 16px 24px;
  margin: 2em 0;
  background: rgba(255,94,46,.06);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #94a3b8;
}

/* ── Code inline ── */
.entry-content code {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: .875em;
  color: #ff8a60;
}

/* ═══════════════════════════════════════════════════════════════
   SHAPE DIVIDERS — SVG Wave Decorators
   ═══════════════════════════════════════════════════════════════ */
.tf-shape-divider {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
  z-index: 2;
}
.tf-shape-bottom {
  bottom: -1px;
}
.tf-shape-top {
  top: -1px;
  transform: rotateX(180deg);
}
.tf-shape-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}
/* Taller on wide screens */
@media (min-width: 1200px) {
  .tf-shape-divider svg { height: 80px; }
}
@media (max-width: 600px) {
  .tf-shape-divider svg { height: 36px; }
}

/* Ensure sections have position:relative for dividers */
.tf-hero-section,
[id="sf-features"],
.sf-testi-section {
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   HOVER GLOW CARDS — Global utility
   ═══════════════════════════════════════════════════════════════ */
.tf-card-glow {
  transition: box-shadow .3s ease, transform .3s ease;
}
.tf-card-glow:hover {
  box-shadow: 0 0 0 1px rgba(255,94,46,.25),
              0 16px 48px rgba(0,0,0,.5),
              0 0 48px rgba(255,94,46,.08);
  transform: translateY(-4px);
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL REVEAL — entrance animation helpers
   ═══════════════════════════════════════════════════════════════ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="scale"] { transform: scale(.94); }
[data-reveal].tf-revealed {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER IMPROVEMENTS — scrolled state polish
   ═══════════════════════════════════════════════════════════════ */
.tf-header-scrolled {
  background: rgba(6,2,29,.92) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
  box-shadow: 0 2px 32px rgba(0,0,0,.4) !important;
  transition: all .3s ease !important;
}

/* ── Nav hover underline ── */
.sf-nav a {
  position: relative;
}
.sf-nav a::after {
  content: '';
  position: absolute; left: 0; bottom: -2px; right: 0;
  height: 2px; background: #ff5e2e;
  transform: scaleX(0); transform-origin: right;
  transition: transform .25s ease;
  border-radius: 2px;
}
.sf-nav a:hover::after,
.sf-nav .current-menu-item > a::after { transform: scaleX(1); transform-origin: left; }

/* ═══════════════════════════════════════════════════════════════
   BUTTON IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */
.sf-btn,
.tf-btn,
.wp-block-button__link {
  position: relative; overflow: hidden;
}
.sf-btn::after,
.tf-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.sf-btn:hover::after,
.tf-btn:hover::after { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   FOCUS RING — keyboard accessibility
   ═══════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid #ff5e2e;
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Hero typing word ── */
.tf-hero-h1 .tf-typing-word {
  background: linear-gradient(135deg, #ff5e2e 0%, #ff9d5e 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  min-width: 2ch; /* prevent layout shift */
}
.tf-hero-h1 .tf-typing-cursor {
  display: inline-block;
  width: 3px;
  height: .85em;
  background: #ff5e2e;
  vertical-align: middle;
  margin: 0 2px;
  animation: tfBlink .7s step-end infinite;
  border-radius: 2px;
}
