/* =================================================================
   TerraVista — vlastní styly nad rámec parent themu
   Načteno přes functions.php s prioritou 100 (po Astra stylech).
   Při úpravě BUMPNI verzi v functions.php.

   Changelog:
   2026-04-29  Initial — fix nav overlap "O mně" 769-1024px
   ================================================================= */

@media (min-width: 1025px) and (max-width: 1100px) {
  .nav-links { gap: 24px !important; }
  #navbar .nav-links a:not(.nav-cta) { font-size: 0.95rem !important; }
}

@media (max-width: 1024px) {
  .hamburger {
    display: flex !important;
    z-index: 101 !important;
  }
  .nav-links {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgb(250, 247, 232) !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 40px !important;
    z-index: 99 !important;
  }
  .nav-links.open { display: flex !important; }
  .nav-links a {
    color: rgb(28, 73, 40) !important;
    font-size: 1.5rem !important;
  }
}

/* ===== TASK 3: GDPR label + error ===== */
.tv-gdpr-label,
label[for*="gdpr"],
.tv-form-gdpr label {
    text-transform: none !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
}

#tv-gdpr-error {
    display: none;
    color: #c0392b;
    font-size: 0.83rem;
    margin-top: 5px;
    width: 100%;
    font-weight: 500;
}

/* ===== TASK 4: Contact form polish ===== */

/* Submit button + GDPR on same row */
.tv-form-bottom-row,
.tv-contact-form .form-bottom-row,
.tv-contact-form > div:last-of-type {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

/* Deeper card shadow */
.tv-contact-card,
.tv-contact-form,
.contact-form-wrap,
section#contact .tv-card {
    box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 2px 12px rgba(0,0,0,0.07) !important;
}

/* Mobile: stack GDPR + button vertically */
@media (max-width: 600px) {
    .tv-form-bottom-row,
    .tv-contact-form .form-bottom-row,
    .tv-contact-form > div:last-of-type {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* ===== TASK 5: Mobile nav stability ===== */
@media (max-width: 1024px) {
    .main-header-bar-wrap,
    #masthead,
    .site-header,
    .ast-primary-header-bar {
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
        transform: translateZ(0) !important;
        will-change: auto !important;
        backface-visibility: hidden !important;
    }

    /* Prevent contact section height changes from affecting header */
    #contact,
    section[id="contact"] {
        isolation: isolate;
    }
}

/* ===== TASK 8: Certifications section ===== */
.tv-certs-section {
    padding: 80px 0;
    background: #f8f7f2;
}

.tv-certs-section .tv-section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: #1a4d2e;
    margin-bottom: 12px;
}

.tv-certs-section .tv-section-sub {
    text-align: center;
    color: #5a6b57;
    font-size: 1rem;
    margin-bottom: 0;
}

.tv-certs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.tv-cert-card {
    background: #ffffff;
    border-radius: 12px;
    border-top: 3px solid #2d6a4f;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tv-cert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.13);
}

.tv-cert-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
}

.tv-cert-body { flex: 1; }

