/* ==========================================================================
   YNEP Theme - Main Styles
   Mobile-first responsive design
   ========================================================================== */

:root {
    --ynep-accent: #8B3FB5;
    --ynep-accent-dark: #6A2D8E;
    --ynep-accent-light: #C77DDB;
    --ynep-accent-gold: #F0C040;
    --ynep-bg: #f4f4f4;
    --ynep-bg-white: #ffffff;
    --ynep-text: #1a1a1a;
    --ynep-text-secondary: #686868;
    --ynep-text-light: #999999;
    --ynep-border: #e0e0e0;
    --ynep-radius: 12px;
    --ynep-radius-sm: 8px;
    --ynep-container: 1200px;
    --ynep-container-narrow: 780px;
    --ynep-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --ynep-font-serif: Georgia, 'Times New Roman', serif;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--ynep-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ynep-text);
    background: var(--ynep-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--ynep-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--ynep-accent-dark);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.ynep-container {
    max-width: var(--ynep-container);
    margin: 0 auto;
    padding: 0 20px;
}

.ynep-container--narrow {
    max-width: var(--ynep-container-narrow);
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */

.ynep-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.ynep-header.scrolled {
    border-bottom-color: var(--ynep-border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.ynep-front-page .ynep-header {
    background: transparent;
    border-bottom-color: transparent;
}

.ynep-front-page .ynep-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: var(--ynep-border);
}

.ynep-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: var(--ynep-container);
    margin: 0 auto;
    padding: 0 20px;
}

.ynep-header__logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ynep-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.ynep-front-page .ynep-header:not(.scrolled) .ynep-header__logo {
    color: #ffffff;
}

.ynep-header__logo img,
.ynep-header__logo .custom-logo-link img,
.ynep-header__logo .custom-logo {
    max-height: 45px;
    width: auto;
    height: auto;
    display: block;
}

/* Mobile menu toggle */
.ynep-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.ynep-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ynep-text);
    transition: all 0.3s ease;
    border-radius: 1px;
}

.ynep-front-page .ynep-header:not(.scrolled) .ynep-menu-toggle span {
    background: #ffffff;
}

.ynep-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.ynep-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.ynep-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Navigation */
.ynep-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--ynep-bg-white);
    padding: 80px 32px 32px;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
}

.ynep-nav.open {
    right: 0;
}

.ynep-nav__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.ynep-nav__overlay.visible {
    display: block;
}

.ynep-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ynep-nav li {
    border-bottom: 1px solid var(--ynep-border);
}

.ynep-nav a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--ynep-text);
}

.ynep-nav a:hover {
    color: var(--ynep-accent);
}

.ynep-nav .current-menu-item a,
.ynep-nav .current_page_item a {
    color: var(--ynep-accent);
    font-weight: 700;
}

/* ==========================================================================
   SINGLE POST / PAGE
   ========================================================================== */

.ynep-single-header {
    padding: 100px 0 40px;
    background: var(--ynep-bg-white);
}

.ynep-single-header__inner {
    max-width: var(--ynep-container-narrow);
    margin: 0 auto;
    padding: 0 20px;
}

.ynep-single-header__category {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ynep-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.ynep-single-header__title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: var(--ynep-text);
    margin: 0 0 20px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.ynep-single-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--ynep-text-secondary);
}

.ynep-single-header__meta a {
    color: var(--ynep-text-secondary);
    font-weight: 500;
}

.ynep-single-header__meta a:hover {
    color: var(--ynep-accent);
}

/* Featured image */
.ynep-featured-image {
    max-width: var(--ynep-container-narrow);
    margin: 0 auto;
    padding: 0 20px;
}

.ynep-featured-image img {
    width: 100%;
    border-radius: var(--ynep-radius);
    margin: 24px 0 0;
}

/* Post content */
.ynep-content {
    max-width: var(--ynep-container-narrow);
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.ynep-content h2 {
    font-size: 1.6rem;
    margin: 48px 0 16px;
}

.ynep-content h3 {
    font-size: 1.3rem;
    margin: 36px 0 12px;
}

.ynep-content p {
    margin: 0 0 20px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--ynep-text);
}

.ynep-content ul, .ynep-content ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.ynep-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.ynep-content blockquote {
    margin: 32px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--ynep-accent);
    background: var(--ynep-bg);
    border-radius: 0 var(--ynep-radius-sm) var(--ynep-radius-sm) 0;
    font-style: italic;
    color: var(--ynep-text-secondary);
}

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

.ynep-content img {
    border-radius: var(--ynep-radius-sm);
    margin: 24px 0;
}

