/* =========================================================
   Table of contents (high level)

   1) :root theme variables (colors, spacing)
   2) Base / typography
   3) Header + navigation
   4) Home page sections (hero, rotator, Instagram)
   5) Gallery page
   6) Jobs page
   7) Footer

   Collaborator tip:
   - If you want to "theme" the site, start in :root and adjust colors.
   - Keep Romanian flag strip colors intact unless a maintainer requests changes.
   ========================================================= */

/* =========================================================
   NYRG styles (collaborator-friendly)
   - Change colors, fonts, spacing, and rounded corners here.
   - Keep selectors simple (no frameworks).
   ========================================================= */

:root {
  /* Romanian flag colors */
  --ro-blue: #002B7F;
  --ro-yellow: #FCD116;
  --ro-red: #CE1126;

  /* Light sky theme */
  --bg: #cfe0ff;              /* page background */
  --card: #dbe8ff;            /* cards, header surface */
  --card-2: #e7f0ff;          /* inset surfaces (frames/embeds) */

  --text: #0b1220;            /* main text becomes dark */
  --muted: rgba(11,18,32,0.70);

  /* Accent (slightly stronger sky) */
  --accent: #5a7de6;
  --accent-strong: #3f66da;
  --accent-rgb: 90,125,230;

  --border: rgba(11,18,32,0.18);
  --focus: rgba(90,125,230,0.45);

  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --pad-card: 16px;
  --pad-nav-y: 14px;
  --banner-h: clamp(220px, 30vw, 420px);
}

/* =========================================================
   Base page styling
   ========================================================= */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* =========================================================
   Links + focus states
   ========================================================= */

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

a:hover { text-decoration: underline; }

/* Keyboard focus should be visible (important for accessibility) */
a:focus-visible,
.btn:focus-visible,
.btn-ig:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* =========================================================
   Layout helpers
   ========================================================= */

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* =========================================================
   Header / nav
   ========================================================= */

header {
  position: sticky;
  top: 0;
  background: rgba(219,232,255,0.92); /* matches --card but with slight transparency */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  color: var(--text);
}

/* Romanian flag strip (blue, yellow, red) */
.flag-strip{
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg,
    #002B7F 0%,
    #002B7F 33.333%,
    #FCD116 33.333%,
    #FCD116 66.666%,
    #CE1126 66.666%,
    #CE1126 100%
  );
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--pad-nav-y) - 2px) 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  /* border-radius: var(--radius-sm); */
  object-fit: contain;
  /* border: 1px solid var(--border); */
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(110,168,255,0.9), rgba(255,255,255,0.15));
  border: 1px solid var(--border);
}

.navlinks {
  display: flex;
  gap: 14px;
  align-items: center;
}

.navlinks a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

.navlinks a:hover {
  background: rgba(255,255,255,0.55);
  text-decoration: none;
}

.navlinks a.active {
  background: rgba(var(--accent-rgb), 0.15);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--text);
}

/* =========================================================
   Hero section
   ========================================================= */

.hero {
  padding: 36px 0 10px 0;
}

.hero h1 {
  margin: 0 0 10px 0;
  font-size: 34px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 16px;
}

.banner-hero {
  padding-top: 28px;
}

.hero-banner-image {
  width: 100%;
  height: var(--banner-h);
  object-fit: contain;
  object-position: center;
  display: block;

  background: var(--card-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

#hero-rotator-caption { display: none; }

/* =========================================================
   Rotating photo strip
   ========================================================= */

.photo-rotator {
  margin: 10px 0 16px 0;
}

.rotator-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-2, var(--card));
}

.rotator-image {
  width: 100%;
  height: clamp(220px, 34vw, 420px);
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--card-2);
}

.rotator-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rotator-controls .small {
  text-align: center;
  flex: 1;
  color: var(--muted);
}

.hidden-slides {
  display: none;
}

/* =========================================================
   Cards + grid
   ========================================================= */

/* Landing page grid:
   Photo Highlights is removed, so this is now 1 column by default. */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px 0 36px 0;
  align-items: start;
}

