/**
 * startup.ph — custom.css
 * Supplementary CSS for component-level styles not in style.css.
 * Loaded after Tailwind and style.css via wp_enqueue_style.
 *
 * This file handles:
 * - Single CPT profile page layouts (startup, investor, event, job)
 * - PWA offline page polish
 * - Print styles
 * - Utility overrides for Tailwind conflicts
 * - Animation keyframes
 */

/* ============================================================
   PROFILE PAGE LAYOUTS — startup, investor, event, job
   ============================================================ */

/* Profile Hero — full-width section above the fold */
.startup-profile-hero,
.investor-profile-hero,
.event-hero,
.job-hero {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-card);
    padding: 48px 0 40px;
}

/* Hero inner: logo/photo + meta — stacked on mobile, row on tablet and above */
.profile-hero-inner,
.investor-hero-inner,
.event-hero-inner,
.job-hero-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

@media (min-width: 769px) {
    .profile-hero-inner,
    .investor-hero-inner,
    .event-hero-inner,
    .job-hero-inner {
        flex-direction: row;
        gap: 40px;
    }
}

/* Logo / Photo wrap */
.profile-logo-wrap,
.investor-photo-wrap,
.job-company-logo {
    flex-shrink: 0;
}

.profile-logo-img,
.investor-photo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border-card);
    background: var(--bg-primary);
    padding: 8px;
}

/* Monogram fallbacks — shown when no logo/photo uploaded */
.profile-logo-monogram,
.investor-monogram,
.founder-monogram,
.job-logo-monogram {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1D4ED8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: white;
    font-family: var(--font-heading);
    letter-spacing: -1px;
    flex-shrink: 0;
}

.founder-monogram {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    font-size: 20px;
}

.job-logo-monogram {
    width: 80px;
    height: 80px;
    font-size: 24px;
}

/* Company/investor name row with verified badge */
.profile-name-row,
.investor-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.profile-company-name,
.investor-name-row h1 {
    font-family: var(--font-heading);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.1;
}

.profile-tagline,
.investor-firm {
    color: var(--text-secondary);
    font-size: 18px;
    margin: 4px 0 16px;
    line-height: 1.4;
}

/* Tag strip: industry, stage, location, etc. */
.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

/* CTA row below tags */
.profile-ctas {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Social icon row in hero */
.profile-social-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.social-icon-link {
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.social-icon-link:hover {
    color: var(--accent-blue);
}

/* ============================================================
   PROFILE BODY — Two-column layout: main + sidebar
   ============================================================ */

.profile-body {
    padding: 48px 0 80px;
}

/* Profile grid: single column on mobile, two-column on large screens */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: start;
}

/* Sidebar above content on mobile */
.profile-sidebar {
    order: -1;
}

@media (min-width: 1025px) {
    .profile-grid {
        grid-template-columns: 1fr 340px;
    }

    .profile-sidebar {
        order: 0; /* Restore natural order on large screens */
    }
}

/* Profile section — each content block */
.profile-section {
    margin-bottom: 48px;
}

.profile-section h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-card);
}

.profile-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 16px;
}

.profile-content p {
    margin-bottom: 16px;
}

/* Investment thesis — distinct styling */
.profile-thesis {
    background: var(--bg-card);
    border-left: 3px solid var(--accent-blue);
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
}

/* Traction section — green accent */
.profile-traction {
    background: #10B98108;
    border-left: 3px solid var(--accent-green);
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
}

/* ============================================================
   SIDEBAR CARDS
   ============================================================ */

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 120px; /* Below fixed header */
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 24px;
}

.sidebar-card h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Funding card — green accent */
.sidebar-card-funding {
    border-color: var(--accent-green);
    border-opacity: 0.3;
}

.funding-amount-display {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--accent-green);
    line-height: 1;
    margin-bottom: 4px;
}

.funding-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.investors-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.investors-names {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Contact card */
.sidebar-card-contact {
    border-color: rgba(59, 130, 246, 0.3);
}

.contact-note {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Quick facts list */
.quick-facts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-facts-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-card);
    gap: 12px;
}

.quick-facts-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fact-label {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.fact-value {
    font-size: 13px;
    color: var(--text-primary);
    text-align: right;
    font-weight: 500;
}

/* Sub-labels inside sidebar cards */
.sidebar-sub-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 16px 0 8px;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Share buttons — stacked in sidebar */
.share-buttons-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-btn {
    display: block;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity 0.2s;
    width: 100%;
}

.share-btn:hover {
    opacity: 0.85;
}

.share-linkedin {
    background: #0A66C2;
    color: white;
}

.share-twitter {
    background: #000000;
    color: white;
}

.share-copy {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
}

/* Back button */
.back-btn {
    text-align: center;
    font-size: 14px;
}

/* CTA sidebar card */
.sidebar-cta-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.sidebar-cta-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================================
   FOUNDERS GRID
   ============================================================ */

.founders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.founder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: border-color 0.2s;
}

