/* Porto Seguro Roteiros — layout + post content (port do front Astro) */

:root {
  --psr-teal: #2c8c9a;
  --psr-teal-dark: #23707b;
  --psr-orange: #f69602;
  --psr-gray-50: #f9fafb;
  --psr-gray-100: #f3f4f6;
  --psr-gray-500: #6b7280;
  --psr-gray-600: #4b5563;
  --psr-gray-700: #374151;
  --psr-gray-900: #111827;
  --psr-max: 1280px;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: #333;
  line-height: 1.6;
  background-color: var(--psr-gray-50);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* —— Layout shell —— */
.psr-container {
  width: 100%;
  max-width: var(--psr-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--psr-gray-100);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.3s;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-header__logo {
  margin-right: auto;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.site-header__logo:hover {
  opacity: 0.8;
}

.site-header__logo img,
.site-header__logo .custom-logo {
  width: 160px;
  height: auto;
}

.site-header__logo .custom-logo-link {
  display: inline-block;
  line-height: 0;
}

.site-nav {
  display: none;
  gap: 1.5rem;
  margin-left: 1rem;
}

.site-nav a {
  color: var(--psr-gray-600);
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--psr-teal);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--psr-gray-600);
}

.menu-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid var(--psr-gray-100);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.mobile-menu a {
  color: var(--psr-gray-600);
  font-weight: 500;
}

.mobile-menu a:hover {
  color: var(--psr-teal);
}

@media (min-width: 768px) {
  .site-header__logo {
    margin-right: 0;
  }

  .site-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }
}

/* —— Weather badge —— */
#weather-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--psr-teal);
  background: rgba(44, 140, 154, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  cursor: default;
  user-select: none;
  min-width: 80px;
  white-space: nowrap;
}

/* —— Posts grid —— */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  justify-content: center;
  margin-top: 3.5rem;
  margin-bottom: 5rem;
}

@media (min-width: 768px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--psr-gray-100);
  transition: box-shadow 0.3s, transform 0.3s;
}

.post-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

.post-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  transition: transform 0.5s;
}

.post-card:hover .post-card__media img {
  transform: scale(1.05);
}

.post-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.badge-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--psr-teal);
  background: rgba(44, 140, 154, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

.badge-category--lg {
  font-weight: 700;
  padding: 0.25rem 0.75rem;
}

.post-card__date,
.meta-date {
  font-size: 0.75rem;
  color: var(--psr-gray-500);
}

.post-card__title {
  font-weight: 700;
  color: var(--psr-gray-900);
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.3;
  transition: color 0.2s;
}

.post-card:hover .post-card__title {
  color: var(--psr-teal);
}

.post-card__excerpt {
  color: var(--psr-gray-600);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__footer {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--psr-gray-100);
  gap: 0.75rem;
}

.post-card__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.author-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
  flex-shrink: 0;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-avatar--lg {
  width: 2.5rem;
  height: 2.5rem;
}

.post-card__author-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--psr-gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-card__more {
  color: var(--psr-teal);
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
}

.post-card__more:hover {
  text-decoration: underline;
}

/* Featured (first) card */
.post-card--featured {
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .post-card--featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
  }

  .post-card--featured .post-card__media {
    height: 100%;
    aspect-ratio: auto;
  }

  .post-card--featured .post-card__media img {
    aspect-ratio: 16 / 8;
    min-height: 100%;
  }

  .post-card--featured .post-card__body {
    justify-content: center;
  }

  .post-card--featured .post-card__title {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .post-card--featured {
    grid-column: span 3;
  }

  .post-card--featured .post-card__title {
    font-size: 2.25rem;
  }
}

/* —— Pagination —— */
.psr-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 4rem;
  flex-wrap: wrap;
}

.psr-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.psr-pagination a,
.psr-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--psr-gray-700);
  background: #fff;
  border: 1px solid var(--psr-gray-100);
}

.psr-pagination a:hover {
  color: #fff;
  background: var(--psr-teal);
  border-color: var(--psr-teal);
}

.psr-pagination .current {
  color: #fff;
  background: var(--psr-teal);
  border-color: var(--psr-teal);
}

/* —— Single post —— */
.single-main {
  padding-top: 2rem;
  padding-bottom: 4rem;
  background: #fff;
}

@media (min-width: 1024px) {
  .single-main {
    padding-top: 4rem;
    padding-bottom: 6rem;
  }
}

.single-wrap {
  display: flex;
  justify-content: space-between;
  max-width: var(--psr-max);
  margin: 0 auto;
  padding: 0 1rem;
}