/*
  OLD layout (kept for easy restore later):
  .grid {
    grid-template-columns: 1.6fr 0.9fr;
  }

  .grid.grid--single {
    grid-template-columns: 1fr;
  }

  .grid.grid--single > #instagram-card {
    grid-column: 1 / -1;
  }

  @media (min-width: 901px){
    .photo-highlights{
      position: sticky;
      top: 78px;
      align-self: start;
    }
  }
*/

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--pad-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.18);
}

.card h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.card p {
  margin: 0 0 10px 0;
  color: var(--muted);
  line-height: 1.5;
}

.small {
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   Embeds (Google Drive, Instagram, Google Forms)
   ========================================================= */

.embed-wrap {
  background: var(--card-2);
  border: 1px solid var(--border);
}

/* All iframes should fill the card width and have no border */
iframe {
  width: 100%;
  border: 0;
}

/* Instagram embeds come in as <blockquote class="instagram-media"> */
.instagram-media {
  width: 100%;
  max-width: 540px;  /* keeps it Instagram-native width */
  margin: 0 auto;
}

.insta-profile-wrap {
  display: flex;
  justify-content: center;
}

.insta-profile-wrap .instagram-media {
  max-width: 540px;
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0 30px 0;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.btn:hover {
  background: rgba(var(--accent-rgb), 0.18);
}

.btn-ig {
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  color: var(--text);
}

.btn-ig:hover {
  background: rgba(var(--accent-rgb), 0.20);
}

/* =========================================================
   Instagram "latest posts" layout
   ========================================================= */

/*
  Note:
  Instagram embeds do not behave like small thumbnail cards.
  This grid is best-effort and will often become 1 column on smaller screens.
*/
.insta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* force 2 columns */
  gap: 12px;
  align-items: start;
}

@media (max-width: 980px) {
  .insta-grid {
    grid-template-columns: 1fr; /* phones */
  }
}

/* Center the full Instagram profile embed (the page, not the posts grid) */
#instagram-card .embed-wrap:last-of-type {
  display: flex;
  justify-content: center;
}

/* =========================================================
   Gallery page (auto-rendered cards)
   - Desktop: 2x2 grid (4 cards)
   - Mobile: 1 column (JS renders only 2 cards)
   ========================================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

@media (max-width: 980px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card);
}

.gallery-card a {
  color: inherit;
  text-decoration: none;
}

.gallery-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: var(--card-2);
  transition: opacity 220ms ease;
}

.gallery-card-body {
  padding: 12px;
}

.gallery-title {
  font-weight: 700;
  margin: 0 0 6px 0;
}

.gallery-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.gallery-drive-link {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(255,255,255,0.04));
}

.gallery-drive-link:hover {
  text-decoration: none;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(255,255,255,0.06));
}

.gallery-list {
  display: grid;
  gap: 10px;
}

/* Stack cards on narrower screens */
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .photo-highlights {
    position: static; /* disable sticky on mobile */
    top: auto;
  }
}

#insta-fallback-links { display: none; }

/* =========================================
   Mobile Header Improvements
   Makes header clean and readable on phones
   ========================================= */

/* =========================================
   Mobile header fix (matches header.html)
   ========================================= */
@media (max-width: 980px) {

  /* Header row wraps */
  .nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 0;
  }

  /* Brand occupies its own row */
  .brand {
    width: 100%;
    align-items: center;
  }

  /* Slightly smaller logo */
  .brand-logo {
    width: 34px;
    height: 34px;
  }

  /* Title slightly tighter */
  .brand > div > div:first-child {
    font-size: 18px;
    line-height: 1.15;
  }

  /* Tagline */
  .brand .small {
    font-size: 13px;
    line-height: 1.2;
  }

  /* Navigation grid */
  .navlinks {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
  }

  /* Mobile nav buttons */
  .navlinks a {
    display: block;
    text-align: center;
    padding: 10px 12px;
    font-size: 14px;

    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.35);

    transition: background 0.15s ease, border 0.15s ease;
  }

  .navlinks a:hover {
    background: rgba(255,255,255,0.55);
  }

  /* Keep active page highlighted */
  .navlinks a.active {
    background: rgba(var(--accent-rgb), 0.15);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
  }

  /* Romanian flag stripe looks cleaner on mobile */
  .flag-strip {
    height: 4px;
  }

}

