/* Reviewed legacy frontpage component styles; see source manifest. */

/* Scope + theme vars */
:root .pirm-front-modules,
.pirm-front-modules {
  --pirm-category-color: var(--pirmediat-front-color, #00589b);

  /* Card look */
  --pirm-card-bg: #ffffff;
  --pirm-card-shadow: -2px 2px 10px rgba(0,0,0,0.2);
  --pirm-card-radius: 3px;
  --pirm-card-pad: 15px;

  /* Titles (CONFIGURE HERE) */
  --pirm-title-large-size: clamp(18px, calc(1vw + 1.2rem), 28px);
  --pirm-title-large-lh: 1.2;
  --pirm-title-small-size: clamp(15px, calc(0.6rem + 0.9vw), 20px);
  --pirm-title-small-lh: 1.2;

  /* Category font per size (CONFIGURE HERE) */
  --pirm-cat-font-large: clamp(14px, calc(0.65rem + 0.9vw), 17px);
  --pirm-cat-font-small: clamp(12px, calc(0.6rem + 0.8vw), 16px);

  /* Excerpt + meta */
  --pirm-ote-size: 16px;
  --pirm-ote-lh: 1.35;
  --pirm-ote-color: #606060;

  --pirm-meta-font-size: 16px;
  --pirm-meta-lh: 1.3;
  --pirm-meta-color: #909090;

  --pirm-grid-gap: 16px;

  /* Dark (mainos) */
  --pirm-dark-bg: #1B4965;
  --pirm-dark-text: #ffffff;

  /* Mourning */
  --pirm-mourning-bg: #0f1115;
  --pirm-mourning-text: #ffffff;

  --pirm-mainos-pill: #B9314F;
  --pirm-divider-color: #e6e6e6;
}

/* Card shell */
.pirm-front-modules .pirm-card,
.pirm-front-modules.pirm-card {
  background-color: var(--pirm-card-bg);
  border-radius: var(--pirm-card-radius);
  box-shadow: var(--pirm-card-shadow);
  padding: var(--pirm-card-pad);
  margin-bottom: 20px;
  position: relative; /* allow absolute badge inside */
}

/* Dark (mainos) */
.pirm-front-modules .pirm-card--dark,
.pirm-front-modules.pirm-card--dark {
  background-color: var(--pirm-dark-bg);
  color: var(--pirm-dark-text);
}
.pirm-front-modules .pirm-card--dark a,
.pirm-front-modules.pirm-card--dark a { color: var(--pirm-dark-text); }

/* Mourning */
.pirm-front-modules .pirm-card--mourning,
.pirm-front-modules.pirm-card--mourning {
  background-color: var(--pirm-mourning-bg);
  color: var(--pirm-mourning-text);
}
.pirm-front-modules .pirm-card--mourning a { color: var(--pirm-mourning-text); text-decoration: none; }
/* keep category pill colored on mourning */
.pirm-front-modules .pirm-card--mourning .pirm-cat-pill { color: var(--pirm-category-color); }
/* paywall label white on mourning */
.pirm-front-modules .pirm-card--mourning .pirm-meta .maksu,
.pirm-front-modules .pirm-card--mourning .pirm-meta .maksu .maksu__text,
.pirm-front-modules .pirm-card--mourning .pirm-meta .maksu i { color:#fff !important; fill:#fff !important; }

/* LIVE badge (flashing red) */
.pirm-front-modules .pirm-live-badge {
  position: absolute;
  top: 25px;
  right: 25px;
  background: linear-gradient(90deg,#ff0000,#ff0000);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 6;
  transform: translateZ(0);
  animation: pirm-live-blink 2s linear infinite;
}
/* smaller badge for small cards (slightly smaller) */
.pirm-front-modules .pirm-live-badge.small {
  padding: 4px 8px;
  font-size: 11px;
  top: 0px !important;
  right: 20px;
  border-radius: 5px;
  width: fit-content;
}

/* blinking keyframes */
@keyframes pirm-live-blink {
  0%   { opacity: 1; box-shadow: 0 0 10px rgba(255,40,40,0.6); }
  30%  { opacity: 0.25; box-shadow: 0 0 2px rgba(255,40,40,0.15); }
  60%  { opacity: 1; box-shadow: 0 0 12px rgba(255,40,40,0.75); }
  100% { opacity: 1; box-shadow: 0 0 10px rgba(255,40,40,0.6); }
}



/* JUURI NYT badge (responsive) */
.pirm-front-modules .pirm-juuri-nyt-badge,
.pirm-front-modules .pirm-juuri-nyt-badge-juttusarja{
  position: absolute;
  background: #1C3563;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;

  /* Responsive sizing */
  font-size: clamp(12px, 1.2vw + 8px, 20px);
  padding: clamp(6px, 0.6vw + 4px, 10px) clamp(8px, 0.8vw + 5px, 12px);
  border-radius: clamp(3px, 0.3vw + 2px, 6px);

  line-height: 1;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 6;
  transform: translateZ(0);
  white-space: nowrap;
}

/* Position differences only */
.pirm-juuri-nyt-badge{
  top: 20px;
  right: 20px;
}

.pirm-juuri-nyt-badge-juttusarja{
  top: 5px;
  right: 5px;
}

/* smaller badge for small cards */
.pirm-front-modules .pirm-juuri-nyt-badge.small {
  padding: 4px 6px;
  font-size: 11px;
  top: 0px !important;
  left: 10px;
  border-radius: 2px;
  width: fit-content;
}



/* Two-up grid for Pääuutinen subposts — always 50/50 */
.pirm-front-modules .pirm-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:var(--pirm-grid-gap); }
.pirm-front-modules.paauutiset-block .pirm-grid-2 { grid-template-columns:1fr 1fr !important; }
@media (max-width:720px){
  .pirm-front-modules.paauutiset-block .pirm-grid-2 { grid-template-columns:1fr 1fr !important; }
}

/* Category pill (base) */
.pirm-front-modules .pirm-cat-pill {
  font-weight: bold;
  text-transform: uppercase;
  line-height: 1;
  width: fit-content;
  margin-top: 6px;
  color: var(--pirm-category-color);
}
.pirm-front-modules .pirm-cat-pill a { color: inherit; text-decoration: none; }

/* Category size per variant */
.pirm-front-modules .pirm-cat-pill--large { font-size: var(--pirm-cat-font-large); }
.pirm-front-modules .pirm-cat-pill--small { font-size: var(--pirm-cat-font-small); }

/* Mainos pill overrides */
.pirm-front-modules .pirm-cat-pill--mainos {
  color: var(--pirm-dark-text);
  background-color: var(--pirm-mainos-pill);
  padding: 2px 8px;
  border-radius: 2px;
  line-height: 1.3;
  margin: 8px 0;
}

/* Titles */
.pirm-front-modules .pirm-title-large {
  font-size: var(--pirm-title-large-size);
  line-height: var(--pirm-title-large-lh);
  margin: 8px 0 6px 0;
  font-weight: 800;
}
.pirm-front-modules .pirm-title-small {
  font-size: var(--pirm-title-small-size);
  line-height: var(--pirm-title-small-lh);
  margin: 6px 0 4px 0;
  font-weight: 800;
}
.pirm-front-modules .pirm-title-large a,
.pirm-front-modules .pirm-title-small a { 
	text-decoration:none; 
	color:inherit; 
	hyphens: auto;
    overflow-wrap: break-word;
    word-break: normal;
}
/* Excerpt + meta */
.pirm-front-modules .pirm-ote {
  color: var(--pirm-ote-color);
  font-size: var(--pirm-ote-size);
  line-height: var(--pirm-ote-lh);
}
.pirm-front-modules .pirm-meta {
  font-size: var(--pirm-meta-font-size);
  line-height: var(--pirm-meta-lh);
  color: var(--pirm-meta-color);
  display:flex; flex-direction:column; gap:2px;
}
.pirm-front-modules .pirm-meta .maksu:empty { display:none; }

/* Divider (legacy) */
.pirm-front-modules.paauutiset-block > .pirm-front-modules:first-child {
  border-bottom: 1px solid var(--pirm-divider-color);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

/* Paywall label (default = category color) */
.pirm-front-modules .pirm-meta .maksu { color: var(--pirm-category-color); }

.pirm-site-mainosautomaatti .pirm-front-modules .pirm-title-large a,.pirm-site-mainosautomaatti .pirm-front-modules .pirm-title-small a{hyphens:manual;overflow-wrap:normal;}
.pirm-front-modules .maksu svg{width:1em;height:1em;vertical-align:-.12em;flex:none;}
@media(prefers-reduced-motion:reduce){.pirm-front-modules .pirm-live-badge{animation:none!important;}}
