/*
Theme Name: Michael Cards Pro
Theme URI: https://michaelcards.com
Description: Lightweight magazine theme with 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 { color: #6a0dad; }   /* Purple */
h2 { color: #00008b; }   /* Dark Blue */
h3 { color: #c41e3a; }   /* Red (unchanged) */
h4 { color: #1a6eb5; }   /* Medium Blue */
h5 { color: #444444; }   /* Dark Gray */
h6 { color: #1a5c2a; }   /* Dark Green */

.site-container {
    /* Issue #54: no max-width — header and nav must span full viewport.
       Content is constrained by .site-content (max-width: 1200px) instead. */
    width: 100%;
    margin: 0;
}

/* Header & branding styles → assets/css/header.css */

/* ==========================================
   NAVIGATION WITH PROPER BOXES & CHEVRONS
   ========================================== */
.main-navigation {
    background: #34495e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-top: 4px solid #c41e3a;    /* Issue #55: nav owns both borders equally */
    border-bottom: 4px solid #c41e3a;
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* Issue 1: suppress iOS gray tap flash */
    position: relative;
    z-index: 1000; /* flyout menus render above .site-header on iOS Safari (GPU compositing) */
}

.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: 20px 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;
    cursor: pointer;
    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 */
}

/* fix(#113): Label-only menu items (no URL) may render as <span> instead of <a>.
   <span> does not get cursor:pointer from the UA stylesheet; set it explicitly. */
.main-navigation .nav-inner > ul > li > span {
    cursor: pointer;
}

/* 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-visible,
.main-navigation .nav-inner > ul > li:hover > a {
    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);
}

/* JS-enhanced layer (arrow injection, state classes, query-cards panel) is in
   assets/css/nav-menu.css — loaded alongside assets/js/nav-menu.js. */

/* DROPDOWN SUBMENU - PROPER BOXES */
.main-navigation ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    /* fix(#77): content-driven width — never wider than viewport, never narrower than readable */
    width: max-content;
    min-width: 180px;
    max-width: min(380px, 92vw);
    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;
    position: relative; /* required so 3rd-level position:absolute flyouts position relative to this li */
}

.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;
}

/* Issue #64 / #77 — submenu positioning is now handled entirely by navigation.js
   via inline styles. No CSS flip classes needed. */

.main-navigation ul ul .menu-item-has-children > a::after {
    content: "▶";
    float: right;
    font-size: 10px;
    margin-left: 10px;
}

/* ==========================================
   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 20px 40px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

@media (max-width: 480px) {
    /* Outer grey gap is 8px each side; match white inner gap to it. */
    .content-area {
        padding: 12px 8px 16px 8px;
        border-radius: 8px;
    }
    .entry-content {
        padding: 0 0 16px;
    }
    .site-content {
        padding: 8px 8px;
    }
}

/* ==========================================
   MAGAZINE LAYOUT - Post Grid
   ========================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    margin-bottom: 40px;
}

/* Card of the Day Widget - Homepage Grid Integration */
.card-of-the-day-widget {
    background: #E3F2FD;
    border: 1px solid #90CAF9;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);

    /* Desktop (3 columns): Rightmost column, spans 2 rows */
    grid-column: 3;
    grid-row: 1 / span 2;

    /* Shrink to content height — don't stretch to fill grid row height */
    align-self: start;

    /* Flex column: title pins top, card fills remaining height */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-of-the-day-widget .widget-title {
    flex-shrink: 0;
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    color: #c41e3a;
    border-bottom: 2px solid #4A90E2;
    padding-bottom: 10px;
}

/* Card of the Day - Inner layout using CSS Grid
   Rows: [image+title link fills space] [polarity | description] */
.card-of-the-day-widget .tcard {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    grid-template-columns: auto 1fr;
    row-gap: 12px;
    column-gap: 8px;
}

/* Anchor wraps name + image: spans both columns, centred at intrinsic width.
   justify-self: center prevents the link from stretching to the full grid
   row width, so only the image (and card name above it) is clickable — not
   the empty margins to the left and right of the image on narrow screens. */
.card-of-the-day-widget .tcard > a {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    text-decoration: none;
}

.card-of-the-day-widget .tcard-name {
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #1e3c72;
    text-align: center;
    padding-bottom: 8px;
}

/* Image container: top-aligned, grows to fill remaining link height */
.card-of-the-day-widget .tcard-face-container {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

/* Image shrinks to fit without distortion */
.card-of-the-day-widget .tcard-face {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Polarity (+/-): left column of second row, sits beside description */
.card-of-the-day-widget .tcard-polarity {
    grid-column: 1;
    grid-row: 2;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4A90E2;
    align-self: start;
    padding-top: 2px;
}

/* Description: right column of second row */
.card-of-the-day-widget .tcard-description {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.99rem;
    line-height: 1.5;
    color: #555;
}

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: 0 25px 0; /* Issue #42: top/bottom padding collapsed to 0 — do not revert */
}

.entry-title {
    font-size: 1.4em;
    margin: 0 0 4px 0; /* Issue #42: top margin collapsed to 0 — do not revert */
    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 {
    padding: 0 25px 25px;
    line-height: 1.8;
    color: #1a1a1a;
}

/* entry-content has no horizontal padding — full-width tables (mmc-card-list)
   need the room. Horizontal inset is provided by .content-area padding. */
.entry-content {
    padding: 0 0 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;
}

/* Image captions — WordPress (.wp-caption) and HTML5 (figure/figcaption) */
.entry-content .wp-caption,
.entry-content figure {
    display: table;
    max-width: 100%;
    margin-bottom: 1em;
}

.entry-content .wp-caption.alignleft,
.entry-content figure.alignleft {
    float: left;
    margin: 0 1.5em 1em 0;
}

.entry-content .wp-caption.alignright,
.entry-content figure.alignright {
    float: right;
    margin: 0 0 1em 1.5em;
}

.entry-content .wp-caption.aligncenter,
.entry-content figure.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

.entry-content .wp-caption img,
.entry-content figure img {
    display: block;
    margin-bottom: 0;
}

.entry-content .wp-caption-text,
.entry-content figcaption {
    display: table-caption;
    caption-side: bottom;
    text-align: center;
    font-style: italic;
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
    padding-top: 0.4em;
    line-height: 1.4;
}

/* 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;
    }
    
    /* Tablet (2 columns): Rightmost column, spans 2 rows */
    .card-of-the-day-widget {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    
    .featured-widgets-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .main-navigation > ul > li > a {
        padding: 18px 25px;
        font-size: 14px;
    }
}

/* ==========================================
   PRIORITY QUEUE NAVIGATION — Issue #49
   Above mobile breakpoint (426px+): overflow items collapse
   into a "•••" dropdown rather than wrapping or clipping.
   ========================================== */

/* The overflow trigger <li> — same box style as regular top-level items */
.pq-overflow-item {
    border-right: 1px solid rgba(255,255,255,0.1);
    position: relative; /* Ensures .pq-overflow-menu is positioned relative to this button */
}
.pq-overflow-item > a.pq-overflow-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 18px;
    color: white;
    text-decoration: none;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 3px;
    background: #34495e;
    transition: background 0.3s ease;
    white-space: nowrap;
}
.pq-overflow-item:hover > a.pq-overflow-trigger,
.pq-overflow-item.pq-open  > a.pq-overflow-trigger {
    background: #c41e3a;
}

/* The overflow dropdown — reuses .sub-menu positioning + styling */
.pq-overflow-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 9999;
    flex-direction: column;
    border-top: 4px solid #c41e3a;
    border-radius: 0 0 8px 8px;
    display: none;
}
.pq-overflow-item.pq-open .pq-overflow-menu {
    display: flex !important;
    flex-direction: column;
}
/* .pq-open > li visibility is handled in assets/css/nav-menu.css */

/* Cloned items inside overflow menu */
.pq-overflow-menu > li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    position: relative;
}
.pq-overflow-menu > li:last-child {
    border-bottom: none;
}
.pq-overflow-menu > li > a {
    padding: 16px 24px;
    color: #1a1a1a;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
    display: block;
    background: white;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}
.pq-overflow-menu > li > a:hover {
    background: #f8f8f8;
    color: #c41e3a;
    border-left-color: #c41e3a;
    padding-left: 30px;
}

/* Overflow clone arrow injection is now handled by nav-menu.js (injectArrows on clones).
   See assets/css/nav-menu.css for JS-authority overflow rules.

/* Overflow clone submenu positioning is handled by navigation.js inline styles.
   CSS safe-default: fly LEFT (right:0/left:auto/top:0) so that even during the
   single requestAnimationFrame before JS corrects the position, the sub-menu is
   NOT at the default left:0 (which would extend off-screen to the right).
   Specificity (0,2,2) beats .main-navigation ul ul (0,1,2). */
.main-navigation .pq-overflow-menu > li > .sub-menu {
    right: 0;
    left: auto;
    top: 0;
}

/* High-specificity override to beat .main-navigation ul ul { left:0 !important } (specificity 0,1,2)
   injected by the submenu-flip script. (0,3,0) > (0,1,2) so !important beats !important here. */
.main-navigation .pq-overflow-item .pq-overflow-menu {
    right: 0 !important;
    left: auto !important;
}

@media (max-width: 425px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile (1 column): First item, full width */
    .card-of-the-day-widget {
        grid-column: 1;
        grid-row: auto;
        order: -1;
        height: auto;
    }

}

/* ==========================================
   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;
}



/* ==========================================
   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;
}

/* ASK CARDS MEGA-DROPDOWN PANEL — moved to assets/css/nav-menu.css */

/* ==========================================
   IN-CONTENT ASK FORM (Issue #57)
   mtarot_generate_layout_form() injects .mtarot-asknew into the post
   content of tarot-layout pages. The plugin uses a <table width="713">
   which breaks narrow viewports. Override to flex, add blue background.
   ========================================== */

.single-tarot-layout .entry-content .mtarot-asknew,
.single-tarot-layout .entry-content .mtarot-asklayout {
    background: #E3F2FD;
    border: 1px solid #90CAF9;
    border-radius: 8px;
    padding: 16px 20px;
    box-sizing: border-box;
    width: 100% !important;
    margin: 16px 0;
}

/* Flatten the table into flex rows */
.single-tarot-layout .entry-content .mtarot-asknew table,
.single-tarot-layout .entry-content .mtarot-asklayout table {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    border: none;
    box-sizing: border-box;
}

.single-tarot-layout .entry-content .mtarot-asknew tbody,
.single-tarot-layout .entry-content .mtarot-asklayout tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.single-tarot-layout .entry-content .mtarot-asknew tr,
.single-tarot-layout .entry-content .mtarot-asklayout tr {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.single-tarot-layout .entry-content .mtarot-asknew td,
.single-tarot-layout .entry-content .mtarot-asklayout td {
    display: block !important;
    width: auto !important;      /* override inline width="135" / "443" etc. */
}

/* Center the prompt heading */
.single-tarot-layout .entry-content .mtarot-question-prompt {
    text-align: center;
    width: 100%;
}

/* Question text input — full width */
.single-tarot-layout .entry-content .mtarot-question {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #90CAF9;
    border-radius: 4px;
    display: block !important;
}

/* Submit button — auto-width, does not stretch */
.single-tarot-layout .entry-content .mtarot-ask,
.single-tarot-layout .entry-content input[name="submit_ask"] {
    background: #c41e3a;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: background 0.15s ease;
}

.single-tarot-layout .entry-content .mtarot-ask:hover,
.single-tarot-layout .entry-content input[name="submit_ask"]:hover {
    background: #a3172f;
}

/* On mobile the label cell stacks above the input+button row */
@media (max-width: 640px) {
    .single-tarot-layout .entry-content .mtarot-asknew tr,
    .single-tarot-layout .entry-content .mtarot-asklayout tr {
        flex-direction: column;
        align-items: stretch;
    }

    .single-tarot-layout .entry-content .mtarot-ask,
    .single-tarot-layout .entry-content input[name="submit_ask"] {
        width: 100%;
    }
}
/* END IN-CONTENT ASK FORM */


   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 + mtarot plugin the_content filter
   Addresses: michael-cards-pro #12, #17, #18, #19
   Architecture: plugin injects .tcard-rendering via the_content filter;
   theme owns layout, polish, and mobile breakpoints.
   ========================================== */

/* ---- Outer wrapper injected by mtarot_prepend_card_widget() ---- */
.single-tarot-card .tcard-rendering {
    float: left;
    width: 192px;
    margin: 0 28px 24px 0;
    padding: 10px 10px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ---- Card face image ---- */
.single-tarot-card .tcard-face-container {
    text-align: center;
    margin-bottom: 6px;
}

.single-tarot-card .tcard-face {
    width: 100% !important;
    height: auto !important;
    border-radius: 6px;
    border: 1px solid #b0b0b0;
    background: #aaa;
    display: block;
    margin: 0 auto;
}

/* ---- Polarity badge (+/-) — visible when card is dealt in a slot ---- */
.single-tarot-card .tcard-polarity {
    display: inline;
    float: left;
    padding: 0 8px;
    margin: 0 5px 0 2px;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
}

.single-tarot-card .up-tcard-polarity   { background-color: #5cb85c; color: #fff; border-radius: 4px; }
.single-tarot-card .down-tcard-polarity { background-color: #c41e3a; color: #fff; border-radius: 4px; }

/* ---- Card label (name caption) — suppress since h1 already shows it ---- */
.single-tarot-card .tcard-label {
    display: none;
}

/* ---- Description text ---- */
.single-tarot-card .tcard-description {
    font-size: 0.82em;
    line-height: 1.5;
    color: #444;
    padding: 6px 4px 2px;
    min-height: 48px;
    word-break: break-word;
}

/* ---- Description navigator: +/- cycle buttons ---- */
.single-tarot-card #tcard-desc-controls {
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    padding: 4px 2px;
    font-size: 0.75em;
    color: #555;
    margin-top: 4px;
    overflow: hidden;
}

.single-tarot-card #tcard-desc-controls a {
    text-decoration: none;
    color: #555;
}

.single-tarot-card #tcard-desc-controls a:hover {
    color: #c41e3a;
}

.single-tarot-card #tcard-desc-control-buttons {
    float: right;
    width: auto;
}

.single-tarot-card #tcard-desc-control-buttons .up-tcard-polarity,
.single-tarot-card #tcard-desc-control-buttons .down-tcard-polarity {
    display: inline-block;
    float: none;
    margin: 0 1px;
    padding: 2px 7px;
    font-size: 13px;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
}

