/* ===== wow.tw Responsive DWT Stylesheet ===== */
/* Preserves original desktop look; adapts for mobile/tablet */

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

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

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

table {
  max-width: 100%;
  border-collapse: collapse;
}

/* ── Responsive Images for article pages ── */
img[src*="ga.jpg"],
img[src*="gb.jpg"],
img[src*="gc.jpg"],
img[src*="gd.jpg"] {
  max-width: 100%;
  height: auto;
}

/* ── Announce page responsive ── */

/* Base announce-item styles (desktop) */
#content .announce-item {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: #faf6f0;
  border-left: 4px solid #a67c5c;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
#content .announce-item:last-child {
  margin-bottom: 0;
}
#content .announce-item .title {
  font-size: 20px;
  font-weight: bold;
  color: #3d2b20;
  letter-spacing: 3px;
  margin-bottom: 12px;
}
#content .announce-item .body {
  font-size: 15px;
  line-height: 1.8;
  color: #4a3a2e;
}

/* Announce rules list */
.announce-rules {
  list-style: none;
  padding: 0;
  margin: 0;
}
.announce-rules li {
  position: relative;
  padding: 10px 0 10px 28px;
  font-size: 15px;
  line-height: 1.8;
  color: #4a3a2e;
  border-bottom: 1px dashed #e5d8cc;
}
.announce-rules li:last-child {
  border-bottom: none;
}
.announce-rules li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 10px;
  color: #a67c5c;
  font-size: 14px;
}
.announce-rules li .highlight {
  color: #8b5a42;
  font-weight: bold;
}
#wrap {
  max-width: 800px;
  width: 92%;
  margin: 30px auto;
}

#banner {
  padding: 50px 20px 40px;
}
#banner h1 {
  font-size: 40px;
  letter-spacing: 12px;
}

#nav a {
  margin: 0 18px;
  font-size: 14px;
}

#content {
  padding: 35px 45px;
}

/* ── Homepage (index2.shtml) responsive ── */
body[bgcolor="#000000"] img,
body[bgcolor="#000000"] table,
body > center > table,
body > center img {
  max-width: 100%;
  height: auto;
}

body > center > table {
  width: auto;
}

/* Hide the smoke animation column on mobile to prevent horizontal scroll */
@media screen and (max-width: 767px) {
  body[bgcolor="#000000"] table td[style*="display"] {
    display: none !important;
  }
  body[bgcolor="#000000"] img[src*="nsmoke"] {
    display: none;
  }
  body[bgcolor="#000000"] td[height="163"] {
    display: none;
  }
}

/* ── Guestbook responsive ── */
body[background="background.gif"] table,
body[background="background.gif"] img {
  max-width: 100%;
}

/* ── WBS article pages ── */
body[bgcolor="#ffffff"] > center > h2 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ── Mobile Navigation Toggle ── */
.nav-toggle {
  display: none;
  background: #3d2b20;
  color: #dcc4b0;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  letter-spacing: 2px;
}
.nav-toggle:hover {
  color: #fff8f0;
}

/* ── ===== MEDIA QUERIES ===== ── */

/* ── Tablet (768px–1024px) ── */
@media screen and (max-width: 1024px) {
  #wrap {
    width: 94%;
  }
  #content {
    padding: 28px 30px;
  }
  #banner h1 {
    font-size: 34px;
    letter-spacing: 10px;
  }
  #nav a {
    margin: 0 14px;
    font-size: 13px;
  }
}

