/*
Theme Name: Fast Locker Pro
Author: You
Description: Flattened design. No more "box inside a box".
Version: 7.0
*/

/* =========================================
   1. VARIABLES & SETUP
   ========================================= */
:root {
    --primary: #2563eb;       
    --primary-dark: #1d4ed8;
    --bg-body: #f8fafc;       /* Slightly lighter background */
    --bg-card: #ffffff;
    --text-main: #0f172a;     
    --text-muted: #64748b;    
    --border: #e2e8f0;
    --radius: 16px;           /* Smoother corners */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --container-width: 700px; 
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* =========================================
   2. LAYOUT
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 40px auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    overflow: hidden;
    min-height: 80vh;
}

@media (max-width: 768px) {
    .container { margin: 0; border-radius: 0; min-height: 100vh; }
}

/* =========================================
   3. HEADER & ARTICLE
   ========================================= */
header {
    background: #fff; padding: 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
header h1 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; }
header h1 a { color: var(--text-main); text-decoration: none; }

article { padding: 40px; }
@media (max-width: 600px) { article { padding: 25px 20px; } }

h1.entry-title {
    font-size: 2rem; font-weight: 800; line-height: 1.2;
    margin-bottom: 0.5rem; letter-spacing: -1px;
}
.meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 2rem; display: block; font-weight: 500; }

