/* =================================================================
   PHOTOIUPAC 2028 — Landing Page Styles
   Main color: #0007c0 (deep blue)
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  --color-primary: #0007c0;          /* main brand blue */
  --color-primary-dark: #000591;     /* darker variation (hover/active) */
  --color-primary-light: #3a40e0;    /* lighter variation (accent) */
  --color-ink: #1a1d29;              /* body text */
  --color-muted: #5c6170;            /* secondary text */
  --color-bg: #ffffff;
  --color-bg-alt: #f4f6fb;           /* alternating section background */
  --color-border: #e2e6f0;
  --color-overlay: rgba(0, 4, 64, 0.55);

  --header-height: 162px; /* desktop: 112px logo + 25px margin top/bottom (overridden on mobile) */

  --font-sans: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-heading: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
                  "Hiragino Sans", "Noto Sans JP", "Meiryo", system-ui, sans-serif;

  --maxw: 1100px;
  --radius: 10px;
  --shadow-sm: 0 2px 8px rgba(0, 7, 192, 0.08);
  --shadow-md: 0 6px 24px rgba(0, 7, 192, 0.12);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

/* Anchor offset so headings are not hidden behind the fixed header */
.section,
.hero {
  scroll-margin-top: var(--header-height);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 1.5rem;
  letter-spacing: 0.01em;
  position: relative;
  padding-bottom: 0.6rem;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* =================================================================
   HEADER / NAVIGATION
   ================================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
}

.header-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--color-primary);
}

/* PC title (two lines) next to the logo */
.brand-title-pc {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 700;
}

.brand-line1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.brand-line2 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Brand text appears only on mobile (next to the logo) */
.brand-title-mobile {
  display: none;
}

.brand-logo {
  height: 112px;
  width: auto;
  flex-shrink: 0;
  box-sizing: content-box; /* keep the 112px applied to the image itself */
  margin: 25px 0; /* 25px breathing space above and below the logo (desktop) */
}

/* Primary nav (desktop) — 6 columns × 2 rows (11 items: 6 + 5) */
.primary-nav ul {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 4px 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: end; /* align the block to the right, as before */
}

.nav-link {
  display: block;
  padding: 8px 9px;
  font-size: 1.04rem; /* 1.3× the original 0.8rem */
  text-align: center;
  font-weight: 600;
  color: var(--color-ink);
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

.nav-link.is-active {
  color: var(--color-primary);
  background: rgba(0, 7, 192, 0.08);
}

/* YouTube-style "Promotion Video" button */
.nav-link.nav-video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ff0000;
  color: #fff;
}

.nav-link.nav-video:hover,
.nav-link.nav-video.is-active {
  background: #cc0000;
  color: #fff;
}

.nav-video-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger -> X when open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(9.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-9.5px) rotate(-45deg);
}

/* =================================================================
   HERO (#home)
   ================================================================= */
.hero {
  position: relative;
  /* Match the image aspect ratio (1199 x 499) so the full image is shown */
  aspect-ratio: 1199 / 499;
  /* Beyond 1280px wide, fix the hero size (cap width and center it) */
  max-width: 1280px;
  margin: var(--header-height) auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url("../images/IUPAC2028_0608.png") center / contain no-repeat;
  color: #fff;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 32px 24px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 1.2rem + 4vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem);
  font-style: italic;
  margin: 0 0 2.5rem;
  opacity: 0.95;
}

.hero-meta {
  display: inline-block;
  padding: 1.5rem 2rem;
  background: rgba(0, 4, 64, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
}

.hero-conf-name {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  margin: 0 0 0.3rem;
}

.hero-conf-full {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem); /* match .hero-conf-name (April 2-7, 2028) */
  line-height: 1.2;
  margin: 0 0 0.35rem;
  opacity: 0.92;
}

.hero-conf-place {
  font-size: clamp(0.95rem, 0.8rem + 0.8vw, 1.3rem);
  line-height: 1.2;
  margin: 0;
  opacity: 0.92;
  font-weight: 500;
}

/* =================================================================
   HERO INFO (date / venue text under the hero image)
   ================================================================= */
.hero-info {
  text-align: center;
  padding: 28px 16px;
  background: var(--color-primary-light);
  color: #fff;
  /* Match the hero image frame width (1199 x 499, capped at 1280px) and center it */
  max-width: 1280px;
  margin: 0 auto;
}

