/* ═══════════════════════════════════════════════════════════════
   PORADNIK.CSS — NetRecepta Blog Styles
   Porady medyczne: Archive + Single Post
   Phase 6: Layout & UX Improvements
═══════════════════════════════════════════════════════════════ */

/* --- CSS Variables (reuse NetRecepta tokens) --- */
:root {
    --porady-primary: #e65100;
    --porady-primary-light: rgba(230, 81, 0, 0.08);
    --porady-primary-medium: rgba(230, 81, 0, 0.15);
    --porady-green: #2E7D32;
    --porady-green-light: rgba(46, 125, 50, 0.08);
    --porady-text-dark: #111827;
    --porady-text-medium: #4b5563;
    --porady-text-light: #9ca3af;
    --porady-bg-light: #f9fafb;
    --porady-border: #e5e7eb;
    --porady-radius: 16px;
    --porady-radius-lg: 24px;
    --porady-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --porady-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --porady-shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.12);
}


/* ═══════════════════════════════════════
   0. ONLINE BADGE (Zeitbasiert)
═══════════════════════════════════════ */
.porady-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 20px 6px 14px;
    border-radius: 32px;
    font-size: 14px;
    font-weight: 600;
    line-height: 24px;
    transition: all 0.3s ease;
}

.porady-online-badge--online {
    background: rgba(46, 125, 50, 0.1);
    color: var(--porady-green);
}

.porady-online-badge--offline {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.porady-online-badge__dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.porady-online-badge--online .porady-online-badge__dot {
    background: rgba(46, 125, 50, 0.15);
}

.porady-online-badge--offline .porady-online-badge__dot {
    background: rgba(239, 68, 68, 0.15);
}

.porady-online-badge__dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
    animation: poradyPulse 2s ease-in-out infinite;
}

.porady-online-badge--online .porady-online-badge__dot::after {
    background: var(--porady-green);
}

.porady-online-badge--offline .porady-online-badge__dot::after {
    background: #dc2626;
    animation: none;
}

@keyframes poradyPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}


/* ═══════════════════════════════════════
   0.5 SERVICE CARDS (Archiv SEO-Sektion)
═══════════════════════════════════════ */
.porady-services {
    background: linear-gradient(180deg, #fff 0%, var(--porady-bg-light) 100%);
}

.porady-services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .porady-services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

.porady-service-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: var(--porady-radius);
    background: #fff;
    border: 1px solid var(--porady-border);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: poradyFadeIn 0.5s ease-out forwards;
}

.porady-service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--porady-shadow-lg);
    border-color: var(--porady-primary);
}

.porady-service-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--porady-primary-light);
    color: var(--porady-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.porady-service-card:hover .porady-service-card__icon {
    transform: scale(1.08);
}

.porady-service-card__icon--blue {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

.porady-service-card__icon--rose {
    background: rgba(219, 39, 119, 0.08);
    color: #db2777;
}

.porady-service-card__price {
    font-size: 22px;
    font-weight: 800;
    color: var(--porady-primary);
    letter-spacing: -0.5px;
}

.porady-service-card__cta {
    font-size: 13px;
    font-weight: 600;
    color: var(--porady-primary);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.porady-service-card:hover .porady-service-card__cta {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 640px) {
    .porady-service-card {
        padding: 20px;
    }

    .porady-service-card__cta {
        opacity: 1;
        transform: translateX(0);
        font-size: 12px;
    }
}


/* ═══════════════════════════════════════
   1. ARCHIVE: CATEGORY PILLS
═══════════════════════════════════════ */
.porady-categories {
    -webkit-overflow-scrolling: touch;
}

.porady-pill {
    scroll-snap-align: start;
    border: 1px solid transparent;
}

.porady-pill:hover {
    border-color: var(--porady-primary);
}

.porady-pill[aria-current="true"] {
    border-color: var(--porady-primary);
}


/* ═══════════════════════════════════════
   2. CARDS
═══════════════════════════════════════ */
.porady-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.porady-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--porady-shadow-lg);
}

/* Line clamp (cross-browser) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ═══════════════════════════════════════
   3. PAGINATION
═══════════════════════════════════════ */
.porady-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--porady-text-medium);
    background: white;
    border: 1px solid var(--porady-border);
    transition: all 0.2s ease;
    text-decoration: none;
}

