body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  color: #333;
}

/* Header layout */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: none;
  color: #6600ff;
  border-bottom: 1px solid #ddd;
  flex-wrap: nowrap;
}

.topbar .logo-img {
  height: 70px;
  width: auto;
}

/* Center title */
.header-center h1 {
  font-size: 1.9em; /*1.8em*/
  text-align: center;
  line-height: 1.4; 
  margin: 0;
}

.header-center span {
  font-size: 1.0em; /*0.9em*/
  color: #6600ff;
}

/* Mobile: shrink but preserve layout */
@media (max-width: 768px) {
  .topbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
  }

  .header-left,
  .header-right {
    flex: 0 0 auto;
  }

  .header-center {
    flex: 1;
    text-align: center;
  }

  .topbar .logo-img {
    height: 50px; /*48px*/
  }

  .header-center h1 {
	font-size: clamp(1.0rem, 3vw, 1.1rem);
	white-space: nowrap; /* prevent wrapping */
    /*font-size: 1.0em;*/
  }

  .header-center span {
	font-size: clamp(0.7rem, 3vw, 1.1rem);
	white-space: nowrap; /* prevent wrapping */
    /*font-size: 0.7em;*/
  }
}

/* 3-column layout (index.php) */
.grid-layout-3 {
  display: grid;
  grid-template-columns: 220px 1fr minmax(200px, auto); /* menu + content + news */
  gap: 0;
  padding: 1em;
  border: 1px solid #ccc;
}

/* Desktop order */
.grid-layout-3 .menu-column   { order: 1; }
.grid-layout-3 .content-column{ order: 2; }
.grid-layout-3 .news-column   { order: 3; }


@media (max-width: 1100px) {
  .grid-layout-3 {
    grid-template-columns: 1fr;   /* collapse to single column */
    grid-template-rows: auto;
  }

  /* Mobile order: menu → news → content */
  .grid-layout-3 .menu-column   { order: 1; }
  .grid-layout-3 .news-column   { order: 2; }
  .grid-layout-3 .content-column{ order: 3; }

  /* Optional: make news full width */
  .grid-layout-3 .news-column {
    width: 100%;
    margin-top: 1em;
  }
}

/* 2-column layout (subfolder pages) */
.grid-layout-2 {
  display: grid;
  grid-template-columns: 220px 1fr; /* sidebar + content */
  gap: 0;
  padding: 1em;
  border: 1px solid #ccc;
}

.grid-layout-2 .menu-column   { order: 1; }
.grid-layout-2 .content-column{ order: 2; }


@media (max-width: 1100px) {
  .grid-layout-2 {
    grid-template-columns: 1fr;   /* collapse to single column */
    grid-template-rows: auto;
  }


  /* Toggle to reveal menu */
  .grid-layout-2 .menu-column.open {
    display: block;
    order: 2; /* appear after content */
    margin-top: 1em;
    background: #fff;
    border: 1px solid #ddd;
    padding: 1em;
  }

  /* Toggle button styling */
  .menu-toggle {
    display: block;
    background: none;
    border: 1px solid #ccc;
    padding: 0.5em 1em;
    margin-bottom: 1em;
    font-size: 1em;
    color: #6600FF;
    cursor: pointer;
  }
}

/* Shared styling */
.menu-column,
.content-column,
.news-column {
  padding: 1em;
  border-right: 1px solid #ccc;
}

.content-column {
  border-right: none;
  background: #fff;
  padding: 1.5em;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  min-width: 290px; /* optional, can remove for full fluidity */
  min-height: 60vh;
}

/* Headings inside content */
.content-column h2 {
  color: #6600ff;
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.6em;
  border-bottom: 2px solid #6600ff;
  padding-bottom: 0.3em;
}

.content-column h3 {
  color: #333;
  margin-top: 1.2em;
  margin-bottom: 0.8em;
  font-size: 1.3em; /*1.2em*/
  border-left: 4px solid #6600ff;
  padding-left: 0.5em;
}

/* Responsive image */
.responsive-img {
  max-width: 100%;
  height: auto;
  margin: 1em 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.content-column table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}

.content-column th,
.content-column td {
  border: 1px solid #ddd;
  padding: 0.6em;
  text-align: left;
}

.content-column th {
  background: #f0e6ff;
  color: #6600ff;
  font-weight: bold;
}

