/* ======================================================
   GLOBAL VARIABLES
====================================================== */
:root {
  --bg-dark: #1d1d1d;
  --bg-main: #7E0702;
  --bg-menu: #2D2D2D;
  --bg-button: #5E4238;
  --accent: #B48A7C;

  --text-main: #dbd0d0;
  --text-light: #ffffff;

  --max-width: 1100px;
  --gap: 24px;
}

/* ======================================================
   RESET & BASE
====================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 0.95em;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ======================================================
   TYPOGRAPHY
====================================================== */
h1, h2, h3 {
  font-family: 'Century Gothic', Arial, sans-serif;
  color: #ebb29f;
  margin: 0 0 15px;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; color: #d1a08f; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1rem; color: #ebb29f; text-transform: uppercase; }

p { margin: 0 0 20px; }

a {
  color: var(--accent);
  text-decoration: underline;
  transition: color 0.3s;
}

a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ======================================================
   MAIN STRUCTURE
====================================================== */
#main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ======================================================
   HEADER
====================================================== */
#header {
  background: var(--bg-dark);
  border-bottom: 1px solid #3d3d3d;
}

#logo {
  max-width: var(--max-width);
  margin: auto;
  padding: 20px 16px;
}

#logo_text h1 a {
  color: var(--text-light);
  text-decoration: none;
}

#logo_text h2 {
  color: var(--accent);
  font-size: 1.1rem;
}

/* ======================================================
   MENU
====================================================== */
#menu {
  z-index: 1000;
  max-width: var(--max-width);
  margin: auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

#menubar {
  background: var(--bg-menu);
  position: relative;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  display: none;
}

.menu-overlay.active {
  display: block;
}

#menu > li {
  position: relative;
  list-style: none;
}

#menu a {
  display: block;
  padding: 8px 18px;
  background: var(--bg-button);
  color: var(--text-light);
  text-decoration: none;
}

#menu li.selected > a {
  background: var(--accent);
}

/* submenu */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  padding-left: 5px;
  min-width: 180px;
  background: var(--bg-button);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 10;
}

#menu li:hover > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu li {
  list-style: none;
}

.submenu li a {
  padding: 8px 16px;
}

/* ======================================================
   BURGER MENU
====================================================== */

.burger {
  display: none;
  align-items: center;
  justify-content: center; /* center the line */
  width: 36px;
  height: 36px;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
  background: transparent;
  flex-direction: column;
}

.burger span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  margin: 4px 0;
  transition: all 0.3s ease;
}

/* Open state: hide top & bottom, keep only middle */
.burger.open span:nth-child(1),
.burger.open span:nth-child(3) {
  opacity: 0; /* hide top and bottom lines */
}

.burger.open span:nth-child(2) {
  transform: rotate(0deg); /* middle line stays horizontal */
  width: 24px;             /* ensure same width */
}

/* ======================================================
   CONTENT AREA
====================================================== */
#site_content {
  background: var(--bg-main);
  flex: 1;
}

#site_innercontent {
  max-width: var(--max-width);
  margin: auto;
  padding: 20px 16px;
}

/* Layout container */
.layout {
  display: flex;
  gap: var(--gap);
}

/* ======================================================
   SIDEBAR
====================================================== */
#sidebar_container {
  width: 240px;
  flex-shrink: 0;
}

.sidebar_item {
  margin-bottom: 24px;
}

#bullet_list {
  list-style: disc;
  padding-left: 20px;
}

#bullet_list li.selected > span {
  color: #ebb29f;
}

/* social icons */
.social-icon {
  width: 32px;
  height: 32px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.social-icon:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.sidebar-stamp {
  display: block;
  margin: 16px auto 0;
  max-width: 120px;
}

/* ======================================================
   MAIN CONTENT
====================================================== */
#content {
  flex: 1;
  min-width: 0;
}

#content ul {
  list-style: disc;
  padding-left: 20px;
}