.tv-cert-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.tv-cert-issuer {
    font-size: 0.78rem;
    color: #2d6a4f;
    font-weight: 600;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tv-cert-detail {
    font-size: 0.8rem;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.tv-cert-badge {
    display: inline-block;
    background: #eaf3ed;
    color: #2d6a4f;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

@media (max-width: 1024px) {
    .tv-certs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .tv-certs-grid { grid-template-columns: 1fr; }
    .tv-certs-section { padding: 48px 0; }
    .tv-cert-card { padding: 18px; }
}

/* ===== Base layout utilities for tv-section/tv-container ===== */
.tv-section {
    width: 100%;
}

.tv-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== CERT CARDS: logo místo emoji ===== */
.tv-cert-logo-wrap {
    height: 44px;
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.tv-cert-logo {
    max-height: 40px;
    max-width: 130px;
    width: auto;
    object-fit: contain;
    object-position: left center;
    filter: grayscale(20%);
    transition: filter 0.2s ease;
}

.tv-cert-card:hover .tv-cert-logo {
    filter: grayscale(0%);
}

/* Klikatelný název instituce */
.tv-cert-issuer a {
    color: #2d6a4f;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color 0.15s ease;
}

.tv-cert-issuer a:hover {
    color: #1b4332;
    text-decoration: underline;
}

.tv-cert-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
    flex-shrink: 0;
}

/* Odstraň starou emoji ikonu pokud zůstala */
.tv-cert-icon {
    display: none !important;
}

/* ===== CONTACT SECTION FIX ===== */
/* Odstraň všechny nadbytečné bordery na contact sekci */
section#contact,
.tv-contact-section,
#contact .tv-section-inner,
#contact > div {
    border: none !important;
    outline: none !important;
}

/* Contact card — čistý vzhled */
.tv-contact-card,
#contact .tv-card,
#contact form,
.tv-contact-form {
    border: none !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 2px 10px rgba(0,0,0,0.06) !important;
    padding: 40px !important;
}

/* Pozadí sekce */
section#contact,
.tv-contact-section {
    background: #f0ede3 !important;
    padding: 80px 0 !important;
}

@media (max-width: 768px) {
    .tv-contact-card,
    #contact .tv-card,
    #contact form,
    .tv-contact-form {
        padding: 24px !important;
    }
    section#contact,
    .tv-contact-section {
        padding: 48px 0 !important;
    }
}

/* Phone row — no card styling */
.tv-contact-phones,
.tv-contact-phone,
.tv-prefer-call,
section#contact .tv-phone-row,
section#contact > div > p:last-child,
section#contact .tv-contact-section > p {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 16px 0 0 0 !important;
}

/* Explicit override for phone row element */
div.tv-contact-phones {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Project detail — stats bar: single box with dividers */
.tv-stats {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.tv-stats__inner {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    padding: 0 !important;
    max-width: 900px !important;
    margin: 32px auto !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08) !important;
    overflow: hidden !important;
}

.tv-stat {
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 24px 20px !important;
    border-right: 1px solid #e8e4d9 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    min-width: 0 !important;
}

.tv-stat:last-child {
    border-right: none !important;
}

.tv-stat__label {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #888 !important;
    margin-bottom: 6px !important;
    order: -1 !important;
}

.tv-stat__value {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

@media (max-width: 768px) {
    .tv-stat {
        flex: 0 1 50% !important;
        border-right: none !important;
        border-bottom: 1px solid #e8e4d9 !important;
    }
    .tv-stat:last-child {
        border-bottom: none !important;
    }
}

@media (max-width: 480px) {
    .tv-stat {
        flex: 1 1 100% !important;
    }
}

/* "Pro zvědavce" — references flip card — compact design */
.tv-refs {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.tv-refs__inner {
    max-width: 900px !important;
    margin: 0 auto !important;
}

/* Flip card — dynamic height via JS */
.tv-flip-scene {
    position: relative !important;
    margin: 32px auto !important;
    max-width: 560px !important;
    perspective: 1000px !important;
    transition: height 0.45s ease !important;
    overflow: hidden !important;
}

.tv-flip-card {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    transform-style: preserve-3d !important;
    transition: transform 0.55s ease !important;
    cursor: pointer !important;
}

.tv-flip-card.is-flipped {
    transform: rotateY(180deg) !important;
}

.tv-flip-card__face {
    position: absolute !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    border-radius: 12px !important;
    min-height: 0 !important;
}

.tv-flip-card__front {
    background: #1e4d2b !important;
    border: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 0 24px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15) !important;
}

.tv-flip-front__sub,
.tv-flip-card__front span,
.tv-flip-card__front p,
.tv-flip-card__front svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.tv-flip-front__sub {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

.tv-flip-front__hint {
    display: none !important;
}

.tv-flip-card__back {
    transform: rotateY(180deg) !important;
    background: #2d6a4f !important;
    padding: 24px 28px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    box-shadow: 0 4px 20px rgba(45,106,79,0.2) !important;
}

.tv-flip-citation {
    color: #ffffff !important;
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.tv-flip-doi-btn {
    display: inline-block !important;
    background: #ffffff !important;
    color: #2d6a4f !important;
    padding: 9px 20px !important;
    border-radius: 20px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    width: fit-content !important;
    border: none !important;
    transition: background 0.2s, color 0.2s !important;
    margin-top: 4px !important;
}

.tv-flip-doi-btn:hover {
    background: #e8f4ee !important;
    color: #1b4332 !important;
}

/* No modal/overlay variants */
.tv-flip-modal,
.tv-flip-overlay,
[class*="flip-modal"],
[class*="flip-overlay"] {
    display: none !important;
}

@media (max-width: 768px) {
    .tv-flip-scene {
        max-width: 100% !important;
    }
}