article p { margin-bottom: 1.5rem; font-size: 1.05rem; color: #334155; }
article h2 { font-size: 1.5rem; margin-top: 2.5rem; color: #0f172a; font-weight: 700; letter-spacing: -0.5px; }
article ul { margin-bottom: 1.5rem; padding-left: 20px; }
article li { margin-bottom: 0.5rem; }

/* =========================================
   4. LOCKER WRAPPER (The ONLY Container)
   ========================================= */
.locker-wrapper {
    position: relative;
    margin: 40px 0;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    /* No shadow here to keep it flat and clean inside article */
    overflow: hidden; 
}

/* Teaser Content (Blurred) */
.blurred-secret {
    padding: 30px;
    filter: blur(6px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
    background: #fafafa;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    max-height: 250px;
}

/* Button Overlay */
.mostra-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px); /* Stronger glass effect */
    z-index: 10;
}

.btn-mostra {
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; align-items: center; gap: 8px;
}
.btn-mostra:hover { 
    transform: translateY(-1px); 
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
    background: var(--primary-dark); 
}

/* =========================================
   5. LOCKER CONTENT (Seamless - No Double Borders)
   ========================================= */
.locker-box {
    display: none;
    /* CRITICAL FIX: Removed margins, borders, and radius. 
       It now just fills the .locker-wrapper completely. */
    width: 100%;
    background: #fff;
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Header is now full width and flush with the top */
.locker-header {
    background: #f8fafc; 
    padding: 20px; 
    text-align: center; 
    border-bottom: 1px solid var(--border);
}
.locker-header h3 { margin: 0 0 4px 0; color: var(--text-main); font-size: 1.1rem; }
.locker-header p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

#offer-list { padding: 15px; background: #fff; }

/* Offer Cards - Cleaned up */
.offer-card {
    display: flex; align-items: center;
    padding: 12px; margin-bottom: 8px;
    background: #fff; 
    border: 1px solid var(--border);
    border-radius: 12px; 
    text-decoration: none !important;
    cursor: pointer; transition: all 0.2s;
}
.offer-card:hover { 
    transform: translateY(-1px); 
    border-color: #cbd5e1; 
    background: #fdfdfd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); 
}

.offer-icon img { width: 42px; height: 42px; border-radius: 10px; }
.offer-details { flex: 1; padding: 0 15px; display: flex; flex-direction: column; justify-content: center; }
.offer-title { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }
.offer-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.3; }

.offer-action .btn {
    background: #f1f5f9; color: var(--primary); padding: 6px 12px;
    border-radius: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.offer-card:hover .offer-action .btn { background: var(--primary); color: #fff; }

/* Loading & Success */
.locker-loading { padding: 40px 20px; text-align: center; }
.spinner {
    margin: 15px auto; width: 28px; height: 28px;
    border: 3px solid #e2e8f0; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s infinite linear;
}
@keyframes spin { to { transform: rotate(360deg); } }

.secret-revealed {
    padding: 0; /* Remove padding as it's inside the wrapper */
}
.secret-revealed h3 { 
    background: #ecfdf5; color: #059669; 
    margin: 0; padding: 15px; text-align: center; font-size: 1.1rem;
    border-bottom: 1px solid #d1fae5;
}
/* The actual secret content area */
.secret-content-body {
    padding: 25px;
    background: #fff;
    color: #334155;
}

/* Footer */
footer { text-align: center; padding: 30px; border-top: 1px solid var(--border); color: #94a3b8; font-size: 0.85rem; }

/* =========================================
   6. IMAGE RESPONSIVENESS (THE FIX)
   ========================================= */
article img, 
.entry-content img, 
.wp-block-image img {
    max-width: 100%;       /* Never wider than container */
    height: auto;          /* Maintain aspect ratio */
    display: block;        /* Remove bottom gap */
    margin: 20px auto;     /* Center align */
    border-radius: 12px;   /* Match your theme radius */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* Subtle premium shadow */
}

/* Ensure aligned images don't break layout on mobile */
@media (max-width: 768px) {
    .alignleft, .alignright {
        float: none;
        margin: 0 auto 20px auto;
        display: block;
    }
}

/* =========================================
   7. PAGINATION
   ========================================= */
.pagination-wrapper {
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
}

.pagination-wrapper .screen-reader-text {
    display: none; /* Hides the default "Posts navigation" heading */
}

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

.pagination-wrapper .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.pagination-wrapper .page-numbers:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.pagination-wrapper .page-numbers.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.pagination-wrapper .dots {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 8px;
}
/* =========================================
   8. RELATED POSTS
   ========================================= */
.related-posts {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.related-posts h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-main);
}

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

.related-card {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.related-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    margin: 0; /* Override default img margin */
    border-radius: 0; /* Override default img radius for top corners */
}

.related-info {
    padding: 15px;
}

.related-info h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-main);
    font-weight: 600;
}

.related-info .read-more {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
}

/* =========================================
   9. HOMEPAGE LIST STYLING
   ========================================= */

/* Main Container adjustment for index.php */
.home-container {
    padding: 30px; 
    max-width: 700px; 
    margin: 0 auto;
}

.home-container h2 {
    margin-bottom: 30px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

/* The Card Wrapper */
.home-post-card {
    display: flex; /* Makes them side-by-side */
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.home-post-card:last-child {
    border-bottom: none;
}

/* The Thumbnail Area */
.home-post-thumb {
    flex-shrink: 0;
    width: 140px; /* Fixed width for the image column */
}

.home-post-thumb img {
    width: 100%;
    height: 100px; /* Fixed height for uniformity */
    object-fit: cover; /* Crops image to fit without distortion */
    border-radius: 12px;
    margin: 0; /* Overrides default article image margins */
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.home-post-thumb a:hover img {
    transform: scale(1.02);
}

/* The Content Area */
.home-post-content {
    flex-grow: 1;
}

.home-post-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-post-title a {
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.2s;
}

.home-post-title a:hover {
    color: var(--primary);
}

.home-post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.home-read-more {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-read-more:hover {
    color: var(--primary-dark);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .home-post-card {
        flex-direction: column; /* Stack vertically on phones */
    }
    
    .home-post-thumb {
        width: 100%;
        margin-bottom: 10px;
    }

    .home-post-thumb img {
        height: 160px; /* Taller image on mobile */
        width: 100%;
    }
}

/* =========================================
   10. COOKIE BANNER
   ========================================= */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 150%); /* Start hidden below screen */
    width: 90%;
    max-width: 600px;
    background: #fff;
    padding: 20px 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 16px;
    border: 1px solid var(--border);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.cookie-banner.show {
    transform: translate(-50%, 0); /* Slide up to visible */
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

.cookie-content a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.cookie-actions .btn-accept {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.cookie-actions .btn-accept:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    
    .cookie-banner.show {
        transform: translateY(0);
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-actions .btn-accept {
        width: 100%;
    }
}