/* ---- Taxonomy links (overleaf, soul-evolution-stage, etc.) ---- */
.single-tarot-card .tarot-card-taxonomies {
    font-size: 0.75em;
    line-height: 1.4;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #eee;
    clear: both;
}

.single-tarot-card .tarot-card-taxonomies .taxonomy {
    display: block;
    margin-bottom: 3px;
}

.single-tarot-card .tarot-card-taxonomies .term {
    display: inline;
}

.single-tarot-card .tarot-card-taxonomies .term a {
    color: #c41e3a;
    text-decoration: none;
}

.single-tarot-card .tarot-card-taxonomies .term a:hover {
    text-decoration: underline;
}

/* ---- Content area clears the float after the widget ---- */
.single-tarot-card .entry-content {
    overflow: hidden;
}

/* ---- Prev/Next card navigation ---- */
/* ── Post navigation — all single posts ────────────────────────────────────── */
.single .post-navigation {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    clear: both;
}

.single .post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.single .post-navigation .nav-previous { flex: 1; }

.single .post-navigation .nav-next {
    flex: 1;
    text-align: right;
    margin-left: auto;
}

.single .post-navigation a {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
}

.single .post-navigation .nav-subtitle {
    font-size: 0.8em;
    color: #888;
    font-weight: 400;
}

