@charset "UTF-8";

/* -- Fontes locais (sem dependencia de CDN externo) --------- */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/sourcesans3-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/sourcesans3-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/sourcesans3-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/sourcesans3-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/merriweather-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/merriweather-700.woff2') format('woff2');
}

/* ============================================================
   EduHub - CSS Principal (Mobile-First Responsivo)
   Breakpoints: <480px xs | <640px sm | <768px md | <1024px lg | >=1024px xl
   ============================================================ */

/* -- Reset & Base ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif; font-size: 1rem; line-height: 1.6; color: #333; background: #f4f6f9; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* -- Container ---------------------------------------------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px)  { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* -- Top Bar ------------------------------------------ */
/* Oculta completamente em mobile; aparece apenas em tablet+ */
.top-bar { background: #1e3a5f; color: #cce0f5; font-size: 0.8rem; padding: 6px 0; display: none; overflow: hidden; }
@media (min-width: 640px) { .top-bar { display: block; } }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-bar-left, .top-bar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.top-bar-left a, .top-bar-right a { color: #cce0f5; display: flex; align-items: center; gap: 5px; transition: color .2s; word-break: break-all; overflow-wrap: break-word; min-width: 0; }
.top-bar-left a:hover, .top-bar-right a:hover { color: #f5a623; }
.top-bar i { font-size: 0.75rem; flex-shrink: 0; }

/* -- Header ------------------------------------------ */
.main-header {
    background: #fff;
    border-bottom: 3px solid #f5a623;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    /* Garante que nada estoure o header */
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 60px;
    /* Impede que filhos estourem */
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 0; max-width: calc(100% - 56px); }
.logo-icon { width: 38px; height: 38px; background: #1e3a5f; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #f5a623; font-size: 1.05rem; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; overflow: hidden; }
.logo-name { font-family: 'Merriweather', serif; font-size: 0.95rem; font-weight: 700; color: #1e3a5f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-sub  { font-size: 0.62rem; color: #888; display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 480px) {
    .logo-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .logo-name { font-size: 1.05rem; }
    .logo-sub { display: block; }
}
@media (min-width: 640px) { .logo-name { font-size: 1.1rem; } }

/* Search - oculto em mobile, visivel a partir de 640px */
.header-search { flex: 1; display: flex; max-width: 480px; margin-left: auto; min-width: 0; }
.header-search input { flex: 1; padding: 8px 14px; border: 2px solid #e2e8f0; border-right: none; border-radius: 6px 0 0 6px; font-size: 0.875rem; outline: none; transition: border-color .2s; min-width: 0; }
.header-search input:focus { border-color: #1e3a5f; }
.header-search button { background: #f5a623; border: none; padding: 8px 14px; border-radius: 0 6px 6px 0; color: #fff; font-size: 0.95rem; transition: background .2s; flex-shrink: 0; }
.header-search button:hover { background: #e0941a; }
@media (max-width: 639px) { .header-search { display: none; } }

/* Botao hamburguer - visivel ate 1023px */
.mobile-menu-btn {
    background: none;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 10px;
    color: #1e3a5f;
    font-size: 1rem;
    /* Nao usa margin-left:auto pois o logo ja empurra com flex */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: background .2s;
}
.mobile-menu-btn:hover { background: #f4f6f9; }
@media (min-width: 1024px) { .mobile-menu-btn { display: none; } }

/* -- Navigation --------------------------------------------- */
.main-nav { background: #1e3a5f; position: relative; z-index: 999; border-bottom: 3px solid #f5a623; }
.nav-list { display: none; flex-direction: column; padding: 8px 0; }
.nav-list.open { display: flex; }
@media (min-width: 1024px) { .nav-list { display: flex !important; flex-direction: row; align-items: center; padding: 0; } }

.nav-list > li { position: relative; }
.nav-list > li > a { display: flex; align-items: center; gap: 5px; padding: 11px 16px; color: #e8f0fe; font-size: 0.875rem; font-weight: 600; transition: background .2s, color .2s; white-space: nowrap; }
.nav-list > li > a:hover, .nav-list > li > a.active { background: #f5a623; color: #fff; }
.nav-list > li > a i { font-size: 0.7rem; transition: transform .2s; }
.has-dropdown.open > a i { transform: rotate(180deg); }

/* Dropdown */
.dropdown { display: none; background: #fff; border-top: 3px solid #f5a623; box-shadow: 0 6px 20px rgba(0,0,0,.12); min-width: 200px; z-index: 1001; }
@media (min-width: 1024px) { .dropdown { position: absolute; top: 100%; left: 0; } }
@media (max-width: 1023px) { .dropdown { background: #152d4a; border-top: none; } }
.has-dropdown.open .dropdown { display: block; }
/* Abre dropdown no hover em desktop */
@media (min-width: 1024px) { .has-dropdown:hover .dropdown { display: block; } }
@media (min-width: 1024px) { .has-dropdown:hover > a i.fa-chevron-down { transform: rotate(180deg); } }
.dropdown li a { display: block; padding: 10px 18px; font-size: 0.875rem; color: #333; transition: background .15s, color .15s; border-bottom: 1px solid #f4f6f9; }
@media (max-width: 1023px) { .dropdown li a { color: #cce0f5; border-bottom-color: rgba(255,255,255,.08); } }
.dropdown li a:hover { background: #f4f6f9; color: #1e3a5f; }
@media (max-width: 1023px) { .dropdown li a:hover { background: rgba(255,255,255,.1); color: #f5a623; } }
.dropdown-empty { padding: 10px 18px; color: #999; font-size: 0.85rem; }

/* Mobile search */
.mobile-search { display: flex; padding: 10px 16px; border-top: 1px solid rgba(255,255,255,.1); }
.mobile-search input { flex: 1; padding: 8px 12px; border: none; border-radius: 6px 0 0 6px; font-size: 0.875rem; outline: none; min-width: 0; }
.mobile-search button { background: #f5a623; border: none; padding: 8px 14px; border-radius: 0 6px 6px 0; color: #fff; font-size: 0.875rem; }
@media (min-width: 640px) { .mobile-search { display: none; } }

/* -- Hero Carousel ------------------------------------------ */
.hero-section { position: relative; overflow: hidden; background: #1e3a5f; height: 240px; }
@media (min-width: 480px)  { .hero-section { height: 280px; } }
@media (min-width: 640px)  { .hero-section { height: 320px; } }
@media (min-width: 1024px) { .hero-section { height: 360px; } }

.carousel-track { display: flex; height: 100%; transition: transform .5s cubic-bezier(.4,0,.2,1); will-change: transform; }
.carousel-slide { min-width: 100%; height: 100%; position: relative; overflow: hidden; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #1e3a5f 0%, #2a5298 100%); }
.carousel-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.2) 60%, transparent 100%); }

.carousel-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 16px; color: #fff; }
@media (min-width: 640px)  { .carousel-content { padding: 20px 28px; } }
@media (min-width: 1024px) { .carousel-content { padding: 28px 40px; } }

.carousel-badge { display: inline-block; background: #f5a623; color: #fff; font-size: 0.68rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.carousel-title { font-family: 'Merriweather', serif; font-size: clamp(0.95rem, 3.5vw, 1.6rem); font-weight: 700; line-height: 1.3; margin-bottom: 8px; text-shadow: 0 1px 4px rgba(0,0,0,.4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carousel-desc { font-size: clamp(0.78rem, 2vw, 0.9rem); opacity: .9; margin-bottom: 10px; display: none; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 640px) { .carousel-desc { display: -webkit-box; } }
.carousel-btn { display: inline-flex; align-items: center; gap: 6px; background: #f5a623; color: #fff; padding: 7px 16px; border-radius: 6px; font-size: 0.82rem; font-weight: 700; transition: background .2s; }
.carousel-btn:hover { background: #e0941a; color: #fff; }

.carousel-prev, .carousel-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.4); border: none; color: #fff; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; transition: background .2s; z-index: 10; }
@media (min-width: 640px) { .carousel-prev, .carousel-next { width: 42px; height: 42px; font-size: 1rem; } }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-prev:hover, .carousel-next:hover { background: #f5a623; }

.carousel-dots { position: absolute; bottom: 10px; right: 14px; display: flex; gap: 6px; z-index: 10; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); border: none; padding: 0; transition: background .2s, transform .2s; }
.carousel-dot.active { background: #f5a623; transform: scale(1.3); }

.hero-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #fff; text-align: center; padding: 20px; }
.hero-empty i { font-size: 2.5rem; color: #f5a623; margin-bottom: 12px; }
.hero-empty h2 { color: #fff; font-size: 1.1rem; margin-bottom: 8px; }
.hero-empty p { color: rgba(255,255,255,.7); font-size: 0.875rem; }

/* -- Stats Bar ---------------------------------------------- */
.stats-bar { background: #fff; border-bottom: 1px solid #e8ecf0; padding: 12px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
@media (min-width: 480px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-right: 1px solid #e8ecf0; border-bottom: 1px solid #e8ecf0; }
@media (min-width: 480px) { .stat-item { border-bottom: none; } }
.stat-item:last-child { border-right: none; }
.stat-icon { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.stat-icon.orange { background: #fff3e0; color: #f5a623; }
.stat-icon.blue   { background: #e3f2fd; color: #1e3a5f; }
.stat-icon.green  { background: #e8f5e9; color: #16a34a; }
.stat-icon.purple { background: #f3e5f5; color: #9333ea; }
.stat-info strong { display: block; font-size: 1.1rem; font-weight: 700; color: #1e3a5f; line-height: 1; }
.stat-info span { font-size: 0.72rem; color: #888; }

/* -- Page Layout -------------------------------------------- */
.page-wrapper { padding: 24px 0 40px; }
.content-sidebar-layout { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
@media (min-width: 1024px) { .content-sidebar-layout { flex-direction: row; } }
.main-content { flex: 1; min-width: 0; width: 100%; max-width: 100%; overflow-x: hidden; box-sizing: border-box; }

/* -- Section Header ----------------------------------------- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #e5e7eb; flex-wrap: wrap; gap: 8px; }
.section-title { font-family: 'Merriweather', serif; font-size: clamp(1rem, 3vw, 1.2rem); color: #1e3a5f; display: flex; align-items: center; gap: 8px; }
.section-title i { color: #f5a623; }
.section-link { font-size: 0.82rem; color: #f5a623; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-link:hover { color: #e0941a; }

/* -- Content Cards Grid ------------------------------------- */
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 480px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

/* -- Content Card ------------------------------------------- */
.content-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.content-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.card-thumb { display: block; position: relative; overflow: hidden; aspect-ratio: 16/9; background: #f4f6f9; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.content-card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.type-bg-video    { background: linear-gradient(135deg, #1e3a5f, #2d5a9e); color: #fff; }
.type-bg-tutorial { background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; }
.type-bg-pdf      { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.type-bg-image    { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.type-bg-doc      { background: linear-gradient(135deg, #1a56db, #3b82f6); color: #fff; }
.type-bg-xls      { background: linear-gradient(135deg, #057a55, #10b981); color: #fff; }
.type-bg-ppt      { background: linear-gradient(135deg, #c05621, #f97316); color: #fff; }
.type-bg-audio    { background: linear-gradient(135deg, #6b21a8, #a855f7); color: #fff; }
.card-badge { position: absolute; top: 8px; left: 8px; font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.badge-video    { background: #1e3a5f; }
.badge-tutorial { background: #16a34a; }
.badge-pdf      { background: #dc2626; }
.badge-image    { background: #7c3aed; }
.badge-doc      { background: #1a56db; }
.badge-xls      { background: #057a55; }
.badge-ppt      { background: #c05621; }
.badge-audio    { background: #6b21a8; }
.card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.card-category { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; display: block; }
.card-title { font-family: 'Merriweather', serif; font-size: 0.9rem; font-weight: 700; line-height: 1.4; margin-bottom: 6px; flex: 1; }
.card-title a { color: #1e3a5f; transition: color .2s; }
.card-title a:hover { color: #f5a623; }
.card-desc { font-size: 0.8rem; color: #666; line-height: 1.5; margin-bottom: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-meta { display: flex; gap: 10px; font-size: 0.72rem; color: #999; flex-wrap: wrap; margin-top: auto; }
.card-meta i { margin-right: 3px; }

/* -- Page Header -------------------------------------------- */
.page-header { background: linear-gradient(135deg, #1e3a5f, #2d5a9e); color: #fff; padding: 20px 0; margin-bottom: 24px; }
.page-header h1 { color: #fff; font-size: clamp(1.1rem, 4vw, 1.6rem); margin-bottom: 6px; word-break: break-word; }
.page-header p { color: rgba(255,255,255,.75); font-size: 0.875rem; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: rgba(255,255,255,.7); margin-top: 6px; flex-wrap: wrap; }
.breadcrumb a { color: rgba(255,255,255,.85); }
.breadcrumb a:hover { color: #f5a623; }
.breadcrumb i { font-size: 0.65rem; }

/* -- Filters Bar -------------------------------------------- */
.filters-bar { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }
.filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters-label { font-size: 0.8rem; color: #666; font-weight: 700; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.filter-btn { padding: 5px 13px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; border: 1px solid #e5e7eb; background: #f9fafb; color: #374151; transition: all .2s; white-space: nowrap; display: inline-block; }
.filter-btn:hover, .filter-btn.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.filter-divider { width: 100%; height: 1px; background: #f3f4f6; }

/* -- Pagination --------------------------------------------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 24px; padding: 0 8px; }
.page-btn { min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 0.85rem; font-weight: 600; border: 1px solid #e5e7eb; background: #fff; color: #333; transition: all .2s; padding: 0 8px; }
.page-btn:hover, .page-btn.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.page-ellipsis { padding: 0 4px; color: #999; }
/* -- Content Detail ------------------------------------------ */
.content-detail {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    /* overflow:hidden corta qualquer filho que estoure */
    overflow: hidden;
    margin-bottom: 20px;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Garante que o card nunca ultrapasse o viewport */
    box-sizing: border-box;
}
.detail-body {
    padding: 14px;
    /* Impede estouro horizontal de qualquer filho */
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}
@media (min-width: 480px) { .detail-body { padding: 18px 22px; } }
@media (min-width: 640px) { .detail-body { padding: 24px 36px; } }
@media (min-width: 1024px) { .detail-body { padding: 32px 52px; } }

/* Artigo HTML rico gerado por IA */
#html-rich {
    all: initial;
    display: block;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.detail-meta span { display: flex; align-items: center; gap: 5px; min-width: 0; }
.detail-meta i { color: #f5a623; flex-shrink: 0; }

.detail-title {
    font-family: 'Merriweather', serif;
    font-size: clamp(1.05rem, 4vw, 1.55rem);
    color: #1e3a5f;
    margin-bottom: 10px;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
}
.detail-category { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; color: #fff; margin-bottom: 10px; }
.detail-description { font-size: 0.9rem; color: #4b5563; margin-bottom: 16px; line-height: 1.7; word-break: break-word; overflow-wrap: break-word; }

/* Conteudo HTML generico (sem classe prose) */
.detail-content {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.8;
    max-width: 100%;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
}
.detail-content h2, .detail-content h3 { margin: 18px 0 8px; color: #1e3a5f; font-family: 'Merriweather', serif; }
.detail-content p { margin-bottom: 12px; }
.detail-content ul, .detail-content ol { padding-left: 22px; margin-bottom: 12px; }
.detail-content li { margin-bottom: 5px; }
.detail-content code { background: #f4f6f9; padding: 2px 6px; border-radius: 3px; font-size: 0.85em; }
.detail-content pre {
    background: #1e3a5f;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 14px;
    font-size: 0.85rem;
    max-width: 100%;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}
.detail-content blockquote { border-left: 4px solid #f5a623; padding-left: 14px; color: #6b7280; font-style: italic; margin-bottom: 12px; }
.detail-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 10px 0; display: block; }
.detail-content table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 14px;
    font-size: 0.85rem;
}
.detail-content th, .detail-content td { border: 1px solid #e5e7eb; padding: 8px 12px; text-align: left; }
.detail-content th { background: #1e3a5f; color: #fff; }
.detail-content iframe {
    max-width: 100%;
    width: 100%;
    border: 0;
    display: block;
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { background: #f4f6f9; color: #374151; font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; border: 1px solid #e5e7eb; transition: all .2s; }
.tag:hover { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

/* -- Media: Video (YouTube) --------------------------------- */
.detail-media { width: 100%; max-width: 100%; }
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    width: 100%;
}
.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* -- Media: PDF viewer -------------------------------------- */
.pdf-viewer {
    width: 100%;
    max-width: 100%;
    /* Altura responsiva: 60vw em mobile, minimo 260px, maximo 600px */
    height: clamp(260px, 60vw, 600px);
    border: 0;
    display: block;
}
@media (min-width: 640px) {
    .pdf-viewer { height: clamp(360px, 50vw, 600px); }
}

.pdf-download { padding: 12px 16px; background: #f9fafb; border-top: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: center; }
.pdf-download a { display: inline-flex; align-items: center; gap: 8px; background: #dc2626; color: #fff; padding: 8px 18px; border-radius: 6px; font-size: 0.875rem; font-weight: 700; transition: background .2s; }
.pdf-download a:hover { background: #b91c1c; }

/* -- Media: Imagem / Thumbnail ------------------------------ */
.detail-image {
    /* Nunca ultrapassa o container, independente do tamanho original */
    width: 100%;
    max-width: 100%;
    height: auto;          /* Mantem proporcao original */
    display: block;
    margin: 0 auto;
    object-fit: contain;   /* Nao distorce a imagem */
    border-radius: 4px;
}
/* Em telas maiores limita a altura para nao ficar gigante */
@media (min-width: 640px) {
    .detail-image { max-height: 480px; }
}

/* -- Rating ------------------------------------------------- */
.rating-section { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; margin-top: 20px; text-align: center; }
@media (min-width: 480px) { .rating-section { padding: 18px; } }
.rating-section h3 { font-size: 1rem; color: #1e3a5f; margin-bottom: 12px; }
.stars-display { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.star { font-size: 1.6rem; color: #d1d5db; cursor: pointer; transition: color .15s, transform .15s; line-height: 1; }
.star.filled, .star:hover, .star.hover { color: #f5a623; }
.star:hover { transform: scale(1.15); }
.rating-info { font-size: 0.8rem; color: #6b7280; }
.rating-avg { font-size: 1.6rem; font-weight: 700; color: #1e3a5f; }
.rating-voted { font-size: 0.875rem; color: #16a34a; font-weight: 600; }

/* -- Comments ----------------------------------------------- */
.comments-section { margin-top: 20px; }
.comments-section h3 { font-family: 'Merriweather', serif; font-size: 1.05rem; color: #1e3a5f; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #e5e7eb; }
.comment-item { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; margin-bottom: 10px; word-break: break-word; overflow-wrap: break-word; }
.comment-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.comment-author { font-weight: 700; color: #1e3a5f; font-size: 0.875rem; }
.comment-date { font-size: 0.75rem; color: #9ca3af; white-space: nowrap; }
.comment-body { font-size: 0.875rem; color: #374151; line-height: 1.6; word-break: break-word; overflow-wrap: break-word; }

.comment-form { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; margin-top: 18px; }
@media (min-width: 640px) { .comment-form { padding: 20px; } }
.comment-form h4 { font-size: 1rem; color: #1e3a5f; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
@media (min-width: 480px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 5px; }
.form-control {
    width: 100%;
    max-width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
    background: #fafafa;
    box-sizing: border-box;
}
.form-control:focus { border-color: #1e3a5f; background: #fff; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 6px; font-size: 0.875rem; font-weight: 700; border: none; transition: all .2s; font-family: inherit; }
.btn-primary { background: #1e3a5f; color: #fff; }
.btn-primary:hover { background: #152d4a; }
.btn-orange { background: #f5a623; color: #fff; }
.btn-orange:hover { background: #e0941a; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

/* Alerts */
.alert { padding: 11px 14px; border-radius: 6px; font-size: 0.875rem; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; word-break: break-word; overflow-wrap: break-word; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* -- Sidebar ------------------------------------------------ */
.sidebar { width: 100%; }
@media (min-width: 1024px) { .sidebar { width: 270px; flex-shrink: 0; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; } }
.widget { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
.widget-title { background: #1e3a5f; color: #fff; padding: 10px 14px; font-size: 0.875rem; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.widget-title i { color: #f5a623; }
.widget-body { padding: 12px; }
.widget-list { padding: 0; }
.widget-list-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 0.85rem; color: #374151; border-bottom: 1px solid #f3f4f6; transition: background .15s, color .15s; }
.widget-list-item:last-child { border-bottom: none; }
.widget-list-item:hover { background: #f4f6f9; color: #1e3a5f; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.type-icon { font-size: 0.875rem; }
.type-icon.type-video    { color: #1e3a5f; }
.type-icon.type-tutorial { color: #16a34a; }
.type-icon.type-pdf      { color: #dc2626; }
.type-icon.type-image    { color: #7c3aed; }
.widget-empty { padding: 10px 14px; font-size: 0.82rem; color: #9ca3af; }
.sidebar-search { display: flex; }
.sidebar-search input { flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-right: none; border-radius: 6px 0 0 6px; font-size: 0.85rem; outline: none; min-width: 0; }
.sidebar-search input:focus { border-color: #1e3a5f; }
.sidebar-search button { background: #1e3a5f; color: #fff; border: none; padding: 8px 12px; border-radius: 0 6px 6px 0; }

/* -- Empty State -------------------------------------------- */
.empty-state { text-align: center; padding: 40px 20px; color: #6b7280; }
.empty-state i { font-size: 2.8rem; color: #d1d5db; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.05rem; color: #374151; margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* -- Search Page -------------------------------------------- */
.search-box-large { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.search-form-large { display: flex; }
.search-form-large input { flex: 1; padding: 10px 14px; border: 2px solid #e2e8f0; border-right: none; border-radius: 8px 0 0 8px; font-size: 0.95rem; outline: none; min-width: 0; }
.search-form-large input:focus { border-color: #1e3a5f; }
.search-form-large button { background: #f5a623; border: none; padding: 10px 18px; border-radius: 0 8px 8px 0; color: #fff; font-size: 0.95rem; font-weight: 700; white-space: nowrap; }
.search-form-large button:hover { background: #e0941a; }

/* -- Footer ------------------------------------------ */
.main-footer {
    background: #1e3a5f;
    color: #cbd5e1;
    margin-top: 40px;
    /* Impede estouro horizontal */
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}
/* Mobile: 1 coluna | Tablet: 2 colunas | Desktop: 3 colunas */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 0;
    /* Garante que o grid nunca estoure */
    width: 100%;
    box-sizing: border-box;
}
@media (min-width: 480px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); padding: 32px 0; } }

.footer-col {
    min-width: 0; /* Essencial para que colunas do grid respeitem max-width */
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
}
.footer-col h4 { color: #fff; font-size: 0.875rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid rgba(245,166,35,.4); }
.footer-col p { font-size: 0.85rem; line-height: 1.7; color: #94a3b8; word-break: break-word; overflow-wrap: break-word; }

.footer-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-width: 0; }
.footer-logo-icon { width: 32px; height: 32px; background: #f5a623; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.95rem; flex-shrink: 0; }
.footer-logo span { font-family: 'Merriweather', serif; font-weight: 700; color: #fff; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.footer-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.footer-social a { width: 32px; height: 32px; background: rgba(255,255,255,.1); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 0.875rem; transition: background .2s, color .2s; flex-shrink: 0; }
.footer-social a:hover { background: #f5a623; color: #fff; }

.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    transition: color .2s;
    word-break: break-word;
    overflow-wrap: break-word;
}
.footer-col ul li a:hover { color: #f5a623; }
.footer-col ul li a i { color: #f5a623; font-size: 0.7rem; flex-shrink: 0; margin-top: 4px; }

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: #94a3b8;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}
.contact-list li i { color: #f5a623; width: 14px; flex-shrink: 0; margin-top: 3px; }
/* E-mails e URLs longas no footer nao devem estourar */
.contact-list li a { word-break: break-all; overflow-wrap: break-word; color: inherit; }

.footer-bottom {
    background: rgba(0,0,0,.2);
    padding: 12px 0;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* -- Skeleton Loading --------------------------------------- */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.4s infinite; border-radius: 4px; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* -- Utility ------------------------------------------------ */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }
.results-info { font-size: 0.82rem; color: #666; margin-bottom: 14px; }

/* -- Print -------------------------------------------------- */
@media print {
    .main-nav, .sidebar, .hero-section, .stats-bar, .main-footer, .mobile-menu-btn, .top-bar { display: none !important; }
    .content-sidebar-layout { display: block; }
    .main-content { width: 100%; }
}

/* ============================================================
   Estilos Prose - Renderizacao de HTML no detalhe do conteudo
   NOTA: usa !important nas propriedades de largura para sobrescrever
   atributos style="width:Xpx" colados diretamente no HTML do conteudo.
   ============================================================ */

/* Regra nuclear: NENHUM filho do prose pode ultrapassar o container */
.detail-content.prose *,
.detail-content.prose *::before,
.detail-content.prose *::after {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.detail-content.prose {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: break-word;
    /* Corta qualquer overflow residual no container pai */
    max-width: 100%;
    overflow-x: hidden;
}

.detail-content.prose h1,
.detail-content.prose h2,
.detail-content.prose h3,
.detail-content.prose h4,
.detail-content.prose h5,
.detail-content.prose h6 {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #1e3a5f;
    margin: 1.5em 0 .6em;
    line-height: 1.3;
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: break-word;
}
.detail-content.prose h1 { font-size: clamp(1.3rem, 5vw, 1.9rem); }
.detail-content.prose h2 { font-size: clamp(1.15rem, 4vw, 1.55rem); border-bottom: 2px solid #f5a623; padding-bottom: .3em; }
.detail-content.prose h3 { font-size: clamp(1.05rem, 3.5vw, 1.25rem); }
.detail-content.prose h4 { font-size: 1.05rem; }

.detail-content.prose p { margin: .9em 0; word-break: break-word; overflow-wrap: break-word; }

.detail-content.prose a {
    color: #1e3a5f;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}
.detail-content.prose a:hover { color: #f5a623; }

.detail-content.prose ul,
.detail-content.prose ol {
    padding-left: 1.4em;
    margin: .8em 0;
}
@media (min-width: 480px) {
    .detail-content.prose ul,
    .detail-content.prose ol { padding-left: 1.6em; }
}
.detail-content.prose li { margin: .4em 0; word-break: break-word; overflow-wrap: break-word; }

.detail-content.prose blockquote {
    border-left: 4px solid #f5a623;
    margin: 1.2em 0;
    padding: .6em 1em;
    background: #fffbf0;
    color: #555;
    font-style: italic;
    border-radius: 0 6px 6px 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Bloco de codigo - scroll horizontal em vez de estouro */
.detail-content.prose pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: .85rem;
    line-height: 1.6;
    margin: 1.2em 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    max-width: 100%;
    /* Mantem a formatacao do codigo sem quebrar palavras */
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

.detail-content.prose code {
    background: #f3f4f6;
    color: #c0392b;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: .85rem;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    word-break: break-all;
}
.detail-content.prose pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    word-break: normal;
}

.detail-content.prose img {
    max-width: 100% !important;   /* sobrescreve width="800" ou style="width:800px" */
    width: auto !important;       /* deixa o browser calcular a largura proporcional */
    height: auto !important;      /* mantem a proporcao */
    border-radius: 8px;
    margin: 1em auto;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
}

/* Tabela - scroll horizontal em vez de estouro */
.detail-content.prose table {
    border-collapse: collapse;
    width: 100% !important;       /* sobrescreve width="700" ou style="width:700px" */
    max-width: 100% !important;
    margin: 1.2em 0;
    font-size: .9rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}
.detail-content.prose th,
.detail-content.prose td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}
@media (min-width: 640px) {
    .detail-content.prose th,
    .detail-content.prose td { padding: 9px 14px; white-space: normal; }
}
.detail-content.prose th {
    background: #1e3a5f;
    color: #fff;
    font-weight: 600;
}
.detail-content.prose tr:nth-child(even) td { background: #f9fafb; }

/* Iframes dentro do conteudo (ex: embeds) */
.detail-content.prose iframe {
    max-width: 100% !important;   /* sobrescreve width="560" etc. */
    width: 100% !important;
    border: 0;
    display: block;
}

.detail-content.prose hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 1.8em 0;
}

.detail-content.prose strong { font-weight: 700; color: #111827; }
.detail-content.prose em { font-style: italic; }
.detail-content.prose u { text-decoration: underline; }

/* Ajustes finos para telas muito pequenas */
@media (max-width: 480px) {
    .detail-content.prose { font-size: .93rem; }
    .detail-content.prose pre { padding: 10px 12px; font-size: .78rem; }
    .detail-content.prose blockquote { padding: .5em .8em; }
}
@media (max-width: 360px) {
    .detail-content.prose { font-size: .88rem; }
}

/* ============================================================
   Botoes de Compartilhamento Social
   ============================================================ */

.share-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 20px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    /* Nunca estoura o card */
    max-width: 100%;
    box-sizing: border-box;
}

.share-label {
    font-size: .85rem;
    font-weight: 700;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.share-label i { color: #f5a623; }

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

/* Botao base */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, opacity .15s, box-shadow .15s;
    color: #fff;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.share-btn:hover {
    opacity: .88;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    color: #fff;
}
.share-btn:active { transform: translateY(0); }
.share-btn i { font-size: .95rem; flex-shrink: 0; }

/* Cores individuais */
.share-facebook  { background: #1877f2; }
.share-twitter   { background: #000; }
.share-linkedin  { background: #0a66c2; }
.share-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.share-copy      { background: #6b7280; }

/* Responsividade dos botoes de compartilhamento */
@media (max-width: 480px) {
    .share-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
    .share-buttons { gap: 8px; }
    /* Em telas xs: esconde o texto, mantem apenas o icone em formato circular */
    .share-btn span { display: none; }
    .share-btn {
        padding: 9px;
        border-radius: 50%;
        width: 38px;
        height: 38px;
        justify-content: center;
        gap: 0;
    }
    .share-btn i { font-size: 1rem; margin: 0; }
}

/* Em telas muito pequenas (< 360px): reduz ainda mais */
@media (max-width: 360px) {
    .share-btn {
        width: 34px;
        height: 34px;
        padding: 7px;
    }
    .share-btn i { font-size: .9rem; }
}

/* -- Detail Media: variante imagem / thumbnail ------------- */
.detail-media--image {
    text-align: center;
    background: #f4f6f9;
    /* Garante que o wrapper nunca ultrapasse o card */
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 12px;
}
@media (min-width: 480px) {
    .detail-media--image { padding: 16px; }
}

/* ============================================================
   GALERIA DE IMAGENS - Pagina publica (conteudo.php)
   ============================================================ */

.content-gallery { margin: 32px 0 0; }

.gallery-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

@media (min-width: 480px)  { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
@media (min-width: 768px)  { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; } }

.gallery-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #f4f6f9;
    cursor: pointer;
    padding: 0;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}

.gallery-thumb:hover,
.gallery-thumb:focus {
    border-color: #f5a623;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    outline: none;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.gallery-thumb:hover img { transform: scale(1.04); }

.gallery-thumb-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    color: #fff;
    font-size: .72rem;
    padding: 16px 8px 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -- Lightbox ----------------------------------------------- */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(90vw, 960px);
    max-height: 90vh;
    width: 100%;
}

.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    display: block;
}

.lightbox-caption {
    color: #e5e7eb;
    font-size: .9rem;
    margin-top: 10px;
    text-align: center;
    max-width: 600px;
    min-height: 1.4em;
}

.lightbox-counter {
    color: #9ca3af;
    font-size: .8rem;
    margin-top: 4px;
    text-align: center;
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    padding: 4px 10px;
    border-radius: 4px;
    transition: color .2s, background .2s;
}
.lightbox-close:hover { color: #f5a623; background: rgba(255,255,255,.08); }

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: background .2s, color .2s;
}
.lightbox-nav:hover { background: #f5a623; color: #fff; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

@media (max-width: 479px) {
    .lightbox-nav { width: 36px; height: 36px; font-size: 1rem; }
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
    .lightbox-img { max-height: 65vh; }
}

/* ============================================================
   GALERIA DE IMAGENS - Painel Admin
   ============================================================ */

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .gallery-admin-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

.gallery-admin-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #f4f6f9;
}

.gallery-admin-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-admin-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: .68rem;
    padding: 4px 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-admin-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220,38,38,.85);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s, background .2s;
}
.gallery-admin-item:hover .gallery-admin-delete { opacity: 1; }
.gallery-admin-delete:hover { background: #b91c1c; }

/* Sempre visivel em touch */
@media (hover: none) {
    .gallery-admin-delete { opacity: 1; }
}

.gallery-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    transition: border-color .2s, background .2s;
    cursor: pointer;
}
.gallery-upload-area:hover { border-color: #f5a623; background: #fffbf0; }

/* --- Pagina Fale Conosco ---------------------------------------------------- */

/* Campo obrigatorio */
.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

/* Campo com erro */
.form-group.has-error .form-control,
.form-control.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.field-error {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.field-error i {
    margin-right: 4px;
}

/* Contador de caracteres */
.char-counter {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Card de sucesso */
.contact-success-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.contact-success-icon {
    font-size: 56px;
    color: #22c55e;
    margin-bottom: 16px;
}

.contact-success-card h3 {
    font-size: 22px;
    color: #1e3a5f;
    margin-bottom: 8px;
}

.contact-success-card p {
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 0;
}

/* Itens de info de contato na sidebar */
.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #374151;
}

.contact-info-item:last-child {
    border-bottom: none;
}

.contact-info-item a {
    color: #1e3a5f;
    text-decoration: none;
    word-break: break-all;
}

.contact-info-item a:hover {
    color: #f5a623;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

@media (max-width: 640px) {
    .contact-success-card {
        padding: 28px 20px;
    }
    .contact-success-icon {
        font-size: 44px;
    }
}