.single-article {
  margin: 0 auto;
  width: 100%;
  max-width: 48rem;
}

.single-header {
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .single-header {
    margin-bottom: 3rem;
  }
}

.single-header__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.single-header__meta time {
  font-size: 0.875rem;
  color: var(--psr-gray-500);
}

.single-title {
  margin: 0 0 1.5rem;
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--psr-gray-900);
}

@media (min-width: 1024px) {
  .single-title {
    font-size: 3rem;
    margin-bottom: 2rem;
  }
}

.single-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--psr-gray-100);
  padding-bottom: 2rem;
}

.single-author__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--psr-gray-900);
}

.single-author__role {
  font-size: 0.875rem;
  color: var(--psr-gray-500);
}

.single-hero {
  margin: 0 0 2.5rem;
}

.single-hero img {
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  max-height: 500px;
  aspect-ratio: 16 / 9;
}

/* —— Archive / search titles —— */
.archive-header {
  max-width: var(--psr-max);
  margin: 2.5rem auto 0;
  padding: 0 1rem;
}

.archive-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--psr-gray-900);
}

/* —— 404 —— */
.error-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 1rem;
  text-align: center;
}

.error-404__code {
  font-size: 3.75rem;
  font-weight: 800;
  color: var(--psr-teal);
  margin: 0 0 1rem;
  line-height: 1;
}

.error-404__text {
  font-size: 1.25rem;
  color: var(--psr-gray-600);
  margin: 0 0 2rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--psr-teal);
  color: #fff !important;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--psr-teal-dark);
}

/* —— Footer —— */
.site-footer {
  background: var(--psr-teal);
  color: #fff;
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-footer__brand img {
  width: 120px;
  margin-bottom: 1rem;
}

.site-footer__brand p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  text-align: center;
  max-width: 20rem;
  margin: 0;
}

@media (min-width: 768px) {
  .site-footer__brand {
    align-items: flex-start;
  }

  .site-footer__brand p {
    text-align: left;
  }
}

.site-footer__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-footer__cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--psr-orange);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 20rem;
  color: #fff;
  font-weight: 700;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.site-footer__cta-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-footer__links h3 {
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
}

.site-footer__links nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.site-footer__links a:hover {
  color: #fff;
}

@media (min-width: 768px) {
  .site-footer__links {
    align-items: flex-end;
  }

  .site-footer__links nav {
    text-align: right;
  }
}

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
}

.site-footer__bottom p {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

@media (min-width: 768px) {
  .site-footer__bottom p {
    text-align: left;
  }
}

/* —— Empty state —— */
.psr-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--psr-gray-600);
}

/* —— Post content (from global.css Astro) —— */
.post-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #1a202c;
  margin: 32px 0 16px;
  line-height: 1.2;
}

.post-content h2 {
  font-size: 1.875rem;
  font-weight: 600;
  color: #2d3748;
  margin: 32px 0 16px;
  line-height: 1.3;
}

.post-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin: 24px 0 12px;
}

.post-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin: 20px 0 10px;
}

.post-content p {
  margin: 16px 0;
  color: #4a5568;
  font-size: 1.125rem;
  line-height: 1.8;
}

.post-content ul,
.post-content ol {
  margin: 24px 0;
  padding-left: 24px;
  color: #4a5568;
}

.post-content ul {
  list-style-type: disc;
}

.post-content ol {
  list-style-type: decimal;
}

.post-content li {
  margin: 8px 0;
  font-size: 1.125rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  margin: 32px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.post-content img.propaganda,
.post-content figure.propaganda img {
  aspect-ratio: auto;
}

.post-content figure {
  margin: 32px 0;
}

.post-content blockquote {
  border-left: 4px solid #2c8c9a;
  margin: 24px 0;
  font-style: italic;
  color: #718096;
  background-color: #f7fafc;
  padding: 16px;
  border-radius: 0 8px 8px 0;
}

.post-content a {
  color: #2c8c9a;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.post-content a:hover {
  color: #23707b;
}

.post-content hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 48px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 1rem;
}

.post-content th,
.post-content td {
  border: 1px solid #e2e8f0;
  padding: 0.75rem;
  text-align: left;
}

.post-content pre {
  overflow-x: auto;
  background: #1a202c;
  color: #f7fafc;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 24px 0;
}

.post-content code {
  font-size: 0.9em;
}

/* WP align helpers inside content */
.post-content .aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.post-content .wp-block-image img {
  margin: 0;
}
