/* ============================================================
   MINISEO KATALOG — Responsive Stylesheet
   Drop-in replacement: place in otwarty_tpl/<tpl>/style.css
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;600;700&family=Playfair+Display:wght@700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --c-brand:       #8b0000;
  --c-brand-dark:  #5c0000;
  --c-brand-light: #c0392b;
  --c-accent:      #d4a437;
  --c-bg:          #f4f1e8;
  --c-surface:     #faf8f2;
  --c-surface2:    #ede9d8;
  --c-border:      #c9c2a0;
  --c-border-dark: #989069;
  --c-text:        #2d2a1e;
  --c-text-mid:    #5a5440;
  --c-text-muted:  #8a8268;
  --c-link:        #6d2b2b;
  --c-link-hover:  #8b0000;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.12);
  --shadow-md:     0 4px 12px rgba(0,0,0,.10);
  --sidebar-w:     200px;
  --max-w:         1080px;
  --font-body:     'Noto Sans', Tahoma, Verdana, sans-serif;
  --font-display:  'Playfair Display', Georgia, serif;
  --trans:         .18s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg) url(img/body_bg.jpg) no-repeat top center;
  background-size: cover;
  background-attachment: fixed;
  text-align: left;
}
img { border: 0; max-width: 100%; height: auto; }
a { color: var(--c-link); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--c-link-hover); text-decoration: underline; }
form { margin: 0; }
ul, ol { list-style: none; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */

/* Outer wrapper — keeps max-width and horizontal padding */
.page-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 12px;
}

/* Three-column grid: left sidebar | main | right sidebar */
.page-columns {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-w);
  grid-template-areas: "left main right";
  gap: 16px;
  align-items: start;
  padding: 16px 0 24px;
}

.col-left  { grid-area: left; }
.col-main  { grid-area: main; min-width: 0; }
.col-right { grid-area: right; }

/* ============================================================
   TOP / HEADER
   ============================================================ */

.site-header {
  background: url(img/top_bg.png) repeat-x 0 0;
  border-bottom: 3px solid var(--c-brand);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--c-brand);
  letter-spacing: -.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--c-brand-dark); text-decoration: none; }

/* Inline search in header */
.header-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 340px;
}
.header-search input[type="text"] {
  flex: 1;
  border: 1px solid var(--c-border-dark);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.header-search input[type="text"]:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 2px rgba(139,0,0,.15);
}
.header-search button {
  background: var(--c-brand);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--trans);
}
.header-search button:hover { background: var(--c-brand-dark); }

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--c-border-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--c-brand);
  border-radius: 2px;
  transition: transform var(--trans), opacity var(--trans);
}

/* ============================================================
   NAVIGATION BAR (below header on desktop; drawer on mobile)
   ============================================================ */

.site-nav {
  background: var(--c-brand);
  border-bottom: 2px solid var(--c-brand-dark);
}
.site-nav ul {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.site-nav ul li a {
  display: block;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 14px;
  transition: background var(--trans);
  white-space: nowrap;
}
.site-nav ul li a:hover {
  background: rgba(255,255,255,.15);
  text-decoration: none;
  color: #fff;
}

/* ============================================================
   SIDEBAR BOXES
   ============================================================ */

.box {
  border: 1px solid var(--c-border);
  background: var(--c-surface) url(img/menu_bg.png);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.box_title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  background: var(--c-surface2);
  border-bottom: 1px solid var(--c-border);
  padding: 8px 12px;
  color: var(--c-brand);
}
.box_footer { border-top: 1px solid var(--c-surface2); }

/* Side menu */
ul.sidemenu { width: 100%; }
ul.sidemenu li a {
  display: block;
  width: 100%;
  color: var(--c-text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-surface2);
  transition: background var(--trans), color var(--trans);
}
ul.sidemenu li:last-child a { border-bottom: none; }
ul.sidemenu li a:hover {
  background: var(--c-brand);
  color: #ffdada;
  text-decoration: none;
}
ul.stats-list { padding: 6px 10px; }
ul.stats-list li { font-size: 12px; color: var(--c-text-mid); padding: 3px 0; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

/* Page-level heading */
.text_body_h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-brand);
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--c-surface2);
}
.text_body_h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-text-mid);
  padding-bottom: 6px;
}

