/*
Theme Name: Cotidiano Caiçara
Theme URI: https://cotidianocaicara.com.br
Author: Cotidiano Caiçara
Description: Tema portal de notícias e turismo para o Litoral Norte Paulista, com visual editorial moderno, RSS com cache, SEO local e áreas preparadas para anúncios.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: cotidiano-caicara
*/

:root {
  --bg: #f5f8f7;
  --surface: #ffffff;
  --ink: #172126;
  --muted: #64727a;
  --line: #dfe8e7;
  --brand: #087f8c;
  --brand-dark: #07545c;
  --sun: #f2b84b;
  --radius: 8px;
  --shadow: 0 18px 42px rgba(23, 33, 38, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
.screen-reader-text { position: absolute; left: -9999px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar, .nav, main, .site-footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 22px;
  align-items: center;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 230px; }
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 0.78rem; }
.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fbfb;
}
.search-form label { min-width: 0; }
.search-form input, .search-form button { height: 44px; border: 0; font: inherit; }
.search-form input { width: 100%; min-width: 0; padding: 0 18px; background: transparent; }
.search-form button, .refresh-button, .button-link {
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  font-weight: 750;
}
.search-form button { padding: 0 20px; }
.weather-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.weather-pill span { color: var(--muted); font-size: 0.82rem; }
.weather-pill strong { color: var(--brand-dark); }
.nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 12px; }
.nav li { list-style: none; flex: 0 0 auto; }
.nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: #334047;
  font-weight: 700;
  font-size: 0.9rem;
}
.nav a:hover, .nav .current-menu-item a { background: #e7f2f2; color: var(--brand-dark); }
main { padding: 28px 0 42px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr); gap: 18px; }
.lead-card, .news-card, .beach-grid article, .widget, .content-panel, .listing-card, .info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.lead-card { display: block; position: relative; min-height: 470px; }
.lead-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(6, 27, 32, 0.82));
}
.lead-content { position: absolute; z-index: 1; left: 28px; right: 28px; bottom: 26px; color: #fff; }
.tag, .eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}
.lead-card .tag {
  color: #fff;
  background: rgba(8, 127, 140, 0.9);
  padding: 6px 9px;
  border-radius: 999px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 10px; font-size: clamp(2.1rem, 4vw, 4.6rem); line-height: 0.98; letter-spacing: 0; }
.lead-content p { max-width: 620px; margin-bottom: 0; color: rgba(255, 255, 255, 0.88); font-size: 1.05rem; }
.side-stack { display: grid; gap: 18px; }
.news-card.compact { display: grid; grid-template-rows: 210px auto; }
.news-card div { padding: 16px; }
.news-card h2, .news-card h3 { margin: 5px 0 0; line-height: 1.16; }

.ad-band {
  display: grid;
  place-items: center;
  min-height: 92px;
  margin: 24px 0;
  border: 1px dashed #b8cac9;
  border-radius: var(--radius);
  background: #eef6f5;
  color: var(--muted);
  text-align: center;
}
.ad-band strong, .ad-band span { display: block; }
.ad-band span, .ad-box span { font-size: 0.78rem; text-transform: uppercase; }
.portal-layout, .content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.section-head h2 { margin: 0; font-size: 1.55rem; line-height: 1.15; }
.section-head.slim { margin-bottom: 12px; }
.section-head.slim h2 { font-size: 1.08rem; }
.refresh-button, .button-link { min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; }
.feed-grid, .post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.feed-card, .post-card { min-width: 0; }
.feed-card img, .post-card img { aspect-ratio: 16 / 10; height: auto; }
.feed-card .content, .post-card .content { padding: 14px; }
.feed-card h3, .post-card h3 { margin: 5px 0 8px; font-size: 1rem; line-height: 1.22; }
.feed-card p, .post-card p { margin-bottom: 12px; color: var(--muted); font-size: 0.92rem; }
.meta { color: #7a878d; font-size: 0.78rem; font-weight: 700; }
.sidebar { display: grid; gap: 16px; position: sticky; top: 112px; }
.widget { padding: 18px; box-shadow: none; }
.widget ul { margin: 0; padding-left: 18px; }
.weather-list { display: grid; gap: 10px; }
.weather-list div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.weather-list div:last-child { padding-bottom: 0; border-bottom: 0; }
.weather-list span { color: var(--muted); }
.ad-box { min-height: 250px; display: grid; place-items: center; background: #fff8e8; border-style: dashed; color: #7b6633; text-align: center; }
.event-list { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.event-list li { padding-left: 12px; border-left: 3px solid var(--sun); }
.event-list strong, .event-list span { display: block; }
.event-list span { color: var(--muted); font-size: 0.85rem; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-links a, .category-grid a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fcfc;
  color: #26343a;
  font-weight: 750;
  font-size: 0.9rem;
}
.quick-links a:hover, .category-grid a:hover { border-color: #a7cccc; background: #edf8f7; }
.beach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.beach-grid img { aspect-ratio: 16 / 11; height: auto; }
.beach-grid h3, .beach-grid p { padding: 0 14px; }
.beach-grid h3 { margin: 14px 0 5px; }
.beach-grid p { color: var(--muted); margin-bottom: 16px; }
.category-band { margin-top: 34px; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.page-hero {
  min-height: 310px;
  display: grid;
  align-items: end;
  padding: 34px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(180deg, rgba(7, 38, 44, 0.2), rgba(7, 38, 44, 0.84)), var(--hero-image, url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=82")) center / cover;
}
.page-hero h1 { max-width: 880px; margin-bottom: 10px; }
.page-hero p { max-width: 720px; margin-bottom: 0; color: rgba(255, 255, 255, 0.9); font-size: 1.05rem; }
.breadcrumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.content-panel { padding: 28px; box-shadow: none; }
.article-body { color: #26343a; font-size: 1.05rem; }
.article-body h2 { margin-top: 28px; }
.article-body p { margin-bottom: 18px; }
.article-meta { color: var(--muted); font-weight: 700; margin-bottom: 20px; }
.listing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.listing-card { box-shadow: none; }
.listing-card img { aspect-ratio: 16 / 10; height: auto; }
.listing-card div { padding: 16px; }
.listing-card h2, .listing-card h3 { margin-bottom: 8px; line-height: 1.16; }
.listing-card p { color: var(--muted); margin-bottom: 0; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.info-card { padding: 18px; box-shadow: none; }
.info-card h3 { margin-bottom: 8px; }
.info-card p { color: var(--muted); margin-bottom: 0; }
.pagination { margin-top: 24px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pagination .current { background: var(--brand); color: #fff; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer strong { color: var(--ink); }
.site-footer p { max-width: 560px; margin: 6px 0 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px; align-content: start; justify-content: flex-end; }
.site-footer nav li { list-style: none; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .search-form { grid-column: 1 / -1; grid-row: 2; }
  .hero-grid, .portal-layout, .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .topbar, .nav, main, .site-footer { width: min(100% - 22px, 1180px); }
  .topbar { min-height: auto; padding: 12px 0 10px; gap: 12px; }
  .brand { min-width: 0; }
  .brand small, .weather-pill span { display: none; }
  .weather-pill { padding: 8px 10px; }
  .lead-card { min-height: 430px; }
  .lead-content { left: 18px; right: 18px; }
  .feed-grid, .post-grid, .beach-grid, .sidebar, .category-grid, .listing-grid, .info-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; }
  .page-hero, .content-panel { padding: 20px; }
  .site-footer { display: block; }
  .site-footer nav { justify-content: flex-start; margin-top: 18px; }
}
