/*
 * Conecta Magazine — main stylesheet.
 * White ground, gold as the primary recurring accent, navy reserved
 * for small detail touches (eyebrows, footer labels, one accent panel).
 */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1c1a17;
  --ink-soft: #756e63;
  --gold: #b8934f;
  --gold-strong: #96762f;
  --gold-soft: #f5ecd9;
  --navy: #1f3a5f;
  --navy-soft: #e9edf2;
  --line: #efe9dc;
  --shadow: 0 10px 24px -16px rgba(30, 25, 15, 0.14);
  --font: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.75rem; }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.6rem 0 0;
  text-align: center;
  background: var(--navy);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.25);
}
.masthead-top {
  display: flex; flex-direction: column; align-items: center;
  width: fit-content; gap: 0.3rem; margin-bottom: 0.6rem;
}
.masthead .kicker {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-soft);
  font-weight: 600;
  opacity: 0.8;
}
.masthead-logo-link { display: inline-flex; align-items: center; }
.masthead img.logo,
.masthead .custom-logo { height: 30px; width: auto; margin: 0; display: block; }

nav.tabs { display: flex; justify-content: center; padding: 0 0 0.4rem; }
.tabs-menu {
  display: flex; justify-content: center; gap: 2.2rem; flex-wrap: wrap;
  list-style: none; margin: 0; padding: 0;
}
.tabs-menu a {
  background: none; border: none; font-family: var(--font);
  font-size: 0.82rem; font-weight: 600; color: rgba(255, 255, 255, 0.72);
  text-decoration: none; padding: 0.3rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tabs-menu a:hover { color: #fff; }
.tabs-menu .current-menu-item > a,
.tabs-menu .current_page_item > a {
  color: var(--gold); border-color: var(--gold);
}

/* ---------- Views / sections ---------- */
.view { padding: 2.6rem 0 4rem; }

.intro { max-width: 720px; margin: 0 0 2.4rem; }
.intro .eyebrow {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--navy); font-weight: 700; margin-bottom: 0.6rem;
}
.intro h1 {
  font-weight: 800; font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.2; margin: 0 0 0.8rem; letter-spacing: -0.01em;
  text-wrap: balance;
}
.intro p { color: var(--ink-soft); font-size: 1rem; margin: 0; }

/* ---------- Home: two column ---------- */
.home-grid { display: grid; grid-template-columns: 1fr 280px; gap: 3.4rem; align-items: start; }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; } }

