/*
Theme Name: Notícias de Ourém
Theme URI: https://www.noticiasdeourem.pt/
Author: Ricardo Figueiredo
Description: Tema profissional e responsivo para o Jornal Regional Digital Notícias de Ourém.
Version: 1.1.0
License: GNU General Public License v2 or later
Text Domain: noticias-de-ourem
*/

/* ==========================================================================
   1. VARIÁVEIS E RESET GLOBAL
   ========================================================================== */
:root {
  --ink: #171717;
  --muted: #646464;
  --paper: #fbfaf7;
  --surface: #fff;
  --line: #e7e0d7;
  --brand: #a51218; /* Cor corporativa oficial */
  --dark: #101010;
  --gold: #c58a19;
  --shadow: 0 18px 50px rgba(24, 24, 24, 0.10);
  --site-font: 'Open Sans', Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--site-font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  font-weight: bold;
}
.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   2. ESTRUTURA E UTILITÁRIOS GLOBAL
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
}

/* Badges de Estado (Premium, Grátis, Live) */
.status {
  display: inline-block;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 2px;
  margin-right: 6px;
}
.status.live { background: #fff; color: var(--brand); }
.status.free { background: #e3f2fd; color: #0d47a1; }
.status.paid { background: #fff3e0; color: #e65100; }

.kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .7px;
}

/* Blocos de Publicidade */
.ad {
  background: #fff;
  border: 1px dashed #b9ab9b;
  color: #786e63;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 96px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .7px;
  text-transform: uppercase;
  overflow: hidden;
}
.ad img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-top {
  margin: 22px 0;
  min-height: 150px;
  border: 0;
}
.ad-wide {
  margin: 25px 0;
  min-height: 120px;
  border: 0;
}
.ad-label-text {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   3. CABEÇALHO E NAVEGAÇÃO
   ========================================================================== */
.top-strip {
  background: var(--dark);
  color: #f8f3ec;
  font-size: 13px;
}
.top-strip .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  flex-wrap: wrap;
}

.header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 99;
}
.main-header {
  display: grid;
  grid-template-columns: minmax(150px, 280px) 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}
.logo {
  display: flex;
  flex-direction: column;
}
.logo img {
  width: min(280px, 100%);
  max-height: 92px;
  object-fit: contain;
}
.logo-fallback {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 2px;
}

.menu-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

/* Menu de Navegação Nativo/Principal */
.menu {
  list-style: none;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.menu a {
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}
.menu a:hover, .menu .current-menu-item a {
  color: var(--brand);
}
#Casa-inicio img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* Botões Extras do Header */
.subscribe-mini {
  font-weight: 800;
  padding: 8px 16px;
  background: var(--brand);
  color: #fff !important;
  text-transform: uppercase;
  font-size: 13px;
  border-radius: 3px;
}
.subscribe-mini:hover {
  background: #bd171e;
}

.search {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  max-width: 180px;
}

.menu-toggle {
  display: none;
  background: var(--dark);
  color: #fff;
  border: 0;
  padding: 8px 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
}

/* Barra de categorias secundária (usada no arquivo) */
.category-nav {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.category-nav a {
  padding: 9px 11px;
  font-weight: 900;
  font-size: 14px;
}
.category-nav a:hover, .category-nav a[aria-current="page"] {
  background: #f2e8db;
  color: var(--brand);
}

/* ==========================================================================
   4. PÁGINA INICIAL: HERO SLIDER & SIDE STACK
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 16px;
}

.hero-slider {
  position: relative;
  overflow: hidden;
  background: #000;
  height: 440px;
}
.hero-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.hero-slide {
  min-width: 100%;
  position: relative;
  height: 100%;
}
.lead-image {
  display: block;
  width: 100%;
  height: 100%;
}
.lead-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  color: #fff;
}
.hero-copy h1 {
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.1;
  margin: 8px 0;
  font-weight: 800;
}
.hero-copy h1 a { color: #fff; }
.hero-copy p {
  font-size: 15px;
  opacity: 0.9;
  max-width: 700px;
  margin-bottom: 16px;
}
.lead-labels { margin-bottom: 6px; }
.lead-actions a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-right: 10px;
  background: #fff;
  color: #000;
}
.lead-actions a:last-child {
  background: var(--brand);
  color: #fff;
}

/* Controlos do Slider */
.hero-controls button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: 0;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
}
#heroPrev { left: 10px; }
#heroNext { right: 10px; }

/* Bloco Lateral (Side Stack) */
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.brief-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
}
.brief-card img {
  width: 100px;
  height: 75px;
  object-fit: cover;
}
.brief-card h2 {
  font-size: 14px;
  line-height: 1.2;
  margin-top: 4px;
}

/* ==========================================================================
   5. GRELHA DE NOTÍCIAS (ÚLTIMAS & ARQUIVOS)
   ========================================================================== */
#ultimas { margin-top: 40px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 3px solid var(--dark);
  padding-bottom: 6px;
  margin-bottom: 20px;
}
.section-title {
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.news-card {
  background: #fff;
  border: 1px solid var(--line);
}
.news-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}
.news-card-content { padding: 16px; }
.news-card-content h3 {
  font-size: 19px;
  line-height: 1.2;
  margin: 8px 0;
}
.news-card-content p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}
.meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.free-note, .premium-lock {
  font-size: 11px;
  margin-top: 8px;
  font-weight: bold;
  color: var(--brand);
}

