/* ============================================
   FirmaLaboral Ghost Theme — Matching Squarespace
   Palette: #000000, #bdb2c3, #eae9ea, #5b5650, #ffffff
   Fonts: Nunito (headings+body), Roboto (meta)
   ============================================ */

:root {
    --color-primary: #000000;
    --color-accent: #bdb2c3;
    --color-bg-white: #ffffff;
    --color-bg-light: #eae9ea;
    --color-bg-dark: #5b5650;
    --color-text: #000000;
    --color-text-secondary: #555555;
    --color-text-on-dark: #ffffff;
    --color-link-on-dark: #bdb2c3;

    --font-family: 'Nunito', sans-serif;
    --font-meta: 'Roboto', sans-serif;
    --max-width: 1400px;
    --site-padding: 4vw;
    --content-width: 780px;
    --wide-width: 1080px;
    --header-logo-height: 42px;
    --header-logo-height-mobile: 28px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 62.5%;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family) !important;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--color-text);
    background: #ffffff !important;
}

a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   HEADER — Matches Squarespace firmalaboral.net
   ============================================ */
.site-header {
    background: #eae9ea;
    padding: 0 var(--site-padding);
    position: relative;
    z-index: 100;
    border-bottom: none;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.2vw 0 !important;
}

.header-logo a {
    display: flex;
    align-items: center;
}

.header-logo .logo-img {
    height: var(--header-logo-height);
    width: auto;
}

/* Navigation — horizontal, same style as Squarespace */
.header-nav ul {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

.header-nav li {
    position: relative;
}

.header-nav a {
    display: block;
    font-family: var(--font-family) !important;
    font-size: 1.8rem !important;
    font-weight: 500 !important;
    color: var(--color-primary) !important;
    padding: 0.8rem 1.6rem;
    transition: opacity 0.2s ease;
    text-decoration: none !important;
}

.header-nav a:hover {
    opacity: 0.6;
    color: var(--color-primary);
}

/* "Blog" link — underlined when on blog */
.header-nav a.nav-current {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
}

/* "Contacto" button — matches Squarespace primary button */
.header-nav a.nav-btn {
    background: var(--color-primary);
    color: var(--color-bg-white) !important;
    border-radius: 8px;
    padding: 1rem 2.8rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    margin-left: 0.8rem;
}

.header-nav a.nav-btn:hover {
    opacity: 0.85;
    color: var(--color-bg-white) !important;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.3s ease;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #eae9ea;
    z-index: 99;
    padding: 8rem var(--site-padding) 2rem;
}

.mobile-menu-overlay.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav ul {
    list-style: none;
    text-align: center;
}

.mobile-nav a {
    display: block;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--color-text);
    padding: 1.2rem 0;
}