.ynep-content a {
    color: var(--ynep-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ynep-content a:hover {
    color: var(--ynep-accent-dark);
}

/* ==========================================================================
   ARCHIVE / BLOG INDEX
   ========================================================================== */

.ynep-archive-header {
    padding: 100px 0 40px;
    background: var(--ynep-bg-white);
    text-align: center;
}

.ynep-archive-header__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    margin: 0 0 8px;
}

.ynep-archive-header__description {
    font-size: 1.05rem;
    color: var(--ynep-text-secondary);
    margin: 0;
}

.ynep-archive-grid {
    max-width: var(--ynep-container);
    margin: 0 auto;
    padding: 48px 20px 80px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* Archive card (reuses plugin card styles if loaded, otherwise standalone) */
.ynep-archive-card {
    background: var(--ynep-bg-white);
    border-radius: var(--ynep-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ynep-archive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.ynep-archive-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ynep-archive-card__thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--ynep-border);
}

.ynep-archive-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ynep-archive-card:hover .ynep-archive-card__thumb img {
    transform: scale(1.05);
}

.ynep-archive-card__body {
    padding: 20px;
}

.ynep-archive-card__date {
    font-size: 0.8rem;
    color: var(--ynep-text-light);
    display: block;
    margin-bottom: 6px;
    text-transform: capitalize;
}

.ynep-archive-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
    color: var(--ynep-text);
}

.ynep-archive-card__excerpt {
    font-size: 0.95rem;
    color: var(--ynep-text-secondary);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   COMMENTS
   ========================================================================== */

.ynep-comments {
    max-width: var(--ynep-container-narrow);
    margin: 0 auto;
    padding: 0 20px 60px;
    border-top: 1px solid var(--ynep-border);
    padding-top: 40px;
}

.ynep-comments h2 {
    font-size: 1.4rem;
    margin: 0 0 24px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--ynep-border);
}

.comment-list .comment-body {
    font-size: 0.95rem;
}

.comment-author {
    font-weight: 700;
    margin-bottom: 4px;
}

.comment-metadata {
    font-size: 0.8rem;
    color: var(--ynep-text-light);
    margin-bottom: 8px;
}

.comment-content p {
    margin: 0 0 12px;
}

.comment-respond {
    margin-top: 32px;
}

.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ynep-border);
    border-radius: var(--ynep-radius-sm);
    font-size: 0.95rem;
    font-family: var(--ynep-font);
    transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--ynep-accent);
}

.comment-form .form-submit input {
    background: var(--ynep-accent);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.comment-form .form-submit input:hover {
    background: var(--ynep-accent-dark);
}

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

.ynep-pagination {
    max-width: var(--ynep-container);
    margin: 0 auto;
    padding: 0 20px 60px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ynep-pagination a,
.ynep-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--ynep-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ynep-pagination a {
    background: var(--ynep-bg-white);
    color: var(--ynep-text);
    border: 1px solid var(--ynep-border);
}

.ynep-pagination a:hover {
    background: var(--ynep-accent);
    color: #fff;
    border-color: var(--ynep-accent);
}

.ynep-pagination .current {
    background: var(--ynep-accent);
    color: #fff;
}

/* ==========================================================================
   SEARCH
   ========================================================================== */

.ynep-search-form {
    display: flex;
    gap: 8px;
}

.ynep-search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--ynep-border);
    border-radius: var(--ynep-radius-sm);
    font-size: 0.95rem;
}

.ynep-search-form button {
    background: var(--ynep-accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--ynep-radius-sm);
    cursor: pointer;
    font-weight: 600;
}

/* ==========================================================================
   404 PAGE
   ========================================================================== */

.ynep-404 {
    text-align: center;
    padding: 120px 20px 80px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ynep-404__number {
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: 900;
    color: var(--ynep-accent);
    line-height: 1;
    margin-bottom: 16px;
}

.ynep-404__text {
    font-size: 1.2rem;
    color: var(--ynep-text-secondary);
    margin-bottom: 32px;
}

.ynep-404__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--ynep-accent);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.ynep-404__link:hover {
    background: var(--ynep-accent-dark);
    color: #fff;
}

/* ==========================================================================
   WIDGETS
   ========================================================================== */

.ynep-widget {
    margin-bottom: 32px;
}

.ynep-widget__title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
    color: var(--ynep-text);
}

/* ==========================================================================
   RESPONSIVE - TABLET
   ========================================================================== */

@media (min-width: 640px) {
    .ynep-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   RESPONSIVE - DESKTOP
   ========================================================================== */

@media (min-width: 1024px) {
    .ynep-menu-toggle {
        display: none;
    }

    .ynep-nav {
        position: static;
        width: auto;
        max-width: none;
        height: auto;
        background: transparent;
        padding: 0;
        box-shadow: none;
        overflow: visible;
    }

    .ynep-nav ul {
        display: flex;
        gap: 4px;
    }

    .ynep-nav li {
        border-bottom: none;
    }

    .ynep-nav a {
        padding: 8px 16px;
        font-size: 0.9rem;
        border-radius: var(--ynep-radius-sm);
    }

    .ynep-nav a:hover {
        background: var(--ynep-bg);
    }

    .ynep-front-page .ynep-header:not(.scrolled) .ynep-nav a {
        color: rgba(255, 255, 255, 0.85);
    }

    .ynep-front-page .ynep-header:not(.scrolled) .ynep-nav a:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

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

    .ynep-container {
        padding: 0 40px;
    }
}

/* ==========================================================================
   UTILITY - NO ADMIN BAR OFFSET WHEN LOGGED IN
   ========================================================================== */

body.admin-bar .ynep-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .ynep-header {
        top: 46px;
    }
}
