/*
  Twilight Karaoke — modern responsive theme
  Add this stylesheet AFTER css/tlk.css in the <head>.
  It overrides presentation only; existing PHP and page functionality stay intact.
*/

:root {
  --tk-night: #19051f;
  --tk-plum: #31083a;
  --tk-purple: #4b1556;
  --tk-lilac: #d9b9e2;
  --tk-pink: #f18ad7;
  --tk-text: #f9f4fb;
  --tk-muted: #d8c9df;
  --tk-panel: rgba(35, 10, 43, 0.88);
  --tk-border: rgba(236, 198, 246, 0.28);
  --tk-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

/* Global foundation */
html {
  min-height: 100%;
  scroll-behavior: smooth;
}

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

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 82% 7%, rgba(141, 68, 151, 0.24), transparent 32rem),
    radial-gradient(ellipse at 12% 35%, rgba(93, 28, 105, 0.22), transparent 34rem),
    linear-gradient(145deg, #18031d 0%, #310735 52%, #1c0626 100%);
  color: var(--tk-text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#fullpage {
  width: min(100% - 2rem, 74rem);
  max-width: 74rem;
  margin: 0 auto;
  padding: 1.25rem 0 1.5rem;
}

header {
  padding: 0 0 1.25rem;
  text-align: center;
}

header img {
  display: block;
  width: min(100%, 42rem);
  height: auto;
  max-height: 10rem;
  object-fit: contain;
  margin: 0 auto;
}

h1 {
  padding-bottom: 0.65rem;
  color: #3a0b43;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 750;
  line-height: 1.3;
}

p {
  margin: 0 0 0.85rem;
}

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

a {
  transition: color 160ms ease, background-color 160ms ease,
              border-color 160ms ease, box-shadow 160ms ease,
              transform 160ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--tk-pink);
  outline-offset: 3px;
}

/* Main navigation: keeps the existing menu button and menu toggle */
#navigation {
  margin: 0 0 1.25rem;
}

nav .navbutton {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--tk-border);
  border-radius: 0.8rem;
  background: linear-gradient(135deg, #4b1556, #2b0735);
  color: white;
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

nav .navbutton:hover {
  background: linear-gradient(135deg, #64216f, #3a0b43);
}

nav ul {
  display: none;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border: 1px solid var(--tk-border);
  border-radius: 0.8rem;
  background: rgba(31, 5, 38, 0.94);
  box-shadow: var(--tk-shadow);
}

nav ul.expanded {
  display: block;
}

nav li {
  display: block;
  margin: 0;
  border: 0;
}

nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.5rem;
  color: var(--tk-text);
  text-decoration: none;
  font-weight: 600;
}

nav a:hover,
nav a:focus-visible {
  background: rgba(241, 138, 215, 0.13);
  color: #fff;
}

nav .fa {
  width: 1.25rem;
  padding-right: 0;
  color: var(--tk-pink);
  text-align: center;
}

/* Main content panels */
main {
  min-width: 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 1rem;
  background: rgba(255, 250, 255, 0.97);
  color: #35103d;
  box-shadow: var(--tk-shadow);
}

main a {
  color: #6d2479;
  text-underline-offset: 0.18em;
}

main a:hover {
  color: #a52b8c;
}

.inlinelink {
  color: #6d2479;
  font-size: 1.08em;
  font-weight: 750;
}

/* Homepage */
.index p {
  line-height: 1.6;
  padding-bottom: 0;
  margin-bottom: 0.85rem;
}

.mary {
  float: right;
  width: min(42%, 19rem);
  margin: 0.2rem 0 1rem 1.25rem;
  border-radius: 0.8rem;
  box-shadow: 0 10px 28px rgba(48, 8, 58, 0.2);
}

.about {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.about li {
  margin: 0.25rem 0;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.65rem;
  border: 1px solid rgba(75, 21, 86, 0.22);
  border-radius: 0.8rem;
  background: #f1e7f3;
  text-align: center;
}

.contact li {
  flex: 1 1 10rem;
  min-width: 0;
  width: auto;
  border-radius: 0.55rem;
}

.contact li:hover {
  background: #e4d0e9;
}

.contact li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 100%;
  padding: 0.65rem 0.4rem;
  color: #45104e;
  font-weight: 750;
  font-size: 0.95rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact li .fa {
  padding: 0;
  color: #8e318d;
  font-size: 1.25rem;
}

.contact li .text {
  display: inline;
  font-size: 0.82rem;
}

/* Footer */
footer {
  clear: both;
  padding: 1.25rem 0 0.25rem;
  color: #f4e9f6;
  text-align: center;
  font-size: 0.9rem;
}

footer a {
  color: #f4c8ed;
  font-weight: 700;
}

/* Schedule and controls */
#selectors {
  min-height: 2.8rem;
  margin-bottom: 0.8rem;
  text-align: center;
}

.control {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(75, 21, 86, 0.15);
  border-radius: 999px;
  background: #4b1556;
  color: white;
  text-decoration: none;
}

.control:hover {
  background: #7b2c83;
  color: white;
}

#calendar {
  width: 100%;
  table-layout: fixed;
}

