/**********************************/
/********** ruby CSS ***********/
/**********************************/
/* BODY BACKGROUND – soft sky blue reading environment */
body{
  background: linear-gradient(180deg,#eaf6ff,#dff0ff,#f4fbff);
  font-family:'Inter',sans-serif;
  color:#1c2a35;
  margin:0;
  padding:0;
  overflow-x:hidden;
}

/* NEWS CATEGORY TAG */
.news-tag{
  display:inline-block;
  background:#1e88e5;
  color:#ffffff;
  font-size:0.75rem;
  font-weight:600;
  letter-spacing:0.08em;
  padding:4px 10px;
  border-radius:20px;
  margin:0 auto 8px;
  text-transform:uppercase;
}

/* MAIN HEADLINE */
h1{
  max-width:780px;
  margin:0 auto 18px;
  font-size:2.3rem;
  font-weight:800;
  line-height:1.25;
  color:#0b3551;
  letter-spacing:-0.02em;
  padding-bottom:14px;
  border-bottom:3px solid #42a5f5;
  position:relative;
}

/* headline accent line */
h1::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-3px;
  width:120px;
  height:3px;
  background:#1e88e5;
}

/* ARTICLE CONTAINER */
.paragraph{
  max-width:780px;
  margin:20px auto 30px;
  background:#ffffff;
  color:#243746;
  padding:30px 35px;
  border-radius:24px;
  box-shadow:0 10px 30px rgba(0,0,0,0.08);
  border:1px solid #dbe9f4;
  line-height:1.75;
}

/* SUB HEADLINES */
.paragraph h2{
  color:#0f3d5c;
  font-weight:600;
  letter-spacing:-0.01em;
  margin-bottom:18px;
  border-left:6px solid #42a5f5;
  padding-left:16px;
}

/* PARAGRAPH TEXT */
.paragraph p{
  color:#334e68;
  font-size:1.06rem;
  margin-bottom:1rem;
  transition:all 0.25s ease;
  letter-spacing:0.2px;
}

/* READING FOCUS EFFECT */
.paragraph p:hover{
  color:#1a3c57;
  transform:translateX(3px);
}

/* PARAGRAPH SEPARATOR */
.paragraph p + p{
  border-top:1px dashed #e6eef5;
  padding-top:10px;
}

/* HIGHLIGHT WORDS */
span.highlight{
  background:#e3f2fd;
  color:#0d47a1;
  padding:3px 8px;
  border-radius:6px;
  font-weight:500;
}

/* IMAGE BLOCK */
.sn-img {
  max-width:780px;
  margin:0 auto;
}

.sn-img img {
  width:100%;
  height:auto;
  aspect-ratio:16/9;
  object-fit:cover;
  border-radius:18px;
  border:1px solid #cfe3f4;
  box-shadow:0 8px 20px rgba(0,0,0,0.12);
  display:block;
}

/* IMAGE CAPTION */
.img-alt{
  text-align:center;
  font-size:14.5px;
  color:#2f4a60;
  margin-top:10px;
  font-style:italic;
  background:#eef6fd;
  padding:8px 14px;
  border-radius:14px;
}

/* AD AREA */
.ad-container{
  display:flex;
  justify-content:center;
  margin:35px 0;
}

/* ACTION BAR */
.action-bar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin:25px auto 5px;
  padding:10px 15px;
  background:#ffffff;
  border-radius:50px;
  border:1px solid #d9e6f2;
  max-width:780px;
  box-shadow:0 6px 16px rgba(0,0,0,0.08);
}

/* ACTION BUTTONS */
.action-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  background:#f3f9ff;
  color:#1e3a4d;
  border:none;
  padding:10px 14px;
  border-radius:50px;
  font-size:0.85rem;
  font-weight:500;
  cursor:pointer;
  border:1px solid #cfe3f4;
  flex:1 0 auto;
  transition:0.2s;
}

.action-btn i{
  font-size:1.1rem;
}

