/* ============================================================
   Single OPTCG Cards – Full "Box" Layout, Centered at All Sizes
   ============================================================ */

/* ─── 0) CENTER THE WHOLE AREA ON THE PAGE ───────────────────────────────────────────── */
.content-container {
  display: flex;
  justify-content: center;  /* center .main-content horizontally */
  padding: 20px;            /* optional space around the content */
}

.main-content {
  width: 100%;
  max-width: 1200px;        /* caps the content area so it never exceeds 1200px */
}

/* Wrap each individual card‐container so that we can center it easily */
.card-post-container {
  display: flex;
  flex-direction: column;
  align-items: center;     /* any .card-container child sits in the horizontal middle */
  width: 100%;
}

/* ─── 1) THE CARD "BOX" ITSELF ─────────────────────────────────────────────────────── */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
align-items: stretch !important;
  /* Use width:100% so it fills .main-content up to its max-width */
  width: 100%;
  max-width: 1200px;
  margin: 20px auto 40px;         /* vertical 20px, horizontal auto = centered */
  background-color: transparent; /* or remove if not needed */
}

/* ─── 2) LEFT: CARD IMAGE ─────────────────────────────────────────────────────────── */
.display-card-image {
  flex: 1.2;
  max-width: 100%;
    position: relative; /* establish positioning context */
  overflow: visible;
}

.display-card-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.display-card-image img:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 20px 4px rgba(75, 163, 242, 0.7),
    0 8px 16px rgba(0, 0, 0, 0.3);
}

/* ─── 3) RIGHT: ENTIRE DETAILS PANEL ──────────────────────────────────────────────── */
.card-details-panel {
  flex: 1.8;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  background-color: #1a1a1a;
  border-radius: 15px;
  overflow: hidden;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 3px rgba(255, 255, 255, 0.05);
}

/* ─── 4) HEADER BAR (ID + TYPE) ──────────────────────────────────────────────────── */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  color: #ffffff;
}

.card-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-header .header-card-id {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.card-header .header-card-type {
  font-size: 1.4rem;
  font-weight: 800;
}

/* ─── 5) GRID OF DETAIL FIELDS ───────────────────────────────────────────────────── */
.card-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.6;
}

/* Rows that hold 2-3 fields side by side */
.detail-row {
  display: flex;
  gap: 12px;
}
.detail-row > .detail-field {
  flex: 1;
  min-width: 0;
}

.detail-field {
  background-color: #2a2a2a;
  border-radius: 6px;
  padding: 10px 14px;
}
.detail-field strong {
  display: inline-block;
  color: #ffffff;
  font-weight: 700;
  margin-right: 6px;
}

/* Make "Effect" span two columns */
.effect-field {
  grid-column: span 2;
}

/* Equip effect stays in one column so equip might sits beside it */
.effect-field.equip-effect-cell {
  grid-column: span 1;
}



.card-details .detail-field.effect-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 14px;
  white-space: pre-wrap !important;
  word-break: break-word;
}
.detail-field.effect-field > strong {
  flex-shrink: 0;
}
.detail-field.effect-field .effect-text {
  white-space: pre-wrap;     /* honor newlines */
  word-break: break-word;    /* wrap very long words if needed */
  flex: 1;                   /* take up the rest of the row */
}

/* 2) Make sure your icons stay inline with text */
.card-details .detail-field.effect-field img.card-effect-icon {
  display: inline-block;
  vertical-align: middle;
  height: 1.4em;   /* scales with the effect text */
  width: auto;     /* preserve aspect ratio (badges may be wide) */
}

.card-details .detail-field.flavor-field {
  grid-column: 1 / -1;
}


/* ─── ICON STYLING IN THE DETAILS GRID ─────────────────────────────────────── */
.card-details .detail-field {
  display: flex;
  align-items: center;
}

