/*
Theme Name: Forumia
Theme URI: https://example.com/forumia
Author: You
Description: A clean, performant forum-style WordPress theme optimized for discussion-heavy content.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: forumia
*/

/* Basic reset and accessibility */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}
*, *:before, *:after {
    box-sizing: inherit;
}

:root {
    --cpu-surface: #ffffff;
    --cpu-border: rgba(226, 232, 240, 0.9);
    --cpu-shadow-lg: 0 18px 38px rgba(15, 20, 40, 0.12);
    --cpu-shadow-md: 0 12px 24px rgba(15, 23, 42, 0.08);
    --cpu-accent-start: #2563eb;
    --cpu-accent-end: #1d4ed8;
    --cpu-accent-soft: #4661c9;
    --cpu-gradient-bg: linear-gradient(135deg, #e7edff 0%, #f6f4ff 100%);
    --cpu-text-primary: #1b2540;
    --cpu-text-muted: #5b647c;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--cpu-text-primary);
    background: var(--cpu-gradient-bg);
    line-height: 1.6;
    font-size: 16px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 999999;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.site-header {
    background: linear-gradient(135deg, #1c2f5a 0%, #253d73 100%);
    color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}
.site-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    font-weight: 600;
    font-size: 18px;
}
.site-header a { color: rgba(248, 250, 252, 0.82); text-decoration: none; transition: color 0.2s ease; }
.site-header a:hover { color: #ffffff; }
.nav { display: flex; gap: 18px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.site-main { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding: 48px 0; }
@media (max-width: 960px) { .site-main { grid-template-columns: 1fr; padding: 32px 0; } }

.site-footer {
    background: linear-gradient(135deg, #182645 0%, #1d2f56 100%);
    color: rgba(226, 232, 240, 0.8);
    padding: 32px 0;
    margin-top: 56px;
    text-align: center;
}

.main-content {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--cpu-border);
    border-radius: 20px;
    box-shadow: var(--cpu-shadow-md);
    padding: clamp(28px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vw, 32px);
}

.page-header {
    background: linear-gradient(135deg, rgba(70, 90, 160, 0.18), rgba(70, 90, 160, 0.08));
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    padding: clamp(20px, 4vw, 32px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.page-header .page-title {
    margin: 0 0 12px;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    color: var(--cpu-text-primary);
}

.page-header .page-description {
    margin: 0;
    color: var(--cpu-text-muted);
    font-size: 0.95rem;
}

/* Forum boards and lists */
.forum-boards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1024px) { .forum-boards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .forum-boards { grid-template-columns: 1fr; } }
.board-card { background: var(--cpu-surface); border: 1px solid var(--cpu-border); border-radius: 16px; padding: 20px; transition: transform .2s ease, box-shadow .2s ease; box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08); }
.board-card:hover { box-shadow: var(--cpu-shadow-lg); transform: translateY(-2px); }
.board-card h3 { margin: 0 0 8px; font-size: 18px; }
.board-meta { display: flex; gap: 10px; font-size: 12px; color: #6b7280; }

/* Enhanced Thread List Styling */
.thread-list { list-style: none; padding: 0; margin: 0; }
.thread-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    background: var(--cpu-surface);
    border: 1px solid var(--cpu-border);
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.thread-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(29, 78, 216, 0.10)) border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.thread-item:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--cpu-shadow-lg);
}

.thread-item:hover::before {
    opacity: 1;
}

.thread-item .title { 
    font-weight: 600; 
    margin: 0 0 10px 0; 
    font-size: 16px;
    line-height: 1.4;
}

.thread-item .title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.thread-item .title a:hover {
    color: #3b82f6;
}

.thread-item .excerpt {
    margin: 8px 0;
    color: var(--cpu-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.thread-item .meta { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    color: #6b7280; 
    font-size: 13px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(29, 78, 216, 0.08));
    color: #1d4ed8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.35);
    transition: all 0.2s ease;
}

.badge:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(29, 78, 216, 0.12));
    transform: translateY(-1px);
}

.counter {
    text-align: right;
    color: var(--cpu-text-muted);
    font-size: 12px;
    background: rgba(59, 130, 246, 0.08);
    padding: 10px 14px;
    border-radius: 12px;
    min-width: 92px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.counter div:first-child {
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 3px;
}

/* Latest Posts Heading */
.site-main h2 {
    color: var(--cpu-text-primary);
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid rgba(59, 130, 246, 0.35);
    position: relative;
}

.site-main h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 64px;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .thread-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .thread-item .title {
        font-size: 15px;
    }
    
    .counter {
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* Single post */
.post-header { background: var(--cpu-surface); border: 1px solid var(--cpu-border); border-radius: 16px; padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--cpu-shadow-md); }
.post-header h1 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 32px); }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--cpu-text-muted); font-size: 12px; }
.post-content { background: var(--cpu-surface); border: 1px solid var(--cpu-border); border-radius: 16px; padding: 24px; box-shadow: var(--cpu-shadow-md); }
.post-tags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Comments */
.comments { background: var(--cpu-surface); border: 1px solid var(--cpu-border); border-radius: 16px; padding: 24px; margin-top: 24px; box-shadow: var(--cpu-shadow-md); }
ol.comment-list { list-style: none; margin: 0; padding-left: 0; }
ol.children { list-style: none; margin-left: 24px; padding-left: 0; border-left: 2px dashed #e5e7eb; }
.comment { padding: 12px 0; }
.comment .comment-body { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.comment .avatar { border-radius: 999px; }
.comment .comment-meta { color: #6b7280; font-size: 12px; }
.comment .comment-author { font-weight: 600; color: #111827; }
.comment .comment-content { margin-top: 6px; }

/* Enhanced Widgets */
.widget {
    background: var(--cpu-surface);
    border: 1px solid var(--cpu-border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget:hover {
    box-shadow: var(--cpu-shadow-lg);
    transform: translateY(-2px);
}

.widget-title { 
    font-size: 16px; 
    margin: 0 0 12px; 
    color: #0f172a;
    font-weight: 600;
    position: relative;
    padding-bottom: 8px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

/* Tag Cloud Styling */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag-link {
    display: inline-block;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    padding: 6px 12px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
}

.tag-cloud .tag-link:hover {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    transform: translateY(-1px);
    border-color: #93c5fd;
}

button,
.button,
input[type="submit"],
input[type="button"],
.comment-form .submit {
    background: linear-gradient(135deg, var(--cpu-accent-start), var(--cpu-accent-end));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 600;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.comment-form .submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
}

/* Categories List Styling */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list .category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #f3f4f6;
}

.category-list .category-link:hover {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
    transform: translateX(4px);
}

.category-list .count {
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.category-list .category-link:hover .count {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Image size limitations */
.post-content img,
.comment-content img,
.size-limited {
    max-width: 800px;
    max-height: 800px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.post-content img:hover,
.comment-content img:hover,
.size-limited:hover {
    transform: scale(1.02);
}

/* Ensure images don't break layout on mobile */
@media (max-width: 800px) {
    .post-content img,
    .comment-content img,
    .size-limited {
        max-width: 100%;
        max-height: 400px;
    }
}

/* Enhanced Pagination Styling */
.pagination {
    margin-top: 32px;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 10px 16px;
    margin: 0 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pagination .page-numbers:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.pagination .page-numbers.current {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

.pagination .page-numbers.dots {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: default;
}

.pagination .page-numbers.dots:hover {
    background: transparent;
    color: #9ca3af;
    transform: none;
    box-shadow: none;
}

/* Enhanced Forms */
.search-form { 
    display: flex; 
    gap: 8px;
    margin-bottom: 20px;
}

.search-form input[type="search"] { 
    flex: 1; 
    padding: 12px 16px; 
    border: 1px solid #e5e7eb; 
    border-radius: 10px;
    background: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.search-form input[type="submit"] { 
    padding: 12px 20px; 
    border: none;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6); 
    color: #fff; 
    border-radius: 10px; 
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

.search-form input[type="submit"]:hover { 
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}

/* Loading animation for thread items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.thread-item {
    animation: fadeInUp 0.6s ease-out;
}

.thread-item:nth-child(1) { animation-delay: 0.1s; }
.thread-item:nth-child(2) { animation-delay: 0.2s; }
.thread-item:nth-child(3) { animation-delay: 0.3s; }
.thread-item:nth-child(4) { animation-delay: 0.4s; }
.thread-item:nth-child(5) { animation-delay: 0.5s; }

/* French Language Typography Optimization */
:lang(fr) {
    /* French typography rules */
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
}

/* French quotes styling */
:lang(fr) q {
    quotes: "\AB\A0" "\A0\BB" "\201C" "\201D";
}

:lang(fr) q:before {
    content: open-quote;
}

:lang(fr) q:after {
    content: close-quote;
}

/* French punctuation spacing */
:lang(fr) .post-content {
    /* Add thin space before double punctuation marks */
    word-spacing: 0.1em;
}

/* French typography improvements */
:lang(fr) h1, 
:lang(fr) h2, 
:lang(fr) h3, 
:lang(fr) h4, 
:lang(fr) h5, 
:lang(fr) h6 {
    /* Better letter spacing for French headers */
    letter-spacing: -0.02em;
    word-break: normal;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* French text hyphenation */
:lang(fr) .post-content,
:lang(fr) .excerpt,
:lang(fr) .comment-content {
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    -moz-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    hyphenate-limit-lines: 2;
    hyphenate-limit-last: always;
    hyphenate-limit-zone: 8%;
}

/* French number formatting */
:lang(fr) .counter,
:lang(fr) .comments-count,
:lang(fr) .tags-count {
    font-variant-numeric: oldstyle-nums;
}

/* Improved readability for French text */
:lang(fr) body {
    line-height: 1.65; /* Slightly more spacing for French */
}

:lang(fr) p {
    margin-bottom: 1.2em; /* Better paragraph spacing */
}

/* French-specific font stack optimization */
:lang(fr) body,
:lang(fr) input,
:lang(fr) button,
:lang(fr) textarea {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