.founder-card:hover {
    border-color: var(--accent-blue);
}

.founder-photo img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-card);
    flex-shrink: 0;
}

.founder-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.founder-title {
    font-size: 13px;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.founder-bio {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.founder-linkedin {
    font-size: 12px;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.founder-linkedin:hover {
    text-decoration: underline;
}

/* ============================================================
   SCREENSHOTS GALLERY
   ============================================================ */

.screenshots-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.screenshot-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    transition: border-color 0.2s;
    display: block;
}

.screenshot-item:hover {
    border-color: var(--accent-blue);
}

.screenshot-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

/* ============================================================
   VIDEO EMBED
   ============================================================ */

.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-card);
}

.video-embed-wrap iframe,
.video-embed-wrap object,
.video-embed-wrap embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================================
   EVENT PAGE SPECIFICS
   ============================================================ */

.event-banner {
    height: 280px;
    overflow: hidden;
}

.event-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-date-widget-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--accent-blue);
    color: white;
    border-radius: 12px;
    padding: 20px 28px;
    min-width: 90px;
    flex-shrink: 0;
    text-align: center;
}

.event-date-widget-large .event-month {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.event-date-widget-large .event-day {
    font-size: 48px;
    font-weight: 700;
    font-family: var(--font-heading);
    line-height: 1;
    margin-top: 4px;
}

.event-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.event-organizer-line {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 16px;
}

/* Event detail strip: date, venue, platform, attendance */
.event-detail-strip {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-detail-strip li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 15px;
}

.event-detail-strip svg {
    flex-shrink: 0;
    color: var(--accent-blue);
}

.map-link {
    color: var(--accent-blue);
    text-decoration: none;
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
}

.map-link:hover {
    text-decoration: underline;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

/* Event description page section */
.event-description-wrap {
    padding: 48px 0 80px;
}

.event-description-inner {
    max-width: 740px;
}

.event-description-inner h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-card);
}

.event-description-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 32px;
}

.event-description-content p {
    margin-bottom: 16px;
}

.event-cta-bottom {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ============================================================
   JOB PAGE SPECIFICS
   ============================================================ */

.job-hero {
    padding: 40px 0;
}

.job-hero-inner {
    align-items: center;
}

.job-company-logo {
    flex-shrink: 0;
}

.job-company-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border-card);
    background: var(--bg-primary);
    padding: 6px;
}

.job-hero-meta h1 {
    font-family: var(--font-heading);
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.1;
}

.job-company-line {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.job-company-name-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.job-company-name-link:hover {
    text-decoration: underline;
}

.job-company-name-text {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Meta strip: salary, posted date, deadline */
.job-meta-strip {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.job-apply-ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Skills tag group on single job page */
.skills-tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-skill {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.25);
    font-size: 13px;
}

/* Job description content */
.job-description {
    line-height: 1.8;
}

.job-description ul,
.job-description ol {
    padding-left: 20px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.job-description li {
    margin-bottom: 6px;
}

/* Bottom apply CTA */
.job-apply-bottom {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-card);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Sidebar company logo */
.sidebar-company-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border-card);
    padding: 4px;
    display: block;
    margin-bottom: 12px;
}

.sidebar-company-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 4px;
}

.sidebar-company-stage {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ============================================================
   RELATED SECTION — Below profiles
   ============================================================ */

.related-section {
    padding: 48px 0 80px;
    border-top: 1px solid var(--border-card);
    background: var(--bg-card);
}

.related-section .section-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
}

/* ============================================================
   VERIFIED BADGE
   ============================================================ */

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--accent-blue);
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 20px;
    padding: 3px 10px;
}

/* ============================================================
   SUCCESS / ACTIVE BADGE
   ============================================================ */

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 600;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    /* Hide non-essential UI for printing */
    header,
    footer,
    .ticker-wrap,
    .profile-sidebar,
    .event-cta-bottom,
    .job-apply-ctas,
    .job-apply-bottom,
    .share-buttons-col,
    .back-btn,
    .related-section,
    nav.breadcrumb-nav {
        display: none !important;
    }

    body {
        background: white !important;
        color: #000 !important;
        font-size: 12pt;
    }

    .profile-body,
    .event-description-wrap {
        padding: 0 !important;
    }

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

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* ============================================================
   ANIMATION KEYFRAMES
   Used by animations.js IntersectionObserver.
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Initial state for scroll-animated elements */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Animated state — added by IntersectionObserver in animations.js */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for grid children */
.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.animate-on-scroll:nth-child(5) { transition-delay: 320ms; }
.animate-on-scroll:nth-child(6) { transition-delay: 400ms; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