.single .post-navigation .nav-title {
    font-weight: 700;
    color: #c41e3a;
    font-size: 0.95em;
}

.single-tarot-card .post-navigation,
.single-tarot-layout .post-navigation {
    margin-top: 0;
    padding-top: 16px;
    clear: both;
}

.single-tarot-card .post-navigation .nav-links,
.single-tarot-layout .post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.single-tarot-card .nav-previous {
    flex: 1;
}

.single-tarot-card .nav-next {
    flex: 1;
    text-align: right;
    margin-left: auto;
}

/* Same-line subtitle + title when width allows */
.single-tarot-card .post-navigation a,
.single-tarot-layout .post-navigation a {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    text-decoration: none;
}

.single-tarot-card .nav-subtitle,
.single-tarot-layout .nav-subtitle {
    font-size: 0.8em;
    color: #888;
    font-weight: 400;
    white-space: nowrap;
}

.single-tarot-card .nav-title,
.single-tarot-layout .nav-title {
    font-weight: 700;
    color: #c41e3a;
    font-size: 0.95em;
}

/* Top nav: border below, no top margin */
.single-tarot-card .card-nav--top,
.single-tarot-layout .card-nav--top {
    margin-bottom: 20px;
}

.single-tarot-card .card-nav--top .post-navigation,
.single-tarot-layout .card-nav--top .post-navigation {
    padding-top: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

/* Bottom nav: border above */
.single-tarot-card .card-nav--bottom,
.single-tarot-layout .card-nav--bottom {
    margin-top: 40px;
}

.single-tarot-card .card-nav--bottom .post-navigation,
.single-tarot-layout .card-nav--bottom .post-navigation {
    border-top: 1px solid #e0e0e0;
}

/* ---- Ask the Cards form section (single card + single layout) ---- */
.single-tarot-card article,
.single-tarot-layout article {
    margin-bottom: 0;
    padding-bottom: 0;
}

.single-tarot-card .ask-cards-divider,
.single-tarot-layout .ask-cards-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0 0 28px;
}

