/*
Theme Name: Iberux
Theme URI: https://iberux.org
Description: A WordPress theme built on principles of European software independence, freedom, and digital sovereignty. Inspired by the Iberux Linux distribution.
Author: Iberux Community
Author URI: https://iberux.org
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: iberux-theme
Domain Path: /languages
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4

Free & Open Source Software licensed under the GPL v2 or later license.
*/

/* ================================================
   IBERUX THEME - CUSTOM STYLES
   Built with European digital sovereignty in mind
   ================================================ */

:root {
    --iber-blue: #005A9C;
    --iber-gold: #FFD700;
    --iber-sand: #F4E7D6;
    --iber-dark: #1A202C;
    --iber-accent: #008080;
    --transition-standard: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--iber-sand);
    color: var(--iber-dark);
    line-height: 1.6;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

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

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--iber-blue);
    text-decoration: none;
    transition: var(--transition-standard);
}

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

/* ================================================
   LAYOUT & STRUCTURE
   ================================================ */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-padding {
    padding: 4rem 1rem;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 2rem 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

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

.site-header {
    background: linear-gradient(135deg, var(--iber-blue) 0%, var(--iber-accent) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    color: white;
    text-decoration: none;
}

.site-branding:hover {
    color: var(--iber-gold);
}

.site-branding svg {
    width: 2rem;
    height: 2rem;
    color: var(--iber-gold);
}

.main-navigation {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.main-navigation a {
    color: white;
    font-weight: 500;
    transition: var(--transition-standard);
}

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

.main-navigation .cta-button {
    background-color: var(--iber-accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.main-navigation .cta-button:hover {
    background-color: var(--iber-gold);
    color: var(--iber-dark);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .main-navigation {
        display: none;
        position: absolute;
        top: 4rem;
        left: 0;
        right: 0;
        background: var(--iber-blue);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

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

    .main-navigation a {
        padding: 0.75rem 1.5rem;
        display: block;
    }

    .menu-toggle {
        display: block;
    }
}

/* ================================================
   FOOTER
   ================================================ */

.site-footer {
    background-color: var(--iber-dark);
    color: white;
    padding: 2.5rem 1rem 1.5rem;
    margin-top: 4rem;
}

.site-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.125rem;
    color: var(--iber-gold);
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: #9ca3af;
    transition: var(--transition-standard);
}

.footer-column a:hover {
    color: var(--iber-sand);
}

.footer-bottom {
    border-top: 1px solid #4b5563;
    padding-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ================================================
   CONTENT SECTIONS
   ================================================ */

.hero-section {
    background: linear-gradient(135deg, var(--iber-blue) 0%, var(--iber-accent) 100%);
    color: white;
    padding: 6rem 1rem;
    text-align: center;
}

.hero-section h1 {
    color: var(--iber-gold);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-section p {
    max-width: 42rem;
    margin: 0 auto 2rem;
    font-size: 1.25rem;
    color: var(--iber-sand);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    flex-direction: row;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
    }
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition-standard);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--iber-gold);
    color: var(--iber-dark);
}

.btn-primary:hover {
    background-color: white;
    transform: scale(1.02);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--iber-blue);
    transform: scale(1.02);
}

.btn-accent {
    background-color: var(--iber-accent);
    color: white;
}

.btn-accent:hover {
    background-color: var(--iber-blue);
}

/* ================================================
   CARDS & FEATURES
   ================================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--iber-sand);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition-standard);
}

.feature-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.feature-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.feature-card-icon {
    width: 2rem;
    height: 2rem;
    color: var(--iber-accent);
}

.feature-card h3 {
    color: var(--iber-blue);
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--iber-dark);
    margin-bottom: 0;
}

/* ================================================
   BLOG/POSTS
   ================================================ */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.post-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition-standard);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.post-thumbnail {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--iber-sand);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-standard);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    background-color: var(--iber-gold);
    color: var(--iber-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.post-category.accent {
    background-color: var(--iber-accent);
    color: white;
}

.post-card-title {
    color: var(--iber-blue);
    font-size: 1.25rem;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.3;
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-standard);
}

.post-card-title a:hover {
    color: var(--iber-accent);
}

.post-card p {
    color: #4b5563;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
}

.post-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.read-more-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--iber-blue);
    font-weight: 600;
    transition: var(--transition-standard);
    text-decoration: none;
}

.read-more-link:hover {
    color: var(--iber-accent);
    transform: translateX(4px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0 2rem;
}

.pagination .nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--iber-blue);
    border-radius: 0.5rem;
    transition: var(--transition-standard);
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination .current {
    background: var(--iber-blue);
    color: white;
}