.content-column tr:nth-child(even) {
  background: #f9f9f9;
}

.content-column tr:hover {
  background: #f5f0ff;
}


/* Mobile: stack with custom order */
@media (max-width: 1100px) {
  .grid-layout {
    display: flex;
    flex-direction: column;
    border: none;
  }

  .menu-column   { order: 1; }
  .news-column   { order: 2; }
  .content-column{ order: 3; }

  .menu-column,
  .news-column,
  .content-column {
    border-right: none;
    border-bottom: 1px solid #ccc;
  }

  .content-column {
    border-bottom: none;
	min-height: 45vh;
  }
}

/* Larger screens: give more breathing room */
@media (min-width: 1024px) {
  .content-column {
    min-height: 55vh;
  }
}

/* Smaller screens: reduce so footer isn’t too far down */
@media (max-width: 600px) {
  .content-column {
    min-height: 50vh;
  }
}

/* Base item styling */
/* Remove default bullets and spacing */
.sidebar-menu ul {
  list-style: none;   /* hides bullet points */
  margin: 0;          /* remove default margin */
  padding: 0;         /* remove default padding */
}

.sidebar-menu li {
  margin: 0.3em 0;
  border-bottom: 1px solid #eee;
}

.sidebar-menu a {
  display: block;
  padding: 0.6em 1em;
  text-decoration: none;
  color: #6600ff;
  background: transparent;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}

.submenu a {
  font-weight: bold;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: #f0e6ff;
  color: #333;
}

/* Submenu styling */
.sidebar-menu .submenu {
  margin-left: 1em;
  padding-left: 0.5em;
  border-left: 2px solid #eee;
  display: none; /* hidden by default */
}

.sidebar-menu .submenu a {
  font-size: 1.0em; /*0.9em*/
  font-weight: normal;
  color: #555;
}

.sidebar-menu .submenu a:hover,
.sidebar-menu .submenu a.active {
  background: #f9f9f9;
  color: #6600ff;
}

/* Desktop: show submenu on hover */
@media (min-width: 1099px) {
  .sidebar-menu li:hover > .submenu {
    display: block;
  }
}

/* Mobile: fold everything */
@media (max-width: 1099px) {
  .sidebar-menu ul {
    display: none;
	font-size: 1.1em; /*custom*/
  }

  .sidebar-menu.open ul {
    display: block;
    margin-top: 1em;
    border-top: 1px solid #eee;
    padding-top: 1em;
  }

  .sidebar-menu .submenu.open {
    display: block;
  }

  .menu-toggle {
    display: block;
    background: none;
    border: 1px solid #ccc;
    padding: 0.5em 1em;
    font-size: 1.2em; /*1.1em*/
    color: #6600FF;
    cursor: pointer;
    margin-bottom: 0.5em;
  }
}

/* Latest News */
.latest-news {
  background: #f9f9f9;
  border: 1px solid #ddd;
  max-width: 900px;   /* desktop sidebar width */
  min-width: 265px; 
  padding: 1rem;
}

.latest-news h3 {
  color: #6600ff;
  margin-bottom: 1em;
}

.news-item {
  margin-bottom: 0.3rem;   /* reduced gap between items */
  padding: 0.4rem;         /* slightly smaller padding inside */
  background: #f9f9f9;
  /*border-radius: 6px;
  box-shadow: 0 2px 4px rgba(102,0,255,0.1);*/
}

.news-date {
  /*font-weight: bold;*/
  font-size: 1em;
  color: #6600ff;
  margin-bottom: 0.3rem;
}

.news-desc {
  margin-left: 1em;
  color: #333;
}

table {
  width: 100%;
}

/* Mobile layout */
@media (max-width: 1100px) {
  .news-column {
    margin-bottom: 0.2rem; /* even tighter spacing on mobile */
    max-width: 100%;      /* full width on mobile */
    padding: 0.3rem;      /* slightly smaller padding inside */
  }

  .latest-news h3 {
    text-align: left;     /* keep heading aligned left */
    font-size: 1.2rem;
  }

  .news-item {
    display: flex;
    flex-direction: column; /* stack date above description */
    margin-bottom: 0rem;
    padding: 0.6rem;
  }

  .news-date {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
  }

  .news-desc {
    font-size: 0.95rem;
  }
}