.single-tarot-card .ask-cards-section,
.single-tarot-layout .ask-cards-section {
    background: #E3F2FD;
    border: 1px solid #90CAF9;
    border-radius: 8px;
    padding: 28px 24px;
    text-align: center;
}

.single-tarot-card .ask-cards-heading,
.single-tarot-layout .ask-cards-heading {
    color: #c41e3a;
    font-size: 1.6em;
    margin: 0 0 20px;
}

/* Center all form fields inside the section */
.single-tarot-card .ask-cards-section form,
.single-tarot-layout .ask-cards-section form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
}

.single-tarot-card .ask-cards-section input,
.single-tarot-card .ask-cards-section select,
.single-tarot-card .ask-cards-section textarea,
.single-tarot-layout .ask-cards-section input,
.single-tarot-layout .ask-cards-section select,
.single-tarot-layout .ask-cards-section textarea {
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
}

.single-tarot-card .ask-cards-section button,
.single-tarot-card .ask-cards-section input[type="submit"],
.single-tarot-layout .ask-cards-section button,
.single-tarot-layout .ask-cards-section input[type="submit"] {
    width: auto;
    min-width: 160px;
}

/* Breadcrumbs: Home link at bottom of content area — all page/post templates */
.card-breadcrumbs {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
    font-size: 0.875em;
}