/* ── Phone (<768px) ── */
@media screen and (max-width: 767px) {
  /* Layout */
  #wrap {
    width: 96%;
    margin: 15px auto;
  }
  #content {
    padding: 18px 16px;
    font-size: 14px;
    line-height: 1.7;
  }
  #content .announce-item {
    padding: 12px 14px;
  }
  #content .announce-item .title {
    font-size: 16px;
  }

  /* Banner */
  #banner {
    padding: 30px 15px 24px;
  }
  #banner h1 {
    font-size: 24px;
    letter-spacing: 6px;
  }
  #banner .sub {
    font-size: 13px;
    letter-spacing: 3px;
  }

  /* Navigation - make scrollable on mobile */
  #nav {
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  #nav a {
    margin: 0 10px;
    font-size: 12px;
    display: inline-block;
    padding: 4px 0;
  }

  /* Footer */
  #footer {
    padding: 12px 0;
    font-size: 11px;
  }

  /* WBS article pages on phone */
  body[bgcolor="#ffffff"] > center > h2 {
    font-size: 18px;
  }
  hr {
    max-width: 100% !important;
    width: 96% !important;
  }

  /* Genkis page */
  img[width="614"] {
    width: 100%;
    height: auto;
  }

  /* Homepage index2.shtml */
  body > center > table {
    width: 100% !important;
  }
  body > center > table img {
    max-width: 100%;
    height: auto;
  }
  body > center > table td {
    display: block;
    text-align: center;
  }

  /* Search page */
  input[type="text"][size="40"] {
    width: 90%;
    max-width: 100%;
  }
  textarea {
    width: 90%;
    max-width: 100%;
  }

  /* Search results table */
  table.search-table {
    width: 100% !important;
    table-layout: fixed;
    font-size: 13px;
  }
  table.search-table td,
  table.search-table th {
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 6px 4px !important;
  }
  table.search-table td:first-child {
    width: 35%;
  }
  table.search-table td:last-child {
    width: 65%;
  }

  /* Guestbook / message pages */
  table[width="500"] {
    width: 96% !important;
  }
  table[border="0"] {
    width: 96% !important;
  }

  /* Love board */
  table[width="100%"] {
    width: 100% !important;
  }

  /* Forms */
  input, textarea, select {
    max-width: 100%;
  }
}

/* ── Very small screens (<400px) ── */
@media screen and (max-width: 400px) {
  #banner h1 {
    font-size: 18px;
    letter-spacing: 4px;
  }
  #banner {
    padding: 20px 10px 18px;
  }
  #content {
    padding: 12px 10px;
    font-size: 13px;
  }
  #nav a {
    margin: 0 6px;
    font-size: 11px;
    letter-spacing: 1px;
  }
}

/* ── Button styles (used by search.cgi) ── */
.btn-announce {
  display: inline-block;
  margin: 8px 0;
  padding: 8px 24px;
  background: linear-gradient(135deg, #6d4735, #a67c5c);
  color: #fff8f0;
  text-decoration: none;
  border-radius: 6px;
  font-size: 15px;
  letter-spacing: 4px;
  border: 1px solid #4d2f20;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
}
.btn-announce:hover {
  background: linear-gradient(135deg, #8b5a42, #b8957a);
}

/* ── WBS board pages (wbs/wbs.htm, etc.) ── */
body[background*="wbs"] {
  padding: 10px;
}
body[background*="wbs"] li {
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 4px 0;
}
body[background*="wbs"] h1,
body[background*="wbs"] h4 {
  word-wrap: break-word;
}

@media screen and (max-width: 767px) {
  body[background*="wbs"] li {
    font-size: 13px;
    padding: 6px 0;
  }
}

/* ── Love board ── */
body[style*="f7f5e6"] {
  padding: 10px !important;
  word-wrap: break-word;
}
body[style*="f7f5e6"] table {
  max-width: 100%;
  overflow-x: auto;
}
body[style*="f7f5e6"] textarea {
  max-width: 95%;
}
body[style*="f7f5e6"] input[type="text"] {
  max-width: 95%;
}

/* ── Mobile nav toggle (used in SSI templates) ── */
@media screen and (max-width: 767px) {
  .nav-toggle {
    display: block;
  }
  #nav.desktop-nav {
    display: none;
  }
  #nav.desktop-nav.open {
    display: block;
    white-space: normal;
  }
  #nav.desktop-nav.open a {
    display: block;
    padding: 8px 12px;
    margin: 0;
    border-bottom: 1px solid #5a3f30;
  }
}
