/* Main site stylesheet - generated by migrator */
:root {
    --primary-color: #2563eb;
    --accent: #764ba2;
    --muted: #64748b;
    --bg: #ffffff;
    --surface: #f8fafc;
    --text: #0f172a;
    --border: #e6eef8;
    --max-width: 1200px;
    --sidebar-width: 220px;
    --toc-width: 260px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Play', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav-links {
    display: flex;
    gap: 1rem
}

.hero {
    padding: 0;
    text-align: center;
    background: url('../images/pictures/Cloudpartner_header.png') center/contain no-repeat;
    background-size: 100% auto;
    color: #fff;
    margin-bottom: 1.5rem;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Post header image spacing - reduce whitespace above and below */
.post-header-image {
    margin: 1rem 0 1.5rem 0;
}

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

.hero h1 {
    font-size: 3rem;
    margin: 0 0 .5rem
}

.hero p {
    margin: 0 0 1.25rem;
    opacity: .95
}

.layout-with-sidebar {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.main-col {
    flex: 1 1 0%
}

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width)
}

/* Align sidebar with Latest Posts section on homepage */
body.frontpage-quicklinks .sidebar {
    margin-top: 5rem;
}

.post-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start
}

.post-toc {
    width: var(--toc-width);
    flex: 0 0 var(--toc-width);
    background: #fbfdff;
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    position: sticky;
    top: 90px;
    /* allow TOC to expand without internal scrolling */
    box-shadow: 0 6px 24px rgba(16, 24, 40, 0.06)
}

.post-toc h3 {
    margin: 0 0 .5rem
}

.post-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0
}

.post-toc li {
    margin: .35rem 0
}

.post-toc a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block
}

.post-toc a.active {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.02));
    font-weight: 700
}

.post-content {
    flex: 1 1 0%;
    min-width: 0
}

.post-content h2 {
    margin-top: 2rem
}

.post-content p {
    max-width: none
}

.post-content img,
.post-content figure img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Special-case: make the 'youcandothis' end-of-post image small and centered
   The template file also contains a rule, but generated posts don't include
   template-local styles. Put the rule here so the image is constrained site-wide. */
.post-content img[src$="youcandothis.png"] {
    width: 180px !important;
    height: auto !important;
    display: block;
    margin: 1.25rem auto;
}

.post-content {
    overflow-wrap: break-word;
}

/* table styling to look nicer */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0
}

table thead th {
    background: #f3f6fb;
    padding: .6rem;
    border: 1px solid var(--border);
    text-align: left
}

table tbody td {
    padding: .6rem;
    border: 1px solid var(--border)
}

table tbody tr:nth-child(odd) {
    background: #fff
}

table tbody tr:nth-child(even) {
    background: #fbfdff
}

/* subscribe button removed - styles cleaned up */

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

.post-card {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border)
}

pre {
    background: #0b1220;
    color: #d6deeb;
    padding: 14px;
    border-radius: 8px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 1.25rem 0;
    position: relative
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace
}

.code-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: .4rem
}

.code-toolbar button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: .25rem .45rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .8rem
}

.code-lang {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: .2rem .45rem;
    color: #fff;
    font-size: .75rem
}

.sidebar .widget {
    background: #fff;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 1rem;
    pointer-events: auto;
}

.sidebar .widget h3 {
    margin: 0 0 .6rem
}

/* Avatar in sidebar: constrain size and center it across all posts */
.sidebar .widget.avatar-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
}