.mobile-nav a:hover {
    color: var(--color-text-secondary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.site-main {
    min-height: 60vh;
}

/* ============================================
   POST FEED — 3 column grid
   ============================================ */
.post-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem var(--site-padding) 6rem;
}

/* ============================================
   POST CARD — Elevated white card on gray bg
   ============================================ */
.post-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.post-card-link {
    display: block;
    color: inherit !important;
    text-decoration: none !important;
}

.post-card-image-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.post-card-content {
    padding: 2rem 2.2rem 2.4rem;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    font-family: var(--font-meta);
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.post-card-tag {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 1.1rem;
}

.post-card-meta-sep {
    color: var(--color-text-secondary);
    opacity: 0.4;
}

.post-card-date {
    font-family: var(--font-meta);
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.post-card-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--color-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    font-size: 1.4rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: gap 0.2s ease;
}

.post-card:hover .post-card-readmore {
    gap: 0.8rem;
}

/* Featured card — first card spans 2 columns */
.post-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.post-card--featured .post-card-image-wrap {
    aspect-ratio: auto;
    height: 100%;
}

.post-card--featured .post-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.post-card--featured .post-card-title {
    font-size: 2.8rem;
    -webkit-line-clamp: 3;
}

.post-card--featured .post-card-excerpt {
    font-size: 1.5rem;
    -webkit-line-clamp: 4;
}

/* ============================================
   BLOG HEADER (for tag/author pages)
   ============================================ */
.blog-header {
    text-align: center;
    padding: 5rem var(--site-padding) 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.blog-title {
    font-size: 3.6rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.blog-description {
    font-size: 1.6rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.author-header {
    padding-bottom: 2rem;
}

.author-header-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem var(--site-padding) 6rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.pagination-prev,
.pagination-next {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-primary);
    padding: 0.8rem 1.6rem;
    border: 1px solid var(--color-primary);
    transition: all 0.2s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: var(--color-primary);
    color: var(--color-bg-white);
}

.pagination-location {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
}

/* ============================================
   SINGLE POST
   ============================================ */
.post-full {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--site-padding);
}

.post-full-image {
    margin: 0 calc(var(--site-padding) * -1) 4rem;
    max-height: 55vh;
    overflow: hidden;
}

.post-full-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-full-image figcaption {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    text-align: center;
    padding: 1rem var(--site-padding);
}

.post-full-header {
    max-width: var(--content-width);
    margin: 0 auto 4rem;
    text-align: center;
}

.post-full-tag {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    margin-bottom: 1.2rem;
}

.post-full-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.post-full-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 1.4rem;
    color: var(--color-text-secondary);
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.post-full-meta-author a {
    font-weight: 500;
    color: var(--color-text);
}

.post-full-meta > *:not(:first-child)::before {
    content: '\00B7';
    margin-right: 0.6rem;
    color: var(--color-text-secondary);
}

/* ============================================
   POST CONTENT — Typography
   ============================================ */
.post-full-content {
    max-width: var(--content-width);
    margin: 0 auto 4rem;
    font-size: 1.7rem;
    line-height: 1.8;
}

.post-full-content h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 4rem 0 1.6rem;
}

.post-full-content h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 3.2rem 0 1.2rem;
}

.post-full-content h4 {
    font-size: 1.9rem;
    font-weight: 600;
    margin: 2.4rem 0 1rem;
}

.post-full-content p {
    margin-bottom: 1.8rem;
}

.post-full-content a {
    color: #5b36a9 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-full-content a:hover {
    color: #4a2d8f !important;
}

.post-full-content img {
    margin: 3rem auto;
}

.post-full-content blockquote {
    margin: 3rem 0;
    padding: 2rem 0 2rem 2.4rem;
    border-left: 3px solid var(--color-primary);
    font-style: italic;
    font-size: 1.9rem;
    color: var(--color-text-secondary);
}

.post-full-content ul,
.post-full-content ol {
    margin: 1.8rem 0;
    padding-left: 2.4rem;
}

.post-full-content li {
    margin-bottom: 0.6rem;
}

.post-full-content pre {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--color-bg-light);
    border-radius: 4px;
    overflow-x: auto;
    font-size: 1.4rem;
    line-height: 1.6;
}

.post-full-content code {
    font-size: 0.9em;
    background: var(--color-bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.post-full-content pre code {
    background: none;
    padding: 0;
}

.post-full-content hr {
    margin: 4rem 0;
    border: none;
    border-top: 1px solid var(--color-bg-light);
}

.post-full-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 3rem 0;
    font-size: 1.5rem;
}

.post-full-content th,
.post-full-content td {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--color-bg-light);
    text-align: left;
}

.post-full-content th {
    font-weight: 600;
    background: var(--color-bg-light);
}

/* Ghost editor width cards */
.post-full-content .kg-width-wide {
    max-width: var(--wide-width);
    margin-left: auto;
    margin-right: auto;
}

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

.post-full-content .kg-image-card figcaption,
.post-full-content .kg-gallery-card figcaption {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    text-align: center;
    padding-top: 1rem;
}

/* ============================================
   POST TAGS
   ============================================ */
.post-full-tags {
    max-width: var(--content-width);
    margin: 0 auto 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag-pill {
    font-size: 1.3rem;
    font-weight: 500;
    padding: 0.4rem 1.4rem;
    border: 1px solid var(--color-bg-light);
    border-radius: 20px;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

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

/* ============================================
   SHARE LINKS
   ============================================ */
.post-share {
    max-width: var(--content-width);
    margin: 0 auto 4rem;
    display: flex;
    align-items: center;
    gap: 1.6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-bg-light);
}

.share-label {
    font-size: 1.4rem;
    font-weight: 600;
}

.share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    color: var(--color-primary);
    transition: all 0.2s ease;
}

.share-link:hover {
    background: var(--color-primary);
    color: var(--color-bg-white);
}

/* ============================================
   POST NAVIGATION (prev/next)
   ============================================ */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--site-padding) 6rem;
}

