/*
 * TEC-SKY Theme - Custom Styles
 * All custom animations and interactions from front-page.htm
 * Note: Tailwind CSS and Google Fonts are loaded via CDN in header.php
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --tec-black: #050505;
    --tec-gold: #C5A880;
    --tec-grey: #1F1F1F;
    --tec-light: #F5F5F5;
}

/* ============================================
   BASE STYLES
   ============================================ */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif !important;
    background-color: #ffffff;
    color: #050505;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global Link Reset - Remove underlines */
a {
    text-decoration: none;
    color: inherit;
}

a:hover,
a:focus {
    text-decoration: none;
}

::selection {
    background-color: var(--tec-black);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #fff;
}

::-webkit-scrollbar-thumb {
    background: #333;
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Delays for staggered reveals */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

/* Scroll Indicator Animation */
@keyframes scroll-bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(10px);
    }

    60% {
        transform: translateY(5px);
    }
}


.animate-scroll-indicator {
    animation: scroll-bounce 2s infinite;
}

/* Infinite Marquee */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-marquee {
    display: inline-flex;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

.mask-image-linear-gradient {
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

/* ============================================
   MEGA MENU
   ============================================ */
#mega-menu {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#mega-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#mega-menu.is-closed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Stagger Animation for Menu Items */
.stagger-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#mega-menu.is-open .stagger-item {
    opacity: 1;
    transform: translateY(0);
}

#mega-menu.is-open .delay-1 {
    transition-delay: 0.1s;
}

#mega-menu.is-open .delay-2 {
    transition-delay: 0.2s;
}

#mega-menu.is-open .delay-3 {
    transition-delay: 0.3s;
}

#mega-menu.is-open .delay-4 {
    transition-delay: 0.4s;
}

#mega-menu.is-open .delay-5 {
    transition-delay: 0.5s;
}

/* Menu Preview Image Transition */
.menu-preview-image {
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: scale(1.1);
}

.menu-preview-image.active {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-bg-image {
    transition: opacity 0.5s ease-out, transform 2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: scale(1.1);
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-bg-image.active {
    opacity: 1;
    transform: scale(1);
}

/* Global Link Styling Fixes - Remove default underlines for UI elements */
.hero-nav-link,
#hero-cta a,
#o-nas a,
.journal-item,
a.border-b {
    text-decoration: none;
}

.hero-nav-link:hover,
.hero-nav-link:focus,
#hero-cta a:hover,
#hero-cta a:focus,
#o-nas a:hover,
.journal-item:hover,
a.border-b:hover {
    text-decoration: none;
}

/* ============================================
   BEFORE/AFTER SLIDER
   ============================================ */
.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    cursor: ew-resize;
    z-index: 10;
}

.slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* ============================================
   JOURNAL / BLOG ITEMS
   ============================================ */
.journal-item:hover .journal-arrow {
    transform: translateX(10px) rotate(-45deg);
    opacity: 1;
}

/* ============================================
   FORM STYLES
   ============================================ */
.input-underline:focus-within {
    border-bottom-color: #fff;
}

/* Select Dropdown Contrast Fix */
.input-underline option {
    color: #000;
    background: #fff;
}

/* Custom Select Dropdown for Dark Theme (Contact Form) */
#contact-section select,
.dark-select {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 24px;
    cursor: pointer;
}

#contact-section select option,
.dark-select option {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 12px 16px;
    border: none;
}

#contact-section select option:hover,
#contact-section select option:focus,
#contact-section select option:checked,
.dark-select option:hover,
.dark-select option:focus {
    background-color: #C5A880;
    color: #000000;
}

#contact-section select option:disabled {
    color: #666;
    background-color: #1a1a1a;
}