.hero-info-date {
  font-family: var(--font-heading);
  font-size: clamp(1.28rem, 0.88rem + 1.6vw, 2.08rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 0.3rem;
}

.hero-info-place {
  font-family: var(--font-heading);
  font-size: clamp(1.28rem, 0.88rem + 1.6vw, 2.08rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 0.3rem;
}

.hero-info-venue {
  font-family: var(--font-heading);
  font-size: clamp(1.28rem, 0.88rem + 1.6vw, 2.08rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

.hero-info-venue a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.hero-info-venue a:hover {
  opacity: 0.8;
}

/* =================================================================
   WELCOME
   ================================================================= */
.welcome-head {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.welcome-logo {
  width: 96px;
  height: auto;
  flex-shrink: 0;
}

.welcome-head .section-title {
  margin: 0;
}

.welcome-body p {
  margin: 0 0 1.5rem;
  color: var(--color-ink);
  text-align: justify;
}

.welcome-body p:last-child {
  margin-bottom: 0;
}

/* Conference topics list */
.welcome-topics-intro {
  margin-bottom: 0.75rem !important;
  font-weight: 600;
}

.welcome-topics {
  margin: 0 0 1.75rem;
  padding-left: 1.5rem;
  color: var(--color-ink);
}

.welcome-topics li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.welcome-topics li:last-child {
  margin-bottom: 0;
}

/* Signature block (left-aligned, same gothic body font, bold) */
.welcome-signature {
  margin-top: 2rem;
  font-weight: 700;
}

.welcome-signature p {
  margin: 0 0 1rem;
  text-align: left;
  color: var(--color-ink);
}

.welcome-cochairs {
  line-height: 1.9;
}

/* Co-chairs row: sakura logo on the left, names on the right */
.cochairs-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cochairs-logo {
  width: 150px;
  height: auto;
  flex-shrink: 0;
}

.cochairs-row .welcome-cochairs {
  margin: 0;
}

.welcome-signature sup {
  font-size: 0.65em;
}

/* "Sincerely yours," stays at normal weight (the rest of the block is bold) */
.signature-closing {
  font-weight: 400;
}

/* =================================================================
   TOPICS / NEWS SECTION
   ================================================================= */
.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-ink);
}

.news-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.7;
}

.news-item:first-child {
  border-top: 1px solid var(--color-border);
}

.news-date {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1rem;
  min-width: 9rem;
}

.news-text {
  font-size: 1.05rem;
}

/* =================================================================
   UNDER CONSTRUCTION
   ================================================================= */
.under-construction {
  min-height: 0;
}

.under-construction .container {
  width: 100%;
}

.uc-box {
  text-align: left;
  padding: 0.5rem 0;
  color: var(--color-ink);
}

.uc-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-ink);
  margin: 0;
  letter-spacing: normal;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =================================================================
   VENUE
   ================================================================= */
.venue-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.venue-info {
  margin-bottom: 4px;
}

.venue-map {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--color-bg-alt);
  line-height: 0; /* remove iframe baseline gap */
}

.venue-map iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}

.venue-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin: 0 0 1rem;
}

.venue-address {
  font-size: 1.05rem;
  margin: 0 0 1rem;
  color: var(--color-ink);
}

.venue-link a {
  display: inline-block;
  padding: 10px 22px;
  background: #9b2226; /* match the PAGE TOP button (.back-to-top) */
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.venue-link a:hover {
  background: #8a1f1f; /* match the PAGE TOP button hover */
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.venue-link a:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* =================================================================
   FOOTER
   ================================================================= */
.site-footer {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 56px 0 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}

.footer-conf {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: 0.03em;
}

.footer-full {
  margin: 0 0 0.3rem;
  opacity: 0.9;
}

.footer-place {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.footer-nav ul {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px 16px;
  justify-content: start; /* keep columns compact instead of stretched */
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
}

/* Prefix each footer link with a small, subtle "> " marker (no HTML change) */
.footer-nav li a::before {
  content: "> ";
  font-size: 0.7em;
  opacity: 0.6;
}

.footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  padding: 18px 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.footer-copyright p {
  margin: 0;
}

/* =================================================================
   VIDEO PAGE
   ================================================================= */
.video-frame {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* =================================================================
   BACK TO TOP BUTTON
   ================================================================= */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #9b2226; /* dark brick/wine red — intentionally not the blue brand color */
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  transition: background 0.2s ease, transform 0.2s ease;
}

.back-to-top-arrow {
  font-size: 0.8rem;
  line-height: 1;
}

.back-to-top:hover {
  background: #8a1f1f; /* darker red on hover */
  color: #fff;
  transform: translateY(-2px);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* =================================================================
   RESPONSIVE — TABLET & MOBILE
   ================================================================= */
@media (max-width: 960px) {
  .venue-map iframe {
    height: 360px;
  }
}

@media (max-width: 860px) {
  /* Mobile header: smaller logo with modest 12px breathing space */
  :root {
    --header-height: 84px;
  }

  /* Smaller logo (56px) + 12px top/bottom margin fits the 84px header */
  .brand-logo {
    height: 56px;
    margin: 12px 0;
  }

  /* Hide the PC two-line title; use the single-line mobile title instead */
  .brand-title-pc {
    display: none;
  }

  /* Show the conference name beside the logo on mobile */
  .brand-title-mobile {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    color: var(--color-primary);
  }

  /* Show hamburger, collapse nav into a slide-down panel */
  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    box-shadow: var(--shadow-md);
  }

  .primary-nav.is-open {
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .primary-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .nav-link {
    padding: 14px 24px;
    font-size: 1rem;
    text-align: left;
    border-radius: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .primary-nav li:last-child .nav-link {
    border-bottom: none;
  }

  .nav-link.nav-video {
    display: flex;
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 56px 0;
  }

  /* Stack the co-chairs logo above the names on small screens */
  .cochairs-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero {
    /* On small screens let the hero grow with its content instead of
       being clipped to a fixed viewport fraction */
    min-height: auto;
    padding: 48px 0;
  }

  .hero-meta {
    padding: 1.2rem 1.4rem;
  }

  .back-to-top {
    bottom: 16px;
    right: 16px;
    padding: 12px 16px;
    font-size: 0.8rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 28px;
  }

  /* Footer nav drops to 2 columns on narrow screens */
  .footer-nav ul {
    grid-template-columns: repeat(2, auto);
    gap: 4px 14px;
  }

  .welcome-logo {
    width: 72px;
  }
}
