/**
 * Static Theme - Main Stylesheet
 * 
 * Loaded async after critical CSS.
 * Contains non-critical styles: cards, footer, mobile nav, etc.
 */

/* =========================================================
   POSTS GRID
   ========================================================= */

.posts {
    padding: 4rem 0;
}

.posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* =========================================================
   CARD COMPONENT
   ========================================================= */

.card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card__image {
    display: block;
    overflow: hidden;
    aspect-ratio: 3/2;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.card__image img:not(.is-loaded) {
    opacity: 0;
}

.card__image img.is-loaded {
    opacity: 1;
}

.card:hover .card__image img {
    transform: scale(1.05);
}

.card__content {
    padding: 1.5rem;
}

.card__header {
    margin-bottom: 0.75rem;
}

.card__title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card__title a {
    color: inherit;
}

.card__title a:hover {
    color: #0066cc;
    text-decoration: none;
}

.card__meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.card__excerpt {
    color: #555;
    margin-bottom: 1rem;
}

.card__link {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #0066cc;
    transition: gap 0.2s ease;
}

.card__link::after {
    content: '→';
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.card__link:hover {
    text-decoration: none;
}

.card__link:hover::after {
    transform: translateX(4px);
}

/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.mobile-nav nav {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: #fff;
    padding: 5rem 1.5rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-nav[aria-hidden="false"] nav {
    transform: translateX(0);
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-nav-menu a {
    display: block;
    padding: 1rem 0;
    color: #333;
    font-weight: 500;
    font-size: 1.125rem;
}

/* Nav toggle animation */
body.nav-open .nav-toggle__bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

body.nav-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle__bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =========================================================
   SINGLE POST / PAGE
   ========================================================= */

.single-post {
    padding: 4rem 0;
}

/* Static Builder pages handle their own spacing */
.single-page.sb-page {
    padding: 0;
}

.single-post .container,
.single-page .container {
    max-width: 800px;
}

.entry-header {
    margin-bottom: 2rem;
    text-align: center;
}

.entry-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.entry-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: #666;
    font-size: 0.9375rem;
}

.entry-thumbnail {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
}

.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.entry-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-left: 4px solid #0066cc;
    font-style: italic;
}

.entry-content pre {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #1a1a1a;
    color: #f8f8f2;
    border-radius: 8px;
    overflow-x: auto;
}

.entry-content code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9em;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background: #1a1a1a;
    color: #999;
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.site-footer__branding {
    max-width: 300px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-logo:hover {
    text-decoration: none;
    color: #fff;
}

.footer-tagline {
    margin: 0;
    font-size: 0.9375rem;
}

.footer-nav {
    display: flex;
    gap: 2rem;
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.footer-menu a {
    color: #999;
    transition: color 0.2s;
}

.footer-menu a:hover {
    color: #fff;
    text-decoration: none;
}

.site-footer__bottom {
    border-top: 1px solid #333;
    padding-top: 2rem;
    text-align: center;
}

.copyright {
    margin: 0;
    font-size: 0.875rem;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    color: #333;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.page-numbers:hover {
    background: #0066cc;
    color: #fff;
    text-decoration: none;
}

.page-numbers.current {
    background: #0066cc;
    color: #fff;
}

/* =========================================================
   UTILITY CLASSES
   ========================================================= */

.no-posts {
    text-align: center;
    padding: 4rem 0;
    color: #666;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: #0066cc;
    color: #fff;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    .posts {
        padding: 2rem 0;
    }
    
    .posts__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .single-post {
        padding: 2rem 0;
    }
    
    .entry-content {
        font-size: 1rem;
    }
    
    .site-footer__inner {
        flex-direction: column;
        text-align: center;
    }
    
    .site-footer__branding {
        max-width: none;
    }
    
    .footer-nav {
        width: 100%;
        justify-content: center;
    }
    
    .footer-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .card__content {
        padding: 1rem;
    }
    
    .card__meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   WOOCOMMERCE - SHOP/ARCHIVE PAGES
   ========================================================= */

.woocommerce,
.woocommerce-page {
    padding: 2rem 0 4rem;
}

.woocommerce .woocommerce-products-header {
    padding: 0 var(--container-padding, 2rem);
    max-width: var(--container-max, 1200px);
    margin: 0 auto 2rem;
}

.woocommerce .woocommerce-products-header__title {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
}

/* Product Grid */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    list-style: none;
    margin: 0 auto;
    padding: 0 var(--container-padding, 2rem);
    max-width: var(--container-max, 1200px);
}

.woocommerce ul.products li.product {
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.woocommerce ul.products li.product a.woocommerce-loop-product__link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.woocommerce ul.products li.product img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem;
    font-weight: 500;
    margin: 1rem 1rem 0.5rem;
    line-height: 1.4;
}

.woocommerce ul.products li.product .price {
    display: block;
    margin: 0 1rem 1rem;
    font-size: 0.95rem;
    color: #666;
}

.woocommerce ul.products li.product .price del {
    color: #999;
    margin-right: 0.5rem;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: #e53935;
    font-weight: 600;
}

.woocommerce ul.products li.product .button {
    display: block;
    width: calc(100% - 2rem);
    margin: 0 1rem 1rem;
    padding: 0.75rem 1rem;
    background: #000;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.woocommerce ul.products li.product .button:hover {
    background: #333;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

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

/* =========================================================
   WOOCOMMERCE - SINGLE PRODUCT PAGE
   ========================================================= */

.woocommerce.single-product {
    padding: 0;
}

.woocommerce .product {
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: 2rem var(--container-padding, 2rem) 4rem;
}

.woocommerce .woo-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Gallery */
.woocommerce .woocommerce-product-gallery {
    position: relative;
}

.woocommerce .woocommerce-product-gallery__wrapper {
    margin: 0;
}

.woocommerce .woocommerce-product-gallery__image {
    margin-bottom: 1rem;
}

.woocommerce .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Summary */
.woocommerce .summary.entry-summary {
    position: sticky;
    top: 100px;
    align-self: start;
}

.woocommerce .product_title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1rem;
    line-height: 1.3;
}

.woocommerce .summary .price {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #000;
}

.woocommerce .summary .price del {
    color: #999;
    font-weight: 400;
    margin-right: 0.5rem;
}

.woocommerce .summary .price ins {
    text-decoration: none;
    color: #e53935;
}

.woocommerce .woocommerce-product-details__short-description {
    margin-bottom: 1.5rem;
    color: #555;
    line-height: 1.7;
}

/* Variations */
.woocommerce table.variations {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.woocommerce table.variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.woocommerce table.variations th.label {
    text-align: left;
    font-weight: 500;
    padding: 0 0 0.5rem;
}

.woocommerce table.variations th.label label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.woocommerce table.variations td.value {
    padding: 0;
}

.woocommerce table.variations select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.woocommerce table.variations select:focus {
    outline: none;
    border-color: #000;
}

/* Quantity Input */
.woocommerce .quantity {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.woocommerce .quantity .qty {
    width: 80px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woocommerce .quantity .qty:focus {
    outline: none;
    border-color: #000;
}

/* Add to Cart Button */
.woocommerce form.cart {
    margin-bottom: 2rem;
}

.woocommerce .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    margin-bottom: 1rem;
}

.woocommerce .single_add_to_cart_button:hover {
    background: #333;
}

.woocommerce .single_add_to_cart_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.woocommerce .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Product Meta */
.woocommerce .product_meta {
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
    color: #666;
}

.woocommerce .product_meta > span {
    display: block;
    margin-bottom: 0.5rem;
}

.woocommerce .product_meta a {
    color: #000;
    text-decoration: none;
}

.woocommerce .product_meta a:hover {
    text-decoration: underline;
}

/* Tabs */
.woocommerce .woocommerce-tabs {
    margin-top: 3rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.woocommerce .woocommerce-tabs ul.tabs {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid #eee;
}

.woocommerce .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
}

.woocommerce .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 1rem 0;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.woocommerce .woocommerce-tabs ul.tabs li.active a {
    color: #000;
    border-bottom-color: #000;
}

.woocommerce .woocommerce-tabs .panel {
    line-height: 1.8;
}

/* Responsive Single Product */
@media (max-width: 768px) {
    .woocommerce .woo-product-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .woocommerce .summary.entry-summary {
        position: static;
    }

    .woocommerce .product_title {
        font-size: 1.5rem;
    }

    .woocommerce .woocommerce-tabs ul.tabs {
        gap: 1rem;
    }
}

/* =========================================================
   WOOCOMMERCE - MESSAGES & NOTICES
   ========================================================= */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    margin-bottom: 2rem;
    border-radius: 4px;
    list-style: none;
}

.woocommerce-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.woocommerce-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.woocommerce-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
    color: inherit;
    font-weight: 600;
}

/* =========================================================
   WOOCOMMERCE - VARIATION JS SUPPORT
   ========================================================= */

.woocommerce .single_variation {
    margin-bottom: 1rem;
}

.woocommerce .single_variation .price {
    font-size: 1.25rem;
    font-weight: 600;
}

.woocommerce .woocommerce-variation-availability p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.woocommerce .in-stock {
    color: #28a745;
}

.woocommerce .out-of-stock {
    color: #dc3545;
}
