/* ============================================================
   mk1b.css - Saturation Hall responsive redesign
   Mobile-first. Base = phone, min-width queries for larger.
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --color-bg: #000;
  --color-text: #fff;
  --color-accent: #aaaaff;
  --color-link: #00a0ff;
  --color-link-hover: #00ff00;
  --color-join: #2a7a2a;
  --color-join-hover: #3a9a3a;
  --color-surface: rgba(0,0,0,0.75);
  --color-surface-light: rgba(0,0,0,0.5);
  --color-border: #666;
  --header-height: 54px;
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-image: url('images/backgrounds/the-enchanted-river.jpg');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

a:link, a:visited { color: var(--color-link); }
a:hover { color: var(--color-link-hover); }

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

main { padding-top: var(--header-height); }


/* ============================================================
   STICKY HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
}

.site-header__brand {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--color-accent) !important;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__site-switcher {
  margin-right: auto;
  font-size: 0.75em;
  white-space: nowrap;
  display: none;
}
.site-switcher__link {
  color: #999 !important;
  text-decoration: none;
  border-left: 1px solid var(--color-border);
  padding-left: 10px;
  margin-left: 10px;
  position: relative;
}
.site-switcher__link:hover {
  color: var(--color-link) !important;
}
.site-switcher__tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  text-align: center;
  z-index: 1001;
  pointer-events: none;
}
.site-switcher__tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #222;
}
.site-switcher__link:hover .site-switcher__tooltip {
  display: block;
}

.site-header__menu-btn {
  display: block;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.4em;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.site-header__nav {
  display: none;
}

.site-header__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.8em;
  padding: 6px 12px;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 0.3s, color 0.3s;
}
.btn--primary {
  background: #036;
  color: #fff !important;
  border: 1px solid #58f;
}
.btn--primary:hover {
  background: #058;
}
.btn--outline {
  background: transparent;
  color: var(--color-link) !important;
  border: 1px solid var(--color-border);
}
.btn--outline:hover {
  background: rgba(255,255,255,0.1);
}
.btn--sm { padding: 5px 10px; font-size: 0.75em; }

/* Hide Download Store button text on very small screens */
.site-header__actions .btn--outline {
  display: none;
}

/* Mobile nav: shown when hamburger toggled */
.nav-open .site-header__nav {
  display: block;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.95);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 0;
}
.site-header__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-header__nav li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.site-header__nav a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--color-link);
  font-weight: bold;
}
.site-header__nav a:hover {
  background: rgba(255,255,255,0.05);
}

/* Desktop nav */
@media (min-width: 768px) {
  .site-header__menu-btn { display: none; }
  .site-header__nav,
  .nav-open .site-header__nav {
    display: flex !important;
    position: static;
    background: none;
    border: none;
    padding: 0;
  }
  .site-header__nav ul {
    display: flex;
    gap: 4px;
  }
  .site-header__nav li {
    border: none;
  }
  .site-header__nav a {
    padding: 5px 10px;
    font-size: 0.8em;
    border-radius: 4px;
  }
  .site-header__nav a:hover {
    background: rgba(255,255,255,0.1);
  }
  .site-header__actions .btn--outline {
    display: inline-block;
  }
  .site-header__site-switcher {
    display: inline;
  }
  .nav-desktop-hide { display: none; }
}


/* ============================================================
   LATEST UPDATE BAR (footer section)
   ============================================================ */
