/*
 * Theme Name: SamAndSams-Refactored
 * Author: Tim G of AIOXperts (Modified from Underscores.me)
 * Description: A consolidated and refactored stylesheet for the SamAndSams theme.
 * Version: 2.0.0
 */

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Generic
  - Normalize & Box Sizing
# Base Styles
  - Typography
  - Links & Forms
  - Basic Elements
# Layout
  - Site Container & Grid
  - Header
  - Sidebar
  - Main Content
# Components
  - Navigation
  - Posts & Pages
  - Weekly Specials Grid
# Utilities
  - Accessibility & Alignments
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Generic
--------------------------------------------------------------*/
/* Minimal reset & box-sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* Document-level adjustments */
html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

/*--------------------------------------------------------------
# Base Styles
--------------------------------------------------------------*/
/* Base Typography */
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7f8;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  clear: both;
  margin: 0 0 0.5rem 0;
  font-weight: normal;
  line-height: 1.25;
  color: #222;
}

h1 {
  font-size: 2.5em;
  color: #590202;
  padding: 0;
}

h2 {
  font-size: 1.5em;
  color: #404040;
}

/* Links */
a {
  color: #1780c7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Media & Tables */
img,
embed,
iframe,
object,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
}

/* Forms */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.3em 0.4em;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  background: #e6e6e6;
  cursor: pointer;
}

textarea {
  width: 100%;
  overflow: auto;
}


/*--------------------------------------------------------------
# Layout
--------------------------------------------------------------*/

/* Site Container */
.site,
.site .site-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 12px;
  background-color: transparent;
}

.site .container-body {
  width: 100%;
  background: #fff;
  overflow: hidden;
  border-radius: 15px;
  border: 3px solid #fff;
  border-top-width: 5px;
  border-bottom-width: 5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  position: relative;
}


/* Header */
.site-header {
  background-position: center top !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  position: relative;
  height: 350px;
  min-height: 200px;
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 100%);
  pointer-events: none;
  z-index: 2;
}

.site-header-inner {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 12px;
}


/* Main Layout Columns */
.site-sidebar {
  width: 300px;
  max-width: 340px;
  padding: 0 8px;
  float: left;
  box-sizing: border-box;
}

.site-main-content {
  margin-left: 320px; /* sidebar width + gap */
  padding: 0 8px;
  box-sizing: border-box;
  min-height: 400px;
}

/* Clear float container */
.container-body::after {
  content: "";
  display: table;
  clear: both;
}

/* Sidebar Styling */
.site-sidebar .site-sidebar-title,
.site-sidebar .site-sidebar-info,
.site-sidebar .site-sidebar-top,
.site-sidebar .sidebar-hours,
.site-sidebar-top.b_bg {
  background: linear-gradient(#c2432d, #75281b);
  color: #ffffff;
  padding: 10px 12px;
  font-weight: bold;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* Sidebar header exact sizing and typography */
.site-sidebar .site-sidebar-top,
.site-sidebar-top.b_bg,
.site-sidebar .site-sidebar-title,
.site-sidebar .site-sidebar-info,
.site-sidebar .sidebar-hours,
.menu_header {
  width: 100%;
  max-width: 360px;
  height: 41px;
  font-size: 20px;
  overflow: hidden;
  padding: 0 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

/* Ensure header tags inside the header container are reset and centered */
.menu_header h3,
.site-sidebar .site-sidebar-title h3,
.site-sidebar .site-sidebar-info h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  font-weight: bold;
}

/* Sidebar collapse/toggle base styles */
.sidebar-toggle {
  display: none; /* shown only on small screens */
  background: linear-gradient(#c2432d, #75281b);
  color: #ffffff;
  border: none;
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 4px;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  cursor: pointer;
  margin: 8px 0;
}
.site-sidebar-collapse {
  overflow: hidden;
  transition: max-height 0.28s ease;
  /* default on large screens: fully expanded */
  max-height: none;
}

/* Sidebar list reset */
.site-sidebar-body ul,
.site-sidebar .site-sidebar-links ul {
  list-style: none;
  margin: 0;
  padding: 2px 0;
}

/* Menu item spacing */
.site-sidebar .menu li,
.site-sidebar-body ul li,
.site-sidebar .site-sidebar-links ul li {
  margin: 0 0 0.5rem 0;
}

/* Menu item anchors: fixed height 28px */
.site-sidebar .menu li a,
.site-sidebar-body ul li a,
.site-sidebar .site-sidebar-links ul li a {
  color: #590202;
  display: block;
  padding: 0 12px 0 34px;
  height: 28px;
  line-height: 28px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  vertical-align: middle;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Adjust the pseudo-arrow to vertically center with new item height */
.site-sidebar .menu li a::before,
.site-sidebar-body ul li a::before,
.site-sidebar .site-sidebar-links ul li a::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #590202;
}

/* Hours of Operation: clean layout matching sidebar headers */
#sidebar-hours,
#sidebar-hours-header,
#sidebar-hours-schedule,
#sidebar-hours-accepts {
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
}

/* Hours header now uses the existing .menu_header/.site-sidebar header styles (no duplicate rules) */
#sidebar-hours-header {
  margin: 0;
  height: 41px;
  line-height: 41px;
  font-size: 20px;
  background: linear-gradient(#c2432d, #75281b);
  color: #ffffff;
  padding: 0 12px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
#sidebar-hours-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  font-weight: bold;
}

/* Hours schedule: align left/right cleanly */
#sidebar-hours-schedule p {
  margin: 0;
  padding: 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #590202;
  line-height: 20px;
}

/* Accepts/notes block: match spacing */
#sidebar-hours-accepts p {
  margin: 6px 12px 0 12px;
  font-size: 13px;
  color: #590202;
  line-height: 1.25;
}