/* ===================================
   JOB BOARD (NYRG)
   =================================== */

.jobs-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.jobs-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  background: var(--accent);
  color: white;
  border: 1px solid rgba(0,0,0,0.06);
}

.jobs-submit-btn:hover {
  opacity: 0.92;
}

.jobs-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 18px;
  align-items: center;
}

/* allow children to shrink properly */
.jobs-controls > * {
  min-width: 0;
}

/* search bar gets most space */
#jobs-search.jobs-input {
  flex: 2 1 360px;
}

/* dropdown filters */
.jobs-select {
  flex: 1 1 180px;
}

/* push clear button to the far right on wide screens */
.jobs-clear-btn {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.jobs-input,
.jobs-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 10px;
  font-size: 14px;
  outline: none;
}

.jobs-input::placeholder {
  color: var(--muted);
}

.jobs-clear-btn {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.jobs-clear-btn:hover {
  background: rgba(0,0,0,0.04);
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.job-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-title {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
}

.job-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(110,168,255,0.14);
  color: var(--text);
  white-space: nowrap;
}

.job-company {
  font-weight: 800;
  color: var(--accent);
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.job-note {
  font-size: 13px;
  color: var(--text);
  opacity: 0.95;
}

.job-actions {
  margin-top: 4px;
}

.job-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  background: rgba(110,168,255,0.16);
  color: var(--text);
  border: 1px solid rgba(110,168,255,0.28);
}

.job-apply:hover {
  opacity: 0.92;
}

.jobs-no-results {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--muted);
}

/* Collapsible description block */
.job-desc {
  margin-top: 6px;
}

.job-desc details {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.25);
}

.job-desc summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.job-desc-text {
  margin-top: 8px;
  color: var(--text);
  opacity: 0.95;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap; /* keeps line breaks from the sheet */
}

/* =========================================================
   Featured Event — temporary event card beside photo rotator
   ========================================================= */

/*
  #featured-row
  - Mobile: single column (event card stacks ABOVE photo rotator)
  - Desktop (≥ 700px): two columns, event card takes ~2/3, photos ~1/3
*/
#featured-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 10px 0 16px 0;
}

@media (min-width: 700px) {
  #featured-row {
    flex-direction: row;
    align-items: stretch;
  }

  /* Event card: 2/3 of the row */
  #featured-event-card {
    flex: 2;
    min-width: 0;
  }

  /* Photo rotator: 1/3 of the row */
  #featured-row #featured-photos-card {
    flex: 1;
    min-width: 0;
    margin: 0; /* override .photo-rotator margin */
  }
}

/* Card inner layout */
.featured-event-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.featured-event-card .fe-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--card-2);
  flex-shrink: 0;
}

.featured-event-card .fe-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.featured-event-card:hover .fe-image-wrap img {
  transform: scale(1.03);
}

.featured-event-card .fe-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.featured-event-card .fe-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ro-red);
  display: flex;
  align-items: center;
  gap: 6px;
}

.featured-event-card .fe-eyebrow::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ro-red);
  animation: fe-pulse 1.8s ease-in-out infinite;
}

@keyframes fe-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.75); }
}

.featured-event-card .fe-title {
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}

.featured-event-card .fe-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.featured-event-card .fe-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.featured-event-card .fe-cta {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background: var(--ro-blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  align-self: flex-start;
}

.featured-event-card .fe-cta:hover {
  background: var(--accent-strong);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Remove the photo-rotator's own margin when inside the row
   (the row gap handles spacing instead) */
#featured-row .photo-rotator {
  margin: 0;
}
