/*
Theme Name: Inne Przestrzenie
Theme URI: https://inneprzestrzenie.com
Author: Stowarzyszenie Inne Przestrzenie
Author URI: https://inneprzestrzenie.com
Description: Niestandardowy motyw WordPress dla Stowarzyszenia Inne Przestrzenie — replikuje styl strony głównej (statycznej). Dedykowany dla bloga / czasopisma „Inne Przestrzenie".
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: inne-przestrzenie
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, rtl-language-support
*/

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

:root {
    --bg-primary: #F2EFE9;
    --bg-secondary: #FAF7F1;
    --text-primary: #1A1614;
    --text-secondary: #5C5249;
    --text-muted: #8A7F73;
    --accent: #8B2A1E;
    --accent-light: #C4502B;
    --border: #C9C0B3;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
}

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

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

/* ========================================================== */
/* Nawigacja                                                   */
/* ========================================================== */
nav.site-nav {
    position: fixed;
    top: 0;
    left: 50%;
    right: 0;
    transform: translateX(-50%);
    max-width: 1400px;
    width: 100%;
    background-color: rgba(242, 239, 233, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
}

.logo { display: inline-block; text-decoration: none; }
.logo img { display: block; height: 60px; width: auto; }

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 40px;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: clamp(13px, 1.2vw, 15px);
    transition: color 0.3s;
    position: relative;
}

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

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s;
}

.site-nav a:hover::after { width: 100%; }

/* Hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    z-index: 200;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
    nav.site-nav { padding: 16px 20px; }
    .menu-toggle { display: block; }
    .site-nav ul {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        padding: 80px 20px 40px;
        margin: 0;
        z-index: 150;
    }
    .site-nav ul.open { display: flex; }
    .site-nav ul a {
        font-size: 22px;
        font-family: 'Instrument Serif', serif;
    }
}

/* ========================================================== */
/* Page wrapper                                                */
/* ========================================================== */
.site-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 140px 40px 80px;
}

@media (max-width: 768px) {
    .site-content { padding: 100px 20px 60px; }
}

/* ========================================================== */
/* Typografia podstawowa                                       */
/* ========================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

p { margin-bottom: 1em; color: var(--text-secondary); }

/* ========================================================== */
/* Strona — listing bloga (archive / home)                     */
/* ========================================================== */
.blog-header {
    margin-bottom: 64px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

.blog-header h1 {
    font-size: clamp(48px, 7vw, 96px);
    margin-bottom: 16px;
}

.blog-header .blog-description {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: clamp(18px, 2.2vw, 24px);
    color: var(--text-secondary);
    max-width: 700px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 48px;
}

article.post-card {
    display: flex;
    flex-direction: column;
}

article.post-card .post-thumbnail {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

article.post-card .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

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

article.post-card .post-meta {
    display: flex;
    gap: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

article.post-card .post-meta .category { color: var(--accent); }

article.post-card h2.post-title {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 12px;
}

article.post-card h2.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

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

article.post-card .post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

article.post-card .read-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
}

article.post-card .read-more:hover { color: var(--accent-light); }
article.post-card .read-more::after { content: '→'; transition: transform 0.3s; }
article.post-card .read-more:hover::after { transform: translateX(4px); }

/* ========================================================== */
/* Pojedynczy post (single)                                    */
/* ========================================================== */
article.post-single {
    max-width: 760px;
    margin: 0 auto;
}

article.post-single .post-header {
    margin-bottom: 48px;
}

article.post-single .post-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

article.post-single .post-meta-bar .category { color: var(--accent); }

article.post-single h1.post-title {
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.1;
    margin-bottom: 24px;
}

article.post-single .post-excerpt-lead {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: clamp(20px, 2.2vw, 26px);
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 40px;
}

article.post-single .post-thumbnail-full {
    margin: 0 -40px 48px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

article.post-single .post-thumbnail-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

article.post-single .post-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

article.post-single .post-content h2 {
    font-size: clamp(28px, 3.5vw, 40px);
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

article.post-single .post-content h3 {
    font-size: 24px;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

article.post-single .post-content p { margin-bottom: 1.2em; }

article.post-single .post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 24px;
    margin: 32px 0;
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 20px;
    color: var(--text-primary);
}

article.post-single .post-content ul,
article.post-single .post-content ol {
    margin: 16px 0 24px 24px;
}

article.post-single .post-content li { margin-bottom: 8px; }

article.post-single .post-content img,
article.post-single .post-content .wp-block-image {
    margin: 32px 0;
    width: 100%;
}

article.post-single .post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 4px;
}

article.post-single .post-content a:hover {
    text-decoration-color: var(--accent);
}

article.post-single .post-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

article.post-single .post-content pre {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 32px 0;
}

/* Tagi pod postem */
.post-tags {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags .tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.post-tags .tag:hover {
    background: var(--accent);
    color: var(--bg-secondary);
    border-color: var(--accent);
}

/* Nawigacja między postami */
.post-navigation {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.post-navigation a {
    display: block;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
}

.post-navigation a:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.post-navigation .nav-direction {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.post-navigation .next { text-align: right; }

@media (max-width: 600px) {
    .post-navigation { grid-template-columns: 1fr; }
    article.post-single .post-thumbnail-full { margin: 0 -20px 32px; }
}

/* ========================================================== */
/* Komentarze                                                   */
/* ========================================================== */
.comments-area {
    margin-top: 80px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.comments-area h2.comments-title {
    font-size: 28px;
    margin-bottom: 32px;
}

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

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

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

.comment .comment-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 16px;
    border-radius: 2px;
}

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

.comment-form .submit {
    padding: 14px 32px;
    background: var(--accent);
    color: var(--bg-secondary);
    border: none;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.3s;
}

.comment-form .submit:hover { background: var(--accent-light); }

/* ========================================================== */
/* Wyszukiwarka                                                */
/* ========================================================== */
.search-form {
    display: flex;
    max-width: 480px;
    margin-bottom: 48px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 15px;
    border-radius: 2px 0 0 2px;
}

.search-form .submit {
    padding: 12px 24px;
    background: var(--accent);
    color: var(--bg-secondary);
    border: none;
    cursor: pointer;
    border-radius: 0 2px 2px 0;
}

/* ========================================================== */
/* Paginacja                                                   */
/* ========================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.pagination a,
.pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.3s;
}

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

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

/* ========================================================== */
/* Footer                                                      */
/* ========================================================== */
footer.site-footer {
    padding: 40px;
    background-color: var(--text-primary);
    color: #FAF7F1;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 80px;
}

footer.site-footer a {
    color: var(--accent-light);
}

footer.site-footer a:hover { color: #FAF7F1; }

footer.site-footer .registry-line {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    margin: 6px 0;
}

/* ========================================================== */
/* Helper classes                                              */
/* ========================================================== */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.alignleft { float: left; margin: 0 24px 24px 0; }
.alignright { float: right; margin: 0 0 24px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

/* ========================================================== */
/* Reduced motion                                              */
/* ========================================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
