/*
Theme Name: RTA Aposentados
Theme URI: https://example.com/rta
Author: RTA
Description: Tema WordPress para Roteiro Turístico dos Aposentados.
Version: 1.0.0
Text Domain: rta
*/

:root {
  --rta-red: #c40000;
  --rta-red-dark: #7a0000;
  --rta-red-nav: #8b0000;
  --rta-orange: #ff6600;
  --rta-white: #ffffff;
  --rta-text: #333333;
  --rta-border: #d9d9d9;
  --rta-max-width: 980px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  color: var(--rta-text);
  background: var(--rta-white);
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
  text-wrap: pretty;
}

:focus {
  outline: 2px solid var(--rta-orange);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--rta-orange);
  outline-offset: 2px;
}

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

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.rta-site {
  min-width: 980px;
}

.rta-top-bar {
  background: var(--rta-red);
  height: 8px;
}

.rta-header {
  background: linear-gradient(180deg, var(--rta-red) 0%, #b00000 100%);
  padding: 18px 0 0;
}

.rta-header__inner {
  width: var(--rta-max-width);
  margin: 0 auto;
  background: var(--rta-white);
  border: 1px solid #eee;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
}

.rta-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rta-logo a,
.rta-logo .custom-logo-link {
  display: block;
  line-height: 0;
}

.rta-logo__fallback {
  width: 120px;
  height: 120px;
}

.rta-logo img {
  height: 120px;
  object-fit: cover;
  border: 4px solid #fff;
}

.rta-logo__fallback {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff4d4d, var(--rta-red-dark));
  border: 4px solid #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: #ffd700;
  text-shadow: 0 2px 0 #8b0000, 0 0 8px rgba(255, 215, 0, 0.5);
}

.rta-branding__title {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--rta-red);
  text-shadow:
    1px 1px 0 #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    0 2px 2px rgba(0, 0, 0, 0.25);
}

.rta-branding__tagline {
  margin: 8px 0 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  color: var(--rta-red);
}

