/* Custom Homepage CSS */
:root {
  --c-terracotta: #D36B46;
  --c-terracotta-dark: #b85a3a;
  --c-sage: #819875;
  --c-cream: #FBF6EE;
  --c-oatmeal: #F2E9DC;
  --c-charcoal: #3A332E;
  --font-display: "Playfair Display", serif;
  --font-body: "Inter", sans-serif;
  --radius-xl: 32px;
}

body {
    font-family: var(--font-body);
    color: var(--c-charcoal);
    background: var(--c-cream);
}

h1, h2, h3, h4, .site-title {
    font-family: var(--font-display);
}

.text-terracotta { color: var(--c-terracotta); }
.text-center { text-align: center; }

.btn {
    border-radius: 999px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
    border: 2px solid transparent;
}
.btn--primary {
    background: var(--c-terracotta);
    color: #fff;
}
.btn--primary:hover {
    background: var(--c-terracotta-dark);
}
.btn--outline {
    background: transparent;
    border-color: var(--c-charcoal);
    color: var(--c-charcoal);
}
.btn--outline:hover {
    background: var(--c-charcoal);
    color: #fff;
}

/* Header */
.top-bar {
    background: var(--c-terracotta);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}
.top-bar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar__text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.top-bar__socials {
    display: flex;
    gap: 1rem;
}
.top-bar__socials a {
    color: #fff;
}

.site-header {
    background: var(--c-white);
    padding: 1rem 0;
    border-bottom: 1px solid var(--c-line);
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}
.site-brand__text {
    display: flex;
    flex-direction: column;
}
.site-title {
    font-size: 1.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.title-crochet {
    color: #C58B76;
}
.title-ovia {
    color: #2C3531;
}
.site-brand small {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--c-charcoal-soft);
    letter-spacing: 0.05em;
    font-weight: 600;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav a {
    color: var(--c-charcoal);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.nav a:hover {
    color: var(--c-terracotta);
}
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-charcoal);
    display: flex;
    align-items: center;
}

/* Sections */
.section-title-center {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-title-center h2 {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}
.ornament {
    color: var(--c-sage);
    font-size: 1.2rem;
}
.section-title-left h2 {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

/* Hero */
.hero-new {
    padding: 4rem 0;
    background: var(--c-cream);
}
.hero-new__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.hero-new__content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}
.hero-new__content .lede {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--c-charcoal-soft);
}
.hero-new__features {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.hero-new__features span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--c-sage);
}
.hero-new__media img {
    border-radius: var(--radius-xl);
    width: 100%;
}

/* Explore */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.explore-card {
    background: #fff;
    border-radius: var(--radius-m);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--c-line);
    transition: transform 0.2s;
}
.explore-card:hover {
    transform: translateY(-4px);
}
.explore-card__body {
    padding: 1.5rem;
    position: relative;
}
.explore-card__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.explore-card__text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.explore-card__text p {
    font-size: 0.85rem;
    color: var(--c-charcoal-soft);
    margin: 0;
}
.explore-card__arrow {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    color: var(--c-terracotta);
}

/* Patterns Grid - Masonry */
.masonry-grid {
    column-count: 4;
    column-gap: 1.5rem;
}
.masonry-grid > * {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
}
@media (max-width: 1024px) { .masonry-grid { column-count: 3; } }
@media (max-width: 768px) { .masonry-grid { column-count: 2; } }
@media (max-width: 480px) { .masonry-grid { column-count: 1; } }

.pattern-card-new {
    background: #fff;
    border-radius: var(--radius-m);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
}
.pattern-card-new:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    z-index: 2;
    position: relative;
}
.pattern-card-new__media {
    position: relative;
    overflow: hidden;
}
.pattern-card-new:hover .pattern-card-new__media img {
    transform: scale(1.05);
}
.pattern-card-new__media img {
    transition: transform 0.5s ease;
    display: block;
    width: 100%;
}

/* Category Bubbles Hover */
.bubble-link:hover .bubble-img-wrapper {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(216, 118, 89, 0.3);
}
.bubble-link:hover span {
    color: var(--c-terracotta);
}
.save-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-terracotta);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.pattern-card-new__body {
    padding: 1.25rem;
}
.pattern-card-new__body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.pattern-card-new__meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--c-charcoal-soft);
}
.skill {
    color: var(--c-terracotta);
    font-weight: 600;
}

/* Beginner Section */
.beginner-section {
    background: var(--c-cream);
}
.beginner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}
.beginner-featured-card {
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius-l);
    margin-bottom: 1.5rem;
}
.beginner-featured-card h3 {
    margin-top: 1rem;
    margin-bottom: 0;
}
.filter-widget {
    background: var(--c-white);
    padding: 2.5rem;
    border-radius: var(--radius-l);
}
.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--c-charcoal-soft);
}
.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font-family: var(--font-body);
}