.chip-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; }
.chip {
  font: inherit; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.4rem 0.9rem; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-strong); border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chip:hover { background: var(--gold); color: #241a08; }
.chip.is-active { background: var(--gold); color: #241a08; }
.chip:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.2rem 1.8rem; }

.pagination { margin-top: 2.4rem; }
.pagination .nav-links { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.pagination .page-numbers {
  font: inherit; display: inline-flex; align-items: center; justify-content: center;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  color: #241a08; background: var(--gold); border: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.pagination .page-numbers:hover:not(:disabled) { background: var(--gold-strong); }
.pagination .page-numbers:disabled { opacity: 0.35; cursor: default; }
.pagination .page-status { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pagination .page-numbers.dots { background: transparent; border-color: transparent; }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } }

.story-card { background: var(--surface); border-radius: 5px; overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.story-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.story-card .thumb {
  aspect-ratio: 16/10; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 0.78rem; font-weight: 600;
  text-decoration: none; overflow: hidden;
}
.story-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-card .body { padding: 1rem 0 0; }
.story-card .cat { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--gold-strong); }
.story-card h3 { font-size: 1.02rem; margin: 0.45rem 0 0.4rem; line-height: 1.35; font-weight: 700; }
.story-card h3 a { text-decoration: none; }
.story-card p { margin: 0; color: var(--ink-soft); font-size: 0.86rem; }
.story-card .meta { margin-top: 0.75rem; font-size: 0.72rem; color: var(--ink-soft); display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }

/* ---------- Ad rail / widgets ---------- */
.rail { display: flex; flex-direction: column; gap: 1.6rem; position: sticky; top: 1.5rem; }
.ad-slot {
  border-radius: 4px; background: var(--surface-2);
  color: var(--ink-soft); text-align: center; padding: 2.2rem 1rem; font-size: 0.7rem; font-weight: 600;
}
.ad-slot span { display: block; margin-top: 0.3rem; font-size: 0.66rem; opacity: 0.75; }
.news-letter { background: var(--navy); color: #fff; border-radius: 4px; padding: 1.3rem 1.2rem 1.5rem; }
.news-letter h4 { margin: 0 0 0.4rem; font-size: 1rem; }
.news-letter p { margin: 0 0 1rem; font-size: 0.8rem; opacity: 0.85; }
.news-letter form { display: flex; gap: 0.5rem; }
.news-letter input {
  flex: 1; min-width: 0; height: 2.5rem; border: none; border-radius: 3px;
  padding: 0 0.75rem; font-size: 0.8rem; font-family: var(--font);
}
.news-letter button {
  background: var(--gold); color: #241a08; border: none; font-weight: 700;
  font-size: 0.76rem; font-family: var(--font); white-space: nowrap;
  height: 2.5rem; border-radius: 3px; padding: 0 1rem; cursor: pointer;
}
.newsletter-note {
  margin: 0 0 1rem; padding: 0.55rem 0.75rem; border-radius: 3px;
  background: rgba(255, 255, 255, 0.1); border-left: 3px solid var(--gold);
  font-size: 0.76rem; opacity: 1;
}

/* ---------- Revista ---------- */
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 1.6rem; margin-bottom: 3.2rem; }
.cover-card { cursor: pointer; text-decoration: none; display: block; }
.cover-card .frame { border-radius: 4px; overflow: hidden; aspect-ratio: 3/4; background: var(--surface-2); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.cover-card:hover .frame { transform: translateY(-4px); box-shadow: var(--shadow); }
.cover-card .frame img { width: 100%; height: 100%; object-fit: cover; }
.cover-card .name { margin-top: 0.6rem; font-size: 0.76rem; text-align: center; color: var(--ink-soft); }
.cover-card-pending .name::after { content: " · pendente"; color: var(--gold-strong); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 0.7rem; margin-bottom: 1.8rem; flex-wrap: wrap; gap: 0.5rem; }
.section-head h2 { font-size: 1.3rem; margin: 0; font-weight: 800; }
.section-head .note { font-size: 0.74rem; color: var(--ink-soft); max-width: 280px; text-align: right; }

.pending-note { font-size: 0.76rem; color: var(--ink-soft); border-left: 3px solid var(--navy); padding: 0.65rem 0.9rem; background: var(--surface-2); border-radius: 0 3px 3px 0; margin-top: 2.4rem; }

/* ---------- Reader ---------- */
.reader-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: none; cursor: pointer; text-decoration: none;
  font-family: var(--font); font-size: 0.8rem; font-weight: 700;
  color: var(--ink-soft); padding: 0; margin-bottom: 1.8rem;
}
.reader-back:hover { color: var(--navy); }
.reader-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.reader-head .eyebrow { color: var(--navy); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.5rem; }
.reader-head h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.reader-head .fallback-link { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); white-space: nowrap; }
.reader-head .fallback-link:hover { color: var(--navy); border-color: var(--navy); }

/* Responsive FlipHTML5 embed — per https://help.fliphtml5.com/docs/embed-a-flipbook/ */
.flipbook-embed {
  position: relative; width: 100%; max-width: 900px; margin: 0 auto;
  padding-top: 70%; overflow: hidden; border-radius: 6px;
  box-shadow: 0 30px 60px -28px rgba(20, 15, 5, 0.4);
  background: var(--surface-2);
}
.flipbook-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.reader-pending {
  max-width: 900px; margin: 0 auto; padding: 4rem 2rem; text-align: center;
  border-radius: 6px; background: var(--surface-2); color: var(--ink-soft);
}
.reader-pending strong { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 0.5rem; }
.reader-note {
  margin-top: 1.4rem; font-size: 0.76rem; color: var(--ink-soft);
  border-left: 3px solid var(--navy); padding: 0.65rem 0.9rem; background: var(--surface-2); border-radius: 0 3px 3px 0;
  max-width: 640px;
}
.reader-description { max-width: 720px; margin: 2rem auto 0; color: var(--ink-soft); }

/* ---------- Toast notifications ----------
 * Upgrades the form-submission status messages (contact/newsletter)
 * into a floating notification, top-right below the sticky masthead —
 * assets/js/main.js positions .toast-stack under the masthead's actual
 * rendered height (not a hardcoded offset, since that can change) and
 * reads the same status text WordPress already renders inline, so the
 * copy has one source of truth. */
.toast-stack {
  position: fixed; right: 1.25rem; z-index: 300;
  display: flex; flex-direction: column; gap: 0.6rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.8rem 0.9rem; border-radius: 6px;
  background: var(--surface); box-shadow: var(--shadow);
  border-left: 4px solid var(--ink-soft);
  font-size: 0.84rem; line-height: 1.45; color: var(--ink);
  animation: conecta-toast-in 0.22s ease;
}
.toast.is-leaving { animation: conecta-toast-out 0.18s ease forwards; }
.toast.is-success { border-left-color: #2ea44f; }
.toast.is-warning { border-left-color: #d4a017; }
.toast.is-error   { border-left-color: #d73a49; }
.toast-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 0.1rem; }
.toast.is-success .toast-icon { color: #2ea44f; }
.toast.is-warning .toast-icon { color: #d4a017; }
.toast.is-error   .toast-icon { color: #d73a49; }
.toast-body { flex: 1; }
.toast-close {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: 1rem; line-height: 1; padding: 0;
  margin-top: -0.1rem; font-family: var(--font);
}
.toast-close:hover { color: var(--ink); }
@keyframes conecta-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes conecta-toast-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-6px); }
}
@media (max-width: 480px) {
  .toast-stack { right: 0.75rem; left: 0.75rem; width: auto; }
}

/* ---------- Services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.8rem; align-items: start; }
.service-card { background: var(--surface); border-radius: 5px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.service-thumb { aspect-ratio: 4 / 3; overflow: hidden; }
.service-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.service-card h3 { font-size: 1.08rem; margin: 1rem 1.1rem 0.55rem; font-weight: 700; }
.service-card .service-body { font-size: 0.85rem; color: var(--ink-soft); margin: 0 1.1rem 1.1rem; }
.service-card .service-body p { margin: 0; }

/* ---------- Contato ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.4rem; }
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.contact-list li { display: flex; gap: 0.9rem; align-items: flex-start; }
.contact-list .k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); font-weight: 700; width: 105px; flex-shrink: 0; padding-top: 0.15rem; }
.contact-list .v { font-size: 0.92rem; }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.contact-form input, .contact-form textarea { border: 1px solid var(--line); border-radius: 3px; padding: 0.6rem 0.7rem; font-family: var(--font); font-size: 0.88rem; background: var(--bg); color: var(--ink); }
.contact-form button { background: var(--gold); color: #241a08; border: none; padding: 0.65rem; border-radius: 3px; font-weight: 700; font-size: 0.8rem; cursor: pointer; }

/* ---------- Single post / page content ---------- */
.single-thumb { max-width: 720px; margin: 0 auto 2rem; border-radius: 6px; overflow: hidden; }
.single-thumb img { width: 100%; height: auto; display: block; }
.single-content { max-width: 720px; margin: 0 auto; font-size: 1rem; }
.single-content p { margin: 0 0 1.2rem; text-align: justify; }
.single-content img { border-radius: 6px; margin: 1.5rem 0; }

/* ---------- Mobile touch-target refinements ----------
 * Below ~600px, several controls rendered under the ~44px comfortable
 * tap-target size (nav links, chips, pagination, back link, form
 * fields) and single-post body text stayed fully justified on a
 * narrow column, producing uneven word spacing. Desktop sizing/layout
 * is untouched. */
@media (max-width: 600px) {
  .tabs-menu { gap: 1.4rem; }
  .tabs-menu a { padding: 0.7rem 0.15rem; font-size: 0.86rem; }

  .chip { padding: 0.6rem 1rem; font-size: 0.74rem; }
  .pagination .page-numbers { padding: 0.65rem 1rem; }

  .reader-back { padding: 0.6rem 0; margin-bottom: 1.2rem; }

  .contact-form input,
  .contact-form textarea,
  .contact-form button,
  .news-letter input,
  .news-letter button { min-height: 2.75rem; }

  .single-content p { text-align: left; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); padding: 2.4rem 0 1.5rem; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; margin-bottom: 1.6rem; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h5 { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.7rem; font-weight: 700; }
.foot-grid p { font-size: 0.84rem; color: rgba(255, 255, 255, 0.7); margin-bottom: 0.4rem; }
.social-links { display: flex; flex-direction: column; gap: 0.6rem; }
.social-links a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.84rem; color: rgba(255, 255, 255, 0.7); text-decoration: none;
  transition: color 0.15s ease;
}
.social-links a:hover { color: #fff; }
.social-links svg { flex-shrink: 0; color: var(--gold); }
.copyright { text-align: center; font-size: 0.74rem; color: rgba(255, 255, 255, 0.55); border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 1.1rem; }
.dev-credit { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-top: 0.6rem; font-size: 0.7rem; color: rgba(255, 255, 255, 0.45); text-decoration: none; transition: color 0.15s ease; }
.dev-credit:hover { color: rgba(255, 255, 255, 0.75); }
.dev-credit img { border-radius: 3px; }
