/*
Theme Name:  NOR CAN GEO
Theme URI:   https://norcangeo.eu
Author:      Zahra Ashrafian
Description: Custom classic theme for the NOR-CAN-GEO-EX research project.
Version:     0.1.0
License:     GNU General Public License v2 or later
Text Domain: norcangeo
*/

/* ============================================================
   CSS Custom Properties (palette — never hardcode hex elsewhere)
   ============================================================ */
:root {
  --navy:  #00205B;
  --red:   #FF0000;
  --green: #18a5a4;
  --green-dark: #128382;
  --bg:    #FFFFFF;
  --text:  #1B2A3A;

  /* Typography */
  --font-base: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.6;

  /* Layout */
  --container-max: 1200px;
  --container-pad: 1.25rem;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  2rem;
  --space-xl:  3.5rem;

  /* Card / shadow */
  --card-radius: 8px;
  --card-shadow: 0 2px 8px rgba(0, 32, 91, 0.09);
  --card-shadow-hover: 0 6px 20px rgba(0, 32, 91, 0.15);
  --card-bg: #FFFFFF;
  --card-border: 1px solid rgba(0, 32, 91, 0.08);

  /* Header */
  --header-height: 72px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-weight: 400;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

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

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: var(--font-base);
  font-weight: 400;
}

/* ============================================================
   Base Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--navy);
  font-family: var(--font-base);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}

.hero__label, .card__title, strong {
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem,  3vw, 2rem);    }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem);  }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem;    }
h6 { font-size: 0.9rem;  }

p {
  margin-bottom: var(--space-md);
}

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.site-content {
  min-height: calc(100vh - var(--header-height) - 240px);
  padding-block: var(--space-xl);
}

/* ============================================================
   Card component (reused across phases)
   ============================================================ */
.card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.card__body {
  padding: var(--space-lg);
}

.card__title {
  margin-bottom: var(--space-sm);
}

/* Uniform image box (logos, icons) */
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.6em 1.4em;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

.btn--primary {
  background: var(--green);
  color: #fff;
}

.btn--primary:hover {
  opacity: 0.88;
  text-decoration: none;
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--navy);
  color: var(--navy);
}

.btn--outline:hover {
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 2px solid var(--navy);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo */
.site-branding {
  flex-shrink: 0;
}

.site-branding a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.site-branding .custom-logo {
  max-height: 52px;
  width: auto;
}

.site-branding .site-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}

/* Nav area */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Primary nav */
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.primary-nav ul li a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.primary-nav ul li a:hover,
.primary-nav ul li.current-menu-item > a {
  color: var(--green);
  background: rgba(24, 165, 164, 0.08);
  text-decoration: none;
}

/* Search toggle */
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy);
  padding: var(--space-xs);
  line-height: 1;
  display: flex;
  align-items: center;
}

.search-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* Search bar (hidden by default) */
.header-search {
  position: absolute;
  top: var(--header-height);
  right: 0;
  left: 0;
  background: var(--bg);
  border-bottom: 2px solid var(--navy);
  padding: var(--space-sm) var(--container-pad);
  display: none;
}

.header-search.is-open {
  display: flex;
}

.header-search form {
  display: flex;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
  gap: var(--space-sm);
}

.header-search input[type="search"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0,32,91,0.3);
  border-radius: 4px;
  outline: none;
}

.header-search input[type="search"]:focus {
  border-color: var(--navy);
}

.header-search button[type="submit"] {
  padding: 0.5rem 1rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--navy);
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s, opacity 0.25s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--green);
  color: rgba(255,255,255,0.85);
  padding-top: var(--space-xl);
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.footer-brand .custom-logo {
  max-height: 52px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: var(--space-md);
}

.footer-brand .site-title-footer {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-sm);
}

.footer-info h3,
.footer-social h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--space-md);
}

.footer-info p,
.footer-info a {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.6;
}

.footer-info a:hover {
  color: #fff;
}

/* Social icons */
.social-icons {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.social-icons a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

.social-icons svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Credit bar */
.footer-credit {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-block: var(--space-md);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-credit a {
  color: rgba(255,255,255,0.6);
}

.footer-credit a:hover {
  color: #fff;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 2px solid var(--navy);
    padding: var(--space-md) var(--container-pad);
    z-index: 999;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .primary-nav ul li {
    width: 100%;
  }

  .primary-nav ul li a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    font-size: 1rem;
  }

  .footer-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --container-pad: 1rem;
  }
}

/* ============================================================
   Breadcrumb (global — used on WP single, News single, etc.)
   ============================================================ */
.breadcrumb {
  background: #f5f7fb;
  border-bottom: 1px solid rgba(0, 32, 91, 0.07);
  padding-block: var(--space-sm);
  font-size: 0.82rem;
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3em;
  list-style: none;
}

.breadcrumb__item a {
  color: var(--green);
  opacity: 0.7;
  transition: opacity 0.15s;
}

.breadcrumb__item a:hover {
  opacity: 1;
  text-decoration: underline;
}

.breadcrumb__item[aria-hidden="true"] {
  color: var(--text);
  opacity: 0.35;
}

.breadcrumb__item--current {
  color: var(--text);
  font-weight: 600;
}

/* ============================================================
   Scroll reveal (global — reused across all phases)
   IntersectionObserver adds .is-visible; JS in main.js drives it.
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity  0.5s ease var(--reveal-delay, 0ms),
    transform 0.5s ease var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Share / Print block (global — used on WP, News, Results, About)
   ============================================================ */
.share-print-block {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(0, 32, 91, 0.1);
  margin-top: var(--space-lg);
}

.share-print-block__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
}

.share-print-block__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.4em 0.9em;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(0, 32, 91, 0.18);
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}

.share-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Facebook — use fill, not stroke */
.share-btn--facebook svg,
.share-btn--twitter svg,
.share-btn--linkedin svg {
  fill: currentColor;
  stroke: none;
}

.share-btn:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  text-decoration: none;
}

.share-btn--print {
  font-family: inherit;
}

.share-btn--print svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* ============================================================
   "NEW" badge — posts published within 30 days
   PHP adds .news-card--new via get_the_date('U') check
   ============================================================ */
.news-card--new {
  position: relative;
}

.news-card--new::before {
  content: 'NEW';
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2em 0.55em;
  border-radius: 3px;
  line-height: 1;
}