.avatar-sidebar {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-sidebar img {
    /* show full avatar image and allow larger display to fill the box */
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
    margin: 0 auto;
}

@media (max-width: 900px) {
    .avatar-sidebar img {
        max-width: 180px;
        width: 160px;
        max-height: none;
    }
}

.sidebar .widget a.category,
.sidebar .widget a.tag {
    display: inline-block;
    background: #efefef;
    padding: .25rem .5rem;
    border-radius: 4px;
    margin: .2rem .2rem;
    color: var(--text);
    text-decoration: none
}

.site-footer {
    background: var(--surface);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem
}

@media (max-width: 900px) {
    .layout-with-sidebar {
        display: block
    }

    .sidebar {
        width: 100%;
        margin-top: 1rem
    }

    .post-toc {
        display: none
    }

    .hero {
        padding: 1rem 0;
        min-height: 250px;
    }

    .hero h1 {
        font-size: 2rem
    }

    /* Mobile spacing for post header images */
    .post-header-image {
        margin: 0.5rem 0 1rem 0;
    }

    /* Mobile centering for buy buttons section */
    .buy-buttons-section {
        padding: 24px 16px;
        max-width: 100%;
        margin: 0 auto;
        text-align: center;
    }

    .buy-buttons-grid {
        justify-content: center;
        padding: 0;
        margin: 0 auto 30px;
        gap: 12px;
        flex-wrap: wrap;
        /* Allow wrapping on mobile */
    }

    .buy-buttons-grid .buy-col {
        justify-content: center;
        max-width: 100%;
        flex: 0 0 auto;
    }

    /* Mobile centering for quiz widget */
    .quiz-widget {
        margin: 0 16px;
        max-width: calc(100% - 32px);
        width: calc(100% - 32px);
    }

    .quiz-header,
    .question-container,
    .question {
        text-align: center !important;
    }

    .question-container {
        padding: 0 10px;
    }
}

/* Thin visible scrollbar for TOC */
/* removed TOC internal scrollbar to let it grow with page */

/* Hide the small site brand link on pages (user requested) */
.nav-brand a {
    visibility: hidden
}

/* Quick links at top of sidebar (Home / About) */
.widget.quick-links {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 10px;
    margin-bottom: 1rem
}

/* Navigation icons row - make them bigger and display side by side */
.nav-icons-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 1rem;
    padding: 10px;
}

.nav-icons-row .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-icons-row .nav-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.1);
}

.nav-icons-row .nav-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* On the front page we want quick-links icons side-by-side, but for the frontpage we show a single large about icon */
.frontpage-quicklinks .widget.quick-links {
    display: block;
    padding: 10px;
    margin-bottom: 12px;
    text-align: center;
}

.frontpage-quicklinks .widget.quick-links a.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
}

.frontpage-quicklinks .widget.quick-links .about-link {
    display: inline-block;
    margin: 0 auto 8px auto;
}

.frontpage-quicklinks .widget.quick-links .about-link img {
    width: 98px;
    height: 98px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
    background: #fff;
}

.view-all {
    text-align: center;
    margin: 2rem 0;
}

.view-all .btn {
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.view-all .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.3);
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
}

.pagination-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.25);
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.35);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.page-info {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    min-width: 120px;
    text-align: center;
}

/* Frontpage categories styling */
.frontpage-categories .categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.frontpage-categories .categories-container a.category {
    background: #f3f6fb;
    color: var(--text);
    padding: .4rem .65rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid var(--border);
    font-weight: 600;
}

.btn-link {
    display: inline-block;
    padding: .5rem .75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700
}

/* Make categories widget visually stretch to the height of the main column */
.categories-widget {
    display: block;
    /* let the widget size naturally to the sidebar height (sidebar stretches to match main column)
       remove internal scrolling so the categories visually end where the posts end */
    padding: 12px;
    overflow: hidden;
    /* clip any excess without showing an inner scrollbar */
    /* animate when categories expand/collapse to avoid a sudden half-pill appearing */
    transition: max-height 180ms ease-in-out;
}

.categories-widget a.category {
    display: inline-block;
    margin: .18rem .18rem;
    background: #f3f6fb;
    padding: .22rem .45rem;
    border-radius: 6px;
    font-size: 0.92rem;
}

/* Style category topic and count separately */
.categories-widget a.category {
    text-transform: none;
}

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

.categories-widget a.category .cat-count {
    color: var(--muted);
    font-weight: 600;
    margin-left: 4px;
    font-size: 0.85rem;
}

.categories-widget a.category {
    text-transform: uppercase;
    letter-spacing: .6px;
}

.categories-widget a.category .cat-count {
    text-transform: none;
    letter-spacing: 0;
}

/* Archives section below main frame */
.archives-box {
    padding: 2rem 0
}

.archives-box .widget {
    border: 1px solid var(--border);
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    max-width: 100%;
}

.archives-box .widget ul {
    columns: 2;
    column-gap: 2rem;
    list-style: none;
    padding-left: 0;
    margin: 0
}

.archives-box .widget li {
    break-inside: avoid;
    margin: .25rem 0
}