.porady-page-btn:hover {
    border-color: var(--porady-primary);
    color: var(--porady-primary);
    background: var(--porady-primary-light);
}

.porady-page-btn.active {
    background: var(--porady-primary);
    color: white;
    border-color: var(--porady-primary);
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.3);
}

.porady-page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--porady-text-light);
    font-size: 16px;
}


/* ═══════════════════════════════════════
   4. SINGLE POST: TOC SIDEBAR
═══════════════════════════════════════ */

/* Desktop: Sticky Sidebar — 150px top (50px mehr Abstand zum Nav) */
@media (min-width: 1025px) {
    .porady-toc--sidebar {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 150px;
        align-self: flex-start;
        max-height: calc(100vh - 170px);
        overflow-y: auto;
    }

    /* Hide mobile summary toggle on desktop */
    .porady-toc--sidebar summary {
        display: none;
    }

    /* Always show nav on desktop */
    .porady-toc--sidebar details>nav {
        display: block !important;
    }
}

/* Mobile: Normal flow, collapsible */
@media (max-width: 1024px) {
    .porady-toc--sidebar {
        width: 100%;
    }
}

.porady-toc-desktop {
    transition: opacity 0.3s ease;
}

.porady-toc__link {
    padding: 6px 12px;
    border-left: 3px solid transparent;
    margin-left: -3px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    border-radius: 0 8px 8px 0;
}

.porady-toc__link:hover {
    border-left-color: var(--porady-primary);
    color: var(--porady-primary) !important;
    background: var(--porady-primary-light);
}

/* Aktive H2: fett + grün hervorgehoben */
.porady-toc__link.active {
    font-weight: 700;
    color: var(--porady-green) !important;
    border-left-color: var(--porady-green);
    background: var(--porady-green-light);
}

/* Mobile TOC toggle */
.porady-toc--sidebar summary::-webkit-details-marker {
    display: none;
}

.porady-toc--sidebar[open] summary svg:last-child {
    transform: rotate(180deg);
}


/* ═══════════════════════════════════════
   5. SINGLE POST: FEATURED IMAGE (1200×630)
═══════════════════════════════════════ */
.porady-featured-image {
    aspect-ratio: 1200 / 630;
    width: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: var(--porady-radius);
    display: block;
    box-shadow: var(--porady-shadow-md);
}

.porady-hero-image {
    border-radius: var(--porady-radius);
    overflow: hidden;
}

.porady-image-block {
    border-radius: var(--porady-radius);
    overflow: hidden;
}


/* ═══════════════════════════════════════
   6. SINGLE POST: PROSE / CONTENT
═══════════════════════════════════════ */
.porady-prose {
    line-height: 1.75;
}

.porady-prose p {
    margin-bottom: 1em;
}

.porady-prose p:last-child {
    margin-bottom: 0;
}

.porady-prose a {
    color: var(--porady-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.porady-prose a:hover {
    opacity: 0.8;
}

.porady-prose strong {
    font-weight: 700;
    color: var(--porady-text-dark);
}

.porady-prose ul,
.porady-prose ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.porady-prose li {
    margin-bottom: 0.5em;
}

.porady-prose h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--porady-text-dark);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.porady-prose h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--porady-text-dark);
    margin-top: 1.25em;
    margin-bottom: 0.4em;
}

.porady-prose img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
    box-shadow: var(--porady-shadow-sm);
}

/* Tabellen: Premium-Styling mit Rundung + Schatten */
.porady-prose table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5em 0;
    font-size: 14px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--porady-shadow-sm);
    border: 1px solid var(--porady-border);
}

.porady-prose table th,
.porady-prose table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--porady-border);
    text-align: left;
}