.card-breadcrumbs a {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
}

.card-breadcrumbs a:hover {
    text-decoration: underline;
    color: #c41e3a;
}

/* ---- Mobile: stack widget above content ---- */
@media (max-width: 640px) {
    .single-tarot-card .tcard-rendering {
        float: none;
        width: auto;
        max-width: 200px;
        margin: 0 auto 24px;
        display: block;
    }

    .single-tarot-card .tcard-label {
        display: block;
        text-align: center;
        font-size: 0.8em;
        font-weight: 600;
        color: #555;
        margin-top: 6px;
    }
}

/* ==========================================
   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;
    }
}

/* ==========================================
   ASK THE CARDS FORM ON CARD PAGES (Issue #43)
   Extended by Issue #60 to also cover single-tarot-layout pages.
   ========================================== */

/* ---- Ask the Cards form section (single card + single layout) ---- */
.single-tarot-card article,
.single-tarot-layout article {
    margin-bottom: 0;
    padding-bottom: 0;
}

.single-tarot-card .ask-cards-divider,
.single-tarot-layout .ask-cards-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0 0 28px;
}

.single-tarot-card .ask-cards-section,
.single-tarot-layout .ask-cards-section {
    background: #E3F2FD;
    border: 1px solid #90CAF9;
    border-radius: 8px;
    padding: 28px 24px;
    text-align: center;
}

