/*
Theme Name: FT2026
Theme URI: https://example.com/ft2026
Author: FT2026
Author URI: https://example.com
Description: Responsive WordPress theme with preloader, fixed header, 2-column layout with right sidebar, and WP Club Manager integration
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ft2026
Tags: responsive, custom-header, custom-menu, featured-images, translation-ready
*/

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --header-bg: #FEE685;
    --header-border: #27272A;
    --header-border-width: 3px;
    --button-bg: #27272A;
    --button-text: #FEE685;
    --footer-bg: #31C950;
    --footer-border: #27272A;
    --footer-border-width: 3px;
    --primary-text: #27272A;
    --secondary-text: #555555;
    --link-color: #27272A;
    --link-hover: #31C950;
    --content-bg: #FFFFFF;
    --sidebar-bg: #F5F5F5;
    --border-color: #27272A;
    --preloader-bg: #FEE685;
    --preloader-color: #27272A;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--primary-text);
    background-color: #fafafa;
}

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

a:hover {
    color: var(--link-hover);
}

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

/* ============================================
   Preloader Styles
   ============================================ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--preloader-bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(39, 39, 42, 0.2);
    border-top-color: var(--preloader-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.preloader-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--preloader-color);
    letter-spacing: 2px;
}

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

/* ============================================
   Fixed Header
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    border-bottom: var(--header-border-width) solid var(--header-border);
    z-index: 1000;
    padding: 0 20px;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo a {
    font-size: 28px;
    font-weight: 800;
    color: var(--header-border);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.site-description {
    font-size: 12px;
    color: var(--secondary-text);
    margin-top: 2px;
}

/* Main Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    font-size: 15px;
    font-weight: 600;
    color: var(--header-border);
    padding: 10px 0;
    display: block;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--link-hover);
}

.main-navigation .current_page_item > a,
.main-navigation .current-menu-item > a {
    color: var(--link-hover);
}

/* Dropdown Menu */
.main-navigation ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--header-bg);
    border: 2px solid var(--header-border);
    border-top: none;
    min-width: 200px;
    display: none;
    flex-direction: column;
    gap: 0;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.main-navigation ul ul ul {
    top: 0;
    left: 100%;
    border-top: 2px solid var(--header-border);
}

.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul {
    display: flex;
}

.main-navigation ul ul li {
    border-bottom: 1px solid rgba(39, 39, 42, 0.1);
}

.main-navigation ul ul li:last-child {
    border-bottom: none;
}

.main-navigation ul ul a {
    padding: 12px 20px;
    font-size: 14px;
}

.main-navigation .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    border: 5px solid transparent;
    border-top-color: var(--header-border);
    vertical-align: middle;
}

.main-navigation ul ul .menu-item-has-children > a::after {
    border: 5px solid transparent;
    border-left-color: var(--header-border);
    margin-left: 10px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--header-border);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--header-border);
    margin: 5px 0;
    transition: 0.3s;
}

/* ============================================
   Header Buttons
   ============================================ */
.header-buttons {
    display: flex;
    gap: 10px;
    margin-left: 30px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--button-bg);
    color: var(--button-text);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: #3d3d42;
    color: #FEE685;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--button-bg);
    color: var(--button-bg);
}

.btn-outline:hover {
    background-color: var(--button-bg);
    color: var(--button-text);
}

/* ============================================
   Main Content Layout
   ============================================ */
.site-content {
    padding-top: 100px;
    padding-bottom: 60px;
    min-height: calc(100vh - 200px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
}

/* Full width when no sidebar */
body.no-sidebar .content-area {
    grid-template-columns: 1fr;
}

body.no-sidebar .main-content {
    border-right: 1px solid #e0e0e0;
    border-radius: 8px;
}

.main-content {
    background-color: var(--content-bg);
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 8px;
}

.sidebar {
    background-color: var(--sidebar-bg);
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 100px;
    margin-left: 30px;
    border-left: none;
}

/* ============================================
   WP Club Manager Integration Styles
   ============================================ */
.wpcb-wrapper {
    margin-bottom: 30px;
}

.wpcb-match-list {
    list-style: none;
}

.wpcb-match-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.wpcb-match-date {
    font-size: 12px;
    color: var(--secondary-text);
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
}

.wpcb-team {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 120px;
}

.wpcb-team-name {
    font-weight: 600;
    font-size: 14px;
}

.wpcb-team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.wpcb-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--header-border);
    padding: 0 15px;
}

.wpcb-venue {
    font-size: 12px;
    color: var(--secondary-text);
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

.wpcb-standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.wpcb-standings-table th,
.wpcb-standings-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.wpcb-standings-table th {
    background-color: var(--header-bg);
    font-weight: 700;
    color: var(--header-border);
}

.wpcb-standings-table tr:hover {
    background-color: #f9f9f9;
}

.wpcb-position {
    font-weight: 700;
    width: 30px;
}

.wpcb-points {
    font-weight: 700;
    color: var(--link-hover);
}

/* Club Directory */
.wpcb-club-directory {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.wpcb-club-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wpcb-club-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.wpcb-club-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.wpcb-club-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.wpcb-club-meta {
    font-size: 12px;
    color: var(--secondary-text);
}

/* ============================================
   Article/Post Styles
   ============================================ */
article {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
}

article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.entry-header {
    margin-bottom: 20px;
}

.entry-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    color: var(--header-border);
}

.entry-title a {
    color: var(--header-border);
}

.entry-title a:hover {
    color: var(--link-hover);
}

.entry-meta {
    font-size: 14px;
    color: var(--secondary-text);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.entry-content {
    font-size: 16px;
    line-height: 1.8;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--header-border);
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.entry-content li {
    margin-bottom: 8px;
}

.entry-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.tags-links,
.cat-links {
    font-size: 14px;
    color: var(--secondary-text);
}

.post-thumbnail {
    margin-bottom: 25px;
}

.post-thumbnail img {
    border-radius: 8px;
    width: 100%;
}

/* ============================================
   Sidebar Widgets
   ============================================ */
.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--header-border);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--header-border);
}