/* Firefox specific fix */
@-moz-document url-prefix() {

    #contact-section select,
    .dark-select {
        color: #999;
    }

    #contact-section select option,
    .dark-select option {
        background-color: #1a1a1a;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.blend-smart {
    mix-blend-mode: difference;
}

/* Accent section labels (e.g. Obszar kompetencji, Eksploruj, Kontakt, Journal & Analizy) */
[class*="text-tec-gold"][class*="uppercase"][class*="tracking-[0.2em]"] {
    font-size: clamp(0.8rem, 0.75rem + 0.2vw, 0.95rem) !important;
    font-weight: 800 !important;
    line-height: 1.3;
    opacity: 1 !important;
}

/* Hide scrollbar for offers container */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Hover effects */
.hover-reveal-image {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.nav-item:hover+.hover-reveal-image,
.nav-item:focus+.hover-reveal-image {
    opacity: 0.4;
    transform: scale(1) translateY(0);
}

.outline-text {
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
    color: transparent;
    transition: all 0.3s ease;
}

.group:hover .outline-text {
    -webkit-text-stroke: 1px #000;
    color: #000;
}

/* ============================================
   CAREER PAGE STYLES (Accordion)
   ============================================ */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

details[open] summary~* {
    animation: sweep .5s ease-in-out;
}

@keyframes sweep {
    0% {
        opacity: 0;
        transform: translateY(-10px)
    }

    100% {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ============================================
   CONTACT PAGE STYLES (Form & Map)
   ============================================ */
/* Note: input-underline focus styles are partly defined above, merging here for clarity if needed, or keeping separate */
.input-underline {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    /* transition: border-color 0.3s ease; - already defined in utility or reset? Check conflict. Assume safe addition */
    transition: border-color 0.3s ease;
}

.input-underline:focus {
    outline: none;
    border-bottom-color: #000;
}

.map-frame {
    filter: grayscale(100%) contrast(1.1);
    transition: filter 0.5s ease;
}


/* ============================================
   SINGLE POST STYLES
   ============================================ */
/* Reading Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: #C5A880;
    width: 0%;
    z-index: 100;
    transition: width 0.1s ease;
}

/* Typography Override for Article */
.article-content p {
    margin-bottom: 1.5em;
    line-height: 1.8;
    font-size: 1.125rem;
    color: #333;
}

.article-content h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.05em;
}

.article-content h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5em;
}

.article-content li {
    margin-bottom: 0.5em;
}

/* Wall Link */
.wall-link {
    border-left: 4px solid #C5A880;
    padding: 2rem;
    background: #F9F9F9;
    margin: 3rem 0;
}

/* Key Takeaways Box */
.takeaways-box {
    background-color: #F5F5F5;
    padding: 2rem;
    border-left: 4px solid #000;
    margin-bottom: 3rem;
}

/* TOC Active State */
.toc-link.active {
    color: #C5A880;
    font-weight: 600;
    border-left-color: #C5A880;
}

/* ============================================
   CATEGORY / ARCHIVE STYLES
   ============================================ */
/* Sidebar Links */
.cat-link.active {
    color: #C5A880;
    font-weight: 700;
    padding-left: 10px;
    border-left: 2px solid #C5A880;
}


/* Card Hover */
.archive-card img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-card:hover img {
    transform: scale(1.05);
}

/* ============================================
   PROPERTY & REAL ESTATE STYLES
   ============================================ */

/* Shared hero title sizing for all templates except front page */
.tec-hero-title {
    font-size: clamp(2.75rem, 9vw, 6rem);
    line-height: 0.88;
    margin-bottom: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .tec-hero-title {
        margin-bottom: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Lightbox (property gallery): prevent header toggle overlap */
body.tec-lightbox-open #menu-toggle {
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Fixed aspect ratio utilities (works without Tailwind plugins) */
.tec-aspect-4-3 {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 3/4 = 0.75 */
    overflow: hidden;
}

.tec-aspect-3-4 {
    position: relative;
    width: 100%;
    padding-top: 133.3333%; /* 4/3 = 1.3333 (portrait) */
    overflow: hidden;
}

.tec-aspect-1-1 {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.tec-aspect-4-3 > * {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tec-aspect-3-4 > * {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tec-aspect-1-1 > * {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tec-aspect-4-3 img {
    object-fit: cover;
}

.tec-aspect-3-4 img {
    object-fit: cover;
}

.tec-aspect-1-1 img {
    object-fit: cover;
}

/* Aspect-ratio wrappers for complex overlays (slider, badges etc.) */
.tec-ratio-4-3 {
    position: relative;
    width: 100%;
}

@supports (aspect-ratio: 4 / 3) {
    .tec-ratio-4-3 {
        aspect-ratio: 4 / 3;
    }
}

@supports not (aspect-ratio: 4 / 3) {
    .tec-ratio-4-3 {
        height: 0;
        padding-top: 75%;
    }
}

/* STICKY SIDEBAR */
.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* GALLERY GRID HOVER */
.gallery-item {
    overflow: hidden;
}

.gallery-item img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* MAP STYLING */
.map-wrapper {
    position: relative;
    overflow: hidden;
}

.map-wrapper iframe {
    filter: grayscale(100%) contrast(1.1) brightness(1.05);
    transition: filter 0.5s ease;
    width: 100%;
    height: 100%;
}

.map-wrapper:hover iframe {
    filter: grayscale(0%) contrast(1) brightness(1);
}

.map-overlay-card {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* CHECKBOX CUSTOM */
.tec-checkbox {
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid #ccc;
    display: grid;
    place-content: center;
    margin-right: 0.5em;
    transition: 0.2s;
    cursor: pointer;
}

.tec-checkbox::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #C5A880;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.tec-checkbox:checked::before {
    transform: scale(1);
}

.tec-checkbox:checked {
    border-color: #C5A880;
}

/* DUAL RANGE (PRICE FILTER) */
.tec-dual-range__wrap {
    position: relative;
    height: 2rem;
}

.tec-dual-range__rail {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 9999px;
    background: #e5e7eb;
}

.tec-dual-range__fill {
    position: absolute;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 9999px;
    background: #C5A880;
}

.tec-dual-range__input {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 2rem;
    margin: 0;
    background: transparent;
    pointer-events: none;
}

.tec-dual-range__input::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.tec-dual-range__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 9999px;
    border: 2px solid #C5A880;
    background: #fff;
    margin-top: -6px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tec-dual-range__input::-moz-range-track {
    height: 4px;
    background: transparent;
}

.tec-dual-range__input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 9999px;
    border: 2px solid #C5A880;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================
   SEARCH PAGE STYLES
   ============================================ */
.search-input-lg {
    border: none;
    border-bottom: 2px solid #e5e7eb;
    background: transparent;
    font-size: 2rem;
    font-weight: 300;
    transition: border-color 0.3s ease;
}

.search-input-lg:focus {
    outline: none;
    border-bottom-color: #050505;
}

/* Tab Active State */
.tab-btn.active {
    color: #050505;
    border-bottom: 2px solid #050505;
}

/* ============================================
   LEGAL PAGE STYLES
   ============================================ */
.legal-nav-link.active {
    color: #C5A880;
    border-left-color: #C5A880;
    font-weight: 600;
}

.legal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.legal-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-content p {
    margin-bottom: 1.25rem;
    line-height: 1.7;
    color: #333;
}

.legal-content ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: 1.25rem;
    color: #333;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

/* ============================================
   UTILITY (404, THANKS, ANIMATIONS)
   ============================================ */
.fade-in {
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glitch-hover:hover {
    text-shadow: 2px 0 #C5A880, -2px 0 #333;
}

/* ============================================
   YOAST FAQ ACCORDION STYLES
   ============================================ */
/* Boxed Style to match Investment Page */
.schema-faq-section,
.wp-block-yoast-faq-block .schema-faq-section {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.schema-faq-section.active,
.wp-block-yoast-faq-block .schema-faq-section.active {
    border-color: var(--tec-gold);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.schema-faq-question,
.wp-block-yoast-faq-block .schema-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    /* padding handled by container */
    cursor: pointer;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    color: #1a1a1a;
}

/* Chevron Icon using CSS borders */
.schema-faq-question::after,
.wp-block-yoast-faq-block .schema-faq-question::after {
    content: '';
    display: block;
    width: 0.6em;
    height: 0.6em;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: rotate(45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

.schema-faq-section.active .schema-faq-question::after,
.wp-block-yoast-faq-block .schema-faq-section.active .schema-faq-question::after {
    transform: rotate(225deg);
    /* Flips up */
    border-color: var(--tec-gold);
}

.schema-faq-answer,
.wp-block-yoast-faq-block .schema-faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, padding 0.4s ease;
    padding-bottom: 0;
}

.schema-faq-section.active .schema-faq-answer,
.wp-block-yoast-faq-block .schema-faq-section.active .schema-faq-answer {
    opacity: 1;
    padding-bottom: 1.5rem;
    /* max-height set via JS */
}

/* Fix for paragraph margins inside answer */
.schema-faq-answer p:last-child,
.wp-block-yoast-faq-block .schema-faq-answer p:last-child {
    margin-bottom: 0;
}

/* ============================================
   PARTNER LOGOS NORMALIZATION
   ============================================ */
.partner-logo-normalize {
    /* Force consistent sizing */
    height: 3rem;
    /* 48px */
    width: auto;
    max-width: 200px;
    object-fit: contain;

    /* Normalize colors - convert to grayscale */
    filter: grayscale(100%) brightness(0.4) contrast(1.2);
    opacity: 0.7;

    /* Smooth transitions */
    transition: opacity 0.3s ease;
}

.partner-logo-normalize:hover {
    /* Only increase visibility on hover - keep grayscale */
    opacity: 1;
}

/* Alternative: Force all logos to single color (dark gray) */
.partner-logo-monochrome {
    height: 3rem;
    width: auto;
    max-width: 200px;
    object-fit: contain;

    /* Force single color using filters */
    filter: brightness(0) saturate(100%) invert(20%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(90%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-logo-monochrome:hover {
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%);
    opacity: 1;
}

/* For SVG logos with embedded styles - force color override */
.partner-logo-normalize svg,
.partner-logo-monochrome svg {
    fill: currentColor !important;
}

.partner-logo-normalize svg *,
.partner-logo-monochrome svg * {
    fill: inherit !important;
    stroke: inherit !important;
}