/* Welcome block */
#welcome {
  border: 1px solid var(--c-border);
  background: var(--c-surface) url(img/menu_bg.png);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  padding: 10px 14px;
  font-size: 13px;
}

/* Ads placeholder */
#place-ads2 { clear: both; margin: 10px 0; text-align: center; }
#ads4        { clear: both; margin: 10px 0; text-align: center; }

/* ============================================================
   CATEGORY GRID (home page)
   ============================================================ */

.cat_sub_block {
  border: 1px solid var(--c-border);
  background: var(--c-surface) url(img/menu_bg.png);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

/* Override the PHP table layout — make it responsive grid */
.cat_sub_block table { width: 100%; }
.cat_sub_block td { vertical-align: top; padding: 4px; }

/* Category card */
.cat_block_home {
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  padding: 6px 8px;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.cat_block_home:hover { border-color: var(--c-brand); box-shadow: var(--shadow-sm); }

.in_link_home_cat_div { margin-bottom: 4px; }
a.in_link_home_cat {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-brand);
  text-decoration: none;
  padding-left: 4px;
}
a.in_link_home_cat:hover { color: var(--c-brand-dark); text-decoration: none; }

/* Sub-category list inside category card */
.sub_block_home {
  border-left: 3px solid var(--c-accent);
  margin: 4px 0 4px 4px;
  padding: 2px 0 4px 8px;
}
a.in_link_home_sub      { font-size: 12px; color: var(--c-text-mid); }
a.in_link_home_sub:hover { color: var(--c-brand); text-decoration: underline; }
a.in_link_home_kateg    { font-size: 11px; color: var(--c-text-muted); text-decoration: none; }
.ilosc_cat              { font-size: 11px; color: var(--c-text-muted); }
a.in_link_cat_ilosc     { font-size: 11px; color: var(--c-text-muted); text-decoration: none; }

a.more, a:visited.more {
  font-size: 11.5px;
  color: var(--c-accent);
  text-decoration: none;
  font-weight: 600;
}
a.more:hover { text-decoration: underline; margin-left: 2px; }

/* Sub-category page: sub_block_cat */
.sub_block_cat {
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  padding: 6px 8px 6px 12px;
}
a.in_link_cat_sub      { font-size: 12.5px; font-weight: 700; color: var(--c-text-mid); text-decoration: none; }
a.in_link_cat_sub:hover { color: var(--c-brand); text-decoration: underline; }
a.in_link_menu_left_cat { font-size: 11.5px; font-weight: 700; color: #2c3941; text-decoration: none; padding-left: 6px; }

/* ============================================================
   LINK LISTINGS (wpisy)
   ============================================================ */

.links_block {
  border: 1px solid var(--c-border);
  background: var(--c-surface) url(img/menu_bg.png);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.link_block {
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
  transition: box-shadow var(--trans), border-color var(--trans);
  position: relative;
}
.link_block:hover { box-shadow: var(--shadow-md); border-color: var(--c-brand-light); }

.link_block.adv-promo {
  border: 2px solid var(--c-brand);
  background: #fff8f0;
}
.adv-promo-tab {
  position: absolute;
  top: 0; right: 0;
  background: var(--c-brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 0 var(--radius-md) 0 var(--radius-md);
  text-transform: uppercase;
}
.adv-promo-tab::before { content: "wyróżniony"; }

/* Link block inner table → flex */
.link_block table { width: 100%; border-collapse: collapse; }
.link_block table td { vertical-align: top; }
.link_block table tr { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.link_block .wpistd:first-child { flex-shrink: 0; }
.link_block .wpistd:last-child  { flex: 1; min-width: 0; }

/* Thumbnail image */
img.msn {
  display: block;
  width: 100px;
  height: 75px;
  object-fit: cover;
  border: 2px solid var(--c-border-dark);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

a.out_link {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-brand);
  display: block;
  margin-bottom: 4px;
}
a.out_link:hover { color: var(--c-brand-dark); text-decoration: underline; }

.text_link {
  font-size: 12.5px;
  color: var(--c-text-mid);
  margin-bottom: 4px;
  word-break: break-all;
}
.text_link img { margin-top: 2px; }
.text_link strong { color: var(--c-text); }

a.in_link, .text_block a {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-brand);
  text-decoration: none;
}
a.in_link:hover { text-decoration: underline; }

/* ============================================================
   ADD / UTILITY BLOCKS
   ============================================================ */

.add_block {
  border: 1px solid var(--c-border);
  background: var(--c-surface) url(img/menu_bg.png);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}

.text_block {
  border: 1px solid var(--c-border);
  background: var(--c-surface) url(img/menu_bg.png);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ============================================================
   FORMS
   ============================================================ */

input[type="text"], input[type="email"], input[type="url"],
textarea, select {
  border: 1px solid var(--c-border-dark);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: border-color var(--trans), box-shadow var(--trans);
  outline: none;
}
input[type="text"]:focus, input[type="email"]:focus,
input[type="url"]:focus, textarea:focus, select:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(139,0,0,.12);
}

input.search {
  width: 100%;
  max-width: 160px;
  height: auto;
  padding: 6px 10px;
  font-size: 12.5px;
  margin: 4px 4px 0 0;
}

.wpis {
  border-bottom: 1px solid var(--c-border-dark);
  border-left: none; border-right: none; border-top: none;
  font-size: 12px;
  color: var(--c-text-mid);
  background: var(--c-surface);
  padding: 4px 2px;
  margin-left: 2px;
  width: 100%;
}

.area {
  border-bottom: 1px solid var(--c-border-dark);
  border-left: none; border-right: none; border-top: none;
  font-size: 13px;
  color: var(--c-text-mid);
  background: var(--c-surface);
  padding: 4px 2px;
  width: 100%;
  resize: vertical;
}

/* Generic button */
.button, button, input[type="submit"], input[type="button"] {
  border: 1px solid var(--c-border-dark);
  background: var(--c-surface2);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
  white-space: nowrap;
}
.button:hover, button:hover,
input[type="submit"]:hover, input[type="button"]:hover {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand-dark);
}

/* Primary submit */
input.button, input[type="submit"] {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand-dark);
}
input.button:hover, input[type="submit"]:hover {
  background: var(--c-brand-dark);
}

/* Focus ring */
.focus { border: solid 2px #ffe680 !important; }

/* ============================================================
   NOTIFICATIONS / ALERTS
   ============================================================ */

.notification {
  line-height: 150%;
  font-size: 13px;
  clear: both;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  padding: 10px 12px 10px 50px;
  background-repeat: no-repeat;
  background-position: 12px center;
}
.notification strong { margin-right: 5px; }
.notification p      { margin: 4px 0; padding: 0; }

.warning     { background-image: url(img/ico-alert-error.png);       border: 2px solid #ffc237; background-color: #ffeaa8; color: #826200; }
.success     { background-image: url(img/ico-alert-accept.png);      border: 2px solid #99c600; background-color: #efffb9; color: #3c5a01; }
.failure     { background-image: url(img/ico-alert-exclamation.png); border: 2px solid #eb5339; background-color: #fccac2; color: #ac260f; }
.information { background-image: url(img/ico-alert-information.png); border: 2px solid #418acc; background-color: #d0e4f4; color: #235685; }
.lightbulb   { background-image: url(img/ico-alert-lightbulb.png);   border: 2px solid #d3a350; background-color: #fef0cb; color: #835f21; }
.messages    { background-image: url(img/ico-alert-email.png);       border: 2px solid #42b4ff; background-color: #9ddfff; color: #29668c; }

.bg_small_error { background: url('img/ico_alert_error.png') no-repeat 2px 3px; }
.bg_small_ok    { background: url('img/ico_alert_ok.png') no-repeat 2px 3px; }

/* ============================================================
   NAVIGATION / PAGINATION
   ============================================================ */

.nav {
  text-align: right;
  padding: 6px 2px;
  font-size: 12px;
  color: var(--c-text-muted);
}
.nav_det { text-align: left; padding: 2px 0 2px 14px; font-size: 12.5px; }

a.body_links    { font-weight: 600; color: var(--c-brand); }
a.body_links:hover { color: var(--c-brand-dark); }
a.out_link_body { font-weight: 700; color: var(--c-text); }
a.foot_links    { font-weight: 400; text-decoration: underline; color: #027e22; }
a.foot_links:hover { text-decoration: none; color: #ecae01; }

/* ============================================================
   SLIDES (slideshow widget)
   ============================================================ */

.slides_container {
  display: block;
  margin: 10px auto;
  width: 100%;
  max-width: 134px;
  position: relative;
}
.slides_container img {
  border: 3px solid var(--c-border-dark);
  border-radius: var(--radius-sm);
  width: 100%;
  height: auto;
}
.caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55);
  padding: 3px 5px;
  text-shadow: none;
  border-top: 1px solid #000;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.caption a      { font-size: 10px; color: #f8f5e6; text-decoration: none; }
.caption a:hover { text-decoration: underline; }

/* ============================================================
   PAGERANK BAR
   ============================================================ */
.bar_staty { font-size: 1px; background: var(--c-brand); height: 8px; border-radius: 2px; }

/* ============================================================
   ROBOTS / BADGES
   ============================================================ */
.robots { text-align: right; padding-right: 18px; margin: 4px 0; }
div.robots img  { margin-left: 12px; }
div.robots font { font-size: 11px; }

/* ============================================================
   MISC HELPERS
   ============================================================ */
.highlight  { color: #ff74ab; }
.clear      { clear: both; }
.spacer     { height: 16px; }
.center     { text-align: center; }
.left       { text-align: left; }
.right      { text-align: right; }
.margin_auto{ margin: auto; }
.pos_right  { float: right; }
.pos_left   { float: left; }
.max        { width: 100%; }

/* Fixed-width helpers — fluid on mobile, capped on desktop */
.l16  { width: 16px !important; }
.l20  { width: 20px !important; }
.l30  { width: 50px !important; }
.l50  { width: 50px !important; }
.l70  { width: 70px !important; }
.l100 { width: 100% !important; max-width: 100px; }
.l150 { width: 100% !important; max-width: 150px; }
.l200 { width: 100% !important; max-width: 200px; }
.l250 { width: 100% !important; max-width: 250px; }
.l300 { width: 100% !important; max-width: 300px; }
.l400 { width: 100% !important; max-width: 400px; }
.l500 { width: 100% !important; max-width: 500px; }
.l600 { width: 100% !important; max-width: 600px; }
.l700 { width: 100% !important; max-width: 700px; }
.l800 { width: 100% !important; max-width: 800px; }
.l900 { width: 100% !important; max-width: 900px; }
.l1000{ width: 100% !important; max-width: 1000px; }

/* Hidden SEO linkownia */
#linkownia { display: none !important; }

/* ============================================================
   FOOTER
   ============================================================ */

#footer {
  background: #3d4720 url(img/footer_bg.png) repeat-x 0 0;
  border-top: 3px solid var(--c-brand);
  clear: both;
  width: 100%;
}
#foot {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 16px 20px;
  font-size: 12.5px;
  color: #c8c4a0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  background-image: url(img/foot_bg.png);
  background-repeat: no-repeat;
  background-position: top left;
}
#foot a { color: #e8c060; text-decoration: none; }
#foot a:hover { color: #ffd700; text-decoration: underline; }
#foot-user       { flex-shrink: 0; }
#foot-copyrights { font-size: 11.5px; color: #888; width: 100%; text-align: center; border-top: 1px solid #555; padding-top: 12px; }

/* ============================================================
   MOBILE DRAWER SIDEBAR OVERLAY
   ============================================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
}
.sidebar-overlay.open { display: block; }

.mobile-sidebar {
  position: fixed;
  top: 0; left: -280px;
  width: 260px;
  height: 100%;
  background: var(--c-surface);
  border-right: 2px solid var(--c-border);
  z-index: 201;
  overflow-y: auto;
  transition: left .25s ease;
  padding-bottom: 24px;
}
.mobile-sidebar.open { left: 0; }
.mobile-sidebar-close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-brand);
}
.mobile-sidebar-close button {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* ============================================================
   TABLET — 900px
   ============================================================ */

@media (max-width: 900px) {
  :root { --sidebar-w: 170px; }
  .site-logo { font-size: 1.35rem; }
}

/* ============================================================
   SMALL TABLET — 768px  (drop right sidebar)
   ============================================================ */

@media (max-width: 768px) {
  .page-columns {
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-areas:
      "left main";
  }
  .col-right { display: none; }
}

/* ============================================================
   MOBILE — 600px  (single column, sidebar becomes drawer)
   ============================================================ */

@media (max-width: 600px) {
  :root { --sidebar-w: 0px; }

  /* Header */
  .site-header { position: sticky; top: 0; }
  .header-inner { padding: 0 10px; min-height: 48px; gap: 8px; }
  .site-logo { font-size: 1.15rem; }
  .nav-toggle { display: flex; }

  /* Hide header search — show in mobile sidebar instead */
  .header-search { display: none; }

  /* Nav bar stacks vertically and scrolls */
  .site-nav { overflow-x: auto; }
  .site-nav ul {
    flex-wrap: nowrap;
    padding: 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav ul::-webkit-scrollbar { display: none; }
  .site-nav ul li a { font-size: 12px; padding: 8px 10px; }

  /* Single-column layout */
  .page-columns {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
    padding: 10px 0 16px;
    gap: 10px;
  }
  .col-left  { display: none; }   /* moved to drawer */
  .col-right { display: none; }

  /* Page shell padding */
  .page-shell { padding: 0 8px; }

  /* Category grid — stack columns into rows */
  .cat_sub_block table,
  .cat_sub_block tbody,
  .cat_sub_block tr { display: block; width: 100%; }
  .cat_sub_block td { display: block; width: 100%; padding: 0; }

  /* Cat block full width */
  .cat_block_home { width: 100%; max-width: none; margin-bottom: 8px; }

  /* Link block: thumbnail stacks above text on very small */
  .link_block table tr { flex-direction: column; }
  img.msn { width: 100%; max-width: 220px; height: auto; margin-bottom: 8px; }

  /* Notifications: remove icon padding on tiny screens */
  .notification,
  .warning, .success, .failure, .information, .lightbulb, .messages {
    padding: 10px 12px;
    background-image: none;
  }

  /* Footer: single column */
  #foot { flex-direction: column; gap: 12px; padding: 20px 12px; }
  #foot-copyrights { text-align: left; }

  /* Buttons: full-width on mobile forms */
  .add_block .button,
  .add_block input[type="submit"],
  .add_block button { width: 100%; margin-top: 6px; }

  /* Slides */
  .slides_container { max-width: 100%; }
}

/* ============================================================
   VERY SMALL — 380px
   ============================================================ */

@media (max-width: 380px) {
  .site-logo { font-size: 1rem; }
  html { font-size: 13px; }
}

/* ============================================================
   LARGE DESKTOP — 1100px+ (generous padding)
   ============================================================ */

@media (min-width: 1100px) {
  :root { --sidebar-w: 210px; }
}

/* ============================================================
   RESPONSIVE LAYOUT — pure CSS, no JavaScript required
   Sidebar rendered ONCE in #rsp-sidebar:
   - Desktop: static left column via flex
   - Mobile:  fixed slide-in drawer via CSS checkbox toggle
   ============================================================ */

.rsp-outer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
}

/* Flex row: sidebar | main | right */
.rsp-columns {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0 20px;
  box-sizing: border-box;
}
.rsp-col-left-spacer { display: none; } /* unused on desktop */
.rsp-col-main        { flex: 1 1 0%; min-width: 0; }
.rsp-col-right       { flex: 0 0 180px; min-width: 0; }

/* -------------------------------------------------------
   #rsp-sidebar — DESKTOP: static flex column
   ------------------------------------------------------- */
#rsp-sidebar {
  position: relative;
  left: auto;
  top: 13px;
  width: 175px;
  flex: 0 0 175px;
  height: auto;
  background: transparent;
  border: none;
  overflow: visible;
  z-index: auto;
  transition: none;
}
.rsp-sidebar-head { display: none; }   /* close btn hidden on desktop */
.rsp-sidebar-body { padding: 0; display: block !important; }

/* Desktop sidebar box styling matches original .box */
.rsp-sidebar-body .box {
  width: 160px !important;
  border: 1px solid #989069 !important;
  background: transparent url(img/menu_bg.png) !important;
  margin-bottom: 10px !important;
  display: block !important;
}
.rsp-sidebar-body .box_title {
  font-weight: bold !important;
  font-size: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: #D2CCAF !important;
  padding: 4px 10px !important;
  display: block !important;
  color: #333 !important;
}
.rsp-sidebar-body .left { display: block !important; }
.rsp-sidebar-body ul.sidemenu {
  list-style: none !important;
  font-size: 12px !important;
  width: 160px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}
.rsp-sidebar-body ul.sidemenu li { display: block !important; }
.rsp-sidebar-body ul.sidemenu li a {
  text-decoration: none !important;
  display: block !important;
  width: 140px !important;
  color: #333 !important;
  font-weight: bold !important;
  padding: 4px 10px !important;
}
.rsp-sidebar-body ul.sidemenu li a:hover {
  background-color: #B50000 !important;
  color: #FFDADA !important;
}
.rsp-sidebar-body ul.stats-list {
  list-style: none !important;
  padding: 0 5px !important;
  display: block !important;
}
.rsp-sidebar-body ul.stats-list li { display: block !important; font-size: 11px; }

/* Overlay hidden on desktop */
#rsp-overlay   { display: none !important; }

/* Desktop banner: above main content column only.
   margin-left = sidebar width (175px) + gap (10px) = 185px */
.rsp-top-desktop {
  display: block;
  margin-left: 185px;
  text-align: center;
  margin-bottom: 0;
}
.rsp-top-desktop a   { display: block; }
.rsp-top-desktop img { max-width: 100%; height: auto; display: block; }
/* The original .top div is no longer used */
.top { display: none !important; }

/* Mobile topbar hidden on desktop */
.rsp-topbar { display: none; }
.rsp-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}
.rsp-logo-link { display: block; flex: 1 1 0%; min-width: 0; }
.rsp-logo-img  { max-height: 58px; width: 100%; height: 58px; display: block; object-fit: fill; object-position: left center; }

.rsp-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: #B50000;
  border-radius: 4px;
  cursor: pointer;
  padding: 9px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-sizing: border-box;
}
.rsp-hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  width: 100%;
  pointer-events: none;
}

/* ============================================================
   BREAKPOINTS
   ============================================================ */

/* Tablet: drop right sidebar */
@media (max-width: 820px) {
  .rsp-col-right { display: none; }
}

/* Mobile: sidebar becomes fixed slide-in drawer */
@media (max-width: 640px) {

  /* Show mobile topbar */
  .rsp-topbar {
    display: block;
    background: #D2CCAF url(img/top_bg.png) repeat-x 0 0;
    border-bottom: 3px solid #840404;
    position: sticky;
    top: 0;
    z-index: 90;
    width: 100%;
  }
  /* Hide desktop banner on mobile */
  .rsp-top-desktop { display: none !important; margin-left: 0; }

  /* Single column */
  .rsp-columns   { flex-direction: column; padding: 8px 0 12px; }
  .rsp-col-right { display: none !important; }
  .rsp-col-main  { width: 100%; flex: none; }

  /* Override old inline pixel widths */
  div.main { width: 100% !important; float: none !important; }
  div.top  { height: auto !important; }

  /* #rsp-sidebar becomes fixed drawer */
  #rsp-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -300px !important;
    width: 280px !important;
    height: 100% !important;
    background: #EDEFE5 !important;
    border-right: 2px solid #989069 !important;
    z-index: 201 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    -webkit-transition: left .28s ease !important;
    transition: left .28s ease !important;
    flex: none !important;
  }

  /* Show close button on mobile */
  .rsp-sidebar-head {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 12px;
    min-height: 46px;
    background: #B50000;
    border-bottom: 2px solid #840404;
  }
  .rsp-close {
    display: block !important;
    color: #fff !important;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    -webkit-tap-highlight-color: transparent;
  }

  /* Sidebar body on mobile: full width */
  .rsp-sidebar-body { padding: 8px !important; }
  .rsp-sidebar-body .box,
  .rsp-sidebar-body ul.sidemenu {
    width: 100% !important;
    max-width: none !important;
  }
  .rsp-sidebar-body .box_title { width: 100% !important; box-sizing: border-box !important; }
  .rsp-sidebar-body ul.sidemenu li a {
    width: 100% !important;
    padding: 11px 12px !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid #D2CCAF !important;
  }

  /* CSS checkbox opens the drawer — :has() works regardless of DOM depth */
  body:has(#rsp-menucheck:checked) #rsp-sidebar { left: 0 !important; }

  /* Overlay when drawer open */
  #rsp-overlay {
    display: none;
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    cursor: pointer;
  }
  body:has(#rsp-menucheck:checked) #rsp-overlay { display: block !important; }

  /* Fluid thumbnail images */
  img.msn {
    float: none;
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto 8px;
  }

  /* Stack link-block table cells */
  .link_block table, .link_block tbody, .link_block tr { display: block !important; width: 100% !important; }
  .link_block td { display: block !important; }

  /* Alerts: no icon */
  .warning,.success,.failure,.information,.lightbulb,.messages {
    padding: 8px 10px !important;
    background-image: none !important;
  }

  /* Category grid: stack columns */
  .cat_sub_block table,.cat_sub_block tbody,.cat_sub_block tr { display: block !important; width: 100% !important; }
  .cat_sub_block td { display: block !important; width: 100% !important; padding: 0 !important; }
  .cat_block_home   { width: 100% !important; max-width: none !important; }

  /* Footer */
  #foot-user       { float: none !important; text-align: center; margin-top: 8px; }
  #foot-copyrights { float: none !important; text-align: center; }

  /* Full-width inputs */
  input[type="text"],input[type="email"],input[type="url"],
  textarea,select,input.search {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .rsp-outer { padding: 0 6px; }
  .l100,.l150,.l200,.l250,.l300,.l400,.l500,
  .l600,.l700,.l800,.l900,.l1000 { width: 100% !important; }
}

/* Tiny screens */
@media (max-width: 380px) {
  .rsp-topbar-inner { padding: 5px 8px; }
  .rsp-logo-img     { max-height: 36px; }
  .rsp-hamburger    { width: 38px; height: 38px; padding: 8px; }
}