/* Highlights */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.highlight-card {
    background: #fff;
    border-radius: var(--radius-l);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
}
.highlight-card h3 {
    font-size: 1.2rem;
}
.highlight-card p {
    font-size: 0.9rem;
    color: var(--c-charcoal-soft);
}
.highlight-card a {
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
}

/* Seasonal */
.seasonal-pills {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.seasonal-pill {
    background: #fff;
    border: 1px solid var(--c-line);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--c-charcoal);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Club */
.club-box {
    background: #fdfaf6;
    border-radius: var(--radius-xl);
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    align-items: center;
    text-align: center;
}
.club-box__content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.club-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 1.5rem auto 0;
}
.club-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--c-line);
    border-radius: 999px;
}

/* Footer */
.site-footer-new {
    background: var(--c-charcoal);
    color: var(--c-white);
    padding-top: 4rem;
}
.site-footer-new__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 3rem;
}
.footer-col h3 {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    color: var(--c-white);
}
.footer-col p {
    color: #a0a8a3;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col li {
    margin-bottom: 0.75rem;
}
.footer-col a {
    color: #a0a8a3;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}
.footer-col a:hover {
    color: var(--c-terracotta);
}
.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}
.footer-socials a {
    color: var(--c-cream);
}
.footer-socials a:hover {
    color: var(--c-terracotta);
}
.footer-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.footer-form input {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: var(--c-white);
}
.footer-form input::placeholder {
    color: #a0a8a3;
}
.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #a0a8a3;
}

/* Micro-Interactions */
.pattern-card-new {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pattern-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.pattern-card-new .save-btn {
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.pattern-card-new:hover .save-btn {
    transform: scale(1.1);
}
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
    visibility: visible;
}

/* Mobile Menu Fix */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--c-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        z-index: 100;
    }
    .nav.is-open {
        display: flex;
    }
    .nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}



/* Single Pattern Polish */
.single-pattern .entry-content h2 { font-family: var(--font-display); color: var(--c-terracotta); margin-top: 2rem; }
.materials-list { background: var(--c-cream); padding: 2rem; border-radius: var(--radius-xl); border: 1px solid var(--c-line); }

/* All Categories Page */
.category-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .category-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .category-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    position: relative;
    display: block;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transform: translateZ(0);
}
.category-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.category-card:hover .category-card__bg {
    transform: scale(1.05);
}
.category-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
    transition: background 0.3s ease;
}
.category-card:hover .category-card__overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
}
.category-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    color: var(--c-white);
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.category-card:hover .category-card__content {
    transform: translateY(-5px);
}
.category-card__title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--c-white);
    margin: 0 0 0.25rem;
    line-height: 1.1;
}
.category-card__count {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
}
.steps li { margin-bottom: 1.5rem; line-height: 1.8; }

/* Sticky TOC & Pattern Layout */
@media (max-width: 1023px) {
    .pattern-layout { flex-direction: column; }
    .pattern-sidebar { display: none; }
    .author-box { flex-direction: column; text-align: center; }
}
@media (min-width: 1024px) {
    .pattern-sidebar {
        flex: 0 0 300px;
        position: sticky;
        top: 2rem;
        align-self: flex-start;
    }
}
.toc-widget {
    background: var(--c-cream);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--c-line);
}
.toc-widget h3 {
    font-family: var(--font-display);
    color: var(--c-terracotta);
    margin: 0 0 1rem;
    font-size: 1.5rem;
}
#sticky-toc {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
#sticky-toc a {
    color: var(--c-charcoal-soft);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}
#sticky-toc a:hover, #sticky-toc a.is-active {
    color: var(--c-terracotta);
}

/* Author Box */
.author-box__avatar img {
    border-radius: 50%;
    width: 96px;
    height: 96px;
    object-fit: cover;
    border: 2px solid var(--c-terracotta);
}

/* Related Patterns Carousel */
.related-carousel-wrapper {
    position: relative;
    margin-top: 2rem;
}
.related-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 2rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.related-carousel::-webkit-scrollbar {
    display: none;
}
.related-carousel > .p-card {
    flex: 0 0 85%;
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .related-carousel > .p-card { flex: 0 0 calc(50% - 1rem); }
}
@media (min-width: 1024px) {
    .related-carousel > .p-card { flex: 0 0 calc(33.333% - 1.33rem); }
}
.carousel-btn {
    position: absolute;
    top: calc(50% - 2rem);
    transform: translateY(-50%);
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
    color: var(--c-charcoal);
    transition: transform 0.2s, background 0.2s;
}
.carousel-btn:hover {
    background: var(--c-cream);
    transform: translateY(-50%) scale(1.05);
}
.carousel-btn--prev { left: -24px; }
.carousel-btn--next { right: -24px; }
@media (max-width: 1023px) {
    .carousel-btn { display: none; }
}

