/*
 Theme Name:   Hello Elementor Child
 Theme URI:    https://concretum.com
 Description:  Child theme for Hello Elementor with custom styling for Concretum.
 Author:       Concretum
 Author URI:   https://concretum.com
 Template:     hello-elementor
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  hello-elementor-child
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --color-primary: #0b6ecf;
    --color-primary-hover: #0a5ca9;
    --color-text: #37352f;
    --color-text-light: #6b6a68;
    --color-text-muted: #555;
    --color-bg-warm: #f9f7f2;
    --color-bg-content: #faf8f3;
    --color-border: #e6e2d9;
    --color-code-bg: #f0f1f2;
    --color-code-text: #e03e3e;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --font-body: 'Epilogue', sans-serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.header-inner {
    z-index: 10;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
}

.header-full-width {
    position: fixed !important;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: transparent !important;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    transition: background-color 0.5s ease !important, box-shadow 0.5s ease !important;
}

.header-full-width.scrolled {
    background-color: rgba(0, 0, 0, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

.single-post .header-full-width,
body.single-post #site-header.header-full-width {
    background-color: rgba(0, 0, 0, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

/* ==========================================================================
   Navigation & Submenu Styles
   ========================================================================== */

#menu-item-5575 .sub-menu,
#menu-item-1519 .sub-menu {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.single-post #menu-item-5575 .sub-menu,
.single-post #menu-item-1519 .sub-menu {
    background-color: #000 !important;
}

#menu-item-5572 .sub-menu {
    background-color: transparent;
}

@media (max-width: 992px) {
    .site-navigation-dropdown ul.menu li.current-menu-item > a,
    .site-navigation-dropdown ul.menu li.current-menu-item .sub-menu a {
        background: #000;
    }
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

main.post {
    width: 100vw;
    min-height: 100vh;
    overflow: auto;
    box-sizing: border-box;
    padding-top: 100px;
    font-family: var(--font-body);
}

/* ==========================================================================
   Single Post Styles
   ========================================================================== */

body.single-post {
    background-color: var(--color-bg-warm);
}

.single-post .site-main {
    background-color: var(--color-bg-warm);
}

.single-post .entry-content {
    background-color: var(--color-bg-content);
    color: var(--color-text);
    max-width: 860px;
    margin: 0 auto;
    line-height: 1.75;
    padding: 0 25px;
}

/* Typography */
.single-post .entry-content p {
    margin-bottom: 1.4em;
    margin-top: 1.4em;
}

.single-post .entry-content h1,
.single-post .entry-content h2,
.single-post .entry-content h3 {
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    color: #111;
    font-weight: 600;
}

/* Lists */
.single-post .entry-content ul,
.single-post .entry-content ol {
    margin-bottom: 1.4em;
    margin-top: 1.4em;
    padding-left: 1.5em;
}

.single-post .entry-content li {
    margin-bottom: 0.7em;
}

/* Links */
.single-post .entry-content a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(11, 110, 207, 0.3);
    transition: border-color var(--transition-fast);
}

.single-post .entry-content a:hover {
    border-bottom-color: rgba(11, 110, 207, 0.8);
}