.widget {
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.widget h3 {
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Services / pricing compact widget */
.services-widget .services-list {
    display: grid;
    gap: 12px;
}

.service-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.service-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.service-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.service-price .per {
    font-size: .7rem;
    font-weight: 400;
    color: var(--muted);
}

.subscribe-btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 8px;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.payment-icons img {
    opacity: 0.95;
    filter: none;
}

.categories-container {
    /* Remove the fixed max-height and internal scrollbar so the list flows naturally.
       The sidebar's height matches the main column; this makes the categories end where posts end. */
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.stats-section {
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    padding: 40px 0;
    margin-top: 30px;
}

.stats-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #0078d4;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #0078d4;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

    .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Compact card styles for latest posts */
.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.compact-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.compact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #0078d4;
}

.compact-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-meta {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.compact-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.compact-category {
    background: #8b5cf6;
    /* Purple like intro.cloudpartner.fi */
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 50px;
    font-size: 0.625rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    /* Show only first 6 posts on mobile */
    .compact-grid .compact-card:nth-child(n+7) {
        display: none;
    }
}

@media (max-width: 480px) {
    .compact-grid {
        grid-template-columns: 1fr;
    }

    /* Show only first 6 posts on mobile */
    .compact-grid .compact-card:nth-child(n+7) {
        display: none;
    }
}

/* Mission Statement Section */
.mission-statement {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    /* Purple gradient matching button */
    padding: 60px 0;
    margin: 40px 0;
    border: 2px solid #6b21a8;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25), 0 4px 12px rgba(139, 92, 246, 0.15);
}

.mission-statement .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.mission-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    /* White heading for contrast on purple */
    margin-bottom: 1.5rem;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mission-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #f3e8ff;
    /* Light purple text */
    margin-bottom: 1rem;
    text-align: justify;
}

.mission-content p:last-of-type {
    margin-bottom: 1.5rem;
}

.mission-hashtags {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.mission-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

/* Community Impact Widget */
.community-impact-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    max-width: 100%;
    box-shadow: none;
}

.impact-content {
    text-align: center;
    flex: 1;
}

.impact-value {
    display: inline;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.impact-label {
    display: inline;
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.4;
}

.impact-label sup {
    font-size: 0.65rem;
    vertical-align: super;
    line-height: 0;
}

.impact-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .mission-statement {
        padding: 40px 0;
        margin: 20px 10px;
    }

    .mission-content h2 {
        font-size: 1.5rem;
    }

    .mission-content p {
        font-size: 1rem;
        text-align: left;
    }

    .mission-hashtags {
        gap: 0.5rem;
    }

    .mission-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .community-impact-widget {
        padding: 0.4rem 0.8rem;
    }

    .impact-value {
        font-size: 0.85rem;
    }

    .impact-label {
        font-size: 0.85rem;
    }
}

/* Newsletter Widget (Sidebar - Compact) */
.newsletter-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1rem;
    color: #000000;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.2);
    text-align: center;
}

.newsletter-widget h3 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: #000000;
}

.newsletter-description {
    margin: 0 0 0.75rem 0;
    font-size: 0.8rem;
    opacity: 1;
    line-height: 1.3;
    color: #000000;
}

.newsletter-form-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.newsletter-form-compact input[type="email"] {
    padding: 0.625rem 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: center;
}

.newsletter-form-compact input::placeholder {
    color: #999;
}

.newsletter-form-compact input:focus {
    outline: none;
    border-color: #764ba2;
    background: white;
}