.rta-nav {
  background: linear-gradient(180deg, #a00000 0%, var(--rta-red) 55%, #8b0000 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.rta-nav__inner {
  width: var(--rta-max-width);
  margin: 0 auto;
}

.rta-menu,
.rta-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rta-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.rta-menu > li {
  display: flex;
  align-items: center;
}

.rta-menu > li + li {
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.rta-menu > li > a {
  display: block;
  padding: 7px 10px;
  font-size: clamp(0.65rem, 1.2vw, 0.72rem);
  font-weight: 600;
  color: var(--rta-white);
  white-space: nowrap;
  background: linear-gradient(360deg, rgba(176, 0, 0, 1) 0%, rgba(196, 0, 0, 1) 50%, rgba(196, 105, 75, 0.97) 64%, rgba(176, 0, 0, 1) 100%);
}

.rta-menu > li.current-menu-item > a,
.rta-menu > li.current_page_item > a {
  color: var(--rta-orange);
  text-shadow: 0 0 6px rgba(255, 102, 0, 0.8);
}

.rta-menu > li > a:hover,
.rta-menu > li > a:focus {
  color: var(--rta-orange);
}

/* ======================================================
   Dropdown / Submenu
   ====================================================== */

.rta-menu .menu-item-has-children {
  position: relative;
}

.rta-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 999;
  min-width: 220px;
  background: linear-gradient(180deg, #a00000 0%, var(--rta-red) 55%, #8b0000 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: none;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

/* Hover bridge: transparent gap so mouse can move from parent into submenu */
.rta-menu .sub-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.rta-menu .menu-item-has-children:hover > .sub-menu,
.rta-menu .menu-item-has-children:focus-within > .sub-menu,
.rta-menu .menu-item-has-children.rta-menu-open > .sub-menu {
  display: block !important;
}

.rta-menu .sub-menu li {
  display: block;
  border: none;
}

.rta-menu .sub-menu a {
  display: block;
  padding: 8px 14px;
  font-size: clamp(0.6rem, 1vw, 0.7rem);
  font-weight: 500;
  color: var(--rta-white);
  white-space: nowrap;
  background: transparent;
  border: none;
  transition: background 0.2s, color 0.2s;
}

.rta-menu .sub-menu a:hover,
.rta-menu .sub-menu a:focus {
  background: rgba(255, 255, 255, 0.12);
  color: var(--rta-orange);
}

.rta-menu .sub-menu .current-menu-item > a {
  color: var(--rta-orange);
  text-shadow: 0 0 6px rgba(255, 102, 0, 0.8);
}

/* Downward arrow indicator for items with children */
.rta-menu .menu-item-has-children > a::after {
  content: " ▾";
  font-size: 0.65em;
  vertical-align: middle;
  line-height: 1;
}

.rta-main {
  width: var(--rta-max-width);
  margin: 0 auto;
  padding: 18px 0 40px;
}

.rta-home-grid {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  gap: 24px;
  align-items: start;
}

.rta-sidebar-left,
.rta-sidebar-right {
  font-size: clamp(0.65rem, 1.2vw, 0.75rem);
}

.rta-sidebar-left__label {
  color: var(--rta-orange);
  font-size: clamp(0.7rem, 1.4vw, 0.85rem);
  margin: 0 0 12px;
  text-transform: lowercase;
}

.rta-partner {
  margin-bottom: 18px;
}

.rta-partner__name {
  font-weight: 700;
  color: #0047ab;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1;
  margin: 0 0 4px;
}

.rta-partner__name--aafbb {
  letter-spacing: -0.04em;
}

.rta-partner__desc {
  margin: 0;
  color: #0047ab;
  font-size: clamp(0.6rem, 1.1vw, 0.68rem);
  line-height: 1.25;
}

.rta-partner__logo-box {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #005bbb, #003f88);
  border-radius: 4px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

.rta-partner__logo-box span {
  color: #ffd700;
  font-size: 1.8rem;
  font-weight: 700;
}

.rta-center {
  text-align: center;
}

.rta-counter {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 6px;
}

.rta-counter__digit {
  min-width: 22px;
  padding: 4px 3px;
  background: #111;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid #444;
}

.rta-counter__caption {
  margin: 0 0 18px;
  font-size: 0.78rem;
  font-style: italic;
}

.rta-counter__credit {
  display: block;
  font-size: 0.62rem;
  color: #666;
  margin-top: 4px;
}

.rta-hero-logo {
  width: 420px;
  max-width: 100%;
  margin: 0 auto;
}

.rta-screenshot {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.rta-hero-logo__fallback {
  width: 420px;
  height: 210px;
  margin: 0 auto;
  border-radius: 210px 210px 0 0;
  background: radial-gradient(circle at 50% 100%, #ff4d4d, var(--rta-red-dark));
  border: 8px solid #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.rta-hero-logo__fallback span {
  margin-top: 70px;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 3px 0 #8b0000;
}

.rta-widget {
  margin-bottom: 16px;
  border: 1px solid var(--rta-border);
  background: #fafafa;
}

.rta-widget__header {
  background: #ececec;
  padding: 6px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.rta-widget__body {
  padding: 10px 8px;
}

.rta-clock {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.08em;
}

.rta-weather__city {
  font-weight: 700;
  font-size: 0.72rem;
  margin: 0 0 4px;
}

.rta-weather__date,
.rta-weather__temp,
.rta-weather__desc {
  margin: 0 0 4px;
  font-size: 0.68rem;
  line-height: 1.3;
}

.rta-weather__video {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  background: #ffd700;
  color: #000;
  font-size: 0.62rem;
  font-weight: 700;
}

.rta-content-area {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rta-border);
}

.rta-footer {
  background: var(--rta-red-dark);
  color: var(--rta-white);
  text-align: center;
  padding: 14px 12px;
  font-size: 0.75rem;
}

.rta-home-content {
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.55;
}

.rta-home-content h2,
.rta-home-content h3 {
  color: var(--rta-red);
  margin: 1.2rem 0 0.6rem;
}

.rta-home-content ul {
  padding-left: 1.2rem;
}

.rta-home-content li {
  margin-bottom: 0.45rem;
}

.rta-archive-header {
  margin-bottom: 24px;
}

.rta-archive-header h1 {
  color: var(--rta-red);
  margin: 0 0 8px;
}

.rta-archive-desc {
  font-size: 0.85rem;
  color: #555;
}

.rta-search-header {
  margin-bottom: 24px;
}

.rta-search-header h1 {
  color: var(--rta-red);
  margin: 0 0 12px;
  font-size: 1.4rem;
}

.rta-search-header h1 span {
  font-style: italic;
}

.rta-post-meta {
  font-size: 0.72rem;
  color: #777;
  margin: 4px 0 8px;
}

.rta-404-link {
  display: inline-block;
  margin-top: 16px;
}

.rta-content-area article {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rta-border);
}

.rta-content-area article:last-child {
  border-bottom: none;
}

.rta-content-area article h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.rta-content-area article h2 a {
  color: var(--rta-red);
}

.rta-content-area article h2 a:hover {
  color: var(--rta-orange);
}

.rta-featured-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 24px;
    object-fit: cover;
    max-height: 500px;
}

/* ======================================================
   Off-canvas Drawer (mobile ≤1024px)
   ====================================================== */

/* Hamburger toggle — hidden on desktop */
.rta-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  padding: 10px;
  background: var(--rta-red);
  border: 2px solid var(--rta-white);
  border-radius: 4px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.rta-hamburger-box {
  display: block;
  position: relative;
  width: 24px;
  height: 18px;
  margin: 0 auto;
}

.rta-hamburger-inner,
.rta-hamburger-inner::before,
.rta-hamburger-inner::after {
  display: block;
  position: absolute;
  width: 24px;
  height: 3px;
  background: var(--rta-white);
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.rta-hamburger-inner {
  top: 50%;
  transform: translateY(-50%);
}

.rta-hamburger-inner::before {
  content: "";
  top: -8px;
}

.rta-hamburger-inner::after {
  content: "";
  top: 8px;
}

/* Hamburger → X when open */
.rta-menu-toggle[aria-expanded="true"] .rta-hamburger-inner {
  transform: translateY(-50%) rotate(45deg);
}

.rta-menu-toggle[aria-expanded="true"] .rta-hamburger-inner::before {
  opacity: 0;
  transform: translateY(8px);
}

.rta-menu-toggle[aria-expanded="true"] .rta-hamburger-inner::after {
  transform: translateY(-8px) rotate(-90deg);
}

/* Admin bar logged-in: push hamburger below it */
.admin-bar .rta-menu-toggle {
  top: calc(12px + 46px);
  z-index: 100000;
}
@media screen and (min-width: 783px) {
  .admin-bar .rta-menu-toggle {
    top: calc(12px + 32px);
  }
}

/* Drawer and overlay must stack above admin bar (z-index 99999) */
.admin-bar .rta-nav--open {
  z-index: 100001 !important;
}
.admin-bar .rta-overlay--visible {
  z-index: 100000 !important;
}
.admin-bar .rta-menu-toggle {
  z-index: 100002;
}

/* Drawer header (title + close) */
.rta-nav__header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--rta-red-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.rta-nav__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rta-white);
}

.rta-nav__close {
  display: block;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 2px solid var(--rta-white);
  border-radius: 4px;
  color: var(--rta-white);
  font-size: 1.4rem;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
}

/* Overlay */
.rta-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.rta-overlay--visible {
  display: block !important;
  opacity: 1;
}

/* No scroll when drawer open */
.rta-no-scroll {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

/* ======================================================
   Mobile breakpoint (≤1024px)
   ====================================================== */
@media (max-width: 1024px) {
  .rta-site {
    min-width: 0;
  }

  .rta-header__inner {
    width: 100%;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  .rta-main {
    width: calc(100% - 24px);
  }

  .rta-home-grid {
    grid-template-columns: 1fr;
  }

  .rta-sidebar-left,
  .rta-center,
  .rta-sidebar-right {
    min-width: 0;
    overflow-wrap: break-word;
  }

  /* Search widget: prevent button overflow on narrow screens */
  .widget_search .wp-block-search__inside-wrapper {
    flex-wrap: wrap;
  }
  .widget_search .wp-block-search__button {
    margin-left: 0;
    margin-top: 4px;
  }

  .rta-menu-toggle {
    display: block;
  }

  .rta-overlay--visible {
    display: block;
  }

  .rta-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, #a00000 0%, var(--rta-red) 55%, #8b0000 100%);
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.3s ease;
    will-change: transform;
    border: none;
    border-right: 2px solid rgba(255, 255, 255, 0.15);
  }

  .rta-nav--open {
    transform: translate3d(0, 0, 0);
    display: block !important;
  }

  .rta-nav__header {
    display: flex;
  }

  .rta-nav__inner {
    width: 100%;
  }

  .rta-nav__inner .rta-menu {
    flex-direction: column;
  }

  .rta-nav__inner .rta-menu > li + li {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .rta-nav__inner .rta-menu > li {
    flex-direction: column;
    align-items: stretch;
  }

  .rta-nav__inner .rta-menu > li > a {
    padding: 12px 16px;
    font-size: 0.85rem;
    background: none;
  }

  .rta-nav__inner .rta-menu > li > a:hover,
  .rta-nav__inner .rta-menu > li > a:focus {
    background: rgba(255, 255, 255, 0.08);
  }

  .rta-nav__inner .rta-menu .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1.2em;
    padding-top: 0;
    padding-bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding-top 0.35s ease, padding-bottom 0.35s ease;
  }

  .rta-nav__inner .rta-menu .menu-item-has-children > a::after {
    content: " ▸";
    font-size: 0.85em;
  }

  .rta-nav__inner .rta-menu .menu-item-has-children.rta-menu-open > a {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.65rem;
    opacity: 0.85;
  }

  .rta-nav__inner .rta-menu .rta-menu-open > .sub-menu {
    max-height: 800px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .rta-nav__inner .rta-menu .sub-menu a {
    padding: 10px 14px;
    font-size: 0.78rem;
    white-space: normal;
  }
}
