/* =========================
   Texturas – Textures App
   ========================= */
#textures-app {
  --brand: #12B3B6;
  --brand-2: #F5C84C;

  --bg: #f7f8fa;
  --panel: #ffffff;

  --ink: #0e1720;
  --ink-strong: #0c5d5f;
  --ink-mid: #134e63;
  --muted: #5b6570;

  --line: #e6ebf0;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 16px;

  --hdr-h: 72px;

  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Arial, sans-serif;

  font-size: 24px;
  color: var(--ink);
  background: var(--bg);
}

#textures-app,
#textures-app * {
  box-sizing: border-box;
}

/* ============================================================
   🔓 QUEBRAR LIMITE DO TEMA (WordPress)
============================================================ */
.entry-content > #textures-app {
  max-width: none !important;
  width: 100%;
}

/* ============================================================
   HEADER
============================================================ */
#textures-app .header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--hdr-h);

  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(10px);
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.6),
    transparent
  );

  transition: background .25s ease;
}

#textures-app .header.scrolled {
  background: rgba(255,255,255,.96);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

/* ============================================================
   LAYOUT PRINCIPAL
============================================================ */
#textures-app .layout {
  max-width: 1400px;
  margin: 20px auto 0;
  padding: 0 16px;
  scroll-behavior: smooth;
}

/* ============================================================
   PAINÉIS BASE
============================================================ */
#textures-app .pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  overflow: auto;
}

/* ============================================================
   TOC — BOTÃO
============================================================ */
#textures-app #toc-btn {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 99998;

  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 24px;
  color: var(--ink);
  background: var(--panel);

  border: 2px solid var(--brand);
  border-radius: 12px;
  cursor: pointer;

  box-shadow: var(--shadow);
  transition: all .25s ease;
}

#textures-app #toc-btn::before {
  content: "☰";
  line-height: 1;
}

#textures-app #toc-btn:hover {
  background: var(--brand);
  color: #fff;
}

/* ============================================================
   TOC — PAINEL
============================================================ */
#textures-app .toc {
  position: fixed;
  top: 50px;
  left: 70px;

  width: 300px;
  height: 30vh;

  background: var(--panel);
  border-right: 3px solid var(--brand);
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0,0,0,.08);

  padding: 18px 12px;
  overflow-y: auto;

  z-index: 99997;

  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

#textures-app .toc.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   TOC — LINKS
============================================================ */
#textures-app .toc a {
  display: block;
  padding: 4px 0;

  font-size: 1rem;
  text-decoration: none;
  color: var(--ink);

  border-left: 3px solid transparent;
  transition: all .2s ease;
}

#textures-app .toc a:hover {
  color: var(--brand);
  border-left-color: var(--brand);
}

#textures-app .toc a.active {
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
}

/* ============================================================
   CONTEÚDO
============================================================ */
#textures-app .content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px;
}

/* ============================================================
   HERO — TÍTULO PRINCIPAL (H2)
============================================================ */
#textures-app .hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

#textures-app .hero h2 {
  margin: 0 0 6px;
  padding-left: 14px;

  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;

  color: var(--ink-strong);

  border-left: 4px solid var(--brand);

  background: linear-gradient(
    to right,
    rgba(18,179,182,0.14),
    rgba(18,179,182,0.05) 45%,
    transparent 75%
  );
}

#textures-app .hero small {
  color: var(--muted);
  font-weight: 400;
}

/* ============================================================
   TEXTO CORRIDO
============================================================ */
#textures-app p {
  line-height: 1.6;
  text-align: justify;
  text-justify: inter-word;

  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

/* ============================================================
   LEGENDA / PILLS
============================================================ */
#textures-app .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

#textures-app .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 6px 10px;
  border-radius: 999px;

  font-size: 1rem;
  font-weight: 600;

  background: rgba(18,179,182,.1);
  color: var(--ink-strong);
  border: 1px solid rgba(18,179,182,.25);
}

#textures-app .pill.alt {
  background: rgba(245,200,76,.12);
  color: #6b5609;
  border-color: rgba(245,200,76,.35);
}

/* ============================================================
   CARTÕES
============================================================ */
#textures-app .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

#textures-app .card {
  --card-accent: color-mix(in srgb, var(--brand) 96%, #ffffff);
  --card-accent-soft: color-mix(in srgb, var(--brand) 8%, transparent);

  background:
    linear-gradient(
      to bottom,
      var(--card-accent-soft),
      transparent 45%
    ),
    var(--panel);

  border: 1px solid var(--line);
  border-left: 4px solid color-mix(in srgb, var(--card-accent) 35%, transparent);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
  padding: 18px;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

#textures-app .card:nth-of-type(even) {
  --card-accent: color-mix(in srgb, var(--brand) 94%, var(--brand-2));
}

/* ============================================================
   TÍTULO DO CARTÃO (H3)
============================================================ */
#textures-app .card h3 {
  margin: 0 0 8px;
  padding: 6px 0 6px 14px;

  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;

  color: var(--brand);

  border-left: 4px solid var(--brand);

  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--brand) 10%, transparent),
    transparent 75%
  );
}

#textures-app .card .sub {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ============================================================
   TÍTULOS DAS ENTRADAS
============================================================ */
#textures-app .card h4,
#textures-app .card .entry-title,
#textures-app .card strong {
  margin: 10px 0 4px;
  padding-left: 10px;

  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;

  color: color-mix(in srgb, var(--ink) 85%, var(--brand));

  border-left: 3px solid color-mix(
    in srgb,
    var(--brand) 35%,
    transparent
  );

  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--brand) 6%, transparent),
    transparent 70%
  );
}

/* ============================================================
   MEDIA — YOUTUBE
============================================================ */
#textures-app .media {
  width: 100%;
  margin: 0 auto;
}

#textures-app .media iframe {
  display: block;
  max-width: 720px;
  margin: 0 auto;
}

/* ============================================================
   UTILITÁRIOS
============================================================ */
#textures-app .muted { color: var(--muted); }

#textures-app .hr {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

/* ============================================================
   MOBILE
============================================================ */
@media (max-width: 900px) {

  #textures-app {
    font-size: 16px;
  }

  #textures-app #toc-btn {
    left: 12px;
  }

  #textures-app .toc {
    top: 0;
    left: 55px;
    width: calc(100% - 55px);
    height: 100vh;

    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
}
