/* ============================================
   ATTENTION DRAWING STUDIO — Blog styles
   Lexend, palette: --primary #000, --secondary #c2fcc0
   ============================================ */

/* ---------- Blog page (gallery) ---------- */
.blog-container {
    margin: 0 auto;
    padding: 160px 120px 80px;
    min-height: 70vh;
}

@media (max-width: 900px) {
    .blog-container { padding: 120px 60px 60px; }
}

@media (max-width: 576px) {
    .blog-container { padding: 120px 20px 60px; }
    .blog-header { padding: 0 4px; margin-bottom: 40px; }
}

.blog-header {
    text-align: center;
    margin: 0 0 56px;
}

.blog-title {
    font-family: var(--font);
    font-weight: 800;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.1;
    color: var(--primary);
    margin: 0 0 12px;
}

.blog-subtitle {
    font-family: var(--font);
    font-size: 18px;
    color: #555;
    margin: 0;
}

/* ---------- Blog grid - taki sam uklad jak portfolio ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

@media (max-width: 900px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .blog-grid { grid-template-columns: 1fr; gap: 16px; }
    .blog-tile { aspect-ratio: 4/3; }
}

.blog-tile {
    display: block;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: #111;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.blog-tile:hover {
    transform: scale(1.02);
    filter: brightness(0.85);
}

.blog-tile:active {
    transform: scale(0.98);
    filter: brightness(0.7);
}

.blog-tile-picture,
.blog-tile-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 0;
    transition: transform 0.4s ease;
}

.blog-tile-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.blog-tile:hover .blog-tile-img,
.blog-tile:hover .blog-tile-bg {
    transform: scale(1.05);
}

.blog-tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.blog-tile-title {
    font-family: var(--font);
    font-weight: 700;
    font-size: clamp(14px, 1.8vw, 22px);
    line-height: 1.4;
    color: #fff;
    margin: 0 0 6px;
    /* ograniczenie do 3 linii */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-tile-date {
    font-family: var(--font);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    display: block;
}

/* ---------- Pagination ---------- */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 56px;
    font-family: var(--font);
}

.blog-pagination a,
.blog-pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary);
    font-size: 14px;
}

.blog-pagination a:hover { background: var(--secondary); }
.blog-pagination .page-current { background: var(--primary); color: #fff; }

/* ============================================
   Archive list (legacy, dla archive.hbs jesli uzyty)
   ============================================ */
.archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 160px 24px 80px;
    min-height: 70vh;
}

.archive-header {
    text-align: center;
    margin-bottom: 64px;
}

.archive-title {
    font-family: var(--font);
    font-weight: 800;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.1;
    color: var(--primary);
    margin: 0 0 12px;
}

.archive-subtitle {
    font-family: var(--font);
    font-size: 18px;
    color: #555;
    margin: 0;
}

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

.archive-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.archive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.archive-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.archive-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f0f0f0;
}

.archive-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.archive-card:hover .archive-card-image img {
    transform: scale(1.05);
}

.archive-card-body {
    padding: 24px;
}

.archive-card-title {
    font-family: var(--font);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.3;
    color: var(--primary);
    margin: 0 0 12px;
}

.archive-card-excerpt {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    margin: 0 0 16px;
}

.archive-card-date {
    font-family: var(--font);
    font-size: 13px;
    color: #888;
}

/* ============================================
   Single post
   ============================================ */
.post-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 160px 24px 80px;
    min-height: 70vh;
}

.post-header {
    margin-bottom: 40px;
    text-align: center;
}

.post-title {
    font-family: var(--font);
    font-weight: 800;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.15;
    color: var(--primary);
    margin: 0 0 20px;
}

.post-meta {
    font-family: var(--font);
    font-size: 14px;
    color: #666;
}

.post-author {
    margin-left: 8px;
}

.post-feature-image {
    margin: 0 0 48px;
    border-radius: 12px;
    overflow: hidden;
}

.post-feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.75;
    color: #1a1a1a;
}

.post-content > * + * { margin-top: 1.4em; }

.post-content h2 {
    font-family: var(--font);
    font-weight: 800;
    font-size: 30px;
    line-height: 1.25;
    color: var(--primary);
    margin-top: 2.4em;
}

.post-content h3 {
    font-family: var(--font);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.3;
    color: var(--primary);
    margin-top: 2em;
}

.post-content p { margin: 0; }

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.post-content a:hover {
    background: var(--secondary);
    text-decoration: none;
}

.post-content blockquote {
    border-left: 4px solid var(--secondary);
    padding: 8px 0 8px 24px;
    margin: 1.6em 0;
    font-style: italic;
    color: #333;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.6em 0;
    display: block;
}

.post-content figure { margin: 1.6em 0; }
.post-content figcaption {
    font-size: 14px;
    color: #777;
    text-align: center;
    margin-top: 8px;
}

.post-content pre {
    background: #1a1a1a;
    color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.post-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

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

.post-content ul,
.post-content ol {
    padding-left: 1.5em;
    line-height: 1.7;
}

.post-content li + li { margin-top: 0.4em; }

.post-content hr {
    border: 0;
    height: 2px;
    background: var(--secondary);
    margin: 2.4em 0;
}

.post-footer {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.post-tag {
    background: var(--secondary);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
}

.post-back-link {
    font-family: var(--font);
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.post-back-link:hover { text-decoration: underline; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 64px;
    font-family: var(--font);
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary);
    font-size: 14px;
}

.pagination a:hover { background: var(--secondary); }
.pagination .page-current { background: var(--primary); color: #fff; }

/* ============================================
   Generic page (fallback page.hbs)
   ============================================ */
.page-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 160px 24px 80px;
    min-height: 70vh;
}

.page-feature-image {
    margin: 0 0 32px;
    border-radius: 12px;
    overflow: hidden;
}

.page-feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

.page-title {
    font-family: var(--font);
    font-weight: 800;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.15;
    color: var(--primary);
    margin: 0 0 32px;
}

.page-content {
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.75;
    color: #1a1a1a;
}

.page-content > * + * { margin-top: 1.4em; }

.page-content h2 {
    font-family: var(--font);
    font-weight: 800;
    font-size: 30px;
    line-height: 1.25;
    color: var(--primary);
    margin-top: 2em;
}

.page-content h3 {
    font-family: var(--font);
    font-weight: 700;
    font-size: 22px;
    margin-top: 1.6em;
}

.page-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page-content a:hover {
    background: var(--secondary);
    text-decoration: none;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ============================================
   Koenig/Gallery cards widths (gscan)
   ============================================ */
.post-content .kg-width-wide {
    margin-left: calc(-1 * min(80px, 6vw));
    margin-right: calc(-1 * min(80px, 6vw));
    max-width: none;
    width: auto;
}

.post-content .kg-width-full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

.post-content .kg-width-full img {
    width: 100%;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    .blog-container,
    .archive-container,
    .post-container,
    .page-container { padding-top: 120px; }
    .post-content { font-size: 16px; line-height: 1.7; }
    .post-content h2 { font-size: 24px; }
    .post-content h3 { font-size: 20px; }
}
