﻿/* SMO Excabec – custom styles */

html {
    scroll-behavior: smooth;
}

/* Responsive typographic scale
   Stronger scaling so large screens increase type to ~1.5x or more.
   Base 16px -> md 18px -> lg 20px -> xl 22px -> 2xl 24px (≈1.5x).
   Tailwind utilities using rem will scale proportionally.
*/
:root { font-size: 16px; }

@media (min-width: 768px) { /* md */
    :root { font-size: 18px; }
}

@media (min-width: 1024px) { /* lg */
    :root { font-size: 20px; }
}

@media (min-width: 1280px) { /* xl */
    :root { font-size: 22px; }
}

@media (min-width: 1536px) { /* 2xl */
    :root { font-size: 24px; }
}

:target {
    scroll-margin-top: 4rem;
}

/* Headings use Roboto (serif) and body uses Roboto */
h1, h2, h3, h4 {
    font-family: 'Roboto', Georgia, serif;
    letter-spacing: -0.01em;
}

/* Prevent headings from showing a selection highlight (mobile browsers sometimes
   auto-select the first heading when navigating to an anchor). This removes the
   white box that appears around the h1 on some devices. */
h1 {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

h1:focus {
    outline: none;
}

h1::selection {
    background: transparent;
    color: inherit;
}

body {
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

/* ?? Blazor validation ??????????????????????????????????? */
.validation-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid #10b981;
}

.invalid {
    outline: 2px solid #ef4444;
}

/* ?? Navbar: white with shadow on scroll */
#mainNav {
    transition: box-shadow 0.3s ease;
}

#mainNav.nav-top {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06) !important;
}

#mainNav.nav-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09) !important;
}

/* ?? Hero entrance animations ???????????????????????????? */
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(1.75rem); }
    to   { opacity: 1; transform: none; }
}

.hero-animate {
    opacity: 0;
    animation: heroFadeUp 0.85s ease forwards;
}

.hero-delay-1 { animation-delay: 0.1s;  }
.hero-delay-2 { animation-delay: 0.25s; }
.hero-delay-3 { animation-delay: 0.4s;  }
.hero-delay-4 { animation-delay: 0.58s; }
.hero-delay-5 { animation-delay: 0.76s; }

/* ?? Bouncing scroll-indicator arrow ????????????????????? */
@keyframes bounceY {
    0%, 100% { transform: translateX(-50%) translateY(0);    }
    50%       { transform: translateX(-50%) translateY(10px); }
}

.bounce-arrow {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounceY 2s ease-in-out infinite;
}

/* ?? Scroll-reveal ??????????????????????????????????????? */
.reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-1.75rem);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right {
    opacity: 0;
    transform: translateX(1.75rem);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible,
.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    transform: none;
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.18s; }
.reveal-delay-3 { transition-delay: 0.28s; }
.reveal-delay-4 { transition-delay: 0.38s; }
.reveal-delay-5 { transition-delay: 0.48s; }

/* ?? Back-to-top button ?????????????????????????????????? */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transform: translateY(1rem);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ?? Dot-grid background for alternate sections */
.bg-dot-pattern {
    background-image: radial-gradient(circle, rgba(31, 111, 92, 0.07) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
}

/* ?? Testimonial card micro-interactions */
.testimonial-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -8px rgba(31, 111, 92, 0.15);
}

/* Values cards */
.value-card {
    border: 1px solid rgba(15, 82, 64, 0.06);
}

.value-card .rounded-lg i {
    line-height: 1;
}

/* ?? Active nav link indicator */
#mainNav a.nav-active {
    color: #1F6F5C !important;
    opacity: 1 !important;
    text-decoration-line: underline;
    text-decoration-color: #1F6F5C;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

/* Keep button-style nav links readable when they become "nav-active".
   The primary contact button uses a brand background with white text; when
   nav-active is applied we must preserve white text so it doesn't become
   the same color as the background and disappear. */
