﻿/* ============================================================
   MotorCity Casino Hotel
   Booking Calendar Accessibility Overrides
   WCAG 2.1 AA Criterion 1.4.4 – Resize Text (200% zoom)
   WCAG 2.1 AA Criterion 1.4.12 – Text Spacing
   ============================================================ */

/* --- WCAG 1.4.12 Text Spacing Requirements ---------------- */
/* Applied globally to ensure user overrides work properly */
html, body, button, input, select, textarea, 
.calendar-box, .label, .cal-text, 
.mobile-nav-item, .navbar, 
p, h1, h2, h3, h4, h5, h6, 
a, span, div {
    /* Line height: at least 1.5x font size */
    line-height: 1.5 !important;
    /* Letter spacing: at least 0.12x font size */
    letter-spacing: 0.12em !important;
    /* Word spacing: at least 0.16x font size */
    word-spacing: 0.16em !important;
}

/* Paragraph spacing: at least 2x font size */
p {
    margin-bottom: 2em !important;
}

/* Headings should have proper spacing */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1em !important;
    margin-top: 1.5em !important;
}

/* First heading shouldn't have top margin */
h1:first-child, h2:first-child, h3:first-child,
h4:first-child, h5:first-child, h6:first-child {
    margin-top: 0 !important;
}

/* Lists should have proper spacing */
ul, ol {
    margin-bottom: 2em !important;
}

li {
    margin-bottom: 0.5em !important;
}

/* Exception: Material Icons shouldn't have letter spacing */
.material-icons {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

/* Exception: Monospace/code elements */
code, pre, .monospace {
    letter-spacing: normal !important;
}

/* Exception: Calendar table cells need tighter spacing */
.calendar-table th,
.calendar-table td {
    letter-spacing: 0.05em !important;
    word-spacing: normal !important;
}

/* --- Screen Reader Only Content --------------------------- */
/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
padding: 0 !important;
    margin: -1px !important;
  overflow: hidden !important;
 clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focusable screen reader only content */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* --- Root font-size and text scaling foundation ------------ */
html {
    font-size: 100%; /* Respect user's browser font size preferences */
    height: 100%;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent body scroll, content scrolls in designated area */
}

/* Ensure all text can scale to 200% without loss of content or functionality */
* {
    box-sizing: border-box;
}

/* --- Modern Layout System ---------------------------------- */
/* Replace absolute positioning with CSS Grid for better flexibility */

#main-layout {
    display: grid;
    grid-template-rows: auto 1fr auto; /* header content footer */
    grid-template-areas: 
  "header"
        "content" 
   "footer";
    height: 100vh;
    min-height: 100vh;
}

/* Header area - flexible height based on content */
.top-panel {
    grid-area: header;
    position: relative; /* Remove absolute positioning */
    z-index: 100;
    background-color: #000;
  /* Keep full width background but center content */
    width: 100%;
}

/* Header background - full width but content constrained */
.top-panel .background {
    position: relative;
    padding: 1rem 0; /* Remove horizontal padding, add vertical */
    width: 100%; /* Full width background */
    /* Center the content within */
    display: flex;
    justify-content: center;
}

/* Header content wrapper with max-width constraint */
.top-panel .background .row {
    width: 100%;
    max-width: 68.75rem; /* ~1100px equivalent - same as main content */
    margin: 0 auto;
    padding: 0 1rem; /* Add horizontal padding back to content */
}

/* === TARGETED FIX: Main content area overflow/truncation === */
.main-content-area {
    grid-area: content;
    /* Allow vertical scrolling, prevent horizontal scroll */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* Remove fixed padding that might constrain content */
    padding: 0 !important;
    background-color: #000;
    /* Add scroll padding to account for enlarged text */
    scroll-padding-top: 1rem;
    scroll-padding-bottom: 1rem;
    /* Center content and limit max width */
    display: flex;
    justify-content: center;
}

/* Content wrapper with max-width constraint */
.main-content-area > * {
    width: 100%;
    max-width: 68.75rem; /* ~1100px equivalent */
    margin: 0 auto;
    /* Add padding here instead of on main-content-area */
    padding: 1rem;
}

/* Footer area - flexible height based on content */
.footer-panel {
    grid-area: footer;
    background-color: #101010;
    color: #808080;
    padding: 0;
    position: relative; /* Remove absolute positioning */
    z-index: 100;
    /* Prevent footer from shrinking */
    flex-shrink: 0;
    /* Center footer content with same max-width */
    display: flex;
    justify-content: center;
}