#calendar caption {
  padding: 0.8rem;
  font-size: 1.35rem;
  font-weight: 800;
}

#calendar th,
#calendar td {
  overflow-wrap: anywhere;
}

#calendar th {
  padding: 0.45rem 0.15rem;
}

#calendar td.assigned {
  border-color: #d8c4df;
}

#calendar .currentdate {
  background: #f1e2f4;
}

#calendar .empty {
  background: #e4d5e8;
}

/* Song list: search, alphabet filters, download links, table */
#type {
  position: relative;
  padding-right: 2.2rem;
  margin-bottom: 0.6rem;
}

#songSearchIcon {
  top: 0.1rem;
  right: 0.1rem;
  color: #6d2479;
}

#formwrapper {
  width: 100%;
  margin: 0.6rem 0 0.8rem;
  text-align: left;
}

#searchform {
  display: flex;
  width: 100%;
  min-width: 0;
  border: 1px solid #cbb3d2;
  border-radius: 0.7rem;
  overflow: hidden;
  background: white;
}

#searchform #songsearch {
  float: none;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 2.8rem;
  padding: 0.65rem 0.8rem;
  color: #35103d;
  font: inherit;
}

#searchform button {
  flex: 0 0 auto;
  height: 2.8rem;
  padding: 0 0.9rem;
  background: #4b1556;
  color: white;
  cursor: pointer;
}

#searchform button:hover {
  background: #7b2c83;
}

#letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  margin: 0.7rem 0 1rem;
  color: white;
}

#letters li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(75, 21, 86, 0.12);
  border-radius: 0.4rem;
  background: #eee2f1;
  color: #4b1556;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

#letters li:hover,
#letters li.currentLetter {
  background: #4b1556;
  color: white;
}

#dlLinks {
  float: none;
  margin: 0 0 0.75rem;
  text-align: right;
}

#dlLinks li {
  display: inline-block;
  padding: 0 0 0.25rem 0.8rem;
}

#dlLinks a {
  color: #64216f;
  font-weight: 700;
  text-decoration: none;
}

#dlLinks a:hover {
  color: #a52b8c;
}

#songs {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.45rem;
}

#songs table {
  width: 100%;
}

#songs th {
  padding: 0.7rem 0.55rem;
  border-bottom: 2px solid #8c5a98;
  color: #42104c;
  text-align: left;
  white-space: nowrap;
}

#songs th a {
  color: inherit;
}

#songs tr {
  height: auto;
}

#songs td {
  padding: 0.6rem 0.55rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#songs tr:nth-child(even) {
  background: #f0e7f2;
}

#songs tr:hover {
  background: #e5d1eb;
}

#songs .discno {
  text-align: right;
  white-space: nowrap;
}

/* Listen, gallery, testimonials, forms */
.audioBlock {
  padding: 0.5rem 0;
  text-align: center;
}

#playlist li {
  border-color: #e7d8eb;
  padding: 0.75rem;
  letter-spacing: 0.02em;
}

#playlist li:hover,
#playlist .currentsong {
  background: #6c2a78;
  color: white;
}

.gallsection {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  border: 0;
}

.gallitem {
  flex: 1 1 9rem;
  width: auto;
  max-width: 13rem;
  height: auto;
  min-height: 10rem;
  margin: 0;
  border: 1px solid #dfcce5;
  border-radius: 0.7rem;
  overflow: hidden;
  background: white;
}

.gallitem a {
  padding: 0.75rem;
}

.gallitem:hover {
  background: #f1e4f4;
  transform: translateY(-2px);
}

