/* =========================================================
   OYJ Enhanced Cards — Editorial Skin (Hero + Grid + Lightbox)
   ========================================================= */

:root{
  --oyj-max: 1180px;
  --oyj-gutter: 1.25rem;

  --oyj-ink: rgba(255,255,255,.94);
  --oyj-ink-dim: rgba(255,255,255,.74);
  --oyj-ink-faint: rgba(255,255,255,.60);

  --oyj-shadow: 0 26px 90px rgba(0,0,0,.40);
  --oyj-radius: 22px;
}

.oyj-cards-root{
  max-width: var(--oyj-max);
  margin: 3.25rem auto;
  padding: 0 var(--oyj-gutter);
}

/* Section rhythm */
.oyj-section{ margin-top: 3.75rem; }
.oyj-section:first-child{ margin-top: 0; }
.oyj-section h2{
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
  color: rgba(25,25,35,.88);
}

/* If your theme forces white text, keep headings readable */
.oyj-section h2:where(*){ color: inherit; }

/* Grid */
.oyj-grid{
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(12, 1fr);
}

/* Card base */
.oyj-card{
  grid-column: span 4;
  position: relative;
  border-radius: var(--oyj-radius);
  overflow: hidden;
  cursor: pointer;
  min-height: 360px;
  background: #0f0f14;
  box-shadow: 0 16px 50px rgba(0,0,0,.18);
  transform: translateZ(0);
}

.oyj-card:hover{
  box-shadow: 0 22px 70px rgba(0,0,0,.24);
}

.oyj-card-bg{
  position:absolute;
  inset:0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.02) contrast(1.02);
}

/* Editorial overlay: soft purple glow + bottom readability */
.oyj-card-overlay{
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 520px at 14% 18%, rgba(131,0,233,.22), rgba(0,0,0,0) 58%),
    radial-gradient(820px 520px at 86% 20%, rgba(255,255,255,.09), rgba(0,0,0,0) 62%),
    linear-gradient(to bottom, rgba(0,0,0,.10) 0%, rgba(0,0,0,.52) 56%, rgba(0,0,0,.84) 100%);
}

/* Content */
.oyj-card-content{
  position:absolute;
  inset: 0;
  display:flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.35rem 1.35rem 1.4rem;
  color: var(--oyj-ink);
}

.oyj-card-content h3{
  margin: 0 0 .45rem;
  font-size: 1.18rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.oyj-card-content time{
  font-size: .84rem;
  color: var(--oyj-ink-dim);
}

.oyj-card-content p{
  margin: .7rem 0 0;
  font-size: .97rem;
  line-height: 1.55;
  color: var(--oyj-ink-faint);
  max-width: 58ch;
}

/* HERO (Latest) */
.oyj-card.oyj-latest{
  grid-column: 1 / -1;
  min-height: 520px;
}

.oyj-card.oyj-latest .oyj-card-content{
  padding: 2.0rem 2.0rem 2.1rem;
}

.oyj-card.oyj-latest .oyj-card-content h3{
  font-size: 2.05rem;
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 22ch;
}

.oyj-card.oyj-latest .oyj-card-content p{
  font-size: 1.06rem;
  line-height: 1.65;
  max-width: 62ch;
  color: rgba(255,255,255,.82);
}

/* Favorites & Archive tweaks */
.oyj-card.oyj-favorite{ min-height: 380px; }
.oyj-card.oyj-archive{ min-height: 330px; }

/* Responsive */
@media (max-width: 980px){
  .oyj-card{ grid-column: span 6; }
  .oyj-card.oyj-latest{ grid-column: 1 / -1; }
}

@media (max-width: 620px){
  .oyj-grid{ gap: 1rem; }
  .oyj-card{ grid-column: 1 / -1; min-height: 340px; }
  .oyj-card.oyj-latest{ min-height: 460px; }
  .oyj-card.oyj-latest .oyj-card-content h3{ font-size: 1.75rem; }
}

/* =========================
   Lightbox Modal
   ========================= */

.oyj-modal{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.oyj-modal.open{ display:block; }

.oyj-modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(10,10,14,0.72);
  backdrop-filter: blur(7px);
}

.oyj-modal-card{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding: 1.25rem;
}

.oyj-modal-card > .oyj-modal-bg,
.oyj-modal-card > .oyj-modal-overlay,
.oyj-modal-card > .oyj-modal-content{
  width: min(560px, 92vw);
  height: min(800px, 86vh);
  border-radius: 26px;
}

.oyj-modal-bg{
  position:absolute;
  background-size: cover;
  background-position: center;
  box-shadow: var(--oyj-shadow);
}

.oyj-modal-overlay{
  position:absolute;
  background:
    radial-gradient(920px 560px at 14% 18%, rgba(131,0,233,.24), rgba(0,0,0,0) 58%),
    linear-gradient(to bottom, rgba(0,0,0,.10) 0%, rgba(0,0,0,.55) 56%, rgba(0,0,0,.88) 100%);
}

.oyj-modal-content{
  position:absolute;
  display:flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.8rem 1.65rem 1.75rem;
  color: var(--oyj-ink);
}

.oyj-modal-content time{
  font-size: .9rem;
  color: var(--oyj-ink-dim);
}

.oyj-modal-content h3{
  margin: .6rem 0 .75rem;
  font-size: 1.85rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.oyj-modal-content p{
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.68;
  color: rgba(255,255,255,.84);
}

.oyj-read{
  display:inline-flex;
  margin-top: 1.1rem;
  align-self:flex-start;
  padding: .75rem 1.1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.96);
  font-size: .92rem;
  letter-spacing: .03em;
  text-decoration:none !important;
}

.oyj-read:hover{
  background: rgba(255,255,255,.20);
  border-color: rgba(255,255,255,.26);
}

.oyj-close{
  position:absolute;
  top: 1.05rem;
  right: 1.05rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.95);
  font-size: 28px;
  line-height: 1;
  cursor:pointer;
  z-index: 1;
}