.footer-panel > * {
    width: 100%;
    max-width: 68.75rem; /* ~1100px equivalent */
    margin: 0 auto;
}

/* --- Responsive Layout Adjustments ----------------------- */
@media only screen and (max-width: 56.1875em) { /* 899px */
    #main-layout {
  grid-template-rows: auto 1fr auto;
    }
 
    .main-content-area {
        padding: 0;
    }
    
.footer-panel {
        padding: 0;
    }
    
    /* Mobile header adjustments */
    .top-panel .background {
        padding: 0.5rem 0;
    }
    
    .top-panel .background .row {
        padding: 0 0.5rem;
    }
}

@media only screen and (min-width: 56.25em) { /* 900px */
    .main-content-area {
        padding: 0;
    }
    
    /* Desktop header adjustments */
    .top-panel .background {
        padding: 1rem 0;
    }
 
    .top-panel .background .row {
        padding: 0 1.5rem;
    }
}

/* --- Navigation and Header Improvements ------------------- */
.navbar {
    background-image: linear-gradient(to bottom, #222222, #111111);
    text-align: center;
    padding: 1rem;
    position: relative; /* Remove absolute positioning */
    min-height: 3.5rem; /* Flexible minimum height */
    /* Center navbar content */
    display: flex;
    justify-content: center;
}

.navbar > * {
    width: 100%;
    max-width: 68.75rem; /* ~1100px equivalent */
    margin: 0 auto;
}

/* Mobile Navbar Overrides */
.navbar.mobile-only {
    padding: 0 !important;
    display: block !important;
}

/* Ensure mobile header stays visible and accessible */
@media only screen and (max-width: 56.1875em) { /* 899px */
    .navbar.mobile-only {
        width: 100% !important;
   max-width: 100% !important;
    }
    
    /* Override column behavior for mobile header specifically */
    .navbar.mobile-only [class*="col-"],
    .navbar.mobile-only [class*="fcol-"] {
        width: auto !important;
        float: none !important;
        padding: 0 !important;
   display: inline-block !important;
    }
}

/* --- Content Area Flexibility ---------------------------- */
/* Replace fixed scroll panels with flexible containers */
.scroll-panel {
    /* Remove absolute positioning and fixed heights */
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
  overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
}

.scroll-offset {
    width: 100%;
    max-width: 68.75rem; /* Match main content max-width */
    margin: 0 auto !important;
  padding: 0rem !important;
    text-align: left !important;
}

/* --- Width and Container Improvements -------------------- */
/* Prevent any containers from causing horizontal overflow */

.row {
    margin-left: auto;
    margin-right: auto;
  /* Ensure rows can expand for larger text */
    min-height: auto;
    overflow: visible;
    /* Add flex properties for better layout */
    flex-wrap: wrap;
}

/* Special handling for navbar row to respect max-width */
.navbar .row {
    max-width: 68.75rem !important; /* Match content max-width */
}

/* Make all column classes responsive to text scaling */
[class*="col-"],
[class*="fcol-"] {
    min-width: 0 !important; /* Prevent flex items from overflowing */
    max-width: 100%; /* Ensure columns don't exceed container */
  word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* Add padding for better spacing at high zoom */
    padding: 0.5rem;
}

/* Tables that need to be flexible */
.w-100,
table.w-100 {
    width: 100%;
  max-width: 100%;
    table-layout: auto !important; /* Allow flexible table layout */
    word-wrap: break-word;
}

/* Table cells that need flexibility */
.td-25,
.td-75 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
    /* Remove fixed widths on small screens */
}

/* Responsive table cells */
@media (max-width: 56.1875em) 
{ /* 899px or high zoom */
    .td-25,
    .td-75 {
        display: block !important;
        width: 100%;
        border: none !important;
        padding: 0.5rem !important;
    }

    /* Stack table content vertically on small screens */
    table.w-100 tr,
    table.w-100 td {
        display: block !important;
        width: 100%;
    }
}
/* --- General structure ------------------------------------- */

/* Keep the two-month calendar layout but allow text reflow */
.calendar-box {
    overflow: visible !important;
    vertical-align: top;
  padding: 0.25rem;
    min-width: 18.75rem; /* Changed from 300px to rem */
    max-width: 100%;
    box-sizing: border-box;
}