/* Small screens: make sidebar headers full width */
@media (max-width: 880px) {
  .site-sidebar .site-sidebar-top,
  .site-sidebar-top.b_bg,
  .menu_header,
  #sidebar-hours,
  #sidebar-hours-header,
  #sidebar-hours-schedule,
  #sidebar-hours-accepts {
    max-width: none;
  }

  /* keep menu items tappable on mobile */
  .site-sidebar .menu li a,
  .site-sidebar-body ul li a,
  .site-sidebar .site-sidebar-links ul li a {
    height: 24px;
    line-height: 24px;
    padding-left: 36px;
  }
}


/*--------------------------------------------------------------
# Components
--------------------------------------------------------------*/

/* Main Content Area */
.site-main-content .content-wrap {
  line-height: 1.6;
  width: 100%;
}

.site-main-content .content-wrap p {
  margin: 0 0 1rem 0;
  font-size: 14px;
  color: #590202;
}

/* Posts and pages */
.post,
.page {
  margin: 0 0 1.5em;
}

.entry-content,
.entry-summary {
  margin: 1.5em 0 0;
}

/* Weekly Specials Grid */
.specials-container {
  padding: 2em 1em;
  width: 100%;
}

.specials-header {
  text-align: center;
  margin-bottom: 2.5em;
}

.specials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.special-item-card {
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.special-item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.special-item-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.special-item-details {
  padding: 12px;
  text-align: center;
  background: linear-gradient(180deg, #2c3e50 0%, #1f2a2f 100%);
  color: #f7f7f7;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .35rem;
}

.special-item-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  color: #ffffff;
}

.special-item-price {
  font-weight: 800;
  font-size: 1.1rem;
  color: #d4af37; /* gold accent */
}


/*--------------------------------------------------------------
# Utilities
--------------------------------------------------------------*/

/* Accessibility */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

/* Alignments */
.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1.5em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1.5em;
}

.aligncenter {
  clear: both;
  display: block;
  margin: 1.5em auto;
}

.clearfix::after {
  content: "";
  display: block;
  clear: both;
  height: 0;
  visibility: hidden;
}

/* Additional layout stability utilities */
.site-content-inner {
  width: 100%;
  position: relative;
}

.layout-fixed {
  overflow: hidden;
  zoom: 1; /* IE fix */
}

.layout-fixed::after {
  content: "";
  display: table;
  clear: both;
}

/* Prevent layout shifts */
.site-sidebar,
.site-main-content {
  min-height: 1px;
  position: relative;
}

/* Ensure images don't break layout */
.site img {
  height: auto;
  max-width: 100%;
}

/* Fix for any remaining float issues */
.site-main-content::after {
  content: "";
  display: table;
  clear: both;
}


/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/
@media (max-width: 880px) {
  /* Mobile layout: stack vertically */
  .site-sidebar {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 0 1rem 0;
  }

  .site-main-content {
    float: none;
    margin-left: 0;
    width: 100%;
    max-width: none;
    margin: 0 0 1rem 0;
  }

  /* Show the mobile toggle and collapse the sidebar by default */
  .sidebar-toggle {
    display: block;
  }
  .site-sidebar-collapse {
    max-height: 0;
  }
  /* When JS opens the sidebar, the wrapper has .js-open on .site-sidebar (script sets inline maxHeight too) */
  .site-sidebar.js-open .site-sidebar-collapse {
    max-height: 1200px; /* generous max to allow full expansion — JS will set exact height */
  }

  .site {
    padding: 0 8px;
  }

  .specials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-header {
    background-image: none;
    height: auto;
    min-height: 0;
  }
  .site-header::after {
    content: none;
  }
  .site-header-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
  }
  .site-header .custom-logo {
    display: block;
    max-width: 80%;
    height: auto;
    margin: 0 auto;
  }
  
}

@media (max-width: 600px) {
  .specials-grid {
    grid-template-columns: 1fr;
  }
}

/* Horizontal card layout on wider screens for specials */
@media (min-width: 1024px) {
  .specials-grid {
    grid-auto-rows: minmax(120px, auto);
    gap: 18px;
  }

  .special-item-card {
    flex-direction: row;
    align-items: stretch;
  }

  .special-item-image {
    flex: 0 0 40%;
    max-width: 40%;
  }

  .special-item-image img {
    height: 100%;
  }

  .special-item-details {
    flex: 1 1 60%;
    padding: 12px 16px;
    text-align: left;
  }
}