/*
Theme Name: TechStream Blog
Theme URI: https://yourdomain.com
Author: Developer
Author URI: https://yourdomain.com
Description: A modern, component-driven WordPress blog template built with Tailwind CSS. Styled after a premium tech/streaming aesthetic with a light blue accent.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techstream
Tags: blog, tailwind, modern, responsive, tech
*/

/* ============================================================
   CSS CUSTOM PROPERTIES — Derived from tailwind.config.js
   ============================================================
   These variables are the "single source of truth" for colors.
   Tailwind classes reference these via the config, and any
   non-Tailwind CSS below also uses them for consistency.
   ============================================================ */

:root {
    /* Primary Accent Palette (Sky Blue) */
    --color-primary-50: #F0F9FF;
    --color-primary-100: #E0F2FE;
    --color-primary-200: #BAE6FD;
    --color-primary-300: #7DD3FC;
    --color-primary-400: #38BDF8;
    --color-primary-500: #0EA5E9;
    --color-primary-600: #0284C7;
    --color-primary-700: #0369A1;

    /* Surface Colors */
    --color-body-bg: #F5F7FA;
    --color-card-bg: #FFFFFF;
    --color-muted-bg: #F1F5F9;

    /* Text */
    --color-text-heading: #111827;
    --color-text-body: #4B5563;
    --color-text-muted: #9CA3AF;

    /* Borders */
    --color-border: #E5E7EB;

    /* Radius */
    --radius-card: 14px;
    --radius-btn: 10px;

    /* Shadows */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.10);
}


/* ============================================================
   BASE RESETS & TYPOGRAPHY
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-body-bg);
    color: var(--color-text-body);
    line-height: 1.7;
}


/* ============================================================
   AMBIENT GLOW EFFECT (Replicates the reference site's radial
   blue/purple glow at page edges)
   ============================================================ */

.page-glow {
    position: relative;
    overflow-x: hidden;
}

.page-glow::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -15%;
    width: 50%;
    height: 80%;
    background: radial-gradient(ellipse at center,
            rgba(56, 189, 248, 0.08) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page-glow::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -15%;
    width: 50%;
    height: 80%;
    background: radial-gradient(ellipse at center,
            rgba(99, 102, 241, 0.06) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}


/* ============================================================
   CARD HOVER TRANSITION
   ============================================================ */

.card-hover {
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}


/* ============================================================
   CATEGORY BADGE
   ============================================================ */

.badge-primary {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary-700);
    background-color: var(--color-primary-100);
    border-radius: 9999px;
}


/* ============================================================
   ARTICLE CONTENT TYPOGRAPHY
   ============================================================
   These rules style the article body content (the_content()).
   They work independently of Tailwind's @tailwindcss/typography
   plugin, ensuring proper readability on the live site.
   ============================================================ */

/* --- Base prose container --- */
.prose {
    font-size: 1.125rem;
    /* 18px — optimal for long reads */
    line-height: 1.8;
    color: var(--color-text-heading);
    /* #111827  — high contrast      */
    word-break: break-word;
    overflow-wrap: break-word;
}

/* --- Paragraphs --- */
.prose p {
    margin-top: 0;
    margin-bottom: 1.5em;
    /* Clear separation between ¶s    */
    color: #374151;
    /* gray-700 — great readability    */
}

/* --- Headings --- */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: var(--color-text-heading);
    font-weight: 800;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.prose h1 {
    font-size: 2em;
}

.prose h2 {
    font-size: 1.5em;
}

.prose h3 {
    font-size: 1.25em;
}

.prose h4 {
    font-size: 1.125em;
}

/* First heading after the article starts shouldn't have extra top margin */
.prose>h1:first-child,
.prose>h2:first-child,
.prose>h3:first-child {
    margin-top: 0;
}

/* --- Links --- */
.prose a {
    color: var(--color-primary-500);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 200ms ease;
}

.prose a:hover {
    color: var(--color-primary-700);
}

