/**
 * RebyteTalk Corporate Homepage Styles
 * Editorial Magazine Design - Clean, sophisticated, content-focused
 */

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */
:root {
    /* Colors */
    --rbtt-color-white: #ffffff;
    --rbtt-color-off-white: #fafafa;
    --rbtt-color-black: #1a1a1a;
    --rbtt-color-dark-gray: #333333;
    --rbtt-color-medium-gray: #666666;
    --rbtt-color-light-gray: #e0e0e0;
    --rbtt-color-accent: #e85d04; /* Brand orange - to be adjusted based on RBTF branding */
    --rbtt-color-accent-hover: #cc4d00;
    --rbtt-color-overlay-dark: rgba(0, 0, 0, 0.5);
    --rbtt-color-overlay-light: rgba(255, 255, 255, 0.1);
    --rbtt-color-category-bg: rgba(0, 0, 0, 0.7);
    --rbtt-color-text-on-dark: #ffffff;
    --rbtt-color-text-on-light: #1a1a1a;

    /* Typography */
    --rbtt-font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rbtt-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rbtt-font-size-xs: 0.75rem;    /* 12px */
    --rbtt-font-size-sm: 0.875rem;   /* 14px */
    --rbtt-font-size-base: 1rem;     /* 16px */
    --rbtt-font-size-lg: 1.125rem;   /* 18px */
    --rbtt-font-size-xl: 1.5rem;     /* 24px */
    --rbtt-font-size-2xl: 2rem;      /* 32px */
    --rbtt-font-size-3xl: 3rem;      /* 48px */
    --rbtt-font-size-4xl: 4rem;      /* 64px */
    --rbtt-line-height-tight: 1.1;
    --rbtt-line-height-normal: 1.6;
    --rbtt-line-height-relaxed: 1.8;

    /* Spacing */
    --rbtt-space-xs: 0.25rem;  /* 4px */
    --rbtt-space-sm: 0.5rem;   /* 8px */
    --rbtt-space-md: 1rem;     /* 16px */
    --rbtt-space-lg: 1.5rem;   /* 24px */
    --rbtt-space-xl: 2rem;     /* 32px */
    --rbtt-space-2xl: 3rem;    /* 48px */
    --rbtt-space-3xl: 4rem;    /* 64px */
    --rbtt-space-4xl: 6rem;    /* 96px */

    /* Layout */
    --rbtt-container-max: 1200px;
    --rbtt-container-padding: var(--rbtt-space-xl);
    --rbtt-header-height: 80px;

    /* Transitions */
    --rbtt-transition-fast: 150ms ease;
    --rbtt-transition-normal: 300ms ease;
    --rbtt-transition-slow: 500ms ease;

    /* Shadows */
    --rbtt-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --rbtt-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --rbtt-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --rbtt-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#rbtt-homepage {
    font-family: var(--rbtt-font-body);
    font-size: var(--rbtt-font-size-base);
    line-height: var(--rbtt-line-height-normal);
    color: var(--rbtt-color-text-on-light);
    background-color: var(--rbtt-color-off-white);
    min-height: 100vh;
}

#rbtt-homepage h1,
#rbtt-homepage h2,
#rbtt-homepage h3,
#rbtt-homepage h4 {
    font-family: var(--rbtt-font-display);
    font-weight: 700;
    line-height: var(--rbtt-line-height-tight);
    color: var(--rbtt-color-text-on-light);
}

#rbtt-homepage a {
    color: inherit;
    text-decoration: none;
}

#rbtt-homepage img {
    max-width: 100%;
    height: auto;
    display: block;
}

#rbtt-homepage button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

#rbtt-homepage input {
    font-family: inherit;
    font-size: inherit;
}

/* Container Utility */
.rbtt-container {
    max-width: var(--rbtt-container-max);
    margin: 0 auto;
    padding: 0 var(--rbtt-container-padding);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.rbtt-hero {
    position: relative;
    width: 100%;
    min-height: 70vh;
    max-height: 900px;
    display: flex;
    align-items: flex-end;
    padding-bottom: var(--rbtt-space-4xl);
    overflow: hidden;
}

.rbtt-hero__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.rbtt-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 40%,
        var(--rbtt-color-overlay-dark) 100%
    );
    z-index: 1;
}

.rbtt-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--rbtt-container-max);
    margin: 0 auto;
    padding: 0 var(--rbtt-container-padding);
    color: var(--rbtt-color-text-on-dark);
}