/* Footer (default desktop/tablet) */
.footer {
  text-align: center;
  padding: 1em;
  background: none;
  color: #6600ff;
  border-top: 1px solid #ccc;
}

.footer p {
  margin: 0.5em 0;
}

/* Social links */
.social-links {
  margin-top: 0.5em;
}

.social-icon {
  margin: 0 0.8em;
  text-decoration: none;
  color: #6600ff;
  font-size: 1.1em;
  display: inline-flex;
  align-items: center;
}

.social-icon i {
  margin-right: 0.4em;
}

.social-icon:hover {
  color: #6600ff;
  text-decoration: none;
  font-weight: bold;
}

/* ===========================
   Mobile layout adjustments
   =========================== */
@media (max-width: 768px) {
  .footer {
    text-align: center;       /* keep everything centered */
    padding: 1.2em;
    background: #f9f9f9;      /* optional subtle background */
  }

  .footer p {
    margin: 0.4em 0;
	flex-wrap: nowrap;
	font-size: clamp(0.85rem, 2.5vw, 1rem); 
    /* auto adjust: min 0.85rem, scales with viewport, max 1rem */  
  }
	
  .social-links {
    display: flex;
    justify-content: center;
    white-space: nowrap; /* prevent wrapping */
    overflow-x: auto;  /* allow horizontal scroll if too many */
  }

  .social-icon {
    margin: 0 0.6em;
	/* responsive sizing */ 
    /*font-size: clamp(0.9rem, 3vw, 1.1rem); */
	font-size: clamp(0.85rem, 2.5vw, 1rem); 
  }
}

/*content-text*/
.content-text {
  background: #fff;
  padding: 1.5em;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 2em;	
}

.content-text h2 {
  color: #6600ff;
  border-bottom: 2px solid #6600ff;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
}

.content-text h3 {
  color: #333;
  margin-top: 1.3em; /*1.2em*/
  margin-bottom: 0.6em;
  font-size: 1.3em; /*1.2em*/
  border-left: 4px solid #6600ff;
  padding-left: 0.5em;
}

.content-text p {
  line-height: 1.8;
  margin: 0.5em 0 1em;
  color: #333;
}

.content-text .english {
  font-style: italic;
  color: #555;
}

.english-indent {
  display: block;
  padding-left: 0em;
  font-style: italic;
  color: #555;
}

.content-text ol {
  padding-left: 1.5em;
  margin: 0.5em 0 1em;
}

.content-text ol li {
  margin: 0.4em 0;
  line-height: 1.6;
  line-height: 1.6;
}

.content-text a {
  color: #6600ff;
  text-decoration: none;
}
.content-text a:hover {
  text-decoration: underline;
}

.indented {
  text-indent: 2em;   /* adjust indent size */
}

.nonindented {
  text-indent: 0em;   /* adjust indent size */
}

/* Indent second paragraph line */
.block-indent {
  padding-left: 2em;
  line-height: 1.8;
  color: #333;
}

.content-list.simple {
  list-style-type: decimal;        /* show numbers */
  list-style-position: inside;     /* numbers indent with text */
  margin: 1em 0;
  margin-left: 2em;                /* shift the whole list right */
  padding-left: 0;                 /* avoid double indent */
}

.content-list.simple li {
  margin: 0.4em 0;
  line-height: 1.8;
}

.content-list.numbered {
  counter-reset: item;
  list-style: none;
  margin: 1em 0;
  margin-left: 2em;        /* indent whole list block */
  padding-left: 0;
}

.content-list.numbered li {
  counter-increment: item;
  margin: 0.4em 0;
  line-height: 1.8;
  padding-left: 0em;     /* indent text block */
  text-indent: 0em;     /* pull number back */
}

.content-list.numbered li::before {
  content: var(--section) "." counter(item) ". ";
  display: inline-block;
  width: 2.2em;            /* reserve space for number */
}

/* advisory */
.grid-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* English | Chinese */
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  min-width: 500px; /* optional, can remove for full fluidity */
}

.row {
  display: contents; /* lets child cells participate directly in grid */
}

.cell {
  padding: 0.4em 0.8em;
  line-height: 1.6;
  word-break: break-word;
  text-align: left;   /* force left alignment */
}

