/*
Theme Name: WriteMeister Website
Version: 1.2.0
Author: Sara & Assistant
Description: A lightweight CSS file for WriteMeister website styling.
*/

:root {
    --accent: #8b5cf6;
    --accent2: #a78bfa;
}

.bg-dark-700 {
    background-color: #12121A;
}

.grid-bg {
    position: relative;
    background: #0b0b10;
    overflow: hidden;
}

.grid-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    /* cuadriculado fino */
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0/28px 28px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0/28px 28px;
    /* viñeta leve para enfoque en el contenido */
    mask-image: radial-gradient(120% 90% at 50% 40%, #000 60%, transparent 100%);
    pointer-events: none;
}

/* —— Botones como en la imagen ——————————————— */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.25rem;
    border-radius: 0.75rem;
    background: linear-gradient(90deg, var(--accent, #8b5cf6), var(--accent2, #a78bfa));
    color: #0b0b10;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform .12s ease, opacity .12s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    opacity: .95;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.25rem;
    border-radius: 0.75rem;
    color: #fff;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.02);
    transition: background .12s ease, border-color .12s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.28);
}

/* —— Tarjeta de vista previa (negra, borde sutil y glow) ——————————————— */
.preview-card {
    padding: 1.5rem;
    border-radius: 1rem;
    color: #fff;
    background: #101016;
    /* un toque más claro que el fondo para contraste */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 0 1px rgba(167, 139, 250, 0.05) inset,
        /* halo muy leve */
        0 12px 32px rgba(0, 0, 0, 0.45);
    /* profundidad */
}

/* —— Ajustes finos responsivos ——————————————— */
@media (min-width:1024px) {
    .hero-wrap .preview-card {
        margin-left: 0.5rem;
    }
}

/* Gravity Forms Styling to match original form */
#gform_1 {
    display: grid;
    gap: 1rem;
}

#gform_1 .gfield {
    display: block;
    font-size: 0.875rem;
}

#gform_1 .gfield_label {
    display: block;
    font-size: 0.875rem;
}

#gform_1 .ginput_container input {
    margin-top: 0.25rem;
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: white;
    padding: 0.75rem;
}

#gform_1 .gform_footer {
    margin-top: 0;
}

#gform_1 .gform_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.25rem;
    border-radius: 0.75rem;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.12s ease, opacity 0.12s ease;
    width: 100%;
    cursor: pointer;
}

#gform_1 .gform_button:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

#gform_1 .gfield_required {
    color: #f87171;
}

#gform_1 .gform_fields {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.gform_heading {
    display: none;
}

/* Field Validation Messages */
.gfield_validation_message {
    color: #f87171;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.375rem;
    border-left: 3px solid #ef4444;
}

/* Confirmation Message */
.gform_confirmation_message {
    color: #22c55e;
    font-size: 0.875rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 0.75rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    text-align: center;
}

/* Validation Errors Styling */
.gform_validation_errors {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.gform_submission_error {
    color: #f87171;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.gform-icon--circle-error {
    color: #ef4444;
    margin-right: 0.5rem;
}

@media (min-width:1024px) {
    .hero-wrap .preview-card {
        @apply ml-2;
    }
}

/* Single template styles for `single.php` */
/* Scoped to single-post views so site-wide styles aren't overridden */

.single article h1 {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    margin-bottom: 30px;
    display: inline;
    max-width: 500px;
    color: var(--accent2);
}

.single article .main-content h3 {
    font-size: 28px;
    font-weight: 700;
    line-height: 38px;
    text-align: left;
    margin-bottom: 23px;
}

.single article .main-content h2 {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    margin-bottom: 28px;
}

.single article .main-content p {
    font-size: 16px;
    font-weight: 400;
    line-height: 32px;
    text-align: left;
    margin-bottom: 1.75em;

}

.single article .main-content p+h3 {
    margin-top: 50px;
}

.single article .main-content p+h2 {
    margin-top: 50px;
}

/* Add scroll margin to H2 headings for smooth scroll offset */
.single article .main-content h2 {
    scroll-margin-top: 100px;
}

.single article .main-content figure+p {
    margin-top: 1.75em;
}

.single article .main-content ul li+li {
    margin-top: 12px;
}

.single article .main-content ol li+li {
    margin-top: 12px;
}

.single article .main-content figure img,
.single article .main-content img {
    border-radius: 20px;
    margin-block: 60px;
}

.single article .main-content a {
    color: var(--accent2);
}

/* Featured Image Title Overlay */
.featured-image-title {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    line-height: 1.3;
}

.title-overlay {
    max-width: 900px;
}

/* Sidebar Styling */
.sidebar-sticky {
    position: sticky;
    top: 2rem;
}

.sidebar-sticky .preview-card ol {
    list-style-type: decimal;
}

.sidebar-sticky .preview-card li {
    margin-left: 1.5rem;
    line-height: 1.6;
}

/* Author Avatar */
.single article .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
    .sidebar-sticky {
        position: static;
        top: auto;
    }
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
    overflow: clip;
}

.lenis [data-lenis-prevent],
.lenis [data-lenis-prevent-wheel],
.lenis [data-lenis-prevent-touch] {
    overscroll-behavior: contain;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}

.lenis.lenis-autoToggle {
    transition-property: overflow;
    transition-duration: 1ms;
    transition-behavior: allow-discrete;
}

/* Reading Progress Bar */
#reading-progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: #22C55E;
    width: 0%;
    z-index: 9999;
    transition: opacity 0.3s ease;
    overflow: visible !important;
}

#reading-progress-bar.active {
    opacity: 1;
}

#reading-progress-bar.dim {
    opacity: 0.4;
}

/* Spark animation */
.spark-container {
    position: absolute;
    pointer-events: none;
    width: 0;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spark {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #22C55E;
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(34, 197, 94, 1);
    will-change: transform, opacity;
}

@keyframes spark-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.spark:nth-child(1) {
    --tx: 20px;
    --ty: -20px;
    animation: spark-burst 0.6s ease-out forwards;
}

.spark:nth-child(2) {
    --tx: -20px;
    --ty: -20px;
    animation: spark-burst 0.6s ease-out 0.05s forwards;
}

.spark:nth-child(3) {
    --tx: 24px;
    --ty: 15px;
    animation: spark-burst 0.6s ease-out 0.1s forwards;
}

.spark:nth-child(4) {
    --tx: -24px;
    --ty: 15px;
    animation: spark-burst 0.6s ease-out 0.05s forwards;
}

.spark:nth-child(5) {
    --tx: 16px;
    --ty: -16px;
    animation: spark-burst 0.6s ease-out 0.15s forwards;
}

.spark:nth-child(6) {
    --tx: -16px;
    --ty: -24px;
    animation: spark-burst 0.6s ease-out 0.1s forwards;
}