/* --- Lists --- */
.prose ul,
.prose ol {
    margin-top: 0;
    margin-bottom: 1.5em;
    padding-left: 1.75em;
    color: #374151;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

.prose li>ul,
.prose li>ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* --- Blockquotes --- */
.prose blockquote {
    border-left: 4px solid var(--color-primary-400);
    background-color: var(--color-primary-50);
    padding: 1rem 1.5rem;
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    margin: 1.5em 0;
    font-style: normal;
    color: var(--color-text-body);
}

.prose blockquote p {
    margin-bottom: 0.5em;
}

.prose blockquote p:last-child {
    margin-bottom: 0;
}

/* --- Images --- */
.prose img {
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    max-width: 100%;
    height: auto;
    margin: 2em auto;
    display: block;
}

.prose figure {
    margin: 2em 0;
}

.prose figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.75em;
    font-style: italic;
}

/* --- Inline code --- */
.prose code {
    background-color: var(--color-muted-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
    color: var(--color-text-heading);
}

/* Remove backtick pseudo-elements WordPress/typography plugins sometimes add */
.prose code::before,
.prose code::after {
    content: none;
}

/* --- Code blocks --- */
.prose pre {
    background-color: #1e293b;
    /* slate-800 */
    color: #e2e8f0;
    /* slate-200 */
    border-radius: var(--radius-card);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5em 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.prose pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

/* --- Tables --- */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.9375rem;
}

.prose thead th {
    background-color: var(--color-muted-bg);
    font-weight: 700;
    color: var(--color-text-heading);
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--color-border);
}

.prose tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: #374151;
}

.prose tbody tr:last-child td {
    border-bottom: none;
}

/* --- Horizontal rules --- */
.prose hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2.5em 0;
}

/* --- Strong & emphasis --- */
.prose strong {
    font-weight: 700;
    color: var(--color-text-heading);
}

.prose em {
    font-style: italic;
}

/* --- WordPress-specific: wp-block adjustments --- */
.prose .wp-block-table {
    margin: 1.5em 0;
    overflow-x: auto;
}

.prose .wp-block-image {
    margin: 2em 0;
}

.prose .wp-block-image img {
    margin: 0 auto;
}


/* ============================================================
   BUTTON — Primary
   ============================================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #FFFFFF;
    background-color: var(--color-primary-400);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: background-color 200ms ease, transform 150ms ease;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: var(--color-primary-500);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}


/* ============================================================
   PAGINATION
   ============================================================ */

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-body);
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-btn);
    transition: all 200ms ease;
    text-decoration: none;
}

.pagination-link:hover {
    background-color: var(--color-primary-50);
    border-color: var(--color-primary-300);
    color: var(--color-primary-600);
}

.pagination-link.active {
    background-color: var(--color-primary-400);
    border-color: var(--color-primary-400);
    color: #FFFFFF;
}


/* ============================================================
   MOBILE MENU OVERLAY
   ============================================================ */

.mobile-menu {
    transform: translateX(100%);
    transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.mobile-overlay.open {
    opacity: 1;
    pointer-events: auto;
}


/* ============================================================
   SCROLL PROGRESS BAR (Article page)
   ============================================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary-400), var(--color-primary-300));
    z-index: 9999;
    transition: width 100ms ease;
}


/* ============================================================
   IPTV FREE TRIAL PAGE
   ============================================================ */

/* Feature checklist items */
.feature-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-heading);
}

.feature-check svg {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-primary-400);
}

/* OTP code inputs */
.otp-input {
    width: 3.5rem;
    height: 4rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--color-muted-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--color-text-heading);
}

.otp-input:focus {
    border-color: var(--color-primary-400);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

@media (max-width: 400px) {
    .otp-input {
        width: 2.6rem;
        height: 3.2rem;
        font-size: 1.15rem;
        border-radius: 10px;
    }
}

/* FAQ accordion — native <details> / <summary> */
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-heading);
    transition: color 0.2s;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::marker {
    content: '';
}

.faq-item summary:hover {
    color: var(--color-primary-500);
}

.faq-item summary h3 {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
}

.faq-item summary .faq-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.faq-item[open] summary .faq-icon {
    transform: rotate(45deg);
    color: var(--color-primary-400);
}

.faq-item[open] summary {
    color: var(--color-primary-500);
}

.faq-answer {
    padding: 0 1.5rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text-body);
}

.faq-answer p {
    margin: 0;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Shake animation (error feedback) */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

.shake {
    animation: shake 0.4s ease;
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}