/* TecBlog - Custom styles (TailwindCSS handles the layout)
   ==================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}
body {
    -webkit-tap-highlight-color: transparent;
}
html {
    scroll-behavior: smooth;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* Animations */
@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Hero slides */
.hero-slide { transition: opacity 0.6s ease, transform 0.6s ease; }
.hero-slide.active { opacity: 1; transform: scale(1); z-index: 2; }
.hero-slide:not(.active) { opacity: 0; position: absolute; transform: scale(0.95); }

/* Offcanvas & Overlays */
.offcanvas-overlay { transition: opacity 0.3s ease; }
.offcanvas-panel { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.search-overlay { transition: opacity 0.25s ease, visibility 0.25s ease; }

/* Card hover */
.card-hover { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }

/* Category labels */
.cat-label {
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    display: inline-block;
}
.cat-noticias { background: #1e73be; }
.cat-reviews { background: #14917c; }
.cat-tutoriais { background: #43c9d8; }
.cat-opiniao { background: #8224e3; }

/* Breaking news ticker */
.breaking-track { transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* Ad slots */
.ad-slot { min-height: 1px; }

/* Related Posts */
.related-posts { animation: fadeInUp 0.4s ease; }
.rp-heading { font-size: 16px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; color: var(--text, #333); }
.rp-heading i { color: var(--primary); }

.rp-buttons-wrap { display: flex; flex-direction: column; gap: 8px; }
.rp-btn { display: block; padding: 10px 16px; background: var(--rp-bg, #f8f9fa); color: var(--rp-text, #333); text-decoration: none; border-radius: 6px; border: 1px solid var(--rp-border, #dee2e6); font-size: var(--rp-fs, 14px); transition: all 0.2s; }
.rp-btn:hover { background: var(--rp-hover, #e9ecef); text-decoration: none; }

.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--rp-spacing, 16px); }
.rp-list { display: flex; flex-direction: column; gap: var(--rp-spacing, 12px); }
.rp-carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 8px; scrollbar-width: thin; }
.rp-carousel::-webkit-scrollbar { height: 4px; }
.rp-carousel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.rp-card { background: var(--rp-bg, #fff); border: 1px solid var(--rp-border, #dee2e6); border-radius: 8px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; min-width: 160px; flex-shrink: 0; scroll-snap-align: start; }
.rp-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); background: var(--rp-hover, #f8f9fa); }
.rp-img { width: 100%; object-fit: cover; display: block; background: #e0e0e0; }
.rp-img-link { display: block; overflow: hidden; }
.rp-card-body { padding: var(--rp-spacing, 12px); }
.rp-title { display: block; font-weight: 700; text-decoration: none; margin-top: 6px; line-height: 1.3; }
.rp-title:hover { text-decoration: underline; color: var(--rp-hover-text, #333); }
.rp-summary { font-size: 12px; color: #666; margin: 6px 0 0; line-height: 1.4; }
.rp-readmore { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; text-decoration: none; border-bottom: 1px solid; }
.rp-readmore:hover { opacity: 0.7; text-decoration: none; }

.rp-carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.9); border: 1px solid #dee2e6; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; color: #333; z-index: 2; transition: all 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.rp-carousel-btn:hover { background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.rp-carousel-prev { left: 4px; }
.rp-carousel-next { right: 4px; }

@media (max-width: 600px) {
    .rp-grid { grid-template-columns: 1fr 1fr; }
    .rp-card { min-width: 140px; }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .hero-slide.active { animation: fadeInUp 0.5s ease; }
    .card-hover:hover { transform: none; box-shadow: none; }
}

@media (max-width: 640px) {
    .rp-grid { grid-template-columns: 1fr; }
    .rp-card { min-width: 0; }
}

@media (max-width: 480px) {
    .cat-label { font-size: 10px; padding: 1px 8px; }
    .rp-carousel { gap: 8px; }
    .rp-card-body { padding: 8px; }
    .rp-title { font-size: 13px; }
    .rp-summary { font-size: 11px; }
}

/* Alpine.js cloak */
[x-cloak] { display: none !important; }

/* Line clamp */
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

/* Carrossel Configurável */
.carousel-wrapper {
    position: relative;
    margin-bottom: 8px;
}
.carousel-desktop { display: block; position: relative; }
.carousel-mobile { display: none; }

.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    scrollbar-width: thin;
}
.carousel-track::-webkit-scrollbar { height: 5px; }
.carousel-track::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.carousel-slide {
    min-width: 260px;
    max-width: 320px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.carousel-slide:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.10);
}
.carousel-slide-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.carousel-img-wrap {
    position: relative;
    overflow: hidden;
    height: 170px;
}
.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.carousel-slide:hover .carousel-img { transform: scale(1.05); }
.carousel-cat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
}
.carousel-body { padding: 14px; }
.carousel-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.carousel-slide:hover .carousel-title { color: var(--primary, #ff6b35); }
.carousel-summary {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.carousel-meta {
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}
.carousel-meta i { font-size: 10px; }

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: hsla(0,0%,100%,.92);
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s;
}
.carousel-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.carousel-arrow-prev { left: -12px; }
.carousel-arrow-next { right: -12px; }

/* Mobile carousel */
.carousel-mobile-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 8px;
    scrollbar-width: none;
}
.carousel-mobile-track::-webkit-scrollbar { display: none; }

.carousel-mobile-slide {
    min-width: 75vw;
    max-width: 85vw;
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.carousel-mobile-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.carousel-mobile-img-wrap {
    position: relative;
    height: 160px;
    overflow: hidden;
}
.carousel-mobile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel-mobile-body { padding: 12px; }
.carousel-mobile-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.carousel-mobile-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.carousel-dot.active {
    background: var(--primary, #ff6b35);
    width: 22px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .carousel-desktop { display: none; }
    .carousel-mobile { display: block; }
    .carousel-slide { min-width: 220px; max-width: 280px; }
    .carousel-arrow { display: none !important; }
}

@media (max-width: 480px) {
    .carousel-mobile-slide { min-width: 80vw; }
    .carousel-mobile-img-wrap { height: 140px; }
    .carousel-mobile-body { padding: 10px; }
    .carousel-mobile-title { font-size: 13px; }
}