.rbtt-hero__category {
    display: inline-block;
    font-size: var(--rbtt-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background-color: var(--rbtt-color-accent);
    color: var(--rbtt-color-white);
    padding: var(--rbtt-space-xs) var(--rbtt-space-sm);
    margin-bottom: var(--rbtt-space-md);
}

.rbtt-hero__title {
    font-size: var(--rbtt-font-size-4xl);
    font-weight: 800;
    line-height: var(--rbtt-line-height-tight);
    margin-bottom: var(--rbtt-space-md);
    max-width: 800px;
    position: relative;
}

.rbtt-hero__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--rbtt-color-accent);
    margin-top: var(--rbtt-space-sm);
}

.rbtt-hero__date {
    display: inline-block;
    font-size: var(--rbtt-font-size-sm);
    font-weight: 400;
    opacity: 0.9;
}

/* Hero Entrance Animation */
.rbtt-hero__category,
.rbtt-hero__title,
.rbtt-hero__date {
    opacity: 0;
    transform: translateY(20px);
    animation: rbtt-fade-up var(--rbtt-transition-slow) forwards;
}

.rbtt-hero__category { animation-delay: 100ms; }
.rbtt-hero__title { animation-delay: 200ms; }
.rbtt-hero__date { animation-delay: 300ms; }

@keyframes rbtt-fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Industry Section
   ========================================================================== */
.rbtt-industry {
    padding: var(--rbtt-space-4xl) 0;
    background-color: var(--rbtt-color-white);
}

.rbtt-industry__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--rbtt-space-lg);
    max-width: var(--rbtt-container-max);
    margin: 0 auto;
    padding: 0 var(--rbtt-container-padding);
}

.rbtt-industry__column {
    position: relative;
    min-height: 350px;
    border-radius: 8px;
    overflow: hidden;
}

.rbtt-industry__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform var(--rbtt-transition-slow) ease;
}

.rbtt-industry__column:hover .rbtt-industry__background {
    transform: scale(1.05);
}

.rbtt-industry__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        var(--rbtt-color-overlay-light) 0%,
        var(--rbtt-color-overlay-dark) 100%
    );
    z-index: 1;
}

.rbtt-industry__content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--rbtt-space-xl);
    color: var(--rbtt-color-text-on-dark);
}

.rbtt-industry__title {
    font-size: var(--rbtt-font-size-xl);
    font-weight: 700;
    margin-bottom: var(--rbtt-space-sm);
    line-height: 1.3;
}

.rbtt-industry__description {
    font-size: var(--rbtt-font-size-base);
    font-weight: 400;
    line-height: var(--rbtt-line-height-relaxed);
    opacity: 0.95;
    max-width: 300px;
}

/* Industry Entrance Animation */
.rbtt-industry__column {
    opacity: 0;
    transform: translateY(30px);
    animation: rbtt-fade-up var(--rbtt-transition-slow) forwards;
}

.rbtt-industry__column:nth-child(1) { animation-delay: 400ms; }
.rbtt-industry__column:nth-child(2) { animation-delay: 500ms; }
.rbtt-industry__column:nth-child(3) { animation-delay: 600ms; }

/* ==========================================================================
   Posts Grid Section
   ========================================================================== */
.rbtt-posts {
    padding: var(--rbtt-space-4xl) 0;
    background-color: var(--rbtt-color-off-white);
}

.rbtt-posts__container {
    max-width: var(--rbtt-container-max);
    margin: 0 auto;
    padding: 0 var(--rbtt-container-padding);
}

.rbtt-posts__title {
    font-size: var(--rbtt-font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--rbtt-space-2xl);
    text-align: left;
}

.rbtt-posts__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--rbtt-space-lg);
}

.rbtt-posts__card {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: transform var(--rbtt-transition-normal) ease, box-shadow var(--rbtt-transition-normal) ease;
}

.rbtt-posts__card:hover {
    transform: translateY(-8px);
    box-shadow: var(--rbtt-shadow-xl);
}

.rbtt-posts__card__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform var(--rbtt-transition-slow) ease;
}

.rbtt-posts__card:hover .rbtt-posts__card__background {
    transform: scale(1.05);
}

.rbtt-posts__card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 50%,
        var(--rbtt-color-overlay-dark) 100%
    );
    z-index: 1;
}

.rbtt-posts__card__content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--rbtt-space-lg);
    color: var(--rbtt-color-text-on-dark);
}

.rbtt-posts__card__category {
    display: inline-block;
    font-size: var(--rbtt-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--rbtt-color-accent);
    color: var(--rbtt-color-white);
    padding: var(--rbtt-space-xs) var(--rbtt-space-sm);
    margin-bottom: var(--rbtt-space-md);
    align-self: flex-start;
}