.pagination a:hover {
    background: var(--iber-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


/* ================================================
   FORMS
   ================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
}

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

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--iber-blue);
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

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

.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    color: var(--iber-blue);
    margin-bottom: 1rem;
}

.entry-meta {
    color: #9ca3af;
    font-size: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.entry-content {
    line-height: 1.8;
    max-width: 65ch;
    margin-bottom: 2rem;
}

.entry-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--iber-blue);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
}

/* ================================================
   SIDEBAR & WIDGETS
   ================================================ */

.sidebar {
    margin-top: 0;
}

@media (max-width: 968px) {
    .sidebar {
        margin-top: 3rem;
    }
}

.widget {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.widget-title {
    color: var(--iber-blue);
    font-size: 1.125rem;
    margin-bottom: 1rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--iber-gold);
}

.widget ul,
.widget-list {
    list-style: none;
}

.widget ul li,
.widget-list li {
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.widget ul li a,
.widget-list li a {
    color: var(--iber-dark);
    transition: var(--transition-standard);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.widget ul li a:hover,
.widget-list li a:hover {
    color: var(--iber-accent);
    padding-left: 0.5rem;
}

.widget-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.widget-list .post-date {
    font-size: 0.75rem;
    color: #9ca3af;
    padding-left: 0;
}

/* Tag Cloud */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud-link {
    display: inline-block;
    background: var(--iber-sand);
    color: var(--iber-dark);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    transition: var(--transition-standard);
    text-decoration: none;
    border: 1px solid transparent;
}

.tag-cloud-link:hover {
    background: var(--iber-blue);
    color: white;
    border-color: var(--iber-blue);
    transform: translateY(-2px);
}

/* Categories & Archives count styling */
.widget-categories .count,
.widget-archives .count {
    background: var(--iber-gold);
    color: var(--iber-dark);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Search Form in Widget */
.widget-search form {
    display: flex;
    gap: 0.5rem;
}

.widget-search input[type="search"] {
    flex: 1;
    margin-bottom: 0;
}

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

.comments-area {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.comment-respond {
    margin-bottom: 2rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--iber-blue);
    font-weight: 600;
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

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

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.bg-white {
    background-color: white;
}

.bg-sand {
    background-color: var(--iber-sand);
}

.bg-blue {
    background-color: var(--iber-blue);
}

.text-white {
    color: white;
}

.text-dark {
    color: var(--iber-dark);
}

.text-muted {
    color: #9ca3af;
}

/* ================================================
   RESPONSIVE UTILITIES
   ================================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .features-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }

    /* Stack blog layout on mobile */
    .container>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none;
    }
}

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

.post-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    color: white;
    position: relative;
}

.post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 90, 156, 0.8) 0%, rgba(0, 128, 128, 0.8) 100%);
    z-index: -1;
}

.entry-title {
    font-size: 2.5rem;
    color: var(--iber-blue);
    line-height: 1.2;
    margin: 1.5rem 0 1rem;
}

@media (max-width: 768px) {
    .post-hero {
        min-height: 350px;
    }
    
    .entry-title {
        font-size: 1.75rem;
    }
}

.entry-content {
    line-height: 1.8;
    font-size: 1.0625rem;
    color: var(--iber-dark);
}

.entry-content p {
    margin-bottom: 1.5rem;
    max-width: none;
}

.entry-content h2 {
    font-size: 1.875rem;
    color: var(--iber-blue);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.entry-content h3 {
    font-size: 1.5rem;
    color: var(--iber-dark);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.entry-content blockquote {
    border-left: 4px solid var(--iber-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
}

.entry-content code {
    background-color: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--iber-accent);
}

.entry-content pre {
    background-color: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.entry-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.entry-content ul,
.entry-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.entry-content ul li {
    margin-bottom: 0.75rem;
}

.entry-content ol li {
    margin-bottom: 0.75rem;
}

.page-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--iber-sand);
    border-radius: 0.5rem;
}

.page-links a,
.page-links span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background-color: white;
    color: var(--iber-blue);
    border-radius: 0.375rem;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    transition: var(--transition-standard);
}

.page-links a:hover {
    background-color: var(--iber-blue);
    color: white;
}

.separator {
    color: #d1d5db;
}

/* Post Categories and Tags Styling */
.post-categories,
.post-tags {
    margin-bottom: 2rem;
}

.post-categories h4,
.post-tags h4 {
    color: var(--iber-blue);
    font-size: 1rem;
}

.post-categories a,
.post-tags a {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    background-color: var(--iber-sand);
    color: var(--iber-dark);
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-standard);
}

.post-categories a:hover {
    background-color: var(--iber-accent);
    color: white;
}

.post-tags a:hover {
    background-color: var(--iber-blue);
    color: white;
}

/* Post Navigation */
.post-navigation a {
    display: block;
    color: var(--iber-blue);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-standard);
}

.post-navigation a:hover {
    color: var(--iber-accent);
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

/* Comments List */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border-left: 4px solid var(--iber-sand);
}

.comment:hover {
    border-left-color: var(--iber-accent);
    background-color: #f5f5f5;
}

.comment-body {
    margin-bottom: 1rem;
}

.comment-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: var(--iber-blue);
}

/* Sidebar Widget Enhancements */
.sidebar .widget {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: var(--transition-standard);
}

.sidebar .widget:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar .widget-title {
    color: var(--iber-blue);
    font-size: 1.125rem;
    margin-bottom: 1rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--iber-gold);
}

.sidebar .widget ul {
    list-style: none;
    padding: 0;
}

.sidebar .widget ul li {
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.sidebar .widget ul li a {
    color: var(--iber-dark);
    text-decoration: none;
    transition: var(--transition-standard);
    display: block;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.sidebar .widget ul li a:hover {
    color: var(--iber-accent);
    background-color: var(--iber-sand);
    padding-left: 1rem;
}

/* Responsive adjustments for sidebar */
@media (max-width: 768px) {
    .entry-content {
        font-size: 1rem;
    }
    
    .entry-content h2 {
        font-size: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .entry-content h3 {
        font-size: 1.25rem;
        margin-top: 1.25rem;
    }
}