.widget ul {
    list-style: none;
}

.widget ul li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.widget ul li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget a {
    color: var(--primary-text);
}

.widget a:hover {
    color: var(--link-hover);
}

/* Search Widget */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form label {
    flex: 1;
}

.search-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: var(--link-hover);
}

.search-submit {
    padding: 12px 20px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-submit:hover {
    background-color: #3d3d42;
    color: #FEE685;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination a {
    color: var(--primary-text);
}

.pagination a:hover {
    background-color: var(--button-bg);
    color: var(--button-text);
    border-color: var(--button-bg);
}

.pagination .current {
    background-color: var(--button-bg);
    color: var(--button-text);
    border-color: var(--button-bg);
}

/* ============================================
   Comments
   ============================================ */
.comments-area {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.comments-title {
    font-size: 24px;
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
    margin-bottom: 40px;
}

.comment {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.comment-body {
    display: flex;
    gap: 20px;
}

.comment-author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--header-bg);
}

.comment-content {
    flex: 1;
}

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

.comment-metadata {
    font-size: 12px;
    color: var(--secondary-text);
    margin-bottom: 10px;
}

.comment-body p {
    line-height: 1.6;
}

.reply {
    margin-top: 10px;
}

.reply a {
    font-size: 14px;
    font-weight: 600;
}

/* Comment Form */
.comment-form {
    background: var(--sidebar-bg);
    padding: 25px;
    border-radius: 8px;
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

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

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.form-submit .submit {
    padding: 14px 30px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-submit .submit:hover {
    background-color: #3d3d42;
    color: #FEE685;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background-color: var(--footer-bg);
    border-top: var(--footer-border-width) solid var(--footer-border);
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-widget {
    color: var(--footer-border);
}

.footer-widget .widget-title {
    color: var(--footer-border);
    border-bottom-color: var(--footer-border);
}

.footer-widget a {
    color: var(--footer-border);
}

.footer-widget a:hover {
    color: #fff;
}

.footer-widget ul li {
    border-bottom-color: rgba(39, 39, 42, 0.2);
}

.footer-bottom {
    max-width: 1400px;
    margin: 30px auto 0;
    padding-top: 30px;
    border-top: 1px solid rgba(39, 39, 42, 0.3);
    text-align: center;
    color: var(--footer-border);
    font-size: 14px;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 1024px) {
    .content-area {
        grid-template-columns: 1fr 320px;
        gap: 0;
    }
}

@media (max-width: 768px) {
    .header-inner {
        height: 70px;
    }

    .site-logo a {
        font-size: 22px;
    }

    .menu-toggle {
        display: block;
    }

    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-bg);
        border-bottom: var(--header-border-width) solid var(--header-border);
        padding: 20px;
        display: none;
        flex-direction: column;
    }

    .main-navigation.toggled {
        display: flex;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation li {
        border-bottom: 1px solid rgba(39, 39, 42, 0.2);
    }

    .main-navigation a {
        padding: 15px 0;
    }

    /* Mobile dropdowns */
    .main-navigation ul ul {
        position: static;
        border: none;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.05);
        padding-left: 20px;
        display: none;
    }

    .main-navigation li:hover > ul,
    .main-navigation li.toggled > ul {
        display: block;
    }

    .main-navigation ul ul ul {
        left: 0;
    }

    .main-navigation .menu-item-has-children > a::after {
        display: inline-block;
    }

    .dropdown-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        background: none;
        border: 1px solid var(--header-border);
        border-radius: 4px;
        cursor: pointer;
        margin-left: 10px;
        vertical-align: middle;
    }

    .dropdown-toggle span {
        display: block;
        width: 10px;
        height: 10px;
        border-right: 2px solid var(--header-border);
        border-bottom: 2px solid var(--header-border);
        transform: rotate(45deg);
        margin-top: -3px;
    }

    .menu-item-has-children.toggled > .dropdown-toggle span {
        transform: rotate(-135deg);
        margin-top: 3px;
    }

    .header-buttons {
        margin-left: 0;
        margin-top: 15px;
    }

    .site-content {
        padding-top: 90px;
    }

    .content-area {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: -1;
        margin-left: 0;
    }

    .entry-title {
        font-size: 26px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 15px;
    }

    .container {
        padding: 0 15px;
    }

    .main-content,
    .sidebar {
        padding: 20px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .entry-title {
        font-size: 22px;
    }

    .entry-meta {
        flex-direction: column;
        gap: 8px;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 14px;
    }

    .wpcb-match-item {
        flex-direction: column;
        text-align: center;
    }

    .wpcb-team {
        justify-content: center;
    }
}

/* ============================================
   WordPress Required Classes
   ============================================ */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

.aligncenter {
    display: block;
    margin: 0 auto 20px;
}

.wp-caption {
    max-width: 100%;
    background: #eee;
    padding: 5px;
}

.wp-caption img {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
}

.gallery {
    margin-bottom: 20px;
}

.gallery-item {
    display: inline-block;
    text-align: center;
    margin: 0 4px 4px 0;
}

.gallery-columns-2 .gallery-item {
    width: 48%;
}

.gallery-columns-3 .gallery-item {
    width: 32%;
}

.gallery-columns-4 .gallery-item {
    width: 23%;
}

/* Sticky Post */
.sticky .entry-title::before {
    content: "📌 ";
}

/* Custom Logo Support */
.custom-logo-link {
    display: block;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}
