/* Egyhunt New - staging theme add-on (styleid 32).
   Palette: olive #1a2016, panel #232c1d, panel2 #2b3722, border #3b4a2c, brass #d4a64a, text #f1ead6.
   Mobile: 900px (tablet - nav tightens, count columns drop) / 600px (phone - rows and postbits stack). */

/* ---------- base ---------- */
body{background:#1a2016;color:#f1ead6;font-family:Tajawal,Cairo,Tahoma,sans-serif;min-width:0!important;width:auto!important;max-width:100%}
a{color:#d4a64a}
img{max-width:100%;height:auto}
.page{width:100%!important;max-width:1180px!important;margin:0 auto!important;box-sizing:border-box;padding:0 6px}
table.tborder{max-width:100%!important;box-sizing:border-box}
td,th{overflow-wrap:break-word}

/* ---------- surfaces ---------- */
.tcat{background:linear-gradient(90deg,#3b4a2c,#2b3722)!important;color:#d4a64a!important;border:0}
.tborder{border:1px solid #3b4a2c!important;border-radius:14px;overflow:hidden;background:#232c1d}
.alt1,.alt2,.alt1Active,.alt2Active,td.alt1Active,td.alt2Active{background:#232c1d!important;border-color:#323e26!important;color:#f1ead6}
.thead{background:#2b3722!important;color:#d4a64a!important}
.tfoot{background:#2b3722!important;color:#d4a64a!important}
.tfoot a{color:#d4a64a!important}
.panelsurround{background:#232c1d!important;color:#f1ead6!important;border:1px solid #3b4a2c!important;border-radius:12px!important}
.panel{background:transparent!important;color:#f1ead6!important}
.fieldset{border:1px solid #3b4a2c!important;background:#2b3722!important;color:#f1ead6!important;border-radius:10px;padding:8px}
.fieldset legend,legend{background:#2b3722!important;color:#d4a64a!important;border:1px solid #3b4a2c;border-radius:6px;font-size:13px!important;padding:2px 8px}
.fieldset,.fieldset td,.fieldset p,.fieldset li{font-size:13px!important;color:#f1ead6!important}
.vbmenu_control,.vbmenu_control a{background:#2b3722!important;color:#d4a64a!important;border-color:#3b4a2c!important}
.vbmenu_popup{background:#232c1d!important;border-color:#3b4a2c!important}
option{background:#232c1d;color:#f1ead6}
.vbmenu_option,.vbmenu_option a{background:#232c1d!important;color:#f1ead6!important}
.vbmenu_hilite,.vbmenu_hilite a{background:#2b3722!important;color:#d4a64a!important}
.page,.page div{background-color:transparent}
.navbar,.tborder .alt3{color:#f1ead6}
.smallfont,.time{color:#cdc6ad;font-size:12px!important;line-height:1.5}
input.bginput,select,textarea,input[type=text],input[type=password]{background:#141a11;color:#f1ead6;border:1px solid #3b4a2c;border-radius:8px;padding:5px 8px;max-width:100%;box-sizing:border-box}
input.bginput:focus,select:focus,textarea:focus,input[type=text]:focus,input[type=password]:focus{outline:2px solid #d4a64a;outline-offset:1px}
input.button,.button,button{background:#d4a64a!important;color:#1a2016!important;border:0!important;border-radius:8px;padding:6px 12px;font-family:inherit;font-weight:700;font-size:13px}
.tborder a{color:#d4a64a}
.bigusername{color:#d4a64a!important;font-size:16px;font-weight:700}

/* ---------- hero / strip ---------- */
#egy-hero{background:linear-gradient(rgba(16,21,13,.55),rgba(16,21,13,.9)),url(img/hero-hunter-dog.jpg) center/cover;padding:clamp(26px,7vw,70px) clamp(14px,5vw,56px);border-bottom:3px solid #d4a64a}
#egy-hero h1{color:#d4a64a;margin:0 0 8px;font-size:clamp(22px,5.5vw,32px);line-height:1.25}
#egy-hero p{margin:0;color:#f1ead6;font-size:clamp(13px,3vw,16px);line-height:1.5}
#egy-strip{margin:10px 0;border-radius:14px;border:1px solid #3b4a2c;background:linear-gradient(90deg,rgba(26,32,22,.9),rgba(26,32,22,.4)),url(img/falcon.jpg) center/cover;color:#d4a64a;padding:30px 24px;font-size:18px;box-sizing:border-box;min-height:60px;display:flex;align-items:center}
#egy-credit{text-align:center;padding:18px;margin-top:24px;border-top:1px solid #3b4a2c;font-size:14px;opacity:.85}

/* dead top4top.io logo stays hidden; the hero carries the text logo */
img[src*="top4top.io"]{display:none!important}

/* ---------- tablet: <=900px ---------- */
@media(max-width:900px){
  #egy-hero{padding:40px 24px}
  .navbar{font-size:12px;white-space:normal}
  .vbmenu_control{padding:3px 7px!important;font-size:12px}
  #egy-strip{padding:18px 16px;font-size:16px}
  /* forum rows: drop the thread/post counters, keep title + last post */
  tbody[id^="collapseobj_forumbit_"] td:nth-child(4),
  tbody[id^="collapseobj_forumbit_"] td:nth-child(5),
  table.tborder:has(tbody[id^="collapseobj_forumbit_"]) thead td:nth-child(4),
  table.tborder:has(tbody[id^="collapseobj_forumbit_"]) thead td:nth-child(5){display:none!important}
  tbody[id^="collapseobj_forumbit_"] td{min-width:0}
  tbody[id^="collapseobj_forumbit_"] td *{white-space:normal!important}
  /* the count/moderator column labels no longer line up once those columns are hidden */
  table.tborder:has(tbody[id^="collapseobj_forumbit_"]) thead{display:none!important}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(1){width:44px}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(3){width:30%}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(6){width:22%}
  /* login box on tablets: usable field widths, labels on one line */
  table:has(input[name=vb_login_username]) input.bginput{width:140px!important}
  table:has(input[name=vb_login_username]) td.smallfont{white-space:normal!important}
  table:has(input[name=vb_login_username]) td.smallfont label{white-space:nowrap}
}

/* ---------- phone: <=600px ---------- */
@media(max-width:600px){
  .page{padding:0 4px}
  #egy-hero{padding:26px 14px;border-bottom-width:2px}
  #egy-hero h1{font-size:clamp(22px,5.5vw,32px)}
  #egy-strip{padding:14px;font-size:15px;margin:8px 0}
  .tborder{border-radius:12px}
  .vbmenu_control{padding:3px 6px!important;font-size:12px}
  .vbmenu_popup{max-width:94vw!important}

  /* forum home: each category row stacks under its icon */
  table.tborder:has(tbody[id^="collapseobj_forumbit_"]){display:block!important}
  table.tborder:has(tbody[id^="collapseobj_forumbit_"])>tbody{display:block!important}
  table.tborder:has(tbody[id^="collapseobj_forumbit_"]) thead{display:none!important}
  tbody[id^="collapseobj_forumbit_"]{display:block!important}
  tbody[id^="collapseobj_forumbit_"] tr{display:grid!important;grid-template-columns:34px minmax(0,1fr);gap:2px 8px;align-items:start;padding:9px 10px;border-bottom:1px solid #323e26}
  tbody[id^="collapseobj_forumbit_"] tr:last-child{border-bottom:0}
  tbody[id^="collapseobj_forumbit_"] td{display:block!important;width:auto!important;border:0!important;padding:0!important;background:transparent!important;text-align:right!important;min-width:0}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(1){grid-column:1;grid-row:1;padding-top:2px!important}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(2){grid-column:2;grid-row:1}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(3){grid-column:2;grid-row:2;font-size:12px!important;opacity:.9}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(3) *{white-space:normal!important;font-size:12px!important}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(6){grid-column:2;grid-row:3;font-size:12px!important;opacity:.75}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(6) *{white-space:normal!important;font-size:12px!important}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(4),
  tbody[id^="collapseobj_forumbit_"] td:nth-child(5){display:none!important}
  tbody[id^="collapseobj_forumbit_"] td:nth-child(2) a strong{font-size:15px}

  /* thread postbit: userinfo block above a full-width post body (no squeezed column) */
  table[id^="post"]{display:block!important;width:100%!important;table-layout:auto!important;max-width:100%!important}
  table[id^="post"]>tbody{display:block!important}
  table[id^="post"] tr{display:block!important}
  table[id^="post"] tr:has(>td.thead){display:flex!important;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
  table[id^="post"] td{display:block!important;width:auto!important;box-sizing:border-box;border-left:0!important;border-right:0!important}
  table[id^="post"] td.alt2{padding:8px 10px!important;border-bottom:1px solid #323e26!important}
  table[id^="post"] td.alt2 .smallfont{line-height:1.7}
  table[id^="post"] td.alt2 .smallfont div{display:inline-block;margin-left:12px}
  table[id^="post"] td.alt2 img[src*="avatar"]{float:right;max-width:64px;height:auto;margin:0 0 6px 10px;border-radius:8px}
  table[id^="post"] td.alt1{padding:10px!important}
  div[id^="post_message_"]{overflow-x:auto;word-break:break-word}
  div[id^="post_message_"] img{max-width:100%!important;height:auto!important}
  div[id^="post_message_"] a{display:inline}
  .tborder a.bigusername{font-size:15px}

  /* login box: stack label / field / options, full-width inputs */
  table.tborder:has(input[name=vb_login_username])>tbody>tr{display:block!important}
  table.tborder:has(input[name=vb_login_username])>tbody>tr>td{display:block!important;width:100%!important;box-sizing:border-box}
  table:has(input[name=vb_login_username]){display:block!important;width:100%!important}
  table:has(input[name=vb_login_username])>tbody,
  table:has(input[name=vb_login_username])>tbody>tr,
  table:has(input[name=vb_login_username])>tbody>tr>td{display:block!important;width:100%!important;box-sizing:border-box}
  table:has(input[name=vb_login_username]) td.smallfont{white-space:normal!important;padding:4px 0!important}
  table:has(input[name=vb_login_username]) input.bginput{width:100%!important;font-size:14px!important;padding:7px 8px!important}
  table:has(input[name=vb_login_username]) input[type=submit],
  table:has(input[name=vb_login_username]) input.button{width:100%!important;margin-top:6px;padding:8px 12px!important;font-size:14px!important}

  /* search page: panels stack, search fields full width */
  td.panelsurround{padding:6px!important}
  td.panelsurround .panel,td.panelsurround .panel>tbody,td.panelsurround .panel>tbody>tr,
  td.panelsurround .panel>tbody>tr>td{display:block!important;width:100%!important;box-sizing:border-box}
  td.panelsurround table{width:100%!important;max-width:100%!important}
  td.panelsurround td{display:block!important;width:auto!important;box-sizing:border-box}
  td.panelsurround fieldset{margin:0 0 10px 0!important}
  td.panelsurround input[type=text],td.panelsurround input[type=password],
  td.panelsurround select,td.panelsurround textarea{width:100%!important;max-width:100%!important;box-sizing:border-box}
  td.panelsurround input.button,td.panelsurround input[type=submit]{width:100%!important;margin-top:4px}
  form#searchform table.tborder{display:block!important;width:100%!important}
  form#searchform table.tborder>tbody,form#searchform table.tborder>tbody>tr,
  form#searchform table.tborder>tbody>tr>td{display:block!important;width:100%!important;box-sizing:border-box}

  /* let every bordered table shrink to the phone width (pagers and tab strips are nowrap by default) */
  table.tborder{table-layout:auto!important;width:100%!important;max-width:100%!important}
  td.tcat,td.thead,td.tfoot{white-space:normal!important}
  td.tcat *,td.thead *,td.tfoot *{white-space:normal!important}
  .pagenav,.pagenav *{white-space:normal!important}

  /* thread tool strip: let its menu cells wrap instead of pushing the page wide */
  table.tborder>tbody>tr:has(>td.vbmenu_control){display:flex!important;flex-wrap:wrap;justify-content:flex-start}
  table.tborder>tbody>tr>td.vbmenu_control{flex:1 1 auto;min-width:0;white-space:normal!important;text-align:center;font-size:12px!important;padding:3px 6px!important}
  td.vbmenu_control a{white-space:normal!important}

  /* forum-list display-options strip (two tcat cells side by side) */
  table.tborder:has(>tbody>tr>td.tcat+td.tcat){display:block!important;width:100%!important;max-width:100%!important}
  table.tborder:has(>tbody>tr>td.tcat+td.tcat)>tbody,
  table.tborder:has(>tbody>tr>td.tcat+td.tcat)>tbody>tr,
  table.tborder:has(>tbody>tr>td.tcat+td.tcat)>tbody>tr>td{display:block!important;width:auto!important;box-sizing:border-box}
  table.tborder:has(>tbody>tr>td.tcat+td.tcat) select,
  table.tborder:has(>tbody>tr>td.tcat+td.tcat) input{width:auto!important;max-width:100%!important}
  table.tborder:has(>tbody>tr>td.tcat+td.tcat) *{white-space:normal!important}

  /* search results (and similar-thread lists): stack the result rows on phones */
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"])){display:block!important;width:100%!important;max-width:100%!important;table-layout:auto!important}
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"]))>tbody,
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"]))>tbody>tr,
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"]))>tbody>tr>td{display:block!important;width:auto!important;box-sizing:border-box}
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"]))>tbody>tr{padding:8px 10px;border-bottom:1px solid #323e26}
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"]))>tbody>tr>td{padding:1px 0!important;border:0!important;background:transparent!important}
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"]))>tbody>tr>td:nth-child(n+2){font-size:12px!important;opacity:.85}
  table.tborder:has(a[href*="showthread.php"]):not(:has(tbody[id^="collapseobj_forumbit_"])) thead{display:none!important}

  /* stats blocks under the forum list */
  tbody[id^="collapseobj_forumhome_"],tbody[id^="collapseobj_cyb_fh_stats"]{display:block!important}
  tbody[id^="collapseobj_forumhome_"]>tr,tbody[id^="collapseobj_cyb_fh_stats"]>tr{display:block!important}
  tbody[id^="collapseobj_forumhome_"]>tr>td,tbody[id^="collapseobj_cyb_fh_stats"]>tr>td{display:block!important;width:auto!important}
  tbody[id^="collapseobj_forumhome_"] table,tbody[id^="collapseobj_cyb_fh_stats"] table{width:100%!important;max-width:100%!important}
}
