/* =========================================================================
   Hi-Tec Industrial Automation — Dedicated Video Gallery Stylesheet
   Prefix: .htv-* (Hi-Tec Videos)
   Isolated, conflict-free styles for Squarespace embed and standalone pages.
   ========================================================================= */

:root {
    --htv-navy: #1a2b4c;
    --htv-navy-dark: #0f1d33;
    --htv-accent: #f2500d;
    --htv-accent-hover: #d94206;
    --htv-ink: #0f172a;
    --htv-text: #475569;
    --htv-muted: #64748b;
    --htv-line: #e2e8f0;
    --htv-bg-light: #f8fafc;
    --htv-card-bg: #ffffff;
    --htv-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --htv-shadow-hover: 0 20px 35px -8px rgba(15, 23, 42, 0.16), 0 8px 12px -4px rgba(15, 23, 42, 0.08);
    --htv-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base reset for all htv components to prevent Squarespace layout bleed */
.htv-section,
.htv-section * {
    box-sizing: border-box !important;
}

/* Section wrapper */
.htv-section {
    position: relative;
    padding: 70px 0 90px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    width: 100%;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--htv-text);
}

.htv-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header section */
.htv-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 52px;
}

.htv-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(242, 80, 13, 0.08);
    border: 1px solid rgba(242, 80, 13, 0.2);
    color: var(--htv-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
    line-height: 1;
}

.htv-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--htv-accent);
    box-shadow: 0 0 0 4px rgba(242, 80, 13, 0.18);
}

.htv-title {
    font-size: clamp(24px, 3.2vw, 40px);
    font-weight: 800;
    color: var(--htv-navy);
    line-height: 1.25;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}

.htv-title span {
    color: var(--htv-accent);
}

.htv-desc {
    font-size: 15.5px;
    color: var(--htv-muted);
    line-height: 1.7;
    margin: 0;
}

/* Grid */
.htv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
}

/* Card */
.htv-card {
    background: var(--htv-card-bg);
    border: 1px solid var(--htv-line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--htv-shadow);
    transition: transform 0.35s var(--htv-ease), box-shadow 0.35s var(--htv-ease), border-color 0.35s ease;
    display: flex;
    flex-direction: column;
}

.htv-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--htv-shadow-hover);
    border-color: rgba(242, 80, 13, 0.3);
}

/* Frame (Video container) */
.htv-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0f1d;
    overflow: hidden;
    cursor: pointer;
    display: block;
}

.htv-thumb {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--htv-ease), filter 0.4s ease;
    z-index: 1;
}

.htv-frame:hover .htv-thumb {
    transform: scale(1.05);
}

.htv-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.65) 100%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Play Button */
.htv-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--htv-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(242, 80, 13, 0.45);
    z-index: 3;
    pointer-events: none;
    transition: transform 0.3s var(--htv-ease), background 0.25s ease, box-shadow 0.3s ease;
}

.htv-play-btn svg {
    width: 26px;
    height: 26px;
    fill: #ffffff;
    margin-left: 3px;
    transition: transform 0.25s ease;
}

.htv-frame:hover .htv-play-btn {
    transform: translate(-50%, -50%) scale(1.12);
    background: var(--htv-accent-hover);
    box-shadow: 0 12px 30px rgba(242, 80, 13, 0.6);
}

/* Duration / Action Badge */
.htv-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    z-index: 3;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* HTML5 Video element inside frame */
.htv-video {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
    z-index: 4;
    background: #000000;
}

/* When playing: hide poster, overlay, play-btn, badge */
.htv-frame.htv-playing .htv-thumb,
.htv-frame.htv-playing .htv-overlay,
.htv-frame.htv-playing .htv-play-btn,
.htv-frame.htv-playing .htv-badge {
    display: none !important;
}

/* Card Body */
.htv-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.htv-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--htv-navy);
    line-height: 1.4;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.htv-card-desc {
    font-size: 0.92rem;
    color: var(--htv-text);
    line-height: 1.65;
    margin: 0 0 18px;
    flex-grow: 1;
}

/* Tags */
.htv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.htv-tag {
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    background: rgba(242, 80, 13, 0.08);
    color: var(--htv-accent);
    border-radius: 20px;
    border: 1px solid rgba(242, 80, 13, 0.16);
    line-height: 1;
}

/* Empty state */
.htv-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--htv-muted);
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .htv-section {
        padding: 50px 0 70px;
    }
    .htv-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .htv-play-btn {
        width: 58px;
        height: 58px;
    }
    .htv-play-btn svg {
        width: 22px;
        height: 22px;
    }
    .htv-body {
        padding: 20px;
    }
}