.porady-prose table th {
    background: linear-gradient(135deg, var(--porady-bg-light), #eef2f7);
    font-weight: 700;
    color: var(--porady-text-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.porady-prose table tr:last-child td {
    border-bottom: none;
}

.porady-prose table tr:hover td {
    background: var(--porady-primary-light);
    transition: background 0.2s ease;
}


/* ═══════════════════════════════════════
   7. INFO BOXES (Premium)
═══════════════════════════════════════ */
.porady-infobox {
    box-shadow: var(--porady-shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.porady-infobox:hover {
    box-shadow: var(--porady-shadow-md);
    transform: translateY(-2px);
}


/* ═══════════════════════════════════════
   8. CODE BLOCK
═══════════════════════════════════════ */
.porady-code-block {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.porady-code-block table {
    width: 100%;
    border-collapse: collapse;
}

.porady-code-block table th,
.porady-code-block table td {
    padding: 10px 14px;
    border: 1px solid var(--porady-border);
    text-align: left;
    font-family: inherit;
}

.porady-code-block table th {
    background: #e5e7eb;
    font-weight: 700;
}


/* ═══════════════════════════════════════
   9. QUOTE BLOCK
═══════════════════════════════════════ */
.porady-quote {
    position: relative;
}

.porady-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 16px;
    font-size: 64px;
    line-height: 1;
    color: var(--porady-primary);
    opacity: 0.15;
    font-family: Georgia, serif;
}


/* ═══════════════════════════════════════
   10. AUTHOR BOX
═══════════════════════════════════════ */
.porady-author {
    transition: box-shadow 0.3s ease;
}

.porady-author:hover {
    box-shadow: var(--porady-shadow-md);
}


/* ═══════════════════════════════════════
   11. POST CTA
═══════════════════════════════════════ */
.porady-post-cta {
    position: relative;
    overflow: hidden;
}

.porady-post-cta::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.porady-post-cta::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}


/* ═══════════════════════════════════════
   12. FAQ (reuse home.twig patterns)
═══════════════════════════════════════ */
.porady-faq .faq-item summary::-webkit-details-marker {
    display: none;
}

.porady-faq .faq-item[open] .faq-icon {
    transform: rotate(45deg);
    background-color: var(--porady-primary);
    color: white;
}


/* ═══════════════════════════════════════
   13. BREADCRUMB
═══════════════════════════════════════ */
.porady-breadcrumb a {
    text-decoration: none;
}

.porady-breadcrumb a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* ═══════════════════════════════════════
   14. RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .porady-layout {
        flex-direction: column;
    }

    .porady-toc-wrapper {
        order: 0 !important;
    }

    .porady-content {
        max-width: 100% !important;
    }
}

@media (max-width: 640px) {
    .porady-hero h1 {
        font-size: 28px;
    }

    .porady-featured .grid {
        grid-template-columns: 1fr !important;
    }

    .porady-post-header h1 {
        font-size: 24px;
    }

    .porady-page-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .porady-online-badge {
        font-size: 13px;
        padding: 4px 16px 4px 10px;
    }
}


/* ═══════════════════════════════════════
   15. ANIMATIONS
═══════════════════════════════════════ */
.porady-card,
.porady-featured a,
.porady-infobox,
.porady-quote,
.porady-author {
    animation: poradyFadeIn 0.5s ease-out forwards;
}

@keyframes poradyFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ═══════════════════════════════════════
   16. PRINT STYLES
═══════════════════════════════════════ */
@media print {

    .porady-categories,
    .porady-toc-wrapper,
    .porady-post-cta,
    .porady-related,
    .porady-pagination,
    .porady-online-badge {
        display: none !important;
    }

    .porady-content {
        max-width: 100% !important;
    }
}

/* ═══ MOBILE: Single Post Header Abstand ═══ */
@media (max-width: 1023px) {
    .porady-single header {
        padding-top: 100px !important;
    }

    .porady-hero {
        padding-top: 100px !important;
    }
}