.cell.en {
  text-align: left;
}

.cell.zh {
  text-align: left;
}

/* Mobile: stack English above Chinese */
@media (max-width: 600px) {
  .name-grid {
    grid-template-columns: 1fr; /* single column */
  }
  .cell.en {
    /*font-weight: bold;*/
    margin-bottom: -1em;
  }
}

.image-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.image-wrapper img {
  max-width: 800px;   /* set your preferred maximum width */
  width: 100%;        /* scale down responsively */
  height: auto;       /* keep aspect ratio */
  display: block;
  margin: 0 auto;     /* center the image */
}

.fasfa-list {
  list-style: none;       /* remove default bullets */
  margin-left: 0;
  padding-left: 0;
}

.fasfa-list li {
  margin: 0.5em 0;
  line-height: 1.8;
}

.fasfa-list i {
  color: #6600ff;         /* red PDF icon */
  margin-right: 0.5em;    /* spacing between icon and text */
}


/* Default: hide on desktop */
.menu-toggle {
  display: none;
}

/* Mobile: show smaller, elegant button aligned left */
@media (max-width: 1099px) {
  .menu-toggle {
    display: block;
    position: relative;     /* flows under banner */
    margin: 0.5rem 0 0.5rem 1rem; /* space below banner, aligned left */
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 4px 8px;        /* smaller size */
    font-size: 1.1em;         /* reduced font size */
    cursor: pointer;
    color: #6600ff;
    line-height: 1;
    transition: background 0.3s ease, transform 0.2s ease;
  }

  .menu-toggle:hover {
    background: rgba(0,0,0,0.1);
    transform: translateX(2px); /* subtle hover movement */
  }
}

/* Event gallery wrapper */
.event-gallery {
  margin-top: 1.5em;
}