/* ======================================================
   GALLERY (FIXED & RESPONSIVE)
====================================================== */

#gallery {
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

/* Remove bullets explicitly on items */
#gallery li {
  list-style: none;
  background-color: var(--bg-main);
  border-radius: 6px;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* Anchor fills cell */
#gallery li a {
  display: block;
  width: 100%;
  height: 100%;
}

/* Thumbnails */
#gallery li img {
  width: 100%;
  height: auto;
  display: block;

  transition:
    transform 0.35s ease,
    filter 0.35s ease;
}

/* Hover effect (desktop only feel) */
#gallery li:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

#gallery li:hover img {
  transform: scale(1.08);
  filter: brightness(1.1);
}

/* Keyboard accessibility */
#gallery li a:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: -3px;
}


/* ======================================================
   FORM
====================================================== */
.form_settings { margin-top: 15px; }
.form_settings p { padding-bottom: 4px; }
.form_settings span { float: left; width: 200px; text-align: left; }
.form_settings input, .form_settings textarea { width: 299px; padding: 5px; border: 1px solid #E5E5DB; background: #FFF; color: #47433F; font: 100% Arial; }
.form_settings select { width: 310px; }
.form_settings .submit { width: 99px; height: 33px; margin-left: 212px; border: 0; background: #3B3B3B; color: #FFF; cursor: pointer; font: 100% Arial; padding: 2px 0 3px 0; }
.form_settings .checkbox { width: 14px; margin: 4px 0; padding: 0; border: 0; background: none; }

.success_message {
    padding: 10px 15px;
    background: #f2f1ac;
    color: #2E6622;
    border: 1px solid #2E6622;
    margin-bottom: 20px;
    border-radius: 4px;
}

.error_message {
    padding: 10px 15px;
    background: #f5b5b5;
    color: #A94442;
    border: 1px solid #A94442;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* ======================================================
   FOOTER
====================================================== */
#footer {
  background: var(--bg-dark);
  border-top: 2px solid var(--bg-menu);
  text-align: center;
  padding: 28px 16px 16px;
  color: var(--text-light);
}

#footer a {
  color: var(--text-light);
  text-decoration: none;
}

#footer a:hover {
  color: var(--accent);
}

/* ======================================================
   TABLET
====================================================== */
@media (max-width: 1023px) {
  .layout {
    flex-direction: column;
  }

  #sidebar_container {
    width: 100%;
  }

  #menu {
    justify-content: center;
  }
}

/* ======================================================
   MOBILE
====================================================== */
@media (max-width: 768px) {

  /* Layout: sidebar moves below content */
  .layout {
    flex-direction: column;
  }

  #content {
    order: 1;
  }

  #sidebar_container {
    order: 2;
    margin-top: 24px;
    width: 100%;
  }

  /* ================================
     MENUBAR & BURGER
  ================================= */
  .burger {
    display: flex;
  }

  #menubar {
    display: flex;
    align-items: center;           /* vertical centering */
    justify-content: flex-end;      /* push burger to the right */
    padding: 12px 16px;
    position: relative;
    background: var(--bg-menu);
    min-height: 60px;               /* enough height for touch */
    z-index: 1000;
  }

  /* ================================
     MENU & OVERLAY
  ================================= */
  .menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 900;
  }

  .menu-overlay.active {
    display: block;
  }

  #menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    background: var(--bg-menu);
    padding: 12px 0;
    gap: 6px;
    z-index: 1000;
  }

  #menu.open {
    display: flex;
  }

  #menu a {
    text-align: center;
    padding: 14px;
  }

  /* Submenus always visible on mobile */
  .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* ================================
     HEADER TEXT
  ================================= */
  #logo_text h1 {
    font-size: 1.7rem;
  }

  #logo_text h2 {
    font-size: 1.1rem;
  }

  /* ================================
     GALLERY
  ================================= */
  #gallery {
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