.entry {
  padding: 0.9rem;
  border-color: #e2d2e7;
  line-height: 1.55;
}

.entry:nth-of-type(odd) {
  background: #f4edf6;
}

.signature,
.date {
  margin-top: 0.45rem;
}

.formfield {
  margin-bottom: 1rem;
}

.formfield input,
.formfield textarea,
textarea {
  max-width: 100%;
  border: 1px solid #cbb3d2;
  border-radius: 0.45rem;
  padding: 0.7rem;
  font: inherit;
}

.formfield input:focus,
.formfield textarea:focus,
textarea:focus {
  background: #fbf6fc;
  border-color: #8e318d;
}

input[type="submit"] {
  min-height: 2.75rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: #4b1556;
  font-weight: 750;
}

input[type="submit"]:hover {
  background: #7b2c83;
}

/* Tablet and desktop */
@media (min-width: 36em) {
  #fullpage {
    width: min(100% - 2.5rem, 74rem);
    padding-top: 1.5rem;
  }

  #navigation {
    margin-bottom: 1.25rem;
  }

  nav ul,
  nav ul.expanded {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem;
  }

  nav li {
    display: block;
  }

  nav a {
    min-height: 2.5rem;
    padding: 0.65rem 0.8rem;
  }

  nav .navbutton {
    display: none;
  }

  .contact li {
    padding: 0;
  }

  .contact li .fa {
    display: block;
    margin: 0 auto;
  }

  .contact li .text {
    display: inline;
    font-size: 0.82rem;
  }

  label {
    display: inline-block;
    width: 10em;
    margin-right: 0.8rem;
    text-align: right;
    vertical-align: top;
  }

  .formfield input,
  .formfield textarea,
  textarea {
    width: min(100%, 28rem);
  }

  #calendar thead {
    display: table-header-group;
  }

  #calendar th {
    display: table-cell;
    font-weight: 700;
  }

  #calendar tr {
    display: table-row;
  }

  #calendar td,
  #calendar td.assigned {
    display: table-cell;
    width: 14%;
    height: 5rem;
    padding: 0.25rem;
    border: 1px solid #d8c4df;
    text-align: right;
    vertical-align: top;
  }

  #calendar .formattedDate {
    display: none;
  }
}

@media (min-width: 50em) {
  #fullpage {
    width: min(100% - 3rem, 74rem);
  }

  #navigation {
    float: left;
    width: 13.5rem;
    margin: 0 1.5rem 1.5rem 0;
  }

  nav ul,
  nav ul.expanded {
    display: block;
    padding: 0.4rem;
  }

  nav li {
    display: block;
  }

  nav a {
    min-height: 2.8rem;
  }

  main {
    float: none;
    width: auto;
    margin-left: 15rem;
  }

  footer {
    clear: both;
  }
}

/* Small phones */
@media (max-width: 35.999em) {
  #fullpage {
    width: calc(100% - 1rem);
    padding-top: 0.5rem;
  }

  header {
    padding-bottom: 0.65rem;
  }

  header img {
    max-height: 7rem;
  }

  main {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .mary {
    float: none;
    display: block;
    width: min(100%, 22rem);
    margin: 0 auto 1rem;
  }

  .contact {
    display: grid;
    grid-template-columns: 1fr;
  }

  .contact li a {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.8rem;
  }

  .contact li .fa {
    width: 1.5rem;
  }

  .contact li .text {
    font-size: 0.9rem;
  }

  #letters {
    justify-content: flex-start;
    gap: 0.25rem;
  }

  #letters li {
    min-width: 1.85rem;
    min-height: 1.85rem;
    padding: 0.3rem 0.4rem;
  }

  #dlLinks {
    text-align: left;
  }

  #dlLinks li {
    padding-left: 0;
    padding-right: 0.65rem;
  }

  #songs {
    font-size: 0.9rem;
  }

  #songs th,
  #songs td {
    padding: 0.5rem 0.4rem;
  }

  #selectors {
    padding-bottom: 0.5rem;
  }

  .left,
  .right {
    position: static;
    margin: 0.2rem;
  }

  #calendar caption {
    font-size: 1.1rem;
  }

  #calendar .time {
    font-size: 0.65rem;
  }

  #calendar .location,
  #calendar .textinfo {
    font-size: 0.7rem;
  }

  .gallitem {
    flex-basis: calc(50% - 0.5rem);
    max-width: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
