/*
Theme Name: NRM2028
Theme URI: https://nrm2028.org
Author: NRM2028 Organising Committee
Description: Custom block theme for the XVI International Symposium on Neuroreceptor Mapping — NRM2028, Padova, Italy. Fully responsive, no external dependencies, locally hosted fonts.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nrm2028
Tags: conference, one-column, custom-colors, custom-logo, block-patterns, full-site-editing
*/

/* ==========================================================================
   NRM2028 — layered styles on top of theme.json
   ========================================================================== */

:root {
  --nrm-navy: #14243b;
  --nrm-ink: #0f1b2d;
  --nrm-red: #9b0014;
  --nrm-red-dark: #73000f;
  --nrm-paper: #faf8f5;
  --nrm-tint: #f4ece7;
  --nrm-gold: #d9a441;
  --nrm-radius: 18px;
  --nrm-shadow: 0 10px 30px -12px rgba(15, 27, 45, 0.25);
}

html {
  scroll-behavior: smooth;
}

/* ---- Sticky translucent header ---- */
.nrm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(250, 248, 245, 0.82) !important;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
}

.nrm-header .wp-block-site-title a {
  font-family: var(--wp--preset--font-family--sora);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nrm-header .wp-block-site-title a:hover {
  color: var(--nrm-red);
}

/* ---- Hero ---- */
.nrm-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(155, 0, 20, 0.55), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(217, 164, 65, 0.25), transparent 55%),
    linear-gradient(150deg, #14243b 0%, #1d1a33 55%, #3a1024 100%);
}

.nrm-hero::after {
  /* subtle dot grid, evokes PET voxels */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1.5px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, transparent, black 30%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, transparent 95%);
  pointer-events: none;
}

.nrm-hero > * {
  position: relative;
  z-index: 1;
}

.nrm-hero-badge {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.35em 1.1em;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.08);
}

/* ---- Countdown ---- */
.nrm-countdown {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 2vw, 1rem);
  justify-content: center;
}

.nrm-countdown .nrm-cd-cell {
  min-width: clamp(4.2rem, 12vw, 6.5rem);
  padding: clamp(0.6rem, 1.5vw, 1rem) 0.5rem;
  border-radius: var(--nrm-radius);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  text-align: center;
  color: #fff;
}

.nrm-countdown .nrm-cd-num {
  display: block;
  font-family: var(--wp--preset--font-family--sora);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.nrm-countdown .nrm-cd-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 0.2em;
}

/* ---- Coming soon (pre-release, full screen) ---- */
body.page-template-coming-soon {
  margin: 0;
}

.nrm-soon {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 3rem) 1.5rem !important;
  background: var(--nrm-navy);
}

.nrm-soon > *:not(.nrm-hero-bg) {
  position: relative;
  z-index: 1;
}

/* ---- Hero background slideshow ---- */
.nrm-hero > .nrm-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* the hero group is a constrained layout: WP caps direct children at
     900px with margin auto !important — undo it for the background layer */
  max-width: none;
  margin: 0 !important;
}

.nrm-hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.nrm-hero-bg img.is-active {
  opacity: 1;
}

.nrm-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(155, 0, 20, 0.40), transparent 60%),
    linear-gradient(150deg, rgba(20, 36, 59, 0.82) 0%, rgba(29, 26, 51, 0.60) 55%, rgba(58, 16, 36, 0.78) 100%);
}

.nrm-car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 27, 45, 0.45);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background-color 0.15s ease;
}

.nrm-car-btn:hover {
  background: rgba(155, 0, 20, 0.8);
}

.nrm-car-btn[data-dir="prev"] { left: 1rem; }
.nrm-car-btn[data-dir="next"] { right: 1rem; }

.nrm-car-credit {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(15, 27, 45, 0.45);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.nrm-car-credit:empty {
  display: none;
}

.nrm-car-dots {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 2.2rem;
  position: relative;
  z-index: 1;
}

.nrm-car-dots button {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.nrm-car-dots button[aria-current="true"] {
  background: #fff;
  width: 22px;
}

@media (max-width: 700px) {
  /* on phones you swipe: hide the arrows */
  .nrm-car-btn { display: none; }
}

/* ---- Cards ---- */
.nrm-card .wp-block-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: calc(var(--nrm-radius) - 6px);
}

.nrm-card .wp-block-image figcaption {
  font-size: 0.72rem;
  color: #8a94a6;
  text-align: right;
  margin: 0.35em 0.2em 0;
}


.nrm-card {
  border-radius: var(--nrm-radius);
  box-shadow: var(--nrm-shadow);
  background: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.nrm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -14px rgba(15, 27, 45, 0.35);
}

/* photo placeholder block — replace with an Image block when photos are ready */
.nrm-media-ph {
  aspect-ratio: 16 / 10;
  border-radius: calc(var(--nrm-radius) - 6px);
  background:
    linear-gradient(140deg, rgba(20, 36, 59, 0.92), rgba(155, 0, 20, 0.75)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 12px, transparent 12px 24px);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Key dates timeline ---- */
.nrm-timeline .nrm-date-item {
  position: relative;
  padding-left: 1.6rem;
  border-left: 2px solid rgba(155, 0, 20, 0.25);
}

.nrm-timeline .nrm-date-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0.4em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nrm-red);
  box-shadow: 0 0 0 4px rgba(155, 0, 20, 0.15);
}

/* ---- Committee ---- */
.nrm-person-img {
  width: clamp(96px, 18vw, 140px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin-inline: auto;
  box-shadow: var(--nrm-shadow);
}

.nrm-person .wp-block-image img,
.nrm-person-ph {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
}

.nrm-person-ph {
  width: clamp(96px, 18vw, 140px);
  margin-inline: auto;
  background: linear-gradient(140deg, var(--nrm-navy), var(--nrm-red));
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--wp--preset--font-family--sora);
  font-size: 1.6rem;
  font-weight: 700;
}

/* ---- Buttons ---- */
.wp-block-button__link {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(155, 0, 20, 0.55);
}

.is-style-outline .wp-block-button__link:hover {
  box-shadow: 0 8px 20px -10px rgba(255, 255, 255, 0.6);
}

/* ---- Section eyebrow label ---- */
.nrm-eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nrm-red);
}

/* ---- Footer ---- */
.nrm-footer a {
  text-decoration: none;
}

.nrm-footer a:hover {
  text-decoration: underline;
}

/* ---- Motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .nrm-card,
  .wp-block-button__link,
  .nrm-hero-bg img {
    transition: none;
  }
  .nrm-card:hover {
    transform: none;
  }
}
