/*
Theme Name: Authority of Ash
Theme URI: https://example.com
Author: Page Cle
Description: Custom theme for the Authority of Ash Cycle (Book + Game).
Version: 1.0.0
Text Domain: authority-of-ash
*/

/* =================================================
   OVERRIDES
   Use only for conflict fixes, plugin cleanup,
   and final patches that must win.
================================================= */

/* =================================================
   GLOBAL SAFETY
================================================= */

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

img,
svg,
video{
  max-width: 100%;
  height: auto;
}

/* =================================================
   WORDPRESS ALIGNMENTS
================================================= */

.alignwide{
  width: min(1200px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

.alignfull{
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.wp-block-image,
.wp-block-gallery{
  margin: 16px 0;
}

/* =================================================
   ADMIN BAR OFFSET
================================================= */

body.admin-bar .site-header{
  top: 32px;
}

@media (max-width: 782px){
  body.admin-bar .site-header{
    top: 46px;
  }
}

/* =================================================
   LIMIT GLOBAL LINK UNDERLINES
================================================= */

.btn::after,
.primary-nav a::after,
.footer-nav a::after,
.footer-menu a::after,
.social-menu a::after{
  content: none !important;
}

a[aria-label]::after{
  content: none !important;
}

/* =================================================
   CARD SAFETY
================================================= */

.card{
  position: relative;
  border-radius: var(--radius, 18px);
}

.card::before,
.card::after{
  pointer-events: none;
}

/* =================================================
   HEADER SAFETY
================================================= */

.site-header{
  background: rgba(3,28,36,.55) !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-header.is-scrolled{
  background: rgba(3,28,36,.78) !important;
  border-bottom-color: rgba(123,210,255,.18) !important;
}

/* prevent hero layer from blocking nav */
.site-hero{
  pointer-events: none;
}

.site-header,
.site-header *{
  pointer-events: auto;
}

/* =================================================
   MOBILE NAV TAP TARGETS
================================================= */

.nav-toggle{
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.primary-nav a{
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px){
  .primary-nav.is-open{
    padding-bottom: 10px;
  }
}

/* =================================================
   TYPOGRAPHY SAFETY
================================================= */

@media (max-width: 520px){
  p{
    max-width: none;
  }
}

/* =================================================
   FORM SAFETY
================================================= */

input,
textarea,
select,
button{
  font: inherit;
}

button,
input[type="submit"]{
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus,
button:focus{
  outline: none;
}

/* =================================================
   CONTACT FORM 7
================================================= */

.wpcf7 form p:last-child{
  margin-bottom: 0;
}

.wpcf7 .wpcf7-response-output{
  line-height: 1.5;
}

/* =================================================
   CONTENT LINKS
================================================= */

.content a{
  color: var(--ink);
}

.content a:hover{
  color: var(--accent);
}

/* =================================================
   IMAGE CAPTIONS
================================================= */

.wp-caption,
.wp-block-image figcaption{
  color: rgba(234,246,255,.65);
  font-size: 12px;
  margin-top: 8px;
}

/* =================================================
   FOOTER GRID FALLBACK
================================================= */

@media (max-width: 900px){
  .footer-inner{
    grid-template-columns: 1fr !important;
  }
}

/* =================================================
   ACCESSIBILITY
================================================= */

@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =================================================
   FOOTER DROPDOWN STACKING
   (ONLY stacking here — no footer image/fade logic)
================================================= */

.site-main,
main,
.section{
  position: relative;
  z-index: 1;
}

.site-footer.footer-hero{
  position: relative;
  overflow: visible !important;
  z-index: 500;
}

.site-footer.footer-hero .footer-hero-inner,
.site-footer.footer-hero .container,
.site-footer.footer-hero .footer-inner,
.site-footer.footer-hero .footer-nav,
.site-footer.footer-hero .footer-menu,
.site-footer.footer-hero .footer-menu > li,
.site-footer.footer-hero .footer-meta{
  position: relative;
  overflow: visible !important;
}

.site-footer.footer-hero .footer-nav{
  z-index: 2000;
}

.site-footer.footer-hero .footer-menu .sub-menu{
  position: absolute !important;
  bottom: 100% !important;
  left: 0 !important;
  z-index: 99999 !important;
}

/* open rightmost menus inward */
.site-footer.footer-hero .footer-menu > li:last-child .sub-menu,
.site-footer.footer-hero .footer-menu > li:nth-last-child(2) .sub-menu{
  left: auto !important;
  right: 0 !important;
}

/* =================================================
   REMOVE LAST SECTION DIVIDER LINE
================================================= */

main > .section:last-child::before{
  display: none !important;
}

/* force normal footer nav visible */
.footer-nav,
.footer-nav .footer-menu{
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.footer-nav{
  justify-self: end;
}

.footer-nav .footer-menu{
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

/* -------------------------
   FIX: LEGAL LINK UNDERLINE
------------------------- */

.footer-legal a::after{
  display:none !important;
}

.footer-legal a{
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer-legal a:hover{
  text-decoration-color: var(--accent);
}

/* -------------------------
   FOOTER COPYRIGHT SIZE
------------------------- */

.footer-copyright{
  font-size: calc(1em - 5px);
}