/* =========================================
   MAIN.CSS - Variables, Reset, Base Styles
   Projecte Share Theme
========================================= */

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

/* Base */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--pshare-font, 'Poppins', sans-serif);
    background-color: var(--pshare-bg, #F4F6F8);
    color: var(--pshare-text, #555555);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   TYPOGRAPHY
========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--pshare-font, 'Poppins', sans-serif);
    color: var(--pshare-dark, #1E2022);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.1rem; }

p {
    margin-bottom: 1.2em;
    font-size: 1rem;
    line-height: 1.8;
}

a {
    color: var(--pshare-primary, #E32219);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--pshare-primary-dark, #B81912);
}

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

/* =========================================
   LAYOUT UTILITIES
========================================= */
.container {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 5%;
    }
}

.container-narrow {
    max-width: 850px;
    padding-left: 25px;
    padding-right: 25px;
}

@media (min-width: 768px) {
    .container-narrow {
        padding-left: 5%;
        padding-right: 5%;
    }
}

.content-area {
    padding: 80px 0;
    position: relative;
    z-index: 20;
}

.front-page-content {
    position: relative;
    z-index: 20;
}

/* =========================================
   BUTTONS
========================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--pshare-primary, #E32219);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: var(--pshare-font, 'Poppins', sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(227, 34, 25, 0.3);
}

.btn-primary:hover {
    background: var(--pshare-primary-dark, #B81912);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(227, 34, 25, 0.4);
    color: #ffffff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: transparent;
    color: var(--pshare-dark, #1E2022);
    border: 2px solid var(--pshare-dark, #1E2022);
    border-radius: 50px;
    font-family: var(--pshare-font, 'Poppins', sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--pshare-dark, #1E2022);
    color: #ffffff;
    transform: translateY(-2px);
}

/* =========================================
   PAGE HERO (Internal pages)
========================================= */
.page-hero {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--pshare-dark, #1E2022);
}

.page-hero-compact {
    height: 45vh;
    min-height: 300px;
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
}

.page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30,32,34,0.8) 0%, rgba(227,34,25,0.3) 100%);
    z-index: 1;
}

.page-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    margin-top: 60px;
}

.page-hero-title {
    color: #ffffff;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.page-hero-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    margin-top: 15px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   POSTS GRID
========================================= */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* =========================================
   POST CARDS
========================================= */
.post-card {
    background: var(--pshare-white, #ffffff);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 20px rgba(0,0,0,0.04);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.post-card-image {
    display: block;
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

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

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

.post-card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-card-image-overlay {
    opacity: 1;
}

.post-card-content {
    padding: 25px 30px 30px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--pshare-text, #555);
}

.post-card-meta time {
    color: var(--pshare-primary, #E32219);
    font-weight: 600;
}

.post-card-cat a {
    color: var(--pshare-text, #555);
}

.post-card-title {
    margin-bottom: 10px;
}

.post-card-title a {
    color: var(--pshare-dark, #1E2022);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card-title a:hover {
    color: var(--pshare-primary, #E32219);
}

.post-card-excerpt {
    color: var(--pshare-text, #555);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pshare-primary, #E32219);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-link:hover {
    gap: 12px;
}

/* =========================================
   SINGLE ARTICLE
========================================= */
.single-article .entry-content {
    font-size: 1.05rem;
    line-height: 1.9;
}

.single-article .entry-content p {
    margin-bottom: 1.5em;
}

.single-article .entry-content h2,
.single-article .entry-content h3 {
    margin-top: 2em;
    margin-bottom: 0.8em;
}

.single-article .entry-content img {
    border-radius: 16px;
    margin: 2em 0;
}

.single-article .entry-content blockquote {
    border-left: 4px solid var(--pshare-primary, #E32219);
    padding: 20px 30px;
    margin: 2em 0;
    background: rgba(227, 34, 25, 0.05);
    border-radius: 0 16px 16px 0;
    font-style: italic;
    font-size: 1.1rem;
}

.single-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.single-date, .single-category {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.single-category a {
    color: var(--pshare-primary, #E32219);
}

/* Entry tags */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.entry-tags .tags-label {
    font-weight: 600;
    color: var(--pshare-dark);
}

.entry-tags a {
    display: inline-block;
    padding: 5px 16px;
    background: var(--pshare-bg, #F4F6F8);
    color: var(--pshare-text, #555);
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.entry-tags a:hover {
    background: var(--pshare-primary);
    color: #ffffff;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: var(--pshare-white, #fff);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.post-nav-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.post-nav-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--pshare-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-nav-next .post-nav-label {
    justify-content: flex-end;
}

.post-nav-title {
    color: var(--pshare-dark);
    font-weight: 700;
    font-size: 1rem;
}

/* =========================================
   PAGINATION
========================================= */
.pagination-wrapper {
    margin-top: 60px;
    text-align: center;
}

.pagination-wrapper .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--pshare-white, #fff);
    color: var(--pshare-dark, #1E2022);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.pagination-wrapper .page-numbers:hover,
.pagination-wrapper .page-numbers.current {
    background: var(--pshare-primary, #E32219);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(227, 34, 25, 0.3);
}

/* =========================================
   SEARCH FORM
========================================= */
.search-form {
    max-width: 500px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--pshare-white, #fff);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--pshare-primary, #E32219);
}

.search-icon {
    color: var(--pshare-text, #555);
    flex-shrink: 0;
}

.search-field {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 15px;
    font-family: var(--pshare-font, 'Poppins', sans-serif);
    font-size: 1rem;
    background: transparent;
    color: var(--pshare-dark, #1E2022);
}

.search-submit {
    padding: 12px 24px;
    background: var(--pshare-primary, #E32219);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: var(--pshare-font, 'Poppins', sans-serif);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-submit:hover {
    background: var(--pshare-primary-dark, #B81912);
}

/* =========================================
   SCROLL INDICATOR
========================================= */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: scrollBounce 2s infinite;
}

.scroll-indicator-dot {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    position: relative;
}

.scroll-indicator-dot::after {
    content: '';
    width: 4px;
    height: 8px;
    background: rgba(255,255,255,0.8);
    border-radius: 4px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDot 2s infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes scrollDot {
    0% { opacity: 1; top: 6px; }
    100% { opacity: 0; top: 20px; }
}

/* =========================================
   WORDPRESS SPECIFIC
========================================= */
.wp-block-image img {
    border-radius: 16px;
}

.wp-block-gallery {
    margin: 2em 0;
}

.alignwide {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Entry content typography (Gutenberg) */
.entry-content {
    font-size: 1.05rem;
    line-height: 1.9;
}

.entry-content > * {
    margin-bottom: 1.5em;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 1.8em;
    margin-bottom: 0.8em;
}

.entry-content blockquote {
    border-left: 4px solid var(--pshare-primary, #E32219);
    padding: 20px 30px;
    margin: 2em 0;
    background: rgba(227, 34, 25, 0.05);
    border-radius: 0 16px 16px 0;
    font-style: italic;
    font-size: 1.15rem;
}

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

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

.wp-block-buttons {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

.wp-block-button__link {
    border-radius: 50px !important;
    font-family: var(--pshare-font, 'Poppins', sans-serif);
    font-weight: 600;
}
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}