.latest-update-bar {
  padding: 12px;
  margin: 16px 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-align: center;
}
.latest-update-bar table {
  border-collapse: collapse;
}
.latest-update-bar div[style*='overflow-x'] {
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.latest-update-bar td {
  scroll-snap-align: center;
}
.latest-update-bar img {
  display: block;
}


/* ============================================================
   CONVERSION ACTION BAR
   ============================================================ */
.action-bar {
  max-width: var(--max-width);
  margin: 12px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px;
}

.action-bar__btn {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9em;
  padding: 12px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: #036;
  color: #fff !important;
  transition: background 0.3s;
}
.action-bar__btn:hover {
  background: #058;
  color: #fff !important;
}
.action-bar__btn--join {
  background: var(--color-join);
  border-color: #4a4;
}
.action-bar__btn--join:hover {
  background: var(--color-join-hover);
}

@media (min-width: 768px) {
  .action-bar {
    grid-template-columns: repeat(4, 1fr);
    padding: 0;
  }
}


/* ============================================================
   WELCOME SECTION
   ============================================================ */
.welcome-section {
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.welcome-section__heading {
  color: var(--color-accent);
  font-size: 1.5em;
  margin: 0 0 10px 0;
}

.welcome-section__intro {
  max-width: 700px;
  margin-bottom: 16px;
}

.welcome-section__sites {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.site-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px;
}
.site-card--current {
  border-color: var(--color-accent);
}
.site-card__name {
  font-size: 1.1em;
  margin: 0 0 4px 0;
}
.site-card__name a {
  text-decoration: none;
}
.site-card__badge {
  display: inline-block;
  background: var(--color-accent);
  color: #000;
  font-size: 0.75em;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.site-card p {
  margin: 6px 0 0 0;
  font-size: 0.9em;
}

.welcome-section__bonus {
  color: #aaa;
  margin: 6px 0 0 0;
}

@media (min-width: 768px) {
  .welcome-section__sites {
    grid-template-columns: 1fr 1fr;
  }
}


/* ============================================================
   CURRENT SETS THUMBWALL
   ============================================================ */
.current-sets {
  max-width: var(--max-width);
  margin: 16px auto;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

/* Style the script-generated ltables within the thumbwall */
.current-sets .ltables {
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}
.current-sets .ltables td {
  padding: 10px;
}
.current-sets .ltables img {
  vertical-align: bottom;
}
.current-sets .ltables img {
  border-radius: 3px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.current-sets .ltables img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(170,170,255,0.5);
}
.current-sets h2 {
  line-height: 1.4;
  margin: 6px 0 2px 0;
}
.current-sets p {
  margin: 0 0 6px 0;
  font-size: 0.9em;
}


/* ============================================================
   PORTRAIT GALLERY
   ============================================================ */
.portrait-section {
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.portrait-section > h2 {
  text-align: center;
}
.portrait-section > p {
  text-align: center;
  font-size: 0.85em;
  max-width: 600px;
  margin: 0 auto 16px auto;
}

.portrait-section__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Override the old float-based .portrait_gallery from mod_rshow.php */
.portrait_gallery {
  float: none !important;
  width: 140px;
  border: 1px dotted rgba(255,255,255,0.4);
  border-radius: 4px;
  margin: 0;
  padding: 4px;
  font-size: 80%;
  text-align: center;
  transition: border-color 0.3s;
}
.portrait_gallery:hover {
  border-color: var(--color-accent);
}
.portrait_gallery img {
  display: block;
  border-radius: 3px;
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  max-width: var(--max-width);
  margin: 30px auto 0 auto;
  padding: 20px 16px;
  background: rgba(0,0,0,0.9);
  border-top: 1px solid var(--color-border);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.site-footer__col h3 {
  color: var(--color-accent);
  font-size: 1em;
  margin: 0 0 8px 0;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 4px;
}
.site-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer__col li {
  padding: 3px 0;
}
.site-footer__col p {
  margin: 6px 0;
}

.site-footer__poem {
  text-align: center;
  font-style: italic;
  color: #999;
  border-left: none;
  margin: 20px 0;
  padding: 12px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.site-footer__banner-exchange {
  text-align: center;
  margin: 16px 0;
}
.site-footer__banner-exchange textarea {
  width: 100%;
  max-width: 400px;
  font-size: 0.8em;
}

.site-footer__legal {
  text-align: center;
  color: #888;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}


/* ============================================================
   PRESERVED CLASSES (used by script-generated content)
   ============================================================ */

/* ltables - used by latest_banner.pl and pagebuild2.pl output */
.ltables {
  border-collapse: collapse;
  background-color: var(--color-surface);
}
table.ltables {
  border: 2px solid #ccc;
}
td.ltables {
  border: 1px solid #ccc;
}

/* inner_centred - used in various includes */
.inner_centred {
  display: block;
  margin-left: auto;
  margin-right: auto;
}


/* ============================================================
   LEGACY CLASSES (kept for any pages still referencing mk1b)
   ============================================================ */
.estate {
  width: 90%;
  margin-top: 1%;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid black;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.left_paddock {
  float: left;
  width: 18%;
  margin: 0;
  padding: 0;
  background-color: rgba(0,0,0,0.5);
  order: 0;
}
.inner_paddock {
  width: 100%;
  border: white 1px solid;
}

.house_walls {
  float: right;
  width: 82%;
  margin: 0;
  padding: 0;
  background-color: rgba(0,0,0,1);
  background-image: url('images/backgrounds/south-front-01c.png');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-color: #000;
  color: #fff;
  order: 1;
}
.main_hall {
  width: 100%;
  border: white 1px solid;
}
.inner_standard {
  width: 95%;
  margin: 0 auto;
}

.main_subhead {
  font-size: 0.8em;
  margin: 0;
  padding: 0;
}

/* Legacy nav styles */
.bar1 {
  border: 1px solid #ccc;
  padding: 0;
  display: table;
}
ul.map1 {
  list-style-type: none;
  margin: 0;
  padding: 2px 0 3px 0;
}
li.map1 { display: inline; }
a.map1:link, a.map1:visited {
  font-weight: bold;
  font-size: 0.86em;
  color: #fff;
  background-color: #036;
  text-align: center;
  padding: 3px 6px;
  margin: 0;
  text-decoration: none;
}
a.map1:hover, a.map1:active { background-color: #369; }

/* Legacy nav (Langstonedale style) */
.nav { text-align: center; }
.nav ul { list-style: none; padding: 0; margin: 0; font-weight: bold; }
.nav ul li { display: inline-block; }
.nav ul li a {
  display: block;
  text-decoration: none;
  color: #000;
  transition: 0.4s ease background;
  padding: 15px 20px;
  border-radius: 6px;
  border: solid black 1px;
  background-color: #aaaaff;
  margin: 3px;
}
.nav ul li a:hover {
  color: #fff;
  background-color: #006;
  border: solid white 1px;
}

@media (min-width: 640px) {
  .nav { float: left; padding: 10px 0 0 0; }
  .nav ul li a { padding: 5px 10px; }
}

/* Legacy heading styles */
h1 {
  color: var(--color-accent);
  font-size: 2em;
  margin: 3px 3px 3px 0;
  padding: 0;
}
h2 {
  margin: 10px 3px 3px 3px;
}

/* Legacy box styles */
.newsbox1 {
  background-color: #101010;
  padding: 5px;
  border: solid 1px #ddd;
  border-radius: 0.7em;
  margin-bottom: 5px;
}
.right_box_1 {
  float: right; width: 200px;
  border: thin solid #00a0cc; padding: 10px; margin-left: 1.5em;
}
.right_box_2 {
  float: right; width: 32em;
  border: thin solid #00a0cc; padding: 10px; margin-left: 1.5em; font-size: 90%;
}
.link_box_1 {
  float: left; width: 20%;
  border: thin solid #00a0cc; padding: 6px; margin-right: 1.5em;
}
.left_box_1 {
  float: left; width: 35%;
  border: thin solid #00a0cc; padding: 10px;
}
.ritual_box_right {
  float: right; width: 70%;
  border: thin solid #00a0cc; padding: 10px;
}

/* Legacy mobile responsive (for old index.html) */
@media (max-width: 768px) {
  .estate { width: 100%; }
  .left_paddock { float: none; width: 100%; order: 2; }
  .house_walls { float: none; width: 100%; order: 1; }
}