.single-tarot-card .ask-cards-heading,
.single-tarot-layout .ask-cards-heading {
    color: #c41e3a;
    font-size: 1.6em;
    margin: 0 0 20px;
}

/* Center all form fields inside the section */
.single-tarot-card .ask-cards-section form,
.single-tarot-layout .ask-cards-section form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
}

.single-tarot-card .ask-cards-section input,
.single-tarot-card .ask-cards-section select,
.single-tarot-card .ask-cards-section textarea,
.single-tarot-layout .ask-cards-section input,
.single-tarot-layout .ask-cards-section select,
.single-tarot-layout .ask-cards-section textarea {
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
}

.single-tarot-card .ask-cards-section button,
.single-tarot-card .ask-cards-section input[type="submit"],
.single-tarot-layout .ask-cards-section button,
.single-tarot-layout .ask-cards-section input[type="submit"] {
    width: auto;
    min-width: 160px;
}

/* ── MMC Card List — responsive table (#143) ─────────────────────────── */

.mmc-card-list-wrap {
    width: 100%;
}

/* Base table — 4 columns: Number | Title | +Pole | -Pole (split, >550px)
   table-layout:auto lets the browser size the Number col to its content. */
table.mmc-card-list {
    width: 100% !important;
    table-layout: auto;
}

/* Number column: right-aligned, no wrap */
table.mmc-card-list th:nth-child(1),
table.mmc-card-list td:nth-child(1) {
    white-space: nowrap;
    text-align: right;
}

/* Number header label: "Number" above 550px, "#" at ≤550px */
.mmc-num-hdr-wide   { display: inline; }
.mmc-num-hdr-narrow { display: none; }

/* Allow pole-name cells to wrap without cutting mid-letter */
table.mmc-card-list td:nth-child(3),
table.mmc-card-list td:nth-child(4) {
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Header span visibility — split mode default (>550px) */
.mmc-pole-hdr-split   { display: inline; }
.mmc-pole-hdr-stacked { display: none; }

/* Tablet (≤768px): tighter padding */
@media (max-width: 768px) {
    table.mmc-card-list th,
    table.mmc-card-list td {
        padding: 7px 8px;
    }
}

/* Stacked mode (≤550px):
   Hides col 4 (−Pole) and appends its value as a ::after block inside col 3.
   Table fills the full content width. */
@media (max-width: 550px) {
    table.mmc-card-list {
        width: 100% !important;
        table-layout: fixed;
    }
    /* In fixed layout give title col explicit room; # col gets what's left */
    table.mmc-card-list th:nth-child(1),
    table.mmc-card-list td:nth-child(1) {
        width: 2em;
    }
    table.mmc-card-list th:nth-child(2),
    table.mmc-card-list td:nth-child(2) {
        width: 45%;
    }
    .mmc-num-hdr-wide   { display: none; }
    .mmc-num-hdr-narrow { display: inline; }
    table.mmc-card-list th,
    table.mmc-card-list td {
        padding: 6px 5px;
    }
    table.mmc-card-list th:nth-child(4),
    table.mmc-card-list td:nth-child(4) {
        display: none;
    }
    table.mmc-card-list td:nth-child(3)[data-neg]::after {
        display: block;
        content: "\2212\00A0" attr(data-neg);
        color: #555;
        font-weight: 400;
        margin-top: 3px;
    }
    .mmc-pole-hdr-split   { display: none; }
    .mmc-pole-hdr-stacked { display: inline; }
}

/* Smallest phones (≤480px): tighter cell padding */
@media (max-width: 480px) {
    table.mmc-card-list th,
    table.mmc-card-list td {
        padding: 5px 4px;
    }
}
/* ── End MMC Card List responsive ──────────────────────────────────────── */