#mainNav a.bg-brand.nav-active,
#mainNav a.bg-brand.nav-active:hover,
#mainNav a.bg-brand.nav-active:focus {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Logo should never have an underline */
.logo {
    text-decoration: none !important;
}

/* If logo is inside the nav, ensure it doesn't inherit nav-active underline */
#mainNav .logo.nav-active {
    text-decoration: none !important;
}

/* Icon square helper: fixed-size square containers for bootstrap icons.
   Uses pixel sizes so icons don't scale with the responsive root font-size.
*/
.icon-square {
    display: inline-flex;
    width: 56px; /* a bit larger */
    height: 56px; /* a bit larger */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0; /* perfectly square corners */
    font-size: 20px; /* slightly larger fixed icon size */
    position: relative; /* allow absolute centering of children to avoid baseline offsets */
}

.icon-square svg {
    line-height: 1;
    width: 28px;
    height: 28px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Bootstrap Icons (font) use pseudo-elements (::before). Center those pseudo-elements
   absolutely so font-metric baselines don't introduce offsets. */
.icon-square i {
    position: relative; /* anchor for the pseudo-element */
    display: inline-block;
    line-height: 1;
    font-size: 28px; /* glyph size */
}

.icon-square i::before,
.icon-square i::after {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE FIXES - PREVENT SECTION OVERLAP
   ═══════════════════════════════════════════════════════════ */

/* Fix for ABOUT and SERVICES sections on mobile/tablet
   These sections use min-h-screen and lg:h-screen which can cause content overflow
   and overlap when viewport height is insufficient for the content */

/* Fix 1: Mobile/tablet (narrow screens) */
@media (max-width: 1023px) {
    #apropos, 
    #services {
        min-height: auto !important;
        height: auto !important;
    }

    #apropos > div > div.grid,
    #services > div > div.grid {
        min-height: auto !important;
        height: auto !important;
    }

    #apropos .flex.flex-col.justify-center,
    #services .flex.flex-col.justify-center {
        min-height: auto !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    #apropos .reveal-right,
    #services .reveal-right,
    #apropos .reveal-left,
    #services .reveal-left {
        min-height: 300px;
    }
}

/* Fix 2: Wide but short screens (landscape tablets, short browser windows)
   When screen is wide enough for lg breakpoint but too short for content */
@media (min-width: 1024px) and (max-height: 900px) {
    #apropos, 
    #services {
        height: auto !important;
        min-height: 100vh;
    }

    #apropos > div,
    #services > div {
        height: auto !important;
    }

    #apropos > div > div.grid,
    #services > div > div.grid {
        height: auto !important;
        min-height: 100vh;
    }

    #apropos .flex.flex-col,
    #services .flex.flex-col {
        height: auto !important;
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

/* Fix 3: Very short screens (any width) */
@media (max-height: 700px) {
    #apropos,
    #services {
        height: auto !important;
        min-height: auto !important;
    }

    #apropos > div,
    #services > div,
    #apropos > div > div.grid,
    #services > div > div.grid {
        height: auto !important;
        min-height: auto !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   BLAZOR WEBASSEMBLY LOADING & ERROR UI
   ═══════════════════════════════════════════════════════════ */

/* Ensure footer credits are not visually overlapped by the fixed Back-to-top button.
   Make the credits layer sit above the fixed button and add a small safe-area padding
   on narrow viewports so the button never covers the text. */
.footer-credits {
    position: relative; /* establish stacking context */
    z-index: 60;        /* above #backToTop (z-index:50) */
}

@media (max-width: 768px) {
    footer {
        padding-bottom: 3.5rem; /* create space so back-to-top doesn't cover footer content */
    }
}

/* Loading screen shown while Blazor WebAssembly initializes */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #061a13 0%, #0d2e25 50%, #1F6F5C 100%);
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-screen p {
    font-size: 1.125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

/* Blazor error UI */
#blazor-error-ui {
    background: #ef4444;
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    padding: 0 0.5rem;
    font-size: 1.25rem;
}