/* Grid container */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Individual event card */
.event-card {
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Image inside card */
.event-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

/* Caption area */
.event-caption {
  padding: 10px;
  text-align: center;
}

.event-caption h3 {
  font-size: 16px; /*15px*/
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.event-caption p {
  font-size: 15px; /*14px*/
  color: #666;
}

/* Responsive adjustments */
@media (max-width: 769px) {
  .event-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .event-card img {
    height: 120px;
  }
  .event-caption h3 {
    font-size: 15px; /*14px*/
  }
  .event-caption p {
    font-size: 13px; /*12px*/
  }
}

/* ===========================
   3‑Column Grid Table
   =========================== */
.event-table-3 {
  display: grid;
  grid-template-columns: 1fr 2.5fr 1.5fr; /* 日期 narrow, 項目 wide, 地點 medium */
  border: 1px solid #ccc; /*ccc*/
  background: #f0e6ff; /*f0e6ff*/
  margin: 1em 0;
  overflow: hidden;
  width: 100%;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
}

.event-table-3 .event-header,
.event-table-3 .event-row {
  display: contents;
}

.event-table-3 .event-cell {
  padding: 10px 14px;
  border: 1px solid #ddd;
  line-height: 1.6;
}

.event-table-3 .event-header .event-cell {
  font-weight: bold;
  background: #e0d4ff; /*fff*/
  color: #6600ff;
  font-size: 16px;
}

/* Alternating row colors */
.event-table-3 .event-row:nth-child(even) .event-cell { background: #f5f5f5; }
.event-table-3 .event-row:nth-child(odd) .event-cell { background: #f9f9f9; } /*f0e6ff*/

/* Hover effect */
.event-table-3 .event-row:hover .event-cell {
  background: #f0e6ff;
  transition: background 0.2s ease;
}

.event-table i.fas.fa-file-pdf,
.event-table i.fas.fa-file-word,
.event-table i.fas.fa-file-image,
.event-table i.fas.fa-file-video,
.event-table i.fas.fa-file-audio,
.event-table i.fas.fa-external-link {
  color: #6600ff;
  margin-right: 0.3em;
}

/* ===========================
   2‑Column Grid Table
   =========================== */
.event-table-2 {
  display: grid;
  grid-template-columns: 1fr 4fr; /* 日期 narrow, 項目 wide */
  border: 1px solid #ccc;
  background: #f0e6ff;
  margin: 1em 0;
  overflow: hidden;
  width: 100%;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
}

.event-table-2 .event-header,
.event-table-2 .event-row {
  display: contents;
}

.event-table-2 .event-cell {
  padding: 10px 14px;
  border: 1px solid #ddd;
  line-height: 1.6;
}

.event-table-2 .event-header .event-cell {
  font-weight: bold;
  background: #e0d4ff; /*fff*/
  color: #6600ff;
  font-size: 16px;
}

/* Alternating row colors */
.event-table-2 .event-row:nth-child(even) .event-cell { background: #f5f5f5; }
.event-table-2 .event-row:nth-child(odd) .event-cell { background: #f9f9f9; }

/* Hover effect */
.event-table-2 .event-row:hover .event-cell {
  background: #f0e6ff;
  transition: background 0.2s ease;
}

/* ===========================
   Shared Utility Classes
   =========================== */
.event-cell.nowrap { white-space: nowrap; }
.event-cell.normalrap { white-space: normal; }
.event-cell.center { text-align: center; }

.event-table-2 a,
.event-table-3 a {
  color: #6600ff;
  text-decoration: none;
}
.event-table-2 a:hover,
.event-table-3 a:hover {
  text-decoration: underline;
}

.event-cell i.fas.fa-file-pdf,
.event-cell i.fas.fa-file-word,
.event-cell i.fas.fa-file-image,
.event-cell i.fas.fa-file-video,
.event-cell i.fas.fa-file-audio,
.event-cell i.fas.fa-external-link {
  color: #6600ff;
  margin-right: 0.3em;
}

/* ===========================
   Mobile Cards (applies to both)
   =========================== */
@media (max-width: 1200px) {
  .event-table-2,
  .event-table-3 {
    display: block;
    border: none;
    background: transparent;
  }

  .event-table-2 .event-header,
  .event-table-3 .event-header {
    display: none; /* hide header row */
  }

  .event-table-2 .event-row,
  .event-table-3 .event-row {
    display: block;
    margin-bottom: 14px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    box-shadow: 0 2px 6px rgba(102,0,255,0.15);
    padding: 1px;
    border-radius: 6px;
  }

  .event-table-2 .event-cell,
  .event-table-3 .event-cell {
    display: block;
    border: none;
    padding: 8px 12px;
    background: transparent;
  }

  .event-table-2 .event-cell::before,
  .event-table-3 .event-cell::before {
    content: attr(data-label) "：";
    font-weight: bold;
    color: #6600ff;
    margin-right: 6px;
    display: inline-block;
    min-width: 0em;
  }
}

/* contact.php */
.contact-grid {
  display: grid;
  grid-template-columns: 150px 1fr; /* label | value */
  gap: 0.5rem 1rem;
  max-width: 800px;
  margin: 1rem auto;
}

.contact-row {
  display: contents; /* lets child cells participate directly in grid */
}

.contact-cell {
  padding: 0.6em 0.8em;
  line-height: 1.6;
  word-break: break-word;
  text-align: left;
}

.contact-label {
  font-weight: bold;
  color: #333;
  white-space: nowrap;
}

.contact-value a {
  color: #6600ff;
  text-decoration: none;
}

.contact-value a:hover {
  text-decoration: underline;
}

/* Mobile: stack label above value */
@media (max-width: 600px) {
  .contact-grid {
    grid-template-columns: 1fr; /* single column */
  }
  .contact-label {
    margin-bottom: -1.5em;
  }
}

/* === Committee Grid Base === */
.committee-grid-9 {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1.5fr 1.5fr 1.5fr 1.5fr 1.8fr 1.5fr 1.5fr; /* 9 columns */
  max-width: 100%;
  margin: 1rem auto;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  color: #333; /* default text color */
}

.committee-grid-7 {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1.8fr 1.5fr 1.5fr 1.8fr 6fr; /* 7 columns */
  max-width: 100%;
  margin: 1rem auto;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  color: #333; /* default text color */
}

.committee-header {
  display: contents;
}

.committee-row {
  display: contents;
}

.committee-cell {
  padding: 0.6em 0.8em;
  border: 1px solid #ddd;
  text-align: left;
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

/* === Header Styling === */
.committee-header .committee-cell {
  background-color: #e0d4ff; /* lavender background */
  color: #6600ff;            /* purple text */
  font-weight: bold;
}

/* === Row Styling === */
.committee-row .committee-cell {
  background-color: #f9f9f9; /* light gray background */
}

/* Zebra striping */
.committee-row:nth-child(even) .committee-cell {
  background-color: #fdfdfd;
}

/* Hover effect for rows */
.committee-row:hover .committee-cell {
  background-color: #f0e6ff; /* soft lavender highlight */
}

/* === Mobile Responsive === */
@media (max-width: 1100px) {
  .committee-grid-9, .committee-grid-7 {
    display: block; /* stack rows */
  }

  .committee-header {
    display: none; /* hide header on mobile */
  }

  .committee-row {
    display: block;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(102,0,255,0.1); /* subtle purple shadow */
    transition: box-shadow 0.3s ease, background 0.3s ease;
  }

  .committee-row:hover {
    background: #f0e6ff; /* light lavender on hover */
    box-shadow: 0 4px 8px rgba(102,0,255,0.2);
  }

  .committee-cell {
    display: block;
    border: none;
    padding: 0.3em 0;
    background: none; /* remove background inside cards */
  }

  .committee-cell::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: #6600ff; /* purple labels */
  }
}

/* song.php */
.song-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns */
  max-width: 100%;
  margin: 1rem auto;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  color: #333;
}

.song-header {
  display: contents;
}

.song-row {
  display: contents;
}

.song-cell {
  padding: 0.6em 0.8em;
  border: 1px solid #ddd;
  text-align: center;
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header styling */
.song-header .song-cell {
  background-color: #e0d4ff; /* lavender background */
  color: #6600ff;            /* purple text */
  font-weight: bold;
}

/* Row styling */
.song-row .song-cell {
  background-color: #f9f9f9; /* light gray background */
}

/* Zebra striping */
.song-row:nth-child(even) .song-cell {
  background-color: #fdfdfd;
}

/* Hover effect */
.song-row:hover .song-cell {
  background-color: #f0e6ff; /* soft lavender highlight */
}

.song-cell i.fas.fa-file-pdf,
.song-celli.fas.fa-file-word,
.song-cell i.fas.fa-file-image,
.song-cell i.fas.fa-file-video,
.song-cell i.fas.fa-file-audio,
.song-cell i.fas.fa-external-link {
  color: #6600ff;
  margin-right: 0.3em;
}

/* Mobile: stack into cards */
@media (max-width: 768px) {
  .song-grid {
    display: block;
  }

  .song-header {
    display: none; /* hide header on mobile */
  }

  .song-row {
    display: block;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(102,0,255,0.1);
    transition: box-shadow 0.3s ease, background 0.3s ease;
  }

  .song-row:hover {
    background: #f0e6ff; /* light lavender on hover */
    box-shadow: 0 4px 8px rgba(102,0,255,0.2);
  }

  .song-cell {
    display: block;
    border: none;
    padding: 0.3em 0;
    background: none;
    text-align: left;
  }

  .song-cell::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: #6600ff;
  }
}


/* Back to Top button */
.back_to_top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: none; /* hidden until scroll */
}

.back_to_top a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;   /* smaller circle */
  height: 56px;
  background: #f0e6ff; /* soft lavender background */
  border: 2px solid #6600ff; /* softer purple border */
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15); /* gentle shadow */
  transition: background 0.3s, transform 0.2s;
  color: #6600ff;
}

.back_to_top a:hover {
  background: #fff; /* invert on hover */
  transform: scale(1.05); /* gentle hover grow */
  color: #6600ff;
}

/* Larger arrow inside smaller circle */
.back_to_top-arrow {
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid #6600ff; /* larger arrowhead */
  position: relative;
}

.back_to_top-arrow::after {
  content: '';
  position: absolute;
  top: 28px;
  left: -8px;
  width: 16px;
  height: 28px;
  background-color: #6600ff; /* arrow shaft */
  border-radius: 3px; /* softened edges */
}

/* Mobile tweaks */
@media (max-width:600px) {
  .back_to_top {
    bottom: 14px;
    right: 14px;
  }
  .back_to_top a {
    width: 48px;
    height: 48px;
    border-width: 2px;
  }
  .back_to_top-arrow {
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 24px solid #6600ff;
  }
  .back_to_top-arrow::after {
    top: 24px;
    left: -7px;
    width: 14px;
    height: 24px;
  }
}