/* ==========================================================================
   6. MODELO DE CATEGORIAS / ARQUIVO (De sociedade.html)
   ========================================================================== */
.page-hero {
  background: #fff;
  border-top: 8px solid var(--brand);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 52px);
  margin-bottom: 26px;
}
.page-hero h1 {
  font-size: clamp(42px, 7vw, 82px);
  line-height: .94;
  margin: 10px 0;
}
.page-hero p {
  font-size: 18px;
  color: #444;
  max-width: 780px;
}
.live-status {
  display: inline-block;
  margin-top: 18px;
  background: #f2e8db;
  color: #6e1519;
  padding: 8px 10px;
  font-weight: 900;
  font-size: 13px;
}

.post-count {
  font-weight: 900;
  margin-bottom: 16px;
}
.live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.live-card {
  background: #fff;
  border: 1px solid var(--line);
  min-width: 0;
}
.live-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}
.live-card-content { padding: 15px; }
.source-label {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .7px;
}
.live-card h2 {
  font-size: 23px;
  line-height: 1.08;
  margin: 9px 0;
}
.live-card p {
  color: var(--muted);
  font-size: 14px;
}
.live-card time {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}
.live-card:hover h2, .news-card:hover h3 {
  color: var(--brand);
}

.side {
  display: grid;
  gap: 18px;
  align-content: start;
}
.widget {
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
}
.widget h2, .widget h3 {
  font-size: 22px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.widget p { color: var(--muted); }
.ad-side {
  min-height: 430px;
  position: sticky;
  top: 140px;
}

.empty-state {
  background: #fff;
  border: 1px solid var(--line);
  padding: 24px;
  color: var(--muted);
  grid-column: 1 / -1;
}
.empty-state a {
  color: var(--brand);
  font-weight: 900;
}

.ranked {
  padding-left: 20px;
}
.ranked li {
  margin-bottom: 10px;
  font-weight: bold;
}
.ranked a:hover { color: var(--brand); }

/* ==========================================================================
   7. LOJA ONLINE E CARRINHO DE COMPRAS
   ========================================================================== */
.shop {
  background: #f4efeb;
  padding: 50px 0;
  margin-top: 50px;
  border-top: 1px solid var(--line);
}
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}
.shop-intro {
  margin: 8px 0 24px;
  color: var(--muted);
  max-width: 650px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.plan {
  background: #fff;
  border: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
}
.plan.featured {
  border: 2px solid var(--brand);
  position: relative;
  box-shadow: var(--shadow);
}
.plan h3 { font-size: 20px; margin-bottom: 8px;}
.plan .price {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 16px;
}
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan ul {
  list-style: none;
  margin-bottom: 24px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan ul li::before {
  content: "✓ ";
  color: green;
  font-weight: bold;
}
.plan button {
  margin-top: auto;
  background: var(--dark);
  color: #fff;
  border: 0;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.plan button:hover { background: var(--brand); }

/* Caixa do Carrinho */
.cart {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 4px;
  align-self: start;
}
.cart h3 { margin-bottom: 12px; text-transform: uppercase; border-bottom: 2px solid var(--dark); padding-bottom: 4px; }
.cart label { display: block; font-size: 13px; font-weight: 700; margin-top: 10px; }
.cart select { width: 100%; padding: 8px; margin: 4px 0 14px; border: 1px solid var(--line); }
.cart-items { list-style: none; margin: 12px 0; border-bottom: 1px dashed var(--line); padding-bottom: 12px; }
.cart-items li { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; align-items: center; }
.cart-items li button { background: none; border: 0; color: var(--brand); font-size: 11px; cursor: pointer; text-decoration: underline; }
.cart-empty { color: var(--muted); font-style: italic; font-size: 13px; }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: bold; margin-bottom: 14px; }
.cart-total strong { color: var(--brand); }
.checkout { width: 100%; background: #2e7d32; color: #fff; border: 0; padding: 12px; font-weight: bold; text-transform: uppercase; cursor: pointer; }
.checkout:hover { background: #1b5e20; }
.cart-hint { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ==========================================================================
   8. NEWSLETTER
   ========================================================================== */
.newsletter {
  background: var(--brand);
  color: #fff;
  padding: 40px 0;
}
.newsletter-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.newsletter h2 { font-size: 26px; font-weight: 800; }
.newsletter form { display: flex; gap: 8px; width: 100%; max-width: 450px; }
.newsletter input[type="email"] { flex: 1; padding: 12px; border: 0; border-radius: 2px; font-size: 15px;}
.newsletter button { background: var(--dark); color: #fff; border: 0; padding: 0 24px; font-weight: 700; text-transform: uppercase; cursor: pointer;}
.newsletter button:hover { background: #000; }

/* ==========================================================================
   9. RODAPÉ GLOBAL UNIFICADO (Fusão de index e sociedade)
   ========================================================================== */
.footer {
  background: #111;
  color: #fff;
  padding: 38px 0 24px;
  border-top: 5px solid var(--brand);
}
.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
.footer h3 {
  font-size: 16px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: #fff;
  letter-spacing: 0.5px;
}
.footer p, .footer address, .footer a {
  color: #cfcfcf;
  font-style: normal;
  font-size: 14px;
}
.footer-brand {
  max-width: 210px;
  height: auto;
  margin-bottom: 10px;
}
.footer-contact {
  margin-top: 10px;
  line-height: 1.6;
}
.footer-contact a:hover { color: #fff; text-decoration: underline; }

/* Redes Sociais com SVG */
.footer-social {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}
.footer-social a {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
}
.footer-social a:hover {
  background: #fff;
}
.footer-social a:hover svg {
  fill: #000;
}
.footer-social svg {
  width: 18px;
  height: 18px;
  fill: #fff;
  transition: fill 0.2s ease;
}

/* Coluna de Categorias do Rodapé */
.footer-right {
  min-width: 280px;
}
.footer-categories ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}
.footer-categories a {
  color: #cfcfcf;
}
.footer-categories a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid #282828;
  margin-top: 28px;
  padding-top: 16px;
  color: #8f8f8f;
  font-size: 13px;
  text-align: center;
}

/* ==========================================================================
   10. MEDIA QUERIES (RESPONSIVIDADE)
   ========================================================================== */
@media (max-width: 920px) {
  .main-header {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }
  
  .menu-toggle {
    display: block; /* Ativa botão de menu no mobile */
  }
  
  .menu-wrap {
    justify-content: space-between;
    width: 100%;
    position: relative;
  }
  
  /* Menu colapsável */
  .menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    padding: 10px;
    gap: 0;
    box-shadow: var(--shadow);
  }
  .menu.open {
    display: flex;
  }
  .menu a {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  
  .hero, .layout, .shop-grid {
    grid-template-columns: 1fr;
  }
  
  .hero {
    height: auto;
  }
  .hero-slider {
    height: 360px;
  }
  
  .live-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .ad-side {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1180px);
  }
  
  .hero-slider {
    height: 300px;
  }
  
  .news-grid, .live-grid {
    grid-template-columns: 1fr;
  }
  
  .brief-card {
    grid-template-columns: 80px 1fr;
  }
  .brief-card img { width: 80px; height: 60px; }
  
  .page-hero h1 {
    font-size: 38px;
  }
  
  .newsletter-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .newsletter form {
    max-width: 100%;
  }
  
  .footer-main {
    flex-direction: column;
    gap: 24px;
  }
  .footer-categories ul {
    grid-template-columns: 1fr;
  }
}