/* ============================================================
   CRIMSON LEDGER — Theme CSS
   Visual DNA: Escape Velocity by HTML5 UP
   Transferred: section tab labels, alternating bg rhythm,
   warm coral accent, overlay textures, uppercase letterspacing,
   inset box-shadow borders, dark footer atmosphere
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  color: #8b8e94;
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  background: #fff;
}

/* --- Noise overlay mixin via pseudo-element --- */
.has-overlay { position: relative; }
.has-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJklEQVQYV2P8////fwYGBgYmBhAACQIFQIKMUEEYBSKBgiABAEdhBAbfxTSFAAAAAElFTkSuQmCC");
  opacity: 0.04;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: #3d4149;
  line-height: 1.3;
}

h1 { font-size: 2.2em; }
h2 { font-size: 1.8em; }
h3 { font-size: 1.25em; }

a {
  color: #6b6e74;
  text-decoration: underline;
  transition: color 0.25s ease;
}
a:hover { text-decoration: none; color: #e97770; }

strong, b { font-weight: 700; color: #3d4149; }
em, i { font-style: italic; }

p { margin-bottom: 1.5em; }

img { max-width: 100%; height: auto; display: block; }

/* --- Container --- */
.container {
  max-width: 68em;
  margin: 0 auto;
  width: 100%;
  padding: 0 2em;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.8em 2.2em;
  border-radius: 0.3em;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  line-height: 1.5;
}

.btn-primary {
  background: #e97770;
  color: #fff;
}
.btn-primary:hover {
  background: #f98780;
  color: #fff;
}

.btn-dark {
  background: #2f333b;
  color: #fff;
}
.btn-dark:hover {
  background: #3f434b;
  color: #fff;
}

.btn-ghost {
  background: none;
  color: #555;
  box-shadow: inset 0 0 0 2px #ccc;
}
.btn-ghost:hover {
  box-shadow: inset 0 0 0 2px #e97770;
  color: #e97770;
}

/* ============================================================
   SECTION WRAPPER SYSTEM
   Core DNA: each section has a "tab label" floating on top border
   ============================================================ */
.section-wrap {
  position: relative;
  padding: 5em 0 6em;
}

.section-label {
  position: absolute;
  top: -1.6em;
  left: 50%;
  transform: translateX(-50%);
  display: inline-block;
  padding: 0 2em;
  height: 3.2em;
  line-height: 3.2em;
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  text-align: center;
  white-space: nowrap;
  z-index: 2;
}

/* Alternating section backgrounds — DNA rhythm */
.section-coral {
  background: #e97770;
  color: rgba(255,255,255,0.8);
}
.section-coral .section-label { background: #e97770; color: #fff; }
.section-coral h1, .section-coral h2, .section-coral h3,
.section-coral strong, .section-coral b, .section-coral a { color: #fff; }

.section-white {
  background: #fff;
}
.section-white .section-label { background: #fff; color: #3d4149; }

.section-light {
  background: #f2f2f2;
}
.section-light .section-label { background: #f2f2f2; color: #3d4149; }

.section-dark {
  background: #282b34;
  color: rgba(255,255,255,0.55);
}
.section-dark .section-label { background: #282b34; color: #eee; }
.section-dark h1, .section-dark h2, .section-dark h3,
.section-dark strong, .section-dark a { color: #fff; }
.section-dark a:hover { color: #f98780; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: relative;
  background: #2c3240;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 18em;
  text-align: center;
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJklEQVQYV2P8////fwYGBgYmBhAACQIFQIKMUEEYBSKBgiABAEdhBAbfxTSFAAAAAElFTkSuQmCC");
  opacity: 0.06;
}

.site-header .brand {
  position: relative;
  z-index: 2;
  margin-top: 2em;
}

.site-header .brand-name {
  font-size: 2em;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #fff;
  text-decoration: none;
}
.site-header .brand-name:hover { color: #fff; }

.site-header .brand-tagline {
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85em;
  margin-top: 0.75em;
}

/* Nav */
.main-nav {
  position: relative;
  z-index: 10;
  width: 100%;
  text-align: center;
  padding: 0.5em 0;
  margin-bottom: 0;
}

.main-nav .nav-inner {
  display: inline-flex;
  gap: 0;
  border-radius: 0.35em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
  padding: 0 0.75em;
}

.main-nav a {
  display: block;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  text-decoration: none;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.25em;
  padding: 0 1.5em;
  height: 4.5em;
  line-height: 4.5em;
  transition: color 0.25s ease;
}
.main-nav a:hover { color: #fff; }

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em;
  z-index: 20;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: all 0.3s ease;
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

.nav-toggle.active span { background: transparent; }
.nav-toggle.active span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.active span::after { top: 0; transform: rotate(-45deg); }

/* ============================================================
   HERO (Intro section — coral background, centered text,
   inset-border text block like Escape Velocity)
   ============================================================ */
.hero-section {
  text-align: center;
  padding: 5em 0 6em;
}

.hero-section .hero-kicker {
  font-size: 1.35em;
  letter-spacing: 0.06em;
  margin-bottom: 0.5em;
  color: rgba(255,255,255,0.85);
}

.hero-section .hero-title-block {
  font-weight: 700;
  color: #fff;
  font-size: 2.4em;
  letter-spacing: 0.06em;
  line-height: 1.35;
  padding: 0.8em 0;
  margin: 0 auto 0.8em;
  border-radius: 0.3em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  max-width: 48em;
}
.hero-section .hero-title-block a { color: inherit; text-decoration: none; }

.hero-section .hero-subtitle {
  font-size: 1.05em;
  max-width: 44em;
  margin: 0 auto 2em;
  line-height: 1.7;
}

.hero-section .hero-actions {
  display: flex;
  gap: 1em;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   TOPICS — 2-column icon list (like Escape Velocity features)
   ============================================================ */
.topics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 60em;
  margin: 0 auto;
}

.topic-item {
  padding: 1.8em 2em;
  border-top: 1px solid #e0e0e0;
  position: relative;
}
.topic-item:nth-child(odd) { border-right: 1px solid #e0e0e0; }
.topic-item:nth-child(1),
.topic-item:nth-child(2) { border-top: none; }

.topic-item h3 {
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6em;
  color: #e97770;
}

.topic-item h3::before {
  content: '—';
  margin-right: 0.5em;
  color: #ccc;
}

.topic-item p,
.topic-item .topic-desc { font-size: 0.92em; color: #8b8e94; line-height: 1.75; }
.topic-item .topic-desc p:last-child { margin-bottom: 0; }

/* Section header (centered heading + sub like Escape Velocity) */
.section-header {
  text-align: center;
  padding-bottom: 3em;
}
.section-header h2 {
  font-size: 1.6em;
  letter-spacing: 0.04em;
  margin-bottom: 0.4em;
}
.section-header p {
  color: #aaa;
  font-size: 1em;
}

/* ============================================================
   LATEST POSTS — Highlight cards (3-col, image top + text,
   like Escape Velocity highlights section)
   ============================================================ */
.posts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5em;
}

.post-card {
  text-align: center;
}
.post-card .post-cover {
  display: block;
  margin-bottom: 1.5em;
  border-radius: 0.3em;
  overflow: hidden;
}
.post-card .post-cover img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-cover img { transform: scale(1.03); }

.post-card .post-date {
  display: block;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #aaa;
  margin-bottom: 0.6em;
}

.post-card h3 {
  margin-bottom: 0.6em;
}
.post-card h3 a {
  color: #e97770;
  text-decoration: none;
  font-size: 1.05em;
  letter-spacing: 0.04em;
}
.post-card h3 a:hover { color: #f98780; }

.post-card .post-excerpt {
  font-size: 0.92em;
  color: #8b8e94;
  margin-bottom: 1.2em;
}
.post-card .post-excerpt p:last-child { margin-bottom: 0; }

/* ============================================================
   FAQ — Collapsible accordion
   ============================================================ */
.faq-list {
  max-width: 52em;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.section-white .faq-item,
.section-light .faq-item {
  border-bottom-color: #e0e0e0;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 1.4em 0;
  font-size: 1.05em;
  font-weight: 700;
  color: #3d4149;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
  font-family: inherit;
  line-height: 1.5;
  transition: color 0.2s;
}
.section-dark .faq-question { color: #fff; }
.faq-question:hover { color: #e97770; }

.faq-question::after {
  content: '+';
  font-size: 1.4em;
  font-weight: 300;
  flex-shrink: 0;
  margin-left: 1em;
  transition: transform 0.3s ease;
  color: #ccc;
}
.faq-item.open .faq-question::after {
  content: '−';
  color: #e97770;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 0 0 0;
}
.faq-item.open .faq-answer {
  max-height: 40em;
  padding-bottom: 1.5em;
}
.faq-answer-inner {
  font-size: 0.95em;
  line-height: 1.8;
  color: #8b8e94;
}
.section-dark .faq-answer-inner { color: rgba(255,255,255,0.6); }
.faq-answer-inner p:last-child { margin-bottom: 0; }

/* ============================================================
   FOOTER — Dark background, overlay texture
   ============================================================ */
.site-footer {
  background: #282b34;
  color: rgba(255,255,255,0.45);
  padding: 5em 0 3em;
  position: relative;
}
.site-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJklEQVQYV2P8////fwYGBgYmBhAACQIFQIKMUEEYBSKBgiABAEdhBAbfxTSFAAAAAElFTkSuQmCC");
  opacity: 0.06;
}
.site-footer .container { position: relative; z-index: 2; }

.site-footer a { color: #fff; }
.site-footer a:hover { color: #f98780; }
.site-footer h3, .site-footer strong { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3em;
  padding-bottom: 3.5em;
  margin-bottom: 3em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.footer-brand .footer-name {
  font-size: 1.3em;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #fff;
  margin-bottom: 0.8em;
}

.footer-brand p {
  font-size: 0.9em;
  line-height: 1.7;
  max-width: 28em;
}

.footer-col h4 {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5em;
  font-weight: 700;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6em; }
.footer-col a {
  font-size: 0.9em;
  text-decoration: none;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.footer-col a:hover { color: #fff; }

.footer-copyright {
  text-align: center;
  padding-top: 0.5em;
  font-size: 0.85em;
}
.footer-copyright span {
  display: inline-block;
  border-radius: 0.3em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  padding: 0.6em 2em;
  color: rgba(255,255,255,0.3);
}

/* ============================================================
   BLOG INDEX
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3em;
}

.blog-card {
  display: flex;
  flex-direction: column;
}

.blog-card .blog-cover {
  display: block;
  border-radius: 0.3em;
  overflow: hidden;
  margin-bottom: 1.2em;
}
.blog-card .blog-cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.blog-card:hover .blog-cover img { transform: scale(1.03); }

.blog-card .blog-meta {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #aaa;
  margin-bottom: 0.6em;
}

.blog-card h2 {
  font-size: 1.2em;
  margin-bottom: 0.5em;
}
.blog-card h2 a {
  color: #3d4149;
  text-decoration: none;
}
.blog-card h2 a:hover { color: #e97770; }

.blog-card .blog-excerpt {
  font-size: 0.92em;
  flex: 1;
}
.blog-card .blog-excerpt p:last-child { margin-bottom: 0; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5em;
  margin-top: 4em;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 0.5em 1em;
  border-radius: 0.3em;
  font-size: 0.85em;
  font-weight: 700;
  text-decoration: none;
  color: #6b6e74;
  transition: all 0.2s;
}
.pagination a:hover { background: #e97770; color: #fff; }
.pagination .active {
  background: #e97770;
  color: #fff;
}
.pagination .nav-arrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75em;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-hero {
  text-align: center;
  padding: 3em 0 2em;
}
.post-hero .post-date-single {
  display: inline-block;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1em;
}
.post-hero h1 {
  color: #fff;
  font-size: 2.2em;
  letter-spacing: 0.04em;
  max-width: 36em;
  margin: 0 auto;
}

.post-cover-full {
  max-width: 56em;
  margin: 0 auto 3em;
  border-radius: 0.3em;
  overflow: hidden;
}
.post-cover-full img {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
}

.post-body {
  max-width: 44em;
  margin: 0 auto;
  padding: 0 2em 5em;
}

.post-body .post-excerpt-block {
  font-size: 1.1em;
  color: #6b6e74;
  border-left: 3px solid #e97770;
  padding-left: 1.5em;
  margin-bottom: 2.5em;
  line-height: 1.8;
}
.post-body .post-excerpt-block p:last-child { margin-bottom: 0; }

/* Post content html styling */
.post-content h2 {
  font-size: 1.5em;
  margin: 2em 0 0.8em;
}
.post-content h3 {
  font-size: 1.2em;
  margin: 1.5em 0 0.6em;
}
.post-content p {
  margin-bottom: 1.5em;
}
.post-content ul, .post-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}
.post-content li { margin-bottom: 0.5em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content blockquote {
  border-left: 3px solid #e97770;
  padding: 0.5em 0 0.5em 1.5em;
  margin: 2em 0;
  font-style: italic;
  color: #6b6e74;
}
.post-content img {
  border-radius: 0.3em;
  margin: 2em 0;
}

/* ============================================================
   PAGE (static — O portalu etc.)
   ============================================================ */
.page-header {
  text-align: center;
  padding: 3em 0 2em;
}
.page-header h1 {
  color: #fff;
  font-size: 2.2em;
  letter-spacing: 0.04em;
}

.page-body {
  max-width: 44em;
  margin: 0 auto;
  padding: 3em 2em 5em;
}
.page-body h2 { font-size: 1.5em; margin: 2em 0 0.8em; }
.page-body h3 { font-size: 1.2em; margin: 1.5em 0 0.6em; }
.page-body p { margin-bottom: 1.5em; }
.page-body ul, .page-body ol { margin-bottom: 1.5em; padding-left: 1.5em; }
.page-body li { margin-bottom: 0.5em; }
.page-body ul { list-style: disc; }
.page-body ol { list-style: decimal; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media screen and (max-width: 980px) {
  .container { padding: 0 2.5em; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .posts-row { grid-template-columns: 1fr 1fr; }
  .posts-row .post-card:nth-child(n+3) { display: none; }

  .topics-grid { grid-template-columns: 1fr 1fr; }

  .hero-section .hero-title-block { font-size: 1.8em; }
}

@media screen and (max-width: 768px) {
  .section-wrap { padding: 3.5em 0 4em; }
  .section-label { font-size: 0.7em; }

  /* Mobile nav */
  .nav-toggle { display: block; }

  .main-nav {
    padding: 0.8em 1.5em;
    display: flex;
    justify-content: flex-end;
  }

  .main-nav .nav-inner {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #22252e;
    border-radius: 0;
    box-shadow: none;
    padding: 1em 0;
    z-index: 100;
  }
  .main-nav .nav-inner.open { display: flex; }

  .main-nav a {
    height: auto;
    line-height: 1;
    padding: 1em 2em;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .hero-section { padding: 3em 0 4em; }
  .hero-section .hero-title-block {
    font-size: 1.4em;
    padding: 0.6em 0.5em;
  }
  .hero-section .hero-kicker { font-size: 1.1em; }

  .topics-grid {
    grid-template-columns: 1fr;
  }
  .topic-item { border-right: none !important; }
  .topic-item:nth-child(2) { border-top: 1px solid #e0e0e0; }

  .posts-row {
    grid-template-columns: 1fr;
    gap: 2em;
  }
  .posts-row .post-card:nth-child(n+3) { display: block; }

  .blog-grid { grid-template-columns: 1fr; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2em;
  }

  .post-hero h1 { font-size: 1.6em; }
  .page-header h1 { font-size: 1.6em; }
}

@media screen and (max-width: 480px) {
  body { font-size: 14px; }

  .container { padding: 0 1.2em; }

  .site-header { min-height: 14em; }
  .site-header .brand-name { font-size: 1.4em; }

  .hero-section .hero-title-block {
    font-size: 1.15em;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.2);
  }

  .section-label {
    font-size: 0.65em;
    padding: 0 1.2em;
    letter-spacing: 0.15em;
  }

  .faq-question { font-size: 0.95em; }

  .post-body { padding: 0 1.2em 3em; }
  .page-body { padding: 2em 1.2em 3em; }
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid #e97770;
  outline-offset: 2px;
}

/* Skip nav link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1em;
  background: #e97770;
  color: #fff;
  padding: 0.5em 1em;
  z-index: 999;
  text-decoration: none;
  border-radius: 0 0 0.3em 0.3em;
  font-size: 0.85em;
}
.skip-link:focus { top: 0; }
