/*
Theme Name: Michael Cards Pro
Theme URI: https://michaelcards.com
Description: Lightweight magazine theme with scrolling ticker, dropdown menus, and featured widgets. Built specifically for Michael Cards with no bloat.
Author: Stephen J. Cocconi
Version: 1.0.3
License: GNU General Public License v2 or later
Text Domain: michael-cards-pro
*/

/* ==========================================
   RESET & BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #111;
    font-weight: 500;
    background: #f5f5f5;
}

h1, h2, h3, h4, h5, h6 {
    color: #c41e3a;
}

.site-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================
   SCROLLING TICKER - Pure CSS Animation
   ========================================== */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: #c41e3a;
    color: white;
    padding: 12px 0;
    border-bottom: 3px solid #8b1528;
}

.ticker {
    display: flex;
    white-space: nowrap;
    animation: scroll 40s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 50px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.ticker-item a {
    color: white;
    text-decoration: none;
}

.ticker-item a:hover {
    text-decoration: underline;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================
   HEADER & BRANDING
   ========================================== */
.site-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-bottom: 4px solid #c41e3a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px 0;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.site-branding {
    margin-bottom: 15px;
}

.site-title {
    font-size: 2.8em;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.site-title a {
    color: white;
    text-decoration: none;
}

.site-description {
    color: rgba(255,255,255,0.9);
    font-size: 1.1em;
    font-style: italic;
    margin-top: 8px;
}

/* ==========================================
   NAVIGATION WITH PROPER BOXES & CHEVRONS
   ========================================== */
.main-navigation {
    background: #34495e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-top: 2px solid #c41e3a;
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* Issue 1: suppress iOS gray tap flash */
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.main-navigation .nav-inner ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.main-navigation li {
    position: relative;
    margin: 0;
    display: flex;
}

/* TOP LEVEL MENU ITEMS — flex layout: link + toggle button sit side-by-side inside each <li> */
.main-navigation ul > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 22px;    /* Right side trimmed — toggle button takes the rightmost slot */
    flex: 1;              /* Fill remaining width so the toggle button doesn't crowd it */
    color: white;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: 1.2px;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    background: #34495e;
    /* border-right moved to parent <li> — see below — so it spans full height including toggle */
}

/* Issue 3: separator moved to <li> so it includes the full height toggle button */
.main-navigation .nav-inner > ul > li {
    border-right: 1px solid rgba(255,255,255,0.1);
}
.main-navigation .nav-inner > ul > li:last-child {
    border-right: none;
}

/* fix(#4): removed transform:translateY(-2px) — caused 2px vertical offset between
   link background and toggle button on hover. Box-design nav doesn't need lift effect. */
.main-navigation ul > li > a:hover,
.main-navigation ul > li > a:focus,
.main-navigation .nav-inner > ul > li:hover > a {
    background: #c41e3a;
    color: white;
}

/* Issue 3: toggle button bg matches link when parent <li> is hovered */
.main-navigation .nav-inner > ul > li:hover > .submenu-toggle {
    background: #c41e3a;
    color: white;
}

/* CHEVRON INDICATORS FOR DROPDOWN MENUS */
/* ▼ indicator via pseudo-element — used before JS loads.
   Once JS injects the real .submenu-toggle button the pseudo-element
   is suppressed via .js-nav-enhanced (see Touch-Friendly section below). */
.main-navigation .menu-item-has-children > a::after {
    content: "▼";
    font-size: 10px;
    margin-left: 8px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.main-navigation .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* =============================================
   TOUCH-FRIENDLY DROPDOWN TOGGLES
   Fixes iOS/iPadOS where CSS :hover never fires.
   See navigation.js for full developer notes.
   ============================================= */

/* Once JS runs, suppress CSS pseudo-element arrows at ALL levels — JS buttons replace them.
   Without this, desktop gets ▼▼ duplicates at top level and ▶▶ at nested level. */
.main-navigation.js-nav-enhanced .menu-item-has-children > a::after {
    display: none;
}

/* Parent li must be relative so the absolutely-positioned button
   can anchor to it without adding to the flex item's width. */
.main-navigation li {
    position: relative;
}

/* SHARED baseline for all toggle buttons at any nav level */
.main-navigation .submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* TOP-LEVEL toggle — flex sibling (not absolute).
   Issue 3: sits to the right of <a> in the flex <li> row.
   fix(#5): border-left removed — the dividing line between menu text and arrow
   was visible and unwanted per issue #5. */
.main-navigation .nav-inner > ul > li > .submenu-toggle {
    position: static;
    flex-shrink: 0;
    width: 34px;
    align-self: stretch;
    padding: 0;
    color: rgba(255,255,255,0.85);
    font-size: 10px;
}

/* NESTED toggle — stays position:absolute inside the dropdown link row.
   Issue 2: dark colour (#888) so the ▶ icon is visible on white dropdown background. */
.main-navigation ul ul .submenu-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    min-width: 34px;
    padding: 0 8px;
    color: #888;
    font-size: 10px;
    z-index: 1;
}

/* Issue 2: ▶ becomes red on hover/open in dropdown */
.main-navigation ul ul li:hover > .submenu-toggle,
.main-navigation ul ul li.submenu-open > .submenu-toggle {
    color: #c41e3a;
}

.main-navigation .submenu-toggle:focus {
    outline: 2px solid rgba(255,255,255,0.6);
    outline-offset: 2px;
}

/* Rotate ▼ to ▲ when submenu is open (top-level only) */
.main-navigation .menu-item-has-children.submenu-open > .submenu-toggle:not(.submenu-toggle--nested) .submenu-toggle-icon {
    display: inline-block;
    transform: rotate(180deg);
}

/* Issue 2: Do NOT rotate ▶ when nested flyout is open */
.main-navigation .menu-item-has-children.submenu-open > .submenu-toggle--nested .submenu-toggle-icon {
    transform: none;
}

/* CRITICAL: Show sub-menu when JS has toggled .submenu-open */
.main-navigation .menu-item-has-children.submenu-open > .sub-menu {
    display: flex !important;
}

/* DROPDOWN SUBMENU - PROPER BOXES */
.main-navigation ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    background: #ffffff;        /* Issue 1: explicit color prevents iOS transparent gray flash */
    background-color: #ffffff;  /* belt-and-suspenders for webkit */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: none !important;
    z-index: 9999;
    flex-direction: column;
    border-top: 4px solid #c41e3a;
    border-radius: 0 0 8px 8px;
    /* overflow:hidden removed — it can cause clipping/gray artefacts on iOS WebKit */
    -webkit-backface-visibility: hidden; /* promote layer for iOS GPU compositing */
}

/* SHOW DROPDOWN ON HOVER */
.main-navigation li:hover > ul {
    display: flex !important;
}

.main-navigation ul ul li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    display: block;
}

.main-navigation ul ul li:last-child {
    border-bottom: none;
}

/* DROPDOWN LINK BOXES */
.main-navigation ul ul a {
    padding: 16px 24px;
    color: #1a1a1a;
    font-size: 14px;
    text-transform: none;
    font-weight: 600;
    display: block;
    background: white;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.main-navigation ul ul a:hover {
    background: #f8f8f8;
    color: #c41e3a;
    border-left-color: #c41e3a;
    padding-left: 30px;
}

/* NESTED DROPDOWNS */
.main-navigation ul ul ul {
    left: 100%;
    top: 0;
    border-radius: 0 8px 8px 0;
    border-top: none;
    border-left: 4px solid #c41e3a;
}

.main-navigation ul ul .menu-item-has-children > a::after {
    content: "▶";
    float: right;
    font-size: 10px;
    margin-left: 10px;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: #34495e;
    color: white;
    border: none;
    padding: 18px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-toggle::after {
    content: " ☰";
    float: right;
    font-size: 20px;
}

.menu-toggle.toggled::after {
    content: " ✕";
}

/* ==========================================
   FEATURED WIDGETS AREA
   ========================================== */
.featured-widgets-area {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 20px;
    margin-bottom: 40px;
}

.featured-widgets-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.featured-widget {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.featured-widget h2,
.featured-widget h3 {
    color: #c41e3a;
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 4px solid #c41e3a;
    font-weight: 700;
}

/* ==========================================
   MAIN CONTENT - FULL WIDTH (NO SIDEBAR)
   ========================================== */
.site-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

.content-area {
    width: 100%;
    background: white;
    padding: 30px 40px 40px 40px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

@media (max-width: 480px) {
    .content-area {
        padding: 15px 12px 20px 12px;
    }
    .site-content {
        padding: 8px 8px;
    }
}

/* ==========================================
   MAGAZINE LAYOUT - Post Grid
   ========================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    margin-bottom: 40px;
}

article.post,
article.type-post {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

article.post:hover,
article.type-post:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

.post-thumbnail {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

article:hover .post-thumbnail img {
    transform: scale(1.05);
}

.entry-header {
    padding: 25px;
}

.entry-title {
    font-size: 1.4em;
    margin-bottom: 12px;
    line-height: 1.3;
    font-weight: 700;
    color: #c41e3a;
}

.entry-title a {
    color: #c41e3a;
    text-decoration: none;
    transition: color 0.3s;
}

.entry-title a:hover {
    color: #8b1528;
}

.entry-meta {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entry-summary,
.entry-content {
    padding: 0 25px 25px;
    line-height: 1.8;
    color: #1a1a1a;
}

/* ==========================================
   POST & PAGE CONTENT TYPOGRAPHY
   (Global reset strips all default margins,
   so we restore sensible spacing here)
   ========================================== */

/* Paragraphs — one full line-height gap between blocks */
.entry-content p,
.entry-summary p {
    margin-top: 0;
    margin-bottom: 1em;
}

.entry-content p:last-child,
.entry-summary p:last-child {
    margin-bottom: 0;
}

/* Headings — standard browser-equivalent spacing.
   Extra space ABOVE separates from preceding content.
   Small space BELOW tightly connects heading to its own text. */
.entry-content h1 {
    margin-top: 1.2em;
    margin-bottom: 0.4em;
    line-height: 1.2;
    font-size: 2em;
}
.entry-content h2 {
    margin-top: 1.2em;
    margin-bottom: 0.4em;
    line-height: 1.25;
    font-size: 1.7em;
}
.entry-content h3 {
    margin-top: 1.2em;
    margin-bottom: 0.4em;
    line-height: 1.3;
    font-size: 1.45em;
}
.entry-content h4 {
    margin-top: 1.1em;
    margin-bottom: 0.35em;
    line-height: 1.3;
    font-size: 1.25em;
}
.entry-content h5 {
    margin-top: 1em;
    margin-bottom: 0.3em;
    line-height: 1.35;
    font-size: 1.1em;
}
.entry-content h6 {
    margin-top: 1em;
    margin-bottom: 0.3em;
    line-height: 1.35;
    font-size: 1em;
}

/* First element at top of content — no orphan top gap */
.entry-content > h1:first-child,
.entry-content > h2:first-child,
.entry-content > h3:first-child,
.entry-content > h4:first-child,
.entry-content > h5:first-child,
.entry-content > h6:first-child,
.entry-content > p:first-child {
    margin-top: 0;
}

/* Heading size scale within content */
.entry-content h1 { font-size: 2em; }
.entry-content h2 { font-size: 1.7em; }
.entry-content h3 { font-size: 1.45em; }
.entry-content h4 { font-size: 1.25em; }
.entry-content h5 { font-size: 1.1em; }
.entry-content h6 { font-size: 1em; }

/* Lists */
.entry-content ul,
.entry-content ol {
    margin-bottom: 5px;
    padding-left: 2em;
}

.entry-content li {
    margin-bottom: 3px;
}

/* Nested lists */
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
    margin-top: 3px;
    margin-bottom: 3px;
}

/* Blockquotes */
.entry-content blockquote {
    margin: 1.6em 0;
    padding: 1em 1.5em;
    border-left: 4px solid #c41e3a;
    background: #fafafa;
    color: #1a1a1a;
    font-style: italic;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Horizontal rules */
.entry-content hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 2em 0;
}

/* Images within content */
.entry-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 1em;
}

/* Tables */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.4em;
    font-size: 0.95em;
}

.entry-content th,
.entry-content td {
    padding: 10px 14px;
    border: 1px solid #ddd;
    text-align: left;
}

.entry-content th {
    background: #f0f0f0;
    font-weight: 700;
    color: #111;
}

.entry-content tr:nth-child(even) td {
    background: #fafafa;
}

.read-more {
    color: #c41e3a;
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 20px 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.site-footer a {
    color: #3498db;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

/* Tablet */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .featured-widgets-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .site-title {
        font-size: 2em;
    }
    
    .main-navigation > ul > li > a {
        padding: 18px 25px;
        font-size: 14px;
    }
}

/* Mobile - hamburger menu below 425px */
@media (max-width: 425px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-navigation ul {
        display: none;
        flex-direction: column;
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
    
    .main-navigation li {
        width: 100%;
    }
    
    .main-navigation > ul > li > a {
        width: 100%;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Mobile: toggle button is wider and has a separator line */
    .main-navigation .submenu-toggle {
        min-width: 50px;
        font-size: 14px;
        border-left: 1px solid rgba(255,255,255,0.1);
    }

    /* Mobile dropdowns - override desktop position:absolute and min-width */
    .main-navigation ul ul {
        position: static;
        display: block;            /* Override flex for natural inline flow */
        width: 100% !important;
        min-width: 0 !important;
        box-shadow: none;
        background: #2c3e50;
        border-top: none;
        border-radius: 0;
    }

    /* Re-apply flex display only when js-toggled open (overriding the block above) */
    .main-navigation .menu-item-has-children.submenu-open > .sub-menu {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .main-navigation ul ul a {
        color: rgba(255,255,255,0.9);
        background: #2c3e50;
        padding-left: 40px;
        font-size: 13px;
        border-left: none;
    }
    
    .main-navigation ul ul a:hover {
        background: #1a252f;
        color: white;
    }
    
    .main-navigation ul ul ul a {
        padding-left: 60px;
    }
    
    .site-title {
        font-size: 1.6em;
    }
}

/* Desktop - ensure full menu above 426px */
@media (min-width: 426px) {
    .main-navigation ul {
        display: flex !important;
    }
}

/* ==========================================
   UTILITIES
   ========================================== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
}

.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 10px;
}

.aligncenter {
    display: block;
    margin: 0 auto 20px;
}





/* ============================================================================
   THIRD-LEVEL DROPDOWN MENUS (Grandchild items)
   These appear to the RIGHT of their parent submenu items
   ============================================================================ */

/* Third-level dropdown container - appears to the right */
.main-navigation ul ul ul {
  position: absolute !important;
  top: 0 !important;
  left: 100% !important;
  display: none !important;
  flex-direction: column !important;
  background: white !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
  min-width: 280px !important;
  z-index: 99999 !important;
}

/* Show third-level dropdown when hovering second-level item */
.main-navigation ul ul li:hover > ul {
  display: flex !important;
}

/* Third-level menu item styling */
.main-navigation ul ul ul li a {
  padding: 12px 20px !important;
  color: #111 !important;
  white-space: nowrap !important;
  border-bottom: 1px solid #eee !important;
}

.main-navigation ul ul ul li a:hover {
  background: #f5f5f5 !important;
  color: #c41e3a !important;
}

/* Add right arrow indicator for items that have grandchildren */
.main-navigation ul ul .menu-item-has-children > a::after {
  content: " ▶" !important;
  float: right !important;
  margin-left: 10px !important;
}

/* THIRD-LEVEL DROPDOWN MENUS - DOWNWARD NAVIGATION */
/* Remove old rightward positioning */
.main-navigation ul ul ul {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    display: none !important;
    flex-direction: column !important;
    background: white !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    min-width: 280px !important;
    z-index: 99999 !important;
    border: 1px solid #ddd !important;
}

/* Show third-level menu on parent hover */
.main-navigation ul ul li:hover > ul {
    display: flex !important;
}

/* Third-level menu items styling */
.main-navigation ul ul ul li a {
    padding: 12px 20px !important;
    color: #111 !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #eee !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
}

.main-navigation ul ul ul li a:hover {
    background-color: #f5f5f5 !important;
    color: #d32f2f !important;
}

/* Down arrow indicator for items with grandchildren */
.main-navigation ul ul .menu-item-has-children > a::after {
    content: " ▼" !important;
    float: right !important;
    margin-left: 10px !important;
    font-size: 12px !important;
    color: #666 !important;
}

/* Smart positioning - move left when near right edge */
.main-navigation ul ul li:nth-last-child(-n+3) ul {
    left: -100% !important;
}

/* Remove last border on final item */
.main-navigation ul ul ul li:last-child a {
    border-bottom: none !important;
}
/* END THIRD-LEVEL MENUS */

/* FIX: THIRD-LEVEL MENU CLIPPING ISSUE */
/* Prevent menu items from being cut off at container edges */

.main-navigation ul ul ul {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    display: none !important;
    flex-direction: column !important;
    background: white !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    min-width: 280px !important;
    max-width: 320px !important;
    z-index: 999999 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* Smart positioning - move left when too close to right edge */
.main-navigation ul ul li:nth-last-child(-n+2) ul {
    left: -100% !important;
    right: 100% !important;
}

/* Ensure parent containers don't clip menus */
.main-navigation,
.main-navigation ul,
.main-navigation ul ul {
    overflow: visible !important;
    position: relative !important;
}

/* Third-level menu items styling */
.main-navigation ul ul ul li a {
    padding: 12px 20px !important;
    color: #111 !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #eee !important;
    text-decoration: none !important;
    display: block !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.main-navigation ul ul ul li a:hover {
    background-color: #f8f8f8 !important;
    color: #d32f2f !important;
}

/* Show menu on hover */
.main-navigation ul ul li:hover > ul {
    display: flex !important;
}

/* Arrow indicators */
.main-navigation ul ul .menu-item-has-children > a::after {
    content: " ▶" !important;
    float: right !important;
    margin-left: 10px !important;
    font-size: 12px !important;
    color: #666 !important;
}

/* Remove bottom border from last item */
.main-navigation ul ul ul li:last-child a {
    border-bottom: none !important;
}

/* Ensure menu stays within viewport */
@media screen and (max-width: 768px) {
    .main-navigation ul ul ul {
        position: fixed !important;  
        max-height: 70vh !important;
        overflow-y: auto !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
    }
}
/* END CLIPPING FIX */

/* FIX: EXCESSIVE MENU HEIGHT AND PADDING */
.main-navigation {
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    max-height: auto !important;
}

.main-navigation ul {
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
}

.main-navigation ul li {
    padding: 8px 15px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.main-navigation ul li a {
    padding: 8px 12px !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    display: block !important;
}

/* Reduce dropdown menu excessive spacing */
.main-navigation ul ul {
    padding: 5px 0 !important;
    margin: 0 !important;
    min-height: auto !important;
}

.main-navigation ul ul li {
    padding: 0 !important;
    margin: 0 !important;
}

.main-navigation ul ul li a {
    padding: 10px 15px !important;
    margin: 0 !important;
    border-bottom: 1px solid #eee !important;
}

/* Third-level menu compact spacing */
.main-navigation ul ul ul {
    padding: 5px 0 !important;
    margin: 0 !important;
}

.main-navigation ul ul ul li a {
    padding: 8px 15px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
}

/* Remove excessive ticker spacing */
.ticker-container {
    margin: 0 !important;
    padding: 5px 0 !important;
}
/* END HEIGHT FIX */

/* FIX: SUBMENUS NOT FLOATING - CAUSING EXCESSIVE HEIGHT */

/* First-level menu bar should NOT expand with submenus */
.main-navigation {
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    height: auto !important;
}

/* Top-level menu items - compact height */
.main-navigation > ul {
    display: flex !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.main-navigation > ul > li {
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
}

.main-navigation > ul > li > a {
    display: block !important;
    padding: 12px 18px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* CRITICAL: Second-level menus MUST float absolutely */
.main-navigation ul ul {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    display: none !important;
    flex-direction: column !important;
    background: white !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    min-width: 250px !important;
    z-index: 99999 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 8px 0 !important;
    margin: 0 !important;
}

/* Show submenu on hover */
.main-navigation li:hover > ul {
    display: flex !important;
}

/* Second-level menu items */
.main-navigation ul ul li {
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
}

.main-navigation ul ul li a {
    display: block !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    color: #111 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #eee !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
}

.main-navigation ul ul li:last-child a {
    border-bottom: none !important;
}

.main-navigation ul ul li a:hover {
    background-color: #f5f5f5 !important;
    color: #d32f2f !important;
}

/* Third-level menus also float to the right */
.main-navigation ul ul ul {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    display: none !important;
    margin-top: 0 !important;
}

/* Smart positioning for menus near right edge */
.main-navigation ul ul li:nth-last-child(-n+2) ul {
    left: auto !important;
    right: 100% !important;
}

/* Ensure navigation container doesn't overflow */
nav.main-navigation,
.nav-wrapper,
.navigation-wrapper {
    overflow: visible !important;
    height: auto !important;
}

/* Remove any conflicting height constraints */
.site-header nav,
header nav {
    overflow: visible !important;
}
/* END FLOATING MENU FIX */

/* ==========================================
   MTAROT FORM - RESPONSIVE IN POST BUBBLE
   ========================================== */
.entry-summary .mtarot-form,
.entry-summary .mtarot-form center {
    display: block;
    width: 100%;
}
.entry-summary .mtarot-form select,
.entry-summary .mtarot-form #tlayout {
    max-width: 100%;
    width: 100% !important;
    box-sizing: border-box;
}
.entry-summary .mtarot-question {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Sticky post - yellow highlight */
.posts-grid article.sticky {
    background-color: #fffbcc !important;
    border: 2px solid #f0c000 !important;
}/* FIX: SUBMENUS NOT FLOATING - CAUSING EXCESSIVE HEIGHT */

/* First-level menu bar should NOT expand with submenus */
.main-navigation {
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    height: auto !important;
}

/* Top-level menu items - compact height */
.main-navigation > ul {
    display: flex !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.main-navigation > ul > li {
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
}

.main-navigation > ul > li > a {
    display: block !important;
    padding: 12px 18px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* CRITICAL: Second-level menus MUST float absolutely */
.main-navigation ul ul {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    display: none !important;
    flex-direction: column !important;
    background: white !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    min-width: 250px !important;
    z-index: 99999 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 8px 0 !important;
    margin: 0 !important;
}

/* Show submenu on hover */
.main-navigation li:hover > ul {
    display: flex !important;
}

/* Second-level menu items */
.main-navigation ul ul li {
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
}

.main-navigation ul ul li a {
    display: block !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    color: #111 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #eee !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
}

.main-navigation ul ul li:last-child a {
    border-bottom: none !important;
}

.main-navigation ul ul li a:hover {
    background-color: #f5f5f5 !important;
    color: #d32f2f !important;
}

/* Third-level menus also float to the right */
.main-navigation ul ul ul {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    display: none !important;
    margin-top: 0 !important;
}

/* Smart positioning for menus near right edge */
.main-navigation ul ul li:nth-last-child(-n+2) ul {
    left: auto !important;
    right: 100% !important;
}

/* Ensure navigation container doesn't overflow */
nav.main-navigation,
.nav-wrapper,
.navigation-wrapper {
    overflow: visible !important;
    height: auto !important;
}

/* Remove any conflicting height constraints */
.site-header nav,
header nav {
    overflow: visible !important;
}
/* END FLOATING MENU FIX */


/* ============================================================
   ASK CARDS MEGA-DROPDOWN PANEL   (Sprint 2026-03-04)
   CSS class "query-cards" = internal hook. User-visible label = "Ask Cards".
   Activated when nav item has CSS class "query-cards" in WP Admin.
   Issue #15: card-back icon left of nav label.
   Issue #23: language unified to "Ask" throughout UI.
   ============================================================ */

/* Issue #15 — half-card-back icon left of the Ask Cards nav label.
   Uses an SVG data URI card silhouette that works on all environments.
   On staging/production, functions.php overrides this with the actual
   card back image via wp_add_inline_style (see functions.php). */
.main-navigation .menu-item.query-cards > a::before,
.main-navigation .menu-item.query-cards > span::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Crect width='10' height='16' rx='1.5' fill='%23800020'/%3E%3Crect x='.75' y='.75' width='8.5' height='14.5' rx='1' fill='none' stroke='%23c8a000' stroke-width='.6'/%3E%3Cpath d='M5 3.5L7 6.5L5 9.5L3 6.5Z' fill='%23c8a000'/%3E%3Cpath d='M5 6.5L7 9.5L5 12.5L3 9.5Z' fill='%23c8a000'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.main-navigation .menu-item.query-cards.panel-open > a::before,
.main-navigation .menu-item.query-cards.panel-open > span::before {
    opacity: 1;
}

/* Panel container — positioned relative to .nav-inner */
.nav-inner {
    position: relative;
}

.query-cards-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffe4ec;
    border-top: 3px solid #c41e3a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    visibility: hidden;
}

.query-cards-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.query-cards-panel-inner {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    padding: 32px 24px 28px;
}

.query-cards-panel-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2c2c2c;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.query-cards-panel-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.query-cards-panel-close:hover,
.query-cards-panel-close:focus {
    color: #c41e3a;
    background: rgba(196, 30, 58, 0.07);
}

.main-navigation .menu-item.query-cards.panel-open > a,
.main-navigation .menu-item.query-cards.panel-open > span {
    background: #c41e3a;
    color: #ffffff;
}

@media (max-width: 768px) {
    .query-cards-panel {
        position: static;
        box-shadow: none;
        border-top: 2px solid #c41e3a;
        border-radius: 0;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease;
    }
    .query-cards-panel.is-open {
        max-height: 600px;
        transform: none;
    }
}

/* Ask Cards flyout — form element overrides (Issue #22) */
.query-cards-panel-form .mtarot-form {
    width: 100%;
    box-sizing: border-box;
}
.query-cards-panel-form .mtarot-form center {
    display: block;
    text-align: center;
}
.query-cards-panel-form select#tlayout {
    max-width: 100%;
    width: 100%;
    padding: 6px 10px;
    font-size: 0.9rem;
    border: 1px solid #d4b84a;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: #fffbe6;
}
.query-cards-panel-form .mtarot-question-prompt {
    font-size: 0.875rem;
    color: #555;
    margin: 8px 0;
}
.query-cards-panel-form .mtarot-question {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 4px 0 10px;
    display: block !important;
    text-align: left !important;
}
.query-cards-panel-form .mtarot-ask {
    background: #c41e3a;
    color: #ffffff;
    border: none;
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s ease;
}
.query-cards-panel-form .mtarot-ask:hover,
.query-cards-panel-form .mtarot-ask:focus {
    background: #a3172f;
}
/* END QUERY CARDS MEGA-DROPDOWN */

/* ==========================================
   TAROT CARD ARCHIVE (/tcards/)
   archive-tarot-card.php — fixes mtarot-wp#4
   ========================================== */

.tcard-archive-grid article.type-tarot-card,
.tcard-archive-grid article.tarot-card,
.tcard-archive-grid article {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.tcard-archive-grid article:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.tcard-archive-image {
    width: 100%;
    padding: 20px 20px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 180px;
}

.tcard-archive-image img {
    max-height: 220px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.tcard-archive-image .tcard-no-image {
    width: 120px;
    height: 200px;
    background: #f0e6ea;
    border-radius: 6px;
    border: 2px dashed #c41e3a;
}

.tcard-archive-grid .entry-header {
    padding: 15px 15px 8px;
}

.tcard-archive-grid .entry-title {
    font-size: 1.05em;
    margin-bottom: 6px;
}

.tcard-archive-grid .entry-summary {
    padding: 0 15px 18px;
    font-size: 0.88em;
    color: #555;
}

.tcard-archive-grid .read-more {
    display: inline-block;
    margin-top: 6px;
    color: #c41e3a;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85em;
}

.tcard-archive-grid .read-more:hover {
    color: #8b1528;
}

@media (max-width: 900px) {
    .tcard-archive-grid.posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tcard-archive-grid.posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   SINGLE TAROT CARD PAGE
   single-tarot-card.php — addresses michael-cards-pro#12
   ========================================== */

.single-tarot-card .tcard-featured-image {
    float: right;
    margin: 0 0 25px 30px;
    max-width: 180px;
}

.single-tarot-card .tcard-featured-image img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: block;
}

.single-tarot-card .entry-meta .tarot-card-taxonomies {
    font-size: 0.85em;
    color: #777;
    margin-top: 8px;
    margin-bottom: 4px;
}

.single-tarot-card .entry-meta .tarot-card-taxonomies .term a {
    color: #c41e3a;
    text-decoration: none;
}

.single-tarot-card .entry-meta .tarot-card-taxonomies .term a:hover {
    text-decoration: underline;
}

.single-tarot-card .post-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.single-tarot-card .nav-subtitle {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-bottom: 4px;
    font-weight: 400;
}

.single-tarot-card .nav-title {
    display: block;
    font-weight: 700;
    color: #c41e3a;
    font-size: 0.95em;
}

@media (max-width: 600px) {
    .single-tarot-card .tcard-featured-image {
        float: none;
        margin: 0 auto 20px;
        max-width: 140px;
        display: block;
        text-align: center;
    }
}

/* ==========================================
   TAROT CARD ARCHIVE (/tcards/)
   archive-tarot-card.php — fixes mtarot-wp#4
   ========================================== */

.tcard-archive-grid article.type-tarot-card,
.tcard-archive-grid article.tarot-card,
.tcard-archive-grid article {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.tcard-archive-grid article:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.tcard-archive-image {
    width: 100%;
    padding: 20px 20px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 180px;
}

.tcard-archive-image img {
    max-height: 220px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.tcard-archive-image .tcard-no-image {
    width: 120px;
    height: 200px;
    background: #f0e6ea;
    border-radius: 6px;
    border: 2px dashed #c41e3a;
}

.tcard-archive-grid .entry-header {
    padding: 15px 15px 8px;
}

.tcard-archive-grid .entry-title {
    font-size: 1.05em;
    margin-bottom: 6px;
}

.tcard-archive-grid .entry-summary {
    padding: 0 15px 18px;
    font-size: 0.88em;
    color: #555;
}

.tcard-archive-grid .read-more {
    display: inline-block;
    margin-top: 6px;
    color: #c41e3a;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85em;
}

.tcard-archive-grid .read-more:hover {
    color: #8b1528;
}

@media (max-width: 900px) {
    .tcard-archive-grid.posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tcard-archive-grid.posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   SINGLE TAROT CARD PAGE
   single-tarot-card.php — addresses michael-cards-pro#12
   ========================================== */

.single-tarot-card .tcard-featured-image {
    float: right;
    margin: 0 0 25px 30px;
    max-width: 180px;
}

.single-tarot-card .tcard-featured-image img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: block;
}

.single-tarot-card .entry-meta .tarot-card-taxonomies {
    font-size: 0.85em;
    color: #777;
    margin-top: 8px;
    margin-bottom: 4px;
}

.single-tarot-card .entry-meta .tarot-card-taxonomies .term a {
    color: #c41e3a;
    text-decoration: none;
}

.single-tarot-card .entry-meta .tarot-card-taxonomies .term a:hover {
    text-decoration: underline;
}

.single-tarot-card .post-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.single-tarot-card .nav-subtitle {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-bottom: 4px;
    font-weight: 400;
}

.single-tarot-card .nav-title {
    display: block;
    font-weight: 700;
    color: #c41e3a;
    font-size: 0.95em;
}

@media (max-width: 600px) {
    .single-tarot-card .tcard-featured-image {
        float: none;
        margin: 0 auto 20px;
        max-width: 140px;
        display: block;
        text-align: center;
    }
}