/* Blockquotes */
.single-post .entry-content blockquote {
    border-left: 3px solid #dfe1e4;
    padding-left: 20px;
    margin: 1.5em 0;
    margin-left: 0;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ==========================================================================
   Code Blocks
   ========================================================================== */

.wp-block-code {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin: 1.5em 0;
    overflow-x: auto;
}

.wp-block-code code {
    font-family: var(--font-mono);
    font-size: 14px;
    display: block;
    padding: 0;
    color: #d4d4d4;
    background: transparent;
    white-space: pre;
    line-height: 1.6;
}

/* Inline code */
code:not(.wp-block-code code) {
    background-color: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    white-space: nowrap;
    border: 1px solid #e0e0e2;
}

.wp-block-list li code {
    background-color: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    white-space: nowrap;
    border: 1px solid #e0e0e2;
}

/* ==========================================================================
   Author Box
   ========================================================================== */

.wp-block-post-author {
    background-color: var(--color-bg-warm) !important;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 30px;
    margin: 40px auto;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    max-width: 800px;
}

.wp-block-post-author:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wp-block-post-author__avatar img {
    border-radius: 50%;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.wp-block-post-author__content {
    flex: 1;
}

.wp-block-post-author__byline {
    color: var(--color-text-light);
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px !important;
    font-weight: 500;
}

.wp-block-post-author__name {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    font-size: 24px !important;
    line-height: 1.2;
}

.wp-block-post-author__name a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: none;
}

.wp-block-post-author__name a:hover {
    color: var(--color-primary-hover);
}

.wp-block-post-author__bio {
    color: var(--color-text);
    font-size: 15px !important;
    line-height: 1.6;
    margin: 0 !important;
}

/* Contact link above author */
.entry-content p:has(a[href*="mailto"]) {
    text-align: center;
    margin-bottom: 10px;
    color: var(--color-text-muted);
    font-size: 16px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.entry-content p:has(a[href*="mailto"]) a {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(11, 110, 207, 0.3);
    transition: border-color var(--transition-fast);
}

.entry-content p:has(a[href*="mailto"]) a:hover {
    border-bottom-color: rgba(11, 110, 207, 0.8);
}

/* ==========================================================================
   404 Page
   ========================================================================== */

body.error404 {
    margin: 0;
    padding: 0;
}

body.error404 .site-main {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    margin: 0;
    padding: 40px 20px;
}

body.error404 .error-404-content {
    text-align: center;
    color: white;
    max-width: 500px;
}

body.error404 .error-404-content h1 {
    font-size: 72px;
    margin-bottom: 10px;
    font-weight: 700;
}

body.error404 .error-404-content p {
    font-size: 18px;
    color: #999;
    margin-bottom: 30px;
    line-height: 1.6;
}

body.error404 .home-button {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

body.error404 .home-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   Paper Styles (Posts in Papers Category)
   ========================================================================== */

.single-paper .paper-details {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.single-paper .paper-authors {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.single-paper .paper-authors strong {
    color: var(--color-text-light);
    font-weight: 500;
}

.single-paper .paper-publication {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.single-paper .paper-venue {
    font-style: italic;
}

.single-paper .paper-abstract {
    margin-bottom: 2rem;
}

.single-paper .paper-abstract h2 {
    font-size: 1.25rem;
    color: #111;
    margin-bottom: 1rem;
    font-weight: 600;
}

.single-paper .paper-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 2.5rem 0;
}

.single-paper .paper-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.75rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #000;
    background: transparent;
    color: #000;
}

.single-paper .paper-btn:hover {
    background: #000;
    color: #fff;
    border-color: #000;
    transform: translateY(-1px);
}

.single-paper .paper-btn--primary {
    background: #000;
    color: #fff;
    border-color: #000;
}

.single-paper .paper-btn--primary:hover {
    background: transparent;
    color: #000;
}

.single-paper .paper-btn--secondary {
    background: transparent;
    color: #000;
    border-color: rgba(0, 0, 0, 0.3);
}

.single-paper .paper-btn--secondary:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.single-paper .paper-doi {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.single-paper .paper-doi strong {
    font-weight: 500;
}

.single-paper .paper-doi a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(11, 110, 207, 0.3);
}

.single-paper .paper-doi a:hover {
    border-bottom-color: rgba(11, 110, 207, 0.8);
}

/* ==========================================================================
   Paper Cards (Archive/Listing View)
   ========================================================================== */

.paper-card-authors {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.paper-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.paper-card-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.paper-card-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

.paper-card-btn--pdf {
    color: #6b7280;
    border-color: #6b7280;
}

.paper-card-btn--pdf:hover {
    background: #6b7280;
    color: #fff;
}

/* Auto-injected paper buttons (JavaScript) */
.paper-auto-buttons {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.paper-auto-authors {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.paper-auto-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.paper-auto-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none !important;
    border-radius: 4px;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background-color: transparent;
    color: #fff !important;
    -webkit-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
    -moz-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

.paper-auto-btn:hover {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
    transform: translateY(-2px);
}

.paper-auto-btn--ssrn {
    border-color: rgba(255, 255, 255, 0.5);
}

.paper-auto-btn--pdf {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9) !important;
}

.paper-auto-btn--pdf:hover {
    background-color: #fff !important;
    color: #000 !important;
}

/* Light background variant (for single paper pages) */
.single-paper .paper-auto-authors,
.single-post .entry-content .paper-auto-authors {
    color: #555;
}

.single-paper .paper-auto-btn,
.single-post .entry-content .paper-auto-btn {
    border-color: #000 !important;
    color: #000 !important;
    background-color: transparent !important;
}

.single-paper .paper-auto-btn:hover,
.single-post .entry-content .paper-auto-btn:hover {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

/* Override any Elementor link transitions */
a.paper-auto-btn,
a.paper-auto-btn:link,
a.paper-auto-btn:visited {
    -webkit-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease !important;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease !important;
}

a.paper-auto-btn:hover,
a.paper-auto-btn:focus,
a.paper-auto-btn:active {
    -webkit-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease !important;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease !important;
}

@media (max-width: 480px) {
    .paper-auto-links {
        flex-direction: column;
    }
    
    .paper-auto-btn {
        justify-content: center;
        width: 100%;
    }
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1366px) {
    .elementskit-blog-block-post .row {
        display: flex;
        flex-direction: column;
    }

    .elementskit-blog-block-post .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .elementskit-blog-block-post .col-md-6:first-child {
        order: -1;
    }
}

@media (max-width: 768px) {
    .single-post .entry-content {
        padding: 0 20px;
    }
    
    main.post {
        padding-top: 80px;
    }
}

@media (max-width: 640px) {
    .single-paper .paper-links {
        flex-direction: column;
        padding: 1.25rem;
    }

    .single-paper .paper-btn {
        width: 100%;
        justify-content: center;
    }
    
    body.error404 .error-404-content h1 {
        font-size: 48px;
    }
}

@media (max-width: 600px) {
    .wp-block-post-author {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
        gap: 15px;
    }

    .wp-block-post-author__byline,
    .wp-block-post-author__name,
    .wp-block-post-author__bio {
        text-align: center;
    }
    
    .wp-block-post-author__avatar img {
        width: 80px;
        height: 80px;
    }
}
