/* Penguin PHC - Responsive Styles */

/* Mobile First Approach */

/* Extra Small Devices (320px - 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
}

/* Small Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .container {
    padding: 0 var(--spacing-lg);
  }
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .container {
    padding: 0 var(--spacing-xl);
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  
  html {
    font-size: 18px;
  }
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
  /* Sticky Header for Mobile */
  .header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-md);
  }
  
  /* Mobile Menu */
  .mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--forest-green);
    transition: left var(--transition-base);
    z-index: 2000;
    overflow-y: auto;
  }
  
  .mobile-menu.active {
    left: 0;
  }
  
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
  }
  
  .mobile-menu-overlay.active {
    display: block;
  }
  
  /* Hamburger Menu */
  .hamburger {
    display: block;
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
  }
  
  .hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--forest-green);
    transition: all var(--transition-base);
  }
  
  .hamburger span:nth-child(1) { top: 0; }
  .hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
  .hamburger span:nth-child(3) { bottom: 0; }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
  }
  
  /* Mobile Bottom Navigation */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm) 0;
  }
  
  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--forest-green);
    font-size: 0.75rem;
    padding: var(--spacing-xs);
  }
  
  .mobile-bottom-nav a svg {
    width: 24px;
    height: 24px;
    margin-bottom: var(--spacing-xs);
  }
  
  /* Touch-friendly buttons */
  .btn {
    min-height: 48px;
    min-width: 48px;
  }
  
  /* Mobile forms */
  input,
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 48px;
  }
  
  /* Floating Action Buttons */
  .fab-container {
    position: fixed;
    bottom: 80px;
    right: var(--spacing-lg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .fab {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
  }
  
  .fab:active {
    transform: scale(0.95);
  }
}

/* Desktop Navigation */
@media (min-width: 769px) {
  .hamburger,
  .mobile-menu,
  .mobile-menu-overlay,
  .mobile-bottom-nav,
  .fab-container {
    display: none;
  }
  
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
  }
  
  .desktop-nav a {
    position: relative;
    font-weight: var(--weight-semibold);
    transition: color var(--transition-base);
  }
  
  .desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--mustard-gold);
    transition: width var(--transition-base);
  }
  
  .desktop-nav a:hover::after {
    width: 100%;
  }
  
  /* Mega Menu */
  .mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
  }
  
  .has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Print Styles */
@media print {
  .no-print,
  .header,
  .footer,
  .mobile-bottom-nav,
  .fab-container,
  .btn-emergency {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Video */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper object,
.video-wrapper embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Responsive Tables */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Card-style tables on mobile */
  .responsive-table {
    display: block;
  }
  
  .responsive-table thead {
    display: none;
  }
  
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
  }
  
  .responsive-table tr {
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--medium-gray);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
  }
  
  .responsive-table td {
    text-align: right;
    padding: var(--spacing-sm);
    position: relative;
    padding-left: 50%;
  }
  
  .responsive-table td:before {
    content: attr(data-label);
    position: absolute;
    left: var(--spacing-md);
    width: 45%;
    text-align: left;
    font-weight: var(--weight-semibold);
  }
}