/* Card Layout Stylesheet
   - Album/artwork card styling
   - Glass effect card containers
   - Responsive layout behavior
*/

/* Desktop card styling (large screens) */
@media (min-width: 1001px) {
  body {
    background-attachment: fixed;
    min-height: 100vh;
    overflow: auto;
  }
  #results {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9em;
  }

  .result {
    flex-basis: 12%;
    margin: 0.8em;
    padding: 0.55em 0.35em 0.25em 0.35em;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 180px;
    max-width: 320px;
    background: rgba(255,255,255,0.15);
    border-radius: 1em;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: none;
    transform: translateY(-12px) scale(1.04);
    transition: box-shadow 0.3s, transform 0.3s;
    backdrop-filter: blur(32px) saturate(180%) brightness(1.18);
    -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.18);
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.3);
    border-left: 1px solid rgba(255,255,255,0.3);
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .result .artwork {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
  }
  
  .result .artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
  }
  
  .result .links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25em;
    margin-top: 8px;
    margin-bottom: 0.1em;
    font-size: 0.65em;
    position: static;
    visibility: visible;
  }
  
  .result .links a {
    flex: 0 0 auto;
    padding: 0.35em 0.6em;
    font-size: 0.9em;
    white-space: nowrap;
    min-width: 0;
    max-width: 22%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Base card styling for all screen sizes */
#results {
  margin: 3em;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.result {
  flex-basis: 10%;
  box-sizing: border-box;
  padding: 0.6em 0.4em 0.3em 0.4em;
  margin: 0.4em;
  overflow: hidden;
  border-radius: 0.3em;
  background: rgba(255,255,255,0.15);
  border-radius: 1em;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: none;
  transform: translateY(-12px) scale(1.04);
  transition: box-shadow 0.3s, transform 0.3s;
  cursor: pointer;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  backdrop-filter: blur(16px) saturate(180%) brightness(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(180%) brightness(1.1);
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.3);
  border-left: 1px solid rgba(255,255,255,0.3);
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.result.selected {
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.08),
    0 4px 16px 0 rgba(31,38,135,0.28),
    0 -4px 16px 0 rgba(255,0,128,0.12),   /* top pink */
    4px 0 16px 0 rgba(0,255,255,0.12),    /* right cyan */
    0 4px 16px 0 rgba(255,255,0,0.12),    /* bottom yellow */
    -4px 0 16px 0 rgba(0,255,128,0.12),   /* left green */
    4px 4px 24px 0 rgba(128,0,255,0.12),  /* bottom right purple */
    -4px -4px 24px 0 rgba(255,128,0,0.12);/* top left orange */
  z-index: 2;
}

.result:hover {
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.18), /* glass border, more visible */
    0 4px 16px 0 rgba(31,38,135,0.28),
    0 -4px 16px 0 rgba(255,0,128,0.12),   /* top pink */
    4px 0 16px 0 rgba(0,255,255,0.12),    /* right cyan */
    0 4px 16px 0 rgba(255,255,0,0.12),    /* bottom yellow */
    -4px 0 16px 0 rgba(0,255,128,0.12),   /* left green */
    4px 4px 24px 0 rgba(128,0,255,0.12),  /* bottom right purple */
    -4px -4px 24px 0 rgba(255,128,0,0.12);/* top left orange */
  transform: translateY(-4px) scale(1.03);
  z-index: 2;
}

.result h2 {
  font-size: 11pt;
  color: #fff;
  text-align: center;
  margin-top: 0.5em;
  margin-bottom: 0.3em;
  font-weight: bold;
}

.result h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
  text-shadow:
    1.5px 1.5px 0px rgba(0,0,0,0.68), /* solid, tight bottom right for small font */
    2px 2px 1px rgba(0,0,0,0.32); /* subtle, tight bottom right */
}

.result h2 a:hover {
  color: #e9f8ffdb;
  text-shadow:
    1.5px 1.5px 0px rgba(0,0,0,0.78), /* more solid, tight bottom right */
    2px 2px 1px rgba(0,0,0,0.38); /* subtle, tight bottom right */
}

.result .artwork {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
}

.result .artwork img {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f0f0f0;
}

.result .links {
  position: static;
  margin-top: 4px;
  text-align: center;
  font-size: 8pt;
  visibility: visible;
  margin-bottom: 0.1em;
}

.result .links a {
  display: inline-block;
  float: none;
  padding: 0.45em 0.8em;
  color: #000000;
  font-weight: bold;
  text-decoration: none;
  border: 2px groove #464646;
  font-size: 0.95em;
}