/* BUTTON COLORS */
.action-btn.snapshot{background:#e3f2fd;border-color:#64b5f6;}
.action-btn.whatsapp{background:#e8f7ef;border-color:#25D366;}
.action-btn.copy{background:#edf6ff;border-color:#90caf9;}
.action-btn.listen{background:#eef6fd;border-color:#64b5f6;}

.action-btn:hover{
  transform:translateY(-2px);
  filter:brightness(1.05);
}

/* LISTEN STATUS */
.listening-indicator{
  max-width:780px;
  margin:5px auto 15px;
  font-size:0.9rem;
  color:#0f3d5c;
  background:#eaf4ff;
  padding:8px 20px;
  border-radius:40px;
  border:1px solid #cfe3f4;
  display:none;
  align-items:center;
  gap:10px;
}

.listening-indicator i{
  color:#2ecc71;
}

/* SNAPSHOT CANVAS */
#snapshot-canvas-container{
  position:absolute;
  left:-9999px;
  top:0;
}

canvas{
  width:540px;
  height:675px;
  display:block;
  background:#ffffff;
  box-shadow:0 20px 40px rgba(0,0,0,0.1);
}

/* Disable text selection and right click on entire page */
body{
  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
}

/* Allow selection for article text */
.paragraph p, .img-alt, h2{
  -webkit-user-select:text;
  -moz-user-select:text;
  -ms-user-select:text;
  user-select:text;
}

/* Responsive fixes */
@media (max-width:768px){

  .container{
    max-width:100%;
    padding:0 10px;
  }

  .paragraph{
    max-width:100% !important;
    width:100% !important;
    padding:15px !important;
    margin:10px 0 !important;
    border-radius:16px !important;
  }

  .sn-img{
    max-width:100% !important;
    width:100% !important;
  }

  .sn-img img{
    width:100% !important;
    height:auto !important;
    border-radius:14px !important;
  }

  .img-alt{
    font-size:13px !important;
    padding:6px 12px !important;
  }

  h1{
    font-size:1.8rem !important;
    max-width:100% !important;
    padding:0 5px !important;
  }

  .action-bar{
    max-width:100% !important;
    width:100% !important;
    padding:8px !important;
    gap:5px !important;
    border-radius:40px !important;
  }

  .action-btn{
    font-size:0.75rem !important;
    padding:8px 8px !important;
    flex:1 1 auto !important;
    min-width:60px !important;
  }

  .listening-indicator{
    max-width:100% !important;
    width:100% !important;
    font-size:0.8rem !important;
    padding:6px 15px !important;
  }

  .news-tag{
    font-size:0.65rem !important;
    padding:3px 8px !important;
  }
}

/* Desktop fixes */
@media (min-width:769px){
  .paragraph{max-width:780px !important;width:100% !important;margin:20px auto !important;}
  .sn-img{max-width:780px !important;width:100% !important;margin:0 auto !important;}
  .action-bar{max-width:780px !important;width:100% !important;margin:25px auto !important;}
}

/* Common fixes */
.paragraph p{
  word-wrap:break-word;
  overflow-wrap:break-word;
}

.action-bar{box-sizing:border-box;}

.action-btn{
  white-space:normal;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Snapshot loading indicator */
.snapshot-loading{
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  background:#0b3551;
  color:white;
  padding:15px 30px;
  border-radius:50px;
  font-family:'Inter',sans-serif;
  font-size:16px;
  z-index:9999;
  box-shadow:0 10px 30px rgba(0,0,0,0.2);
  border:1px solid #42a5f5;
  animation:pulse 1.5s infinite;
}

@keyframes pulse{
  0%{opacity:0.9;transform:translate(-50%,-50%) scale(1);}
  50%{opacity:1;transform:translate(-50%,-50%) scale(1.02);}
  100%{opacity:0.9;transform:translate(-50%,-50%) scale(1);}
}

/* Footer brand */
.footer-brand{
  font-family:'Inter',sans-serif;
  font-weight:800;
  font-size:26px;
  text-align:center;
  color:#0a4c8c;
  text-shadow:
  -2px -2px 0 #fff,
  2px -2px 0 #fff,
  -2px 2px 0 #fff,
  2px 2px 0 #fff;
  letter-spacing:-0.02em;
}