.rbtt-posts__card__title {
    font-size: var(--rbtt-font-size-lg);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--rbtt-space-md);
}

.rbtt-posts__card__time {
    display: inline-block;
    font-size: var(--rbtt-font-size-xs);
    font-weight: 400;
    opacity: 0.8;
    align-self: flex-start;
}

/* Card link - covers entire card for full clickable area */
.rbtt-posts__card__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Posts Grid Entrance Animation */
.rbtt-posts__card {
    opacity: 0;
    transform: translateY(20px);
    animation: rbtt-fade-up var(--rbtt-transition-normal) forwards;
}

.rbtt-posts__card:nth-child(1) { animation-delay: 100ms; }
.rbtt-posts__card:nth-child(2) { animation-delay: 150ms; }
.rbtt-posts__card:nth-child(3) { animation-delay: 200ms; }
.rbtt-posts__card:nth-child(4) { animation-delay: 250ms; }
.rbtt-posts__card:nth-child(5) { animation-delay: 300ms; }
.rbtt-posts__card:nth-child(6) { animation-delay: 350ms; }

/* ==========================================================================
   Newsletter Section
   ========================================================================== */
.rbtt-newsletter {
    padding: var(--rbtt-space-3xl) 0;
    background-color: var(--rbtt-color-white);
    border-top: 1px solid var(--rbtt-color-light-gray);
}

.rbtt-newsletter__container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 var(--rbtt-container-padding);
}

.rbtt-newsletter__content {
    display: flex;
    flex-direction: column;
    gap: var(--rbtt-space-md);
}

.rbtt-newsletter__input {
    width: 100%;
    padding: var(--rbtt-space-md) var(--rbtt-space-lg);
    font-size: var(--rbtt-font-size-base);
    color: var(--rbtt-color-dark-gray);
    background-color: var(--rbtt-color-off-white);
    border: 1px solid var(--rbtt-color-light-gray);
    border-radius: 4px;
    transition: border-color var(--rbtt-transition-fast), box-shadow var(--rbtt-transition-fast);
}

.rbtt-newsletter__input::placeholder {
    color: var(--rbtt-color-medium-gray);
}

.rbtt-newsletter__input:focus {
    outline: none;
    border-color: var(--rbtt-color-accent);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}

.rbtt-newsletter__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--rbtt-space-md) var(--rbtt-space-lg);
    font-size: var(--rbtt-font-size-lg);
    font-weight: 600;
    color: var(--rbtt-color-white);
    background-color: var(--rbtt-color-accent);
    border-radius: 4px;
    transition: background-color var(--rbtt-transition-fast), opacity var(--rbtt-transition-fast);
}

.rbtt-newsletter__button:hover {
    background-color: var(--rbtt-color-accent-hover);
}

.rbtt-newsletter__button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.3);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet: 768px - 1024px */
@media (min-width: 768px) {
    :root {
        --rbtt-font-size-4xl: 5rem; /* 80px */
    }

    .rbtt-industry__container {
        grid-template-columns: repeat(2, 1fr);
    }

    .rbtt-industry__column:nth-child(3) {
        grid-column: span 2;
        min-height: 400px;
    }

    .rbtt-posts__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rbtt-newsletter__content {
        flex-direction: row;
        align-items: center;
    }

    .rbtt-newsletter__input {
        flex: 1;
        max-width: 350px;
    }

    .rbtt-newsletter__button {
        width: auto;
        min-width: 120px;
        padding: var(--rbtt-space-md) var(--rbtt-space-xl);
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    :root {
        --rbtt-font-size-4xl: 6rem; /* 96px */
    }

    .rbtt-hero {
        min-height: 80vh;
        padding-bottom: var(--rbtt-space-4xl);
    }

    .rbtt-industry__container {
        grid-template-columns: repeat(3, 1fr);
    }

    .rbtt-industry__column {
        min-height: 400px;
    }

    .rbtt-industry__column:nth-child(3) {
        grid-column: auto;
    }

    .rbtt-posts__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .rbtt-posts__card {
        aspect-ratio: 3 / 4;
    }
}

/* Large Desktop: 1440px+ */
@media (min-width: 1440px) {
    .rbtt-hero {
        min-height: 90vh;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .rbtt-hero,
    .rbtt-industry,
    .rbtt-newsletter {
        break-inside: avoid;
    }

    .rbtt-posts__card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}