/* generic icon inside any detail field */
.card-details .detail-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* specific tweaks if you'd like slightly larger type/color icons */
.card-details .type-icon,
.card-details .color-icon,
.card-details .might-icon {
  width: 24px;
  height: 24px;
}

/* ─── HOVER STATE FOR THE WHOLE PANEL (optional) ─────────────────────────── */
.card-details-panel:hover {
  box-shadow: 0 8px 24px rgba(0, 159, 212, 0.2),
              inset 0 1px 3px rgba(255, 255, 255, 0.05);
}

/* ─── BUTTON-LIKE LINKS IN THE DETAILS GRID (e.g. card-link) ─────────────── */
.card-details-panel a.card-detail-link {
  display: inline-block;
  margin-top: auto;
  color: var(--ps-gold-2);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--ps-gold-2);
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}
.card-details-panel a.card-detail-link:hover {
  background-color: var(--ps-gold-2);
  color: #111;
}
.card-details .color-icon {
  width: 28px;
  height: 28px;
}

.card-details .power-icon {
  width: 28px;
  height: 28px;
  margin-right: 4px;
}
.card-details .color-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─── Alt Art CSS ──────────────────────────────────────────────────── */
/* under .display-card-image */
.alternate-art-container {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.alternate-art-container .alternate-art {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.alternate-art-container .alternate-art:hover {
  transform: scale(1.05);
}

/* ─── RELATED DECKS SECTION ──────────────────────────────────────────────────── */

.related-decks-container {
  width: 100%;
  max-width: 1200px;      /* match your page max */
  margin: 10px auto 80px;
  padding: 0 20px;         /* match your page padding */
  box-sizing: border-box;
}

.related-decks-header {
  border-radius: 12px 12px 0 0;   /* match your other card‐header rounding */
  padding: 12px 20px;            /* adjust for your desired spacing */
  color: #fff;                   /* ensure text is readable */
  margin-bottom: 20px;           /* space before the grid */
}

/* Make sure the <h4> itself doesn't inherit extra flex styles: */
.related-decks-header h4 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Use the same grid layout as all-decks but specifically for related decks */
.related-decks-container .all-decks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 0; /* Remove margin since we have it on the container */
}

/* Ensure deck boxes in related section use the same styling */
.related-decks-container .all-deck-box-wrapper {
  /* All styles inherited from the main all-deck-box-wrapper styles */
}

/* ─── MOBILE RESPONSIVE FOR RELATED DECKS ───────────────────────────────────── */
@media screen and (min-width: 1200px) {
  .related-decks-container .all-decks {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .related-decks-container .all-decks {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .related-decks-container {
    margin: 20px auto 40px;
    padding: 0 10px;
  }
  
  .related-decks-header {
    padding: 10px 16px;
  }
  
  .related-decks-header h4 {
    font-size: 1.1rem;
  }
}

/* ─── RESPONSIVE ADJUSTMENTS ──────────────────────────────────────────────────── */

/* Smaller tablets / large phones (≤ 768px): stack image above details */
@media (max-width: 768px) {
  .card-container {
	  display: flex;
    flex-direction: column;
    max-width: 800px;         /* narrower cap on smaller screens */
    margin: 20px auto;
  }
    .display-card-image {
     display: contents;
    position: relative;
  }

  /* 1) First: the main card image (your <img>) */
  .display-card-image > img:first-child {
    order: 1;
    width: 100%;      /* ensure it still fills container */
    max-width: 100%;
  }

  /* 2) Then: your details panel */
  .card-details-panel {
    order: 2;
  }

/* ─── Alt Art CSS ──────────────────────────────────────────────────── */
/* under .display-card-image */
.alternate-art-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  order: 3;
  width: 100%;
}

.alternate-art-container .alternate-art {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.alternate-art-container .alternate-art:hover {
  transform: scale(1.05);
}

  .display-card-image,
  .card-details-panel {
    flex: 1;
    max-width: 100%;
  }
  .card-details {
    gap: 10px;
    padding: 16px 20px;
  }
  .detail-field {
    padding: 8px 12px;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .card-header .header-card-id {
    font-size: 1.2rem;
  }
  .card-header .header-card-type {
    font-size: 1.3rem;
  }
}

/* Phone (≤ 480px): turn grid into a single column for detail fields */
@media (max-width: 480px) {
  .card-container {
    max-width: 100%;           /* allow full width on very small phones */
  }
  .card-details {
    padding: 12px 16px;
  }
  .detail-row {
    flex-direction: column;
    gap: 10px;
  }
  .detail-field {
    padding: 6px 10px;
    font-size: 0.95rem;
  }
  .effect-field {
    grid-column: span 1;       /* single‐column on very narrow screens */
  }
  .card-header {
    padding: 12px 16px;
  }
  .card-header .header-card-id {
    font-size: 1.1rem;
  }
  .card-header .header-card-type {
    font-size: 1.2rem;
  }
}
/* ── Effect keyword pills ─────────────────────────────────────────────────
   [Bracketed] keywords in the ACF effect field render as these. Class names
   are generated from the keyword text itself, identically by
   process_effect_html() (PHP, single-cards.php) and effectKeywordSlug()
   (JS, deck-builder.js) — those two MUST agree or a keyword styles in one
   view and not the other.

   Red is the DEFAULT, not a universal rule. These keywords are CONFIRMED red
   from printed cards — On Summon (N-022), Support Activated (N-016),
   During Opponents Attack (N-007), During Your Opponent's Attack (N-004),
   When Attacking (N-019). Other keywords can be other colours; they just have
   not been seen on a card yet. When one turns up, give it its own
   --{slug} rule below and it overrides the default.

   The red holds on both the dark effect box (Sakura/Hinata/Shisui) and the
   light one (Jugo), so the pill carries its own contrast and does not depend
   on the surrounding background.

   Known exception so far: "Summon Requirements" (N-022 Manda) is a light pill
   with dark text, an outline, and a chevron off its trailing edge.

   Not styled here: the orange SUPPORT header bar. That is a separate band
   above the effect text, not an inline [Bracketed] keyword.

   Anything without its own rule falls back to the red, so keywords Bandai
   has not published yet still render as pills rather than raw [Brackets]. */
.card-effect-keyword {
  display: inline-block;
  background: #e0322a;
  color: #fff;
  font-weight: 700;
  font-size: 0.86em;
  line-height: 1.35;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  vertical-align: baseline;
}

/* Per-keyword colours, read off the printed cards. Red (above) is only the
   DEFAULT — anything without a rule here falls back to it. Adding a colour is
   one rule; yellow needs dark text to stay legible, the rest keep white. */
.card-effect-keyword--rush {
  background: #3f97e0;                 /* blue — lighter */
  color: #08243d;                      /* dark text: white on this blue is only
                                          3.1:1, which fails on small bold type */
}
.card-effect-keyword--on-summon {
  background: #e07b26;                 /* orange */
}
.card-effect-keyword--once-per-turn {
  background: #f7db55;                 /* yellow — lighter */
  color: #1a1a1a;
}

.card-effect-keyword--recovery {
  background: #000;                    /* black fill, orange text */
  color: #e8862c;
}

/* "Summon Requirements" (N-022 Manda) — WHITE text on a BLACK fill, with the
   chevron the card shows off its right edge. The hairline outline is not on
   the print: on the card this pill sits on a light effect box, but the site
   renders effect text on #2a2a2a, so black-on-dark-grey needs a little help
   to read as a pill. Delete that one line to match the print exactly.
   position:relative + an ::after triangle keeps it a single inline box so it
   wraps and aligns like any other pill; margin-right leaves room for the
   chevron outside the fill. */
.card-effect-keyword--summon-requirements {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  position: relative;
  margin-right: 7px;
}
.card-effect-keyword--summon-requirements::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #000;
}
