/**
 * TC Advertorials - Frontend Styles
 * Compatible with tctheme design system (CSS variables, Bootstrap grid)
 */

/* ── Advertorial Label (legally required, not hideable) ────────── */
.tc-adv-label {
    display: inline-block;
    background: rgba(255, 193, 7, 0.18);
    color: #8a6d00;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    line-height: 1.4;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    pointer-events: none;
}

/* ── Section Header ────────────────────────────────────────────── */
.tc-adv-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.tc-adv-section-title {
    font-size: var(--font-size-xl, 1.25rem);
    font-weight: 700;
    color: var(--gray-800, #1f2937);
    margin: 0;
}

.tc-adv-section-label {
    display: inline-block;
    background: rgba(255, 193, 7, 0.18);
    color: #8a6d00;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

/* ── Card Component ────────────────────────────────────────────── */
.tc-adv-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-xl, 1rem);
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
    transition: all var(--transition-base, 250ms) cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tc-adv-card:hover {
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1));
    transform: translateY(-2px);
}

.tc-adv-card__image-link {
    display: block;
    text-decoration: none;
}

.tc-adv-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.tc-adv-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base, 250ms);
}

.tc-adv-card:hover .tc-adv-card__image img {
    transform: scale(1.03);
}

.tc-adv-card__body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tc-adv-card__title {
    font-size: var(--font-size-base, 1rem);
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.5rem;
    color: var(--gray-800, #1f2937);
}

.tc-adv-card__title a {
    color: inherit;
    text-decoration: none;
}

.tc-adv-card__title a:hover {
    color: var(--primary, #16518F);
}

.tc-adv-card__excerpt {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--gray-500, #6b7280);
    line-height: 1.6;
    margin: 0 0 1rem;
    flex: 1;
}

.tc-adv-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

.tc-adv-card__footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    background: var(--gray-50, #f9fafb);
}

.tc-adv-card__advertiser {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

.tc-adv-card__logo {
    border-radius: 4px;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tc-adv-card__advertiser-name {
    font-weight: 500;
}

/* ── Compact Card Variant (sidebar) ────────────────────────────── */
.tc-adv-card--compact .tc-adv-card__image {
    aspect-ratio: 3 / 2;
}

.tc-adv-card--compact .tc-adv-card__body {
    padding: 1rem;
}

.tc-adv-card--compact .tc-adv-card__title {
    font-size: var(--font-size-sm, 0.875rem);
}

.tc-adv-card--compact .tc-adv-card__excerpt {
    font-size: 0.8rem;
}

/* ── Homepage Section (shared) ─────────────────────────────────── */
.tc-adv-homepage-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

/* ── Layout 1: Cards Grid (default, no extra styles needed) ───── */

/* ── Layout 2: Hero Banner ────────────────────────────────────── */
.tc-adv-layout-hero-banner {
    padding: 0;
    background: none;
}

.tc-adv-hero-bg {
    min-height: 420px;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-dark, #0f3a65);
    position: relative;
}

.tc-adv-hero-overlay {
    min-height: 420px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(15,58,101,0.88) 0%, rgba(22,81,143,0.75) 100%);
    padding: 3rem 0;
}

.tc-adv-hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 1rem;
    max-width: 700px;
    line-height: 1.2;
}

.tc-adv-hero-excerpt {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    max-width: 600px;
    line-height: 1.7;
    margin: 0 0 1rem;
}

.tc-adv-hero-sponsor {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.65);
    margin: 0 0 1.5rem;
}

/* ── Layout 3: Minimal ────────────────────────────────────────── */
.tc-adv-layout-minimal {
    background: #fff;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.tc-adv-minimal-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tc-adv-minimal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    border-left: 4px solid var(--primary, #16518F);
    padding-left: 1.25rem;
}

.tc-adv-minimal-item:last-child {
    border-bottom: none;
}

.tc-adv-minimal-item__content {
    flex: 1;
}

.tc-adv-minimal-item__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: var(--gray-800, #1f2937);
}

.tc-adv-minimal-item__title a {
    color: inherit;
    text-decoration: none;
}

.tc-adv-minimal-item__title a:hover {
    color: var(--primary, #16518F);
}

.tc-adv-minimal-item__excerpt {
    font-size: 0.875rem;
    color: var(--gray-500, #6b7280);
    margin: 0 0 0.25rem;
    line-height: 1.5;
}

.tc-adv-minimal-item__sponsor {
    font-size: 0.75rem;
    color: var(--gray-400, #9ca3af);
}

.tc-adv-minimal-item__action {
    flex-shrink: 0;
}

/* ── Layout 4: Magazine ───────────────────────────────────────── */
.tc-adv-layout-magazine .tc-adv-card {
    height: 100%;
}

.tc-adv-layout-magazine .col-lg-5 .tc-adv-card__image {
    aspect-ratio: 2 / 1;
}

/* ── Layout 5: Slider ─────────────────────────────────────────── */
.tc-adv-slider-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300, #d1d5db) transparent;
}

.tc-adv-slider-track::-webkit-scrollbar {
    height: 6px;
}

.tc-adv-slider-track::-webkit-scrollbar-thumb {
    background: var(--gray-300, #d1d5db);
    border-radius: 3px;
}

.tc-adv-slider-slide {
    flex: 0 0 320px;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .tc-adv-slider-slide {
        flex: 0 0 360px;
    }
}

/* ── Layout 6: Spotlight ──────────────────────────────────────── */
.tc-adv-layout-spotlight {
    padding: 4rem 0;
}

.tc-adv-spotlight {
    text-align: left;
}

.tc-adv-spotlight__image img {
    border-radius: var(--radius-xl, 1rem);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1));
    transition: transform var(--transition-base, 250ms);
}

.tc-adv-spotlight__image img:hover {
    transform: scale(1.02);
}

.tc-adv-spotlight__title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 1rem;
    color: var(--gray-800, #1f2937);
}

.tc-adv-spotlight__title a {
    color: inherit;
    text-decoration: none;
}

.tc-adv-spotlight__title a:hover {
    color: var(--primary, #16518F);
}

.tc-adv-spotlight__excerpt {
    font-size: 1.05rem;
    color: var(--gray-500, #6b7280);
    line-height: 1.7;
    margin: 0 0 1rem;
}

.tc-adv-spotlight__sponsor {
    font-size: 0.85rem;
    color: var(--gray-400, #9ca3af);
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* ── Responsive for layouts ───────────────────────────────────── */
@media (max-width: 991.98px) {
    .tc-adv-hero-title { font-size: 1.75rem; }
    .tc-adv-hero-bg, .tc-adv-hero-overlay { min-height: 340px; }
    .tc-adv-spotlight__title { font-size: 1.4rem; }
}

@media (max-width: 767.98px) {
    .tc-adv-minimal-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .tc-adv-hero-title { font-size: 1.5rem; }
    .tc-adv-hero-bg, .tc-adv-hero-overlay { min-height: 280px; }
}

/* ── In-Feed Wrapper ───────────────────────────────────────────── */
.tc-adv-infeed-wrapper {
    border: none !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
}

.tc-adv-infeed-wrapper .tc-adv-card {
    border-radius: var(--radius-lg, 0.75rem);
}

/* ── Inline Banner (In-Content) ────────────────────────────────── */
.tc-adv-inline-banner {
    position: relative;
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    border-left: 4px solid var(--primary, #16518F);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    overflow: hidden;
}

.tc-adv-inline-banner .tc-adv-label {
    top: 0.5rem;
    right: 0.75rem;
}

.tc-adv-inline-banner__content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tc-adv-inline-banner__logo {
    flex-shrink: 0;
}

.tc-adv-inline-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
}

.tc-adv-inline-banner__text {
    flex: 1;
    min-width: 200px;
}

.tc-adv-inline-banner__title {
    font-size: var(--font-size-base, 1rem);
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--gray-800, #1f2937);
}

.tc-adv-inline-banner__title a {
    color: inherit;
    text-decoration: none;
}

.tc-adv-inline-banner__title a:hover {
    color: var(--primary, #16518F);
}

.tc-adv-inline-banner__advertiser {
    font-size: 0.8rem;
    color: var(--gray-500, #6b7280);
}

.tc-adv-inline-banner__cta {
    flex-shrink: 0;
}

/* ── Under-Article Section ─────────────────────────────────────── */
.tc-adv-under-article {
    margin: 2.5rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--gray-200, #e5e7eb);
}

.tc-adv-under-article__title {
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: 700;
    color: var(--gray-800, #1f2937);
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════════
   HERO VARIANTS (10 styles for single advertorial)
   ═════════════════════════════════════════════════════════════════ */

/* ── Shared hero base ─────────────────────────────────────────── */
.tc-adv-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
}

.tc-adv-hero h1 {
    font-size: var(--font-size-4xl, 2.25rem);
    font-weight: 700;
    line-height: var(--line-height-tight, 1.2);
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
    margin: 0 0 1rem;
}

.tc-adv-hero .hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4, 1rem);
    font-size: var(--font-size-sm, 0.875rem);
    opacity: 0.9;
}

.tc-adv-hero .hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
}

.tc-adv-hero-sponsor-tag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tc-adv-hero-sponsor-name {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ── 1. Default: uses theme's .hero-single (no custom styles) ─── */

/* ── 2. Fullwidth Background ─────────────────────────────────── */
.tc-adv-hero--fullwidth-bg {
    min-height: 450px;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-dark, #0f3a65);
}

.tc-adv-hero--fullwidth-bg .tc-adv-hero__overlay {
    min-height: 450px;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.7) 100%);
    padding: 3rem 0;
}

/* ── 3/4. Split Layout ────────────────────────────────────────── */
.tc-adv-hero--split {
    display: flex;
    min-height: 400px;
}

.tc-adv-hero__image-half {
    flex: 1;
    background-size: cover;
    background-position: center;
    min-height: 400px;
}

.tc-adv-hero__text-half {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-dark, #0f3a65) 0%, var(--primary, #16518F) 100%);
    display: flex;
    align-items: center;
}

.tc-adv-hero__text-inner {
    padding: 3rem 2.5rem;
    max-width: 600px;
}

.tc-adv-hero--split-reverse {
    flex-direction: row;
}

/* ── 5. Parallax ──────────────────────────────────────────────── */
.tc-adv-hero--parallax {
    min-height: 480px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: var(--primary-dark, #0f3a65);
}

.tc-adv-hero--parallax .tc-adv-hero__overlay {
    min-height: 480px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(15,58,101,0.8) 0%, rgba(22,81,143,0.65) 100%);
    padding: 3rem 0;
}

/* ── 6. Centered Card ─────────────────────────────────────────── */
.tc-adv-hero--centered-card {
    background: none;
    color: #fff;
}

.tc-adv-hero--centered-card .tc-adv-hero__gradient-bg {
    background: linear-gradient(135deg, var(--primary-dark, #0f3a65) 0%, var(--primary, #16518F) 50%, var(--primary-light, #2c71d2) 100%);
    padding: 3rem 0 5rem;
    text-align: center;
}

.tc-adv-hero--centered-card .tc-adv-hero__gradient-bg .hero-meta {
    justify-content: center;
}

.tc-adv-hero__card-image {
    margin-top: -4rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius-xl, 1rem);
    overflow: hidden;
    box-shadow: var(--shadow-2xl, 0 25px 50px -12px rgba(0,0,0,0.25));
}

.tc-adv-hero__card-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── 7. Gradient Blend ────────────────────────────────────────── */
.tc-adv-hero--gradient-blend {
    min-height: 420px;
    display: flex;
    align-items: center;
    padding: 3rem 0;
    background: var(--primary-dark, #0f3a65);
}

.tc-adv-hero__blend-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.tc-adv-hero__blend-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark, #0f3a65) 35%, rgba(15,58,101,0.6) 60%, transparent 85%);
    z-index: 1;
}

.tc-adv-hero--gradient-blend h1 {
    max-width: 550px;
}

/* ── 8. Diagonal Clip ─────────────────────────────────────────── */
.tc-adv-hero--diagonal {
    display: flex;
    min-height: 420px;
    background: var(--primary-dark, #0f3a65);
}

.tc-adv-hero__diag-bg {
    flex: 0 0 55%;
    background: linear-gradient(135deg, var(--primary-dark, #0f3a65), var(--primary, #16518F));
    display: flex;
    align-items: center;
    padding: 3rem 0;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
    z-index: 1;
}

.tc-adv-hero__diag-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* ── 9. Top Banner ────────────────────────────────────────────── */
.tc-adv-hero--top-banner {
    background: none;
    color: inherit;
}

.tc-adv-hero__banner-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
}

/* ── 10. Inline Content (no hero image, uses theme default) ──── */
.tc-adv-inline-featured-image {
    margin-bottom: 1.5rem;
}

.tc-adv-inline-featured-image img {
    border-radius: var(--radius-xl, 1rem);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1));
}

/* ── Hero Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .tc-adv-hero h1 { font-size: var(--font-size-2xl, 1.5rem); }

    .tc-adv-hero--split { flex-direction: column; }
    .tc-adv-hero--split-reverse { flex-direction: column-reverse; }
    .tc-adv-hero__image-half { min-height: 250px; }
    .tc-adv-hero__text-inner { padding: 2rem 1.5rem; }

    .tc-adv-hero--fullwidth-bg,
    .tc-adv-hero--fullwidth-bg .tc-adv-hero__overlay { min-height: 350px; }

    .tc-adv-hero--parallax { background-attachment: scroll; }
    .tc-adv-hero--parallax,
    .tc-adv-hero--parallax .tc-adv-hero__overlay { min-height: 350px; }

    .tc-adv-hero__blend-image { width: 100%; opacity: 0.3; }
    .tc-adv-hero__blend-gradient { background: linear-gradient(180deg, var(--primary-dark, #0f3a65) 30%, rgba(15,58,101,0.7) 100%); }
    .tc-adv-hero--gradient-blend h1 { max-width: none; }

    .tc-adv-hero--diagonal { flex-direction: column; }
    .tc-adv-hero__diag-bg { flex: none; clip-path: none; width: 100%; padding: 2rem 0; }
    .tc-adv-hero__diag-image { position: relative; width: 100%; height: 250px; }

    .tc-adv-hero__banner-image { height: 200px; }

    .tc-adv-hero__card-image { margin-top: -2rem; }
}

/* ══════════════════════════════════════════════════════════════════
   SINGLE ADVERTORIAL DETAIL PAGE
   ═════════════════════════════════════════════════════════════════ */

/* ── Single Advertorial Detail Page ────────────────────────────── */
.tc-adv-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: var(--radius-lg, 0.75rem);
    margin-bottom: 1.5rem;
}

.tc-adv-detail-header__label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8a6d00;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.tc-adv-detail-header__separator {
    color: var(--gray-300, #d1d5db);
}

.tc-adv-detail-header__sponsor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-600, #4b5563);
}

.tc-adv-detail-header__logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.tc-adv-detail-content {
    line-height: 1.8;
}

/* Expired notice */
.tc-adv-expired-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md, 0.5rem);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: #991b1b;
    font-size: var(--font-size-sm, 0.875rem);
}

/* Sticky CTA */
.tc-adv-sticky-cta {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    padding: 1rem 0;
    margin-top: 2rem;
    text-align: center;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.tc-adv-sticky-cta .btn {
    min-width: 250px;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .tc-adv-inline-banner__content {
        flex-direction: column;
        align-items: flex-start;
    }

    .tc-adv-inline-banner__cta {
        width: 100%;
    }

    .tc-adv-inline-banner__cta .btn {
        width: 100%;
        text-align: center;
    }

    .tc-adv-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tc-adv-detail-header__separator {
        display: none;
    }

    .tc-adv-sticky-cta .btn {
        width: 100%;
    }
}

/* ── Button Accent variant (matching tctheme) ──────────────────── */
.btn-accent {
    background: var(--accent, #f59e0b);
    color: #fff;
    border: none;
    font-weight: 600;
}

.btn-accent:hover {
    background: #e08e00;
    color: #fff;
}