/* Medium screen card styling */
@media (max-width: 1024px) {
  .result {
    background: rgba(255,255,255,0.15);
    border-radius: 0.9em;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: none;
    transform: translateY(-10px) scale(1.03);
    transition: box-shadow 0.3s, transform 0.3s;
    backdrop-filter: blur(28px) saturate(180%) brightness(1.16);
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.16);
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.20);
    border-left: 1px solid rgba(255,255,255,0.20);
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
}

/* Tablet styling */
@media (min-width: 601px) and (max-width: 1024px) { /* iPad */
  body {
    background-attachment: fixed;
    min-height: 100vh;
    overflow: auto;
  }
  #results {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8em;
  }
  .result {
    flex-basis: 42%;
    margin: 0.7em;
    padding: 0.7em;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 170px;
    max-width: 400px;
  }
  .result .artwork {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
  }
  .result .artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
  }
  .result .links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
    margin-top: 8px;
    margin-bottom: 0.1em;
    font-size: 8pt;
    position: static;
    visibility: visible;
  }
  .result .links a {
    flex: 0 0 auto;
    padding: 0.45em 0.8em;
    font-size: 0.95em;
    white-space: nowrap;
  }
  .result h2 {
    font-size: 16pt;
  }
}

@media(max-width: 1000px) {
  body {
    background-attachment: fixed;
    min-height: 100vh;
    overflow: auto;
  }
  .result {
    flex-basis: 30%;
    margin: 0.6em;
    padding: 0.5em 0.3em;
  }
  .result h2 {
    font-size: 0.9em;
  }
  .result .links {
    font-size: 0.7em;
    gap: 0.25em;
  }
  .result .links a {
    padding: 0.4em 0.6em !important;
  }
}

/* Mobile styling */
@media only screen and (max-width: 600px) {
  body {
    background-attachment: fixed; /* wallpaper stays fixed, content scrolls */
    min-height: 100vh; /* allow scrolling, do not force height */
    overflow: auto; /* ensure scrolling is enabled */
  }
  #results {
    margin: 0.4em !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.3em !important;
  }
  .result {
    flex-basis: 48% !important;
    max-width: 180px !important;
    margin: 0.8em 0.25em !important;
    padding: 0.4em 0.25em !important;
    min-width: 160px !important;
  }
  .result h2 {
    font-size: 0.75em;
    margin-bottom: 0.3em;
  }
  .result .links {
    font-size: 0.65em;
    gap: 0.2em;
    margin-top: 0.5em;
  }
  .result .links a {
    padding: 0.4em 0.5em !important;
    font-size: 0.9em !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .result .artwork {
    width: 100% !important;
    padding-bottom: 100% !important;
    position: relative !important;
  }
  .result .artwork img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #f0f0f0 !important;
  }
}

/* Extra small devices <=430px */
@media only screen and (max-width: 430px) {
  body {
    background-attachment: fixed;
    min-height: 100vh;
    overflow: auto;
  }
  #results { 
    margin: 0.3em !important;
    gap: 0.25em !important;
  }
  .result { 
    flex-basis: 47% !important;
    max-width: 170px !important; 
    margin: 0.7em 0.25em !important; 
    padding: 0.35em 0.22em !important;
    min-width: 150px !important;
  }
  .result h2 {
    font-size: 0.7em;
    margin-bottom: 0.3em;
  }
  .result .links {
    font-size: 0.6em;
    gap: 0.18em;
    margin-top: 0.4em;
  }
  .result .links a {
    padding: 0.35em 0.45em !important;
    font-size: 0.85em !important;
    min-width: auto !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
  .result .artwork img { 
    object-fit: contain !important; 
  }
}

/* Card hover effects */
.result:hover {
  box-shadow: 
    0 0 0 4px rgba(255,255,255,0.18),
    0 4px 32px 0 rgba(31,38,135,0.32),
    0 8px 64px 0 rgba(0,0,0,0.18);
}

/* Card title styling */
.result h2 {
  font-size: 0.85em;
  margin: 0.5em 0 0 0;
  text-align: center;
  color: #fff;
  text-shadow: 
    2px 2px 0px rgba(0,0,0,0.72),
    3px 3px 1px rgba(0,0,0,0.38);
}

.result h2 a {
  color: inherit;
  text-decoration: none;
}

.result h2 a:hover {
  color: #e9f8ffdb;
}