.post-nav-link {
    display: block;
    padding: 2.4rem;
    background: var(--color-bg-light);
    transition: all 0.3s ease;
}

.post-nav-link:hover {
    background: var(--color-primary);
    color: var(--color-text-on-dark);
}

.post-nav-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    margin-bottom: 0.6rem;
}

.post-nav-link:hover .post-nav-label {
    color: var(--color-link-on-dark);
}

.post-nav-title {
    display: block;
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.3;
}

.post-nav-next {
    text-align: right;
}

/* ============================================
   PAGE
   ============================================ */
.page-full {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--site-padding);
}

.page-full-header {
    max-width: var(--content-width);
    margin: 4rem auto 3rem;
    text-align: center;
}

.page-full-title {
    font-size: 4rem;
    font-weight: 700;
}

.page-full-content {
    max-width: var(--content-width);
    margin: 0 auto 6rem;
    font-size: 1.7rem;
    line-height: 1.8;
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-page {
    text-align: center;
    padding: 10rem var(--site-padding);
}

.error-code {
    font-size: 12rem;
    font-weight: 900;
    line-height: 1;
    color: var(--color-bg-light);
}

.error-message {
    font-size: 2rem;
    margin: 2rem 0 3rem;
    color: var(--color-text-secondary);
}

.error-link {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1.2rem 3rem;
    background: var(--color-primary);
    color: var(--color-bg-white);
    transition: opacity 0.2s ease;
}

.error-link:hover {
    opacity: 0.8;
    color: var(--color-bg-white);
}

/* ============================================
   FOOTER — Matches Squarespace firmalaboral.net
   Purple-gray dark (#5b5650), white text, social icons with border
   ============================================ */
.site-footer {
    background: #eae9ea;
    color: var(--color-text);
    padding: 5rem var(--site-padding) 4rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 4rem;
}

.footer-logo img {
    height: 50px;
    width: auto;
    margin-bottom: 1.2rem;
}

.footer-brand {
    /* just wraps logo */
}

.footer-contact h4,
.footer-location h4 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.4rem;
    color: var(--color-text);
}

.footer-contact ul {
    list-style: none;
}

.footer-contact li {
    margin-bottom: 0.6rem;
}

.footer-contact a {
    color: var(--color-text);
    font-size: 1.4rem;
    transition: color 0.2s ease;
}

.footer-contact a:hover {
    color: var(--color-text-secondary);
}

.footer-location p {
    font-size: 1.4rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* Social icons — border style like Squarespace */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.6rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--color-text);
    box-shadow: 0 0 0 1.5px currentColor inset;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: var(--color-text);
    color: #eae9ea;
    box-shadow: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .post-feed {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-card--featured {
        grid-template-columns: 1fr;
    }

    .post-card--featured .post-card-image-wrap {
        aspect-ratio: 16 / 9;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .header-nav a {
        padding: 0.8rem 1rem;
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    :root {
        --site-padding: 6vw;
    }

    .header-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .post-feed {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding-top: 3rem;
    }

    .post-card-title {
        font-size: 2rem;
    }

    .post-full-title {
        font-size: 2.8rem;
    }

    .post-full-content {
        font-size: 1.6rem;
    }

    .post-full-content h2 {
        font-size: 2.2rem;
    }

    .post-full-content h3 {
        font-size: 1.9rem;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        text-align: left;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.4rem;
    }

    .header-inner {
        padding: 1.4rem 0;
    }

    .header-logo .logo-img {
        height: var(--header-logo-height-mobile);
    }

    .pagination {
        flex-direction: column;
        gap: 1.2rem;
    }
}

@media (max-width: 480px) {
    .post-card-content {
        padding: 1.6rem;
    }

    .post-card-title {
        font-size: 1.8rem;
    }
}

/* ============================================
   ANIMATIONS — Subtle fade-in
   ============================================ */
.post-card {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.5s ease forwards;
}

.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.15s; }
.post-card:nth-child(3) { animation-delay: 0.25s; }
.post-card:nth-child(4) { animation-delay: 0.35s; }
.post-card:nth-child(5) { animation-delay: 0.45s; }
.post-card:nth-child(6) { animation-delay: 0.55s; }

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

/* Ghost built-in overrides */
.gh-portal-triggerbtn-iframe {
    display: none !important;
}