.newsletter-btn-compact {
    padding: 0.625rem 1rem;
    background: white;
    color: #764ba2;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.newsletter-btn-compact:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.newsletter-btn-compact:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(118, 75, 162, 0.3);
    border-top-color: #764ba2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.newsletter-message-compact {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

.newsletter-message-compact.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.newsletter-message-compact.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Newsletter Popup Modal */
.newsletter-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.newsletter-popup-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.newsletter-popup {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.popup-close:hover {
    color: #333;
}

.popup-content {
    padding: 2.5rem;
    text-align: center;
}

.popup-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.popup-content h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.75rem;
    color: #333;
    font-weight: 700;
}

.popup-content p {
    margin: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.5;
}

.newsletter-form-popup {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsletter-form-popup input[type="email"],
.newsletter-form-popup input[type="text"] {
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.newsletter-form-popup input:focus {
    outline: none;
    border-color: #764ba2;
}

.newsletter-form-popup input::placeholder {
    color: #999;
}

.newsletter-btn-popup {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.newsletter-btn-popup:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(118, 75, 162, 0.4);
}

.newsletter-btn-popup:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.newsletter-message-popup {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.newsletter-message-popup.success {
    background: #d1fae5;
    border: 2px solid #10b981;
    color: #065f46;
}

.newsletter-message-popup.error {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.popup-no-thanks {
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-align: center;
}

.popup-no-thanks:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* Responsive Popup */
@media (max-width: 768px) {
    .popup-content {
        padding: 2rem 1.5rem;
    }

    .popup-icon {
        font-size: 2.5rem;
    }

    .popup-content h2 {
        font-size: 1.5rem;
    }
}

/* View All Posts Widget - Vertical Button in Sidebar */
.view-all-widget {
    text-align: center;
    padding: 16px 12px;
}

.btn-vertical {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    display: block;
}

.btn-vertical:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.btn-vertical:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

/* AI Quiz Widget */
.quiz-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    color: #000000;
    margin: 0 auto;
    max-width: 600px;
}

.quiz-header {
    text-align: center;
    margin-bottom: 15px;
}

.quiz-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #000000;
}

.quiz-subtitle {
    font-size: 0.85rem;
    opacity: 1;
    color: #000000;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 6px;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    background: white;
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.question-container {
    margin-bottom: 10px;
}

.question {
    font-size: 0.95rem;
    font-weight: bold;
    margin-bottom: 12px;
    line-height: 1.4;
    color: #000000;
    text-align: center;
}

.answer-option {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    border-radius: 8px;
    color: #000000;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.answer-option:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.answer-option.correct {
    background: #10b981;
    border-color: white;
    color: white;
}

.answer-option.incorrect {
    background: #ef4444;
    border-color: white;
    color: white;
}

.email-reveal {
    display: none;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    margin-top: 15px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.email-text {
    font-size: 1rem;
    margin-bottom: 12px;
    color: white;
    font-weight: 700;
}

.email-address {
    text-align: center;
    background: white;
    padding: 8px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.email-address:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}

.email-address:active {
    transform: scale(0.98);
}

.email-address img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    pointer-events: none;
}

/* Search Section */
.search-section {
    background-color: #ffffff;
    padding: 40px 0;
    border-bottom: 1px solid #e5e7eb;
}

.search-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.search-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-select:focus {
    outline: none;
    border-color: #0078d4;
}

.btn-outline {
    padding: 0.75rem 1.5rem;
    border: 2px solid #0078d4;
    background: transparent;
    color: #0078d4;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #0078d4;
    color: white;
}

.search-results-info {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 1.5rem;
}

.search-results-list {
    max-width: 800px;
    margin: 1rem auto 0;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    text-align: left;
}

.search-result-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item a {
    color: #0078d4;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
}

.search-result-item a:hover {
    text-decoration: underline;
    color: #106ebe;
}

.search-result-item div {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Menu Page Search */
.menu-search-section {
    background: #f9fafb;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
}

.menu-search-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--primary-color, #1a202c);
}

.menu-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.menu-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.menu-search-input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.menu-search-results-info {
    min-height: 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.menu-search-results-list {
    max-width: 100%;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.menu-search-result-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    display: none;
}

.menu-search-result-item.visible {
    display: block;
}

.menu-search-result-item:last-child {
    border-bottom: none;
}

.menu-search-result-item a {
    color: #0078d4;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.menu-search-result-item a:hover {
    text-decoration: underline;
}

.menu-search-result-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Fortytwo Ad Section */
.fortytwo-ad-section {
    background-color: #f9fafb;
    padding: 30px 0;
    border-bottom: 1px solid #e5e7eb;
}

.fortytwo-ad-section .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.fortytwo-ad-container {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fortytwo-ad-image {
    justify-self: center;
    align-self: center;
}

.fortytwo-ad-image a {
    display: block;
    transition: transform 0.2s ease;
}

.fortytwo-ad-image a:hover {
    transform: scale(1.05);
}

.fortytwo-ad-image img {
    width: 160px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.fortytwo-ad-content {
    font-family: 'Roboto', sans-serif;
    align-self: center;
}

.fortytwo-ad-content h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.fortytwo-ad-content p {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    color: #374151;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.fortytwo-ad-content p:last-child {
    margin-bottom: 0;
}

.fortytwo-hashtag {
    color: #0078d4 !important;
    font-weight: 700;
    font-size: 0.8rem !important;
    margin-top: 0.75rem !important;
}

/* Responsive design for Fortytwo ad */
@media (max-width: 768px) {
    .fortytwo-ad-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem;
    }

    .fortytwo-ad-image img {
        width: 180px;
    }

    .fortytwo-ad-content h3 {
        font-size: 1.2rem;
    }

    .fortytwo-ad-content p {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }
}

/* Category filter styles (rounded buttons) */
.category-filter {
    margin: 1rem 0 0.75rem;
}

.category-filter .filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.category-filter .cat-filter {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 1.5px solid rgba(14, 45, 69, 0.12);
    color: var(--text);
    padding: .35rem .6rem;
    border-radius: 999px;
    /* pill */
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    /* remove underline on anchors */
}

.category-filter .cat-filter:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.06), rgba(139, 92, 246, 0.02));
    border-color: rgba(139, 92, 246, 0.18);
    text-decoration: none;
}

.category-filter .cat-filter.active {
    background: linear-gradient(180deg, #8b5cf6, #7c3aed);
    color: #fff;
    border-color: rgba(124, 58, 237, 0.9);
}

.category-filter .cat-filter:focus {
    outline: 3px solid rgba(139, 92, 246, 0.12);
    outline-offset: 2px;
}

.posts-pager {
    margin-top: 1rem;
    display: flex;
    gap: .75rem;
    align-items: center;
}

.card-cats a.category {
    margin-right: .3rem;
    text-decoration: none;
    /* keep category badges un-underlined */
    color: inherit;
}

/* Frontpage layout helpers: center About icon and size Stripe buttons */
.frontpage-quicklinks .widget.quick-links {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.frontpage-quicklinks .widget.quick-links .about-link {
    display: block;
    margin: 0 auto;
}

/* Constrain service area so buttons align under the header width */
.sidebar .widget.services-widget,
.sidebar .widget.pdf-buy {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.services-widget .services-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.service-card {
    width: 100%;
    max-width: 260px;
    /* reduces overall card width so buttons don't overflow header */
    box-sizing: border-box;
}

/* Style stripe buy-button elements so they are narrower and centered */
stripe-buy-button {
    display: block;
    width: 100%;
    max-width: 240px;
    margin: 6px auto 0;
}

/* Slightly smaller payment icons inside narrow cards */
.service-card .payment-icons img {
    width: 28px;
}

@media (max-width: 900px) {
    .service-card {
        max-width: 100%;
    }

    stripe-buy-button {
        max-width: 100%;
    }
}

/* Buy-buttons layout (under the hero) */
.buy-buttons-section {
    padding: 24px 20px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.buy-buttons-grid {
    display: flex;
    /* Desktop: keep in one row, mobile will wrap via media query */
    flex-wrap: nowrap;
    gap: 16px;
    max-width: 100%;
    margin: 0 auto 30px;
    align-items: center;
    justify-content: center;
}

.buy-buttons-grid .buy-col {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 280px;
}

/* wrapper around each buy-button: controls outer width and spacing to avoid inner component overflow */
.buy-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Make the buy button visually match the 98px about image (slightly larger for legibility) */
.buy-buttons-grid stripe-buy-button {
    display: block;
    /* let the outer wrapper control the spacing and width; make host take full width */
    width: 100%;
    max-width: 100%;
    margin: 0;
    /* avoid heavy scaling which can cause layout bleed inside the shadow DOM */
    transform: none;
    transform-origin: center;
}

/* Ensure buy buttons inside post content appear inline and small */
.post-content stripe-buy-button {
    display: inline-block;
    width: 86px;
    max-width: 86px;
    margin: 0 8px 8px 0;
    transform: scale(0.95);
    transform-origin: center;
}

@media (max-width: 600px) {
    .buy-buttons-grid {
        flex-wrap: wrap;
        gap: 12px;
        max-width: 100%;
        padding: 0 12px;
    }

    .buy-buttons-grid stripe-buy-button {
        width: 100%;
        max-width: 100%;
        transform: none;
    }
}

/* About section styles */
.about-section {
    text-align: center;
}

.about-section .about-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
}

.me-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    /* show full picture and fill the box */
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.me-img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.about-blurb {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    margin: 0;
    text-align: center;
}

/* User requested: make Stripe buttons same width as about section and center aside */
.services-widget .about-section {
    width: 100%;
    margin: 0 auto 20px auto;
}

.services-widget .services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.services-widget stripe-buy-button {
    display: block;
    width: 98px;
    max-width: 98px;
    margin: 0 auto;
    /* Reduce visual size slightly to account for internal padding inside the web component */
    transform: scale(0.92);
    transform-origin: center;
    -webkit-transform: scale(0.92);
}

/* Optional: Center everything in the widget */
.services-widget {
    text-align: center;
}

.services-widget h3 {
    margin-bottom: 15px;
}

.about-link {
    display: inline-block;
}

/* ========================================
   CATEGORY GRID (Step 3)
   ======================================== */

.categories-overview {
    margin: 2rem 0 3rem 0;
    padding: 0;
}

.categories-overview h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    text-align: center;
}

.categories-intro {
    text-align: center;
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.category-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0078d4, #00bcf2);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #0078d4;
}

.category-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.category-count {
    display: inline-block;
    background: linear-gradient(135deg, #0078d4, #00bcf2);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
}

.category-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Responsive adjustments for category grid */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .category-card {
        padding: 1rem;
    }

    .category-name {
        font-size: 1rem;
    }

    .category-count {
        font-size: 1.25rem;
        min-width: 50px;
        min-height: 50px;
    }

    .categories-overview h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
}