/* Month header reflows */
.cal-header {
    font-size: 1.2rem;
    font-weight: 600;
 white-space: nowrap;
overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

/* Arrow buttons scaled with relative units */
.arrow-left,
.arrow-right {
    width: 2.5em;
    height: auto;
    /*padding: 0.3em;*/
    color: #fff;
    background-color: unset;
    border: 0;
        /* Ensure arrows stay above other content */
    position: absolute;
  z-index: 10;
}

/* Prevent calendar header overlap with arrow buttons */
.calendar-box .font-18.h-50,
.calendar-box .p-5-0.h-50,
.calendar-box .d-block.h-50 {
    /* Allow height to expand with text spacing */
    height: auto !important;
  min-height: 50px !important;
    /* Ensure content doesn't overlap with arrows */
    padding-left: 3em !important;
    padding-right: 3em !important;
}

/* Legend readability */
.cal-text {
    font-size: 0.95rem;
    line-height: 1.4;
    padding-left: 0.5em;
}

/* --- Calendar grid stabilization ---------------------------- */

.calendar-table {
  table-layout: fixed;
    border-collapse: collapse;
    width: 100%;
    font-size: inherit;
}

.calendar-table th,
.calendar-table td {
    text-align: center;
    vertical-align: middle;
    height: auto;
    padding: 1px;
    font-size: 0.9rem;
    word-break: break-word;
    min-height: unset;
}

.calendar-table tbody tr {
    padding: 0px;
}

/* Equal-width cell containers (7 columns) */
.calendar-cell {
    position: relative;
    min-width: calc(100% / 7);
    min-height: 2.5em;
    padding: 0.3em;
    box-sizing: border-box;
    overflow: visible;
}

/* Day item layout with reliable centering */
.calendar-item {
  position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.2em;
    width: 100%;
  border-radius: 0;
    box-sizing: border-box;
}

/* Background layers keep color logic */
.calendar-item-avail,
.calendar-item-unavail,
.calendar-item-selected {
    position: absolute;
    inset: 0;
    border-radius: 0px;
}

.calendar-item-avail {
    background-color: #228B22;
    z-index: 1;
}

.calendar-item-unavail {
    background-color: #B22222;
    z-index: 1;
}

.calendar-item-selected {
    border: 2px solid #fff;
    z-index: 2;
}

/* Date text centers and scales naturally */
.calendar-item-text {
    position: relative;
    z-index: 3;
    font-size: 1.4rem;
    text-align: left;
    color: #fff;
    white-space: normal;
    word-break: break-word;
    padding: 0.3125rem; /* Changed from 5px to rem */
}

/* Disabled/past days stay dim but still readable */
.calendar-cell[aria-hidden="true"],
.calendar-item.disabled {
    opacity: 0.4;
}

/* --- Comprehensive font-size overrides -------------------- */
/* Ensure all remaining pixel-based font sizes are converted */

/* Override any remaining fixed pixel fonts in components */
.font-20,
.font-18,
.font-16,
.font-15,
.font-14,
.font-13,
.font-12 {
    font-size: 1rem !important; /* Force relative sizing for critical text */
}

/* Specific component overrides */
.book-success {
 font-size: 2.5rem !important; /* Was 40px */
    padding: 2.5rem;
    color: white;
    text-align: center;
}

.confirm-num {
    font-size: 1.875rem !important; /* Was 30px */
    padding: 1.25rem;
 color: white;
    text-align: center;
}

.no-avail-alert {
    font-size: 2.1875rem !important; /* Was 35px */
}

/* Material icons scaling */
.material-icons {
    font-size: 1.5em !important; /* Scale with parent text */
}

.menu-icon {
    font-size: 2.375rem !important; /* Was 38px */
    line-height: 55px;
    vertical-align: top;
    padding-left: 0.75rem;
}

.back-icon-mob {
    font-size: 2.375rem !important; /* Was 38px */
    line-height: 55px;
    vertical-align: top;
    padding-left: 0.75rem;
    color: white;
    background-color: unset;
    border: none;
}

/* --- Container and layout flexibility -------------------- */
.h-50,
.h-245,
.mh-461 {
    height: auto !important;
    min-height: auto !important;
}

/* Flexible containers to prevent overflow */
.container {
    max-width: 68.75rem; /* Match main content max-width */
    width: 100%;
    margin: 0 auto;
}

/* Ensure images can scale properly */
img {
    max-width: 100%;
  height: auto;
}

.w-300 {
    width: 18.75rem; /* Changed from 300px */
  max-width: 100%;
}

.w-388 {
    width: 24.25rem; /* Changed from 388px */
    max-width: 100%;
}

/* --- Grid System Improvements ----------------------------- */
/* Make the grid system more flexible for text scaling */
[class*="col-"],
[class*="fcol-"] {
    min-height: auto;
  padding: 0.5rem; /* Add padding for better spacing */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent float-based layout from breaking at high zoom */
@media (min-width: 56.25em) { /* 900px */
 [class*="col-"],
    [class*="fcol-"] {
        float: left;
    }
}

@media (max-width: 56.1875em) { /* 899px */
    [class*="col-"],
    [class*="fcol-"] {
     float: none;
        width: 100%;
        display: block;
    }
}

/* --- Responsive stacking at zoom ---------------------------- */
@media screen and (min-width: 56.25em) { /* 900px */
    .calendar-box {
        /* Maintain side-by-side layout on larger screens */
    }

    .calendar-table td {
        width: 14.285%; /* maintain 7 columns */
    }
}

/* For narrow viewports or extreme zoom, stack months vertically */
@media screen and (max-width: 56.1875em), (min-resolution: 2dppx) { /* 899px */
    .calendar-box {
     width: 100%;
    }
    
    /* Stack calendar months vertically on smaller screens */
    .col-6:has(.calendar-box) {
        width: 100%;
    }
}

/* --- Legend elements accessibility -------------------------- */
.avail-bg,
.sold-bg,
.current-bg {
    height: 1.2em;
    width: 1.2em;
    border-radius: 2px;
    display: inline-block;
}

/* --- Focus indicators (preserve keyboard visibility) --------- */
.calendar-cell:focus,
button:focus,
input:focus,
[tabindex="0"]:focus {
    outline: 2px solid #006dcc;
    outline-offset: 2px;
}

/* High contrast focus for calendar navigation */
.arrow-left:focus,
.arrow-right:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    background-color: rgba(0, 109, 204, 0.3);
}

/* --- Text wrapping and overflow prevention ------------------ */
/* Prevent text truncation at high zoom levels */
.cal-text,
.label,
.button,
.buttonSmaller,
.room-type,
.rate-name {
    white-space: normal !important;
  word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure form labels remain readable */
.required-field {
    position: relative;
    float: none;
    display: inline-block;
margin-left: 0.5rem;
}

/* --- Form and Input Improvements --------------------------- */
.number-input,
.text-box {
    max-width: 100%; /* Prevent inputs from overflowing */
    word-wrap: break-word;
}

/* --- High Zoom Specific Adjustments ----------------------- */
@media (min-resolution: 2dppx) {
    /* Additional adjustments for high DPI/zoom scenarios */
    .main-content-area {
        padding: 0;
    }
    
    .calendar-box {
        margin: 1rem 0;
    }
    
  [class*="col-"] {
        width: 100%;
        float: none !important;
    }
}

/* --- Extreme Zoom Breakpoint ------------------------------- */
/* Handle 200% zoom and above */
@media (max-width: 40em) { /* ~640px - Catches most 200% zoom scenarios */
    /* Force single column layout */
    [class*="col-"],
    [class*="fcol-"] {
 float: none !important;
        display: block;
    }
    
    /* Stack calendar months */
    .calendar-box {
     width: 100%;
        margin-bottom: 2rem;
    }
    
    /* Simplify table layouts */
    table,
    table tr,
    table td {
        display: block !important;
        width: 100%;
    }
    
    /* Adjust navigation */
    .navbar .row {
        flex-direction: column !important;
  }
  
    /* Make forms stack vertically */
    .form-cell {
    width: 100%;
   margin-bottom: 1rem;
    }
}

/* --- Prevent Horizontal Overflow at All Zoom Levels ------- */
/* Ensure no element can extend beyond viewport */
* {
    box-sizing: border-box !important;
}

/* Special handling for absolutely positioned elements */
[style*="position: absolute"],
[style*="position: fixed"] {
    max-width: calc(100vw - 2rem) !important;
}

/* --- Print Styles for Accessibility ----------------------- */
@media print {
    #main-layout {
        display: block !important;
        grid-template-rows: none !important;
    }
    
    .main-content-area {
      overflow: visible !important;
    }
    
    .footer-panel {
     position: static !important;
    }
}

.navbar.mobile-only [class*="fcol-"] {
    width: fit-content;
}


/* ============================================================
   End accessibility.css
   ============================================================ */