/* =========================================================
   OYJ Lightbox (Full Post Modal)
   ========================================================= */

html.oyj-lb-open,
html.oyj-lb-open body {
  overflow: hidden;
}

.oyj-lb {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}

.oyj-lb[aria-hidden="false"] {
  display: block;
}

.oyj-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
}

.oyj-lb-panel {
  position: relative;
  width: min(880px, calc(100vw - 2rem));
  height: min(92vh, 980px);
  margin: 4vh auto;
  background: #0f0f14;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0,0,0,0.55);
}

.oyj-lb-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 26px;
  line-height: 44px;
  cursor: pointer;
}

.oyj-lb-hero {
  position: relative;
  height: 42%;
  min-height: 260px;
}

.oyj-lb-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.02);
}

.oyj-lb-hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15,15,20,0.10) 0%, rgba(15,15,20,0.82) 62%, rgba(15,15,20,0.98) 100%),
    radial-gradient(1200px 600px at 20% 10%, rgba(180,120,255,0.20), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(120,220,255,0.14), transparent 60%);
}

.oyj-lb-hero-inner {
  position: absolute;
  inset: 0;
  padding: 2rem 2rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.6rem;
  color: #fff;
}

.oyj-lb-kicker {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.oyj-lb-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 2.1rem);
  line-height: 1.15;
}

.oyj-lb-meta {
  font-size: 0.95rem;
  opacity: 0.88;
}

.oyj-lb-actions {
  margin-top: 0.25rem;
}

.oyj-lb-read {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  text-decoration: none;
}

.oyj-lb-body {
  height: 58%;
  overflow: auto;
  padding: 1.25rem 1.5rem 1.5rem 1.5rem;
  background:
    radial-gradient(1000px 500px at 20% 0%, rgba(180,120,255,0.10), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(120,220,255,0.08), transparent 60%),
    #0f0f14;
  color: rgba(255,255,255,0.92);
}

.oyj-lb-loading {
  opacity: 0.85;
  padding: 0.75rem 0;
}

.oyj-lb-error {
  padding: 0.75rem 0;
  color: #ffd2d2;
}

.oyj-lb-content {
  font-size: 1.02rem;
  line-height: 1.65;
}

.oyj-lb-content p {
  margin: 0 0 1rem 0;
}

.oyj-lb-content a {
  color: rgba(170,210,255,0.95);
  text-decoration: underline;
}

.oyj-lb-content h1,
.oyj-lb-content h2,
.oyj-lb-content h3 {
  margin: 1.2rem 0 0.65rem 0;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .oyj-lb-panel {
    width: calc(100vw - 1.25rem);
    height: 92vh;
    margin: 4vh auto;
    border-radius: 16px;
  }
  .oyj-lb-hero-inner {
    padding: 1.4rem 1.2rem 1.1rem 1.2rem;
  }
  .oyj-lb-body {
    padding: 1rem 1.1rem 1.25rem 1.1rem;
  }
}
