/* ========================================================================
   Wide Desktop and Large Screens (min-width: 1047px)
   ======================================================================== */


@media screen and (min-width: 1047px) and (max-width: 1200px) {
      /* Curriculum section collapses to single column */
    section#curriculum {
        grid-template-columns: 1fr;
   
    }
    div#curriculum-intro, div.section-box {
        grid-column: 1 / 2;
    }
    div.section-box h3 {
      flex-direction: row;
      align-items: stretch;
      justify-content: flex-start;
      margin: 0 0 1rem 0;
      width: 100%;
    }
    div.section-box h3 div {
      margin-top: 0.5rem;
      margin-left: 0.5rem;
       display: flex;
      align-items: center;
    }
    div.section-box h3 img {
      width: 5rem;
      margin-bottom: 0rem;
    }
    div.section-box h3 label {
      display: flex;
      align-items: center;
      margin-left: 1rem;
    }

}
@media screen and (min-width: 1047px) {

    /* Curriculum section gets extra left margin on wide screens */
    section#curriculum {
        margin-left: 2rem;
    }

    /* Navigation dropdown menus:
       - Reveal submenus when hovered or focused (keyboard accessible)
       - Ensure compatibility with Superfish plugin’s .sfHover class */
    .main-navigation li.menu-item-has-children:hover > .sub-menu,
    .main-navigation li.menu-item-has-children:focus-within > .sub-menu,
    .main-navigation li.sfHover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: opacity .2s ease, transform .2s ease, visibility 0s linear 0s;
        pointer-events: auto;
    }
   
          
}

/* ========================================================================
   Large Tablets and Narrow Desktops (max-width: 1046px)
   ======================================================================== */
@media screen and (max-width:1046px) {

    /* Home content grid layout: 3 unequal columns */
    div#home-content {
        grid-template-columns: 60% 20% 20%;
    }

    /* Hero text resizing */
    div.hero h1 {
        font-size: 3.2rem;
        line-height: 4rem;
    }
    p.tagline {
        font-size: 1.5rem;
        line-height: 2.25rem;
    }

    /* Curriculum section expands to full width */
    section#curriculum {
        width: 100%;
    }

    /* About + curriculum intro span full width of grid */
    section#about, section#curriculum, div#curriculum-intro {
        grid-column: 1 / 4;
    }

    /* Reordering "About" section elements for smaller layouts */
    div#home-content section#about h2 {
        order: 1;
    }
    div#home-content section#about p {
        order: 2;
        margin-top: 0rem;
        margin-bottom: 1rem;
    }
    section#about img {
        order: 3;
        margin: 1rem auto;
        width: 600px;
    }
    section#about a {
        order: 4;
        margin-top: 1.4rem;
    }

    /* Grey boxes (curriculum intro subsections) span full grid width */
    div#curriculum-intro div.section-box {
        grid-column: 1 / 4;
    }

    /* Adjust button alignment inside About */
    div#home-content section#about p {
        margin-bottom: 0rem;
    }
    div#home-content section#about a.primary-btn {
        align-self: flex-start;
        max-width: 550px;
        margin: 0px auto;
    }

    /* Research section layout (text vs. image columns) */
    section#research-text {
        margin-left: 0rem;
        margin-right: 2rem;
        grid-column: 1 / 2;
        order: 1;
    }
    section#research-image {
        order: 2;
        grid-column: 2 / 4;
    }
    section#cop {
        order: 3;
    }

    /* Community of Practice (cop) section becomes single column */
    section#cop {
        grid-template-columns: 1fr;
    }
    section#cop .text-container {
        display: flex;
        flex-direction: column;
    }
    section#cop .primary-btn {
        text-align: center;
        max-width: 500px;
        margin: 0px auto;
    }
}

/* ========================================================================
   Phones and Narrow Tablets (max-width: 980px)
   ======================================================================== */
@media screen and (max-width:980px) {

    /* Research text & image stack into one column */
    section#research-text,
    section#research-image {
        grid-column: 1 / 4;
    }

    /* Research section styling refinements */
    section#research-text a {
        display: block;
        text-align: center;
    }
    section#research-image div.img-container {
        width: 100%;
    }
    section#research-image div.img-container img {
        width: 600px;
        margin: 0px auto;
    }

    /* Mobile navigation menu distribution */
    ul#menu-main-navigation-1 {
        display: flex;
        justify-content: space-between;
    }

    /* Add compact padding for mobile header/content/footer */
    header, div.content, footer {
        padding: 1rem 2rem;
    }

    /* Adjust About section button alignment */
    div#home-content section#about a.primary-btn {
        align-self: flex-end;
        margin-top: 1rem;
    }

    /* About + curriculum intro span entire width */
    section#about, section#curriculum, div#curriculum-intro {
        grid-column: 1 / 4;
    }

    /* Hero section adjusts text width and spacing */
    div#hero-text {
        width: calc(57% - 4rem);
        padding: 0rem var(--horiz_wrap_pad);
    }
    div.hero h1 {
        font-size: 2.3rem;
        line-height: 2.8rem;
        margin: 0 0 0.8rem 0;
    }
    p.tagline {
        font-size: 1.4rem;
        line-height: 2.1rem;
    }
    a.primary-btn {
        font-size: 1rem;
        line-height: 1.7rem;
    }

   
    body.module-template h3#module-hook {
        font-size: 2rem;
        line-height: 3rem;
        font-weight: normal;
        margin-top: 0rem;
    }
    img.module-banner__img {
        display: none;
    }
}

/* ========================================================================
   Moderate Displays (min-width: 769px and max-width: 980px)
   ======================================================================== */
@media screen and (min-width: 769px) and (max-width: 980px) {
  
    /* Logo and navigation scaling for mid-size devices */
    #site-logo {
        width: 4rem;
    }
    header #site-logo #site-description h2 {
        font-size: 1rem;
    }
    header#site-header nav#site-navigation ul li a {
        font-size: 1rem;
    }
}

/* ========================================================================
   Tablet and Larger (min-width: 769px)
   ======================================================================== */
@media screen and (min-width: 769px) {
 
    

    /* Submenus get padding, background color, and positioned dropdown */
    ul.sub-menu {
        padding: 4px 4px 8px 4px;
        background-color: var(--lightnavy);
        border-top: 3px solid var(--white);
        position: absolute;
    }

    /* Adjust contact button spacing */
    a.contact-btn {
        margin-right: 1rem;
    }

    /* Hide mobile-specific menu elements */
    div.oceanwp-mobile-menu-icon {
        display: none;
    }
    div#mobile-dropdown {
        height: 0rem;
        opacity: 0;
        margin: 0rem;
    }
}


/* ========================================================================
   Large Phones & Small Tablets (min-width: 550px, max-width: 768px)
   ======================================================================== */
@media screen and (min-width: 661px) and (max-width: 768px) {
   
  
    /* Prevent menu overflow alignment issues */
    ul#menu-main-navigation-1 ul.sub-menu {
        margin-right: -4rem;
    }

    /* Center align mobile search form */
    div#mobile-menu-search form.mobile-searchform {
        text-align: center;
    }

    /* Standardize button size */
    a.primary-btn {
        font-size: 1rem;
        line-height: 1.7rem;
    }

    /* Main nav distribution */
    ul#menu-main-navigation-1 {
        display: flex;
        justify-content: space-between;
    }

    ul#menu-main-navigation-1 ul.sub-menu li:before {
      content: '\2013';
      display: inline-block;
      color: #FFF;
      position: relative;
      margin-right: 0.25rem;

    }
}


/* ========================================================================
   Small Tablets and All Phones (max-width: 768px)
   ======================================================================== */
@media screen and (max-width: 768px) {
    div#mobile-dropdown ul li a {
        font-size: 1.2rem;
        line-height: 1.8rem;
        cursor: pointer;
    }
    section#curriculum {
        grid-gap: 0px;
    }
    section#curriculum .section-box {
        margin-top: 1rem;
    }
 

    /* Header layout switches to 2-column grid */
    #site-header-inner {
        grid-template-columns: 1fr 1fr;
    }

    /* Smaller typography inside header */
    header #site-logo #site-description h2 {
        font-size: 0.8rem;
    }
    button#searchform-submit {
        padding: 0.5rem;
        font-size: 0.75rem;
        font-weight: bold;
    }

    /* Align mobile menu icon right */
    div.oceanwp-mobile-menu-icon {
        text-align: right;
    }

    /* Reorder header sections */
    #top-search-contact-outer {
        order: 2;
    }
    div#mobile-dropdown, input#ocean-search-form-1 {
        display: none;
    }

    /* Center align top search/contact section */
    div#top-search-contact-outer {
        grid-column: 1 / 4;
    }
    div#top-search-contact-inner {
        justify-content: center;
    }
    /* center headers */
    div.header-page-title h1,
    div.content-wrap h2.page-subtitle {
        text-align: center;
    }

    div.content-wrap h2.page-subtitle {
        font-size: 2.4rem;
        line-height: 3.6rem;
    }

    /* Logo resizing and repositioning */
    #site-logo {
        width: 3rem;
        grid-row: 1 / 2;
    }
    div#site-logo-inner img.custom-logo {
        width: 4em;
    }

    /* Hide desktop navigation */
    #site-navigation-wrap {
        display: none;
    }

    /* Hero layout: column stack, no hero image */
    div.hero {
        flex-direction: column;
        padding-top: 0.5rem;
    }
    div.hero h1 {
        padding-right: 0rem;
    }

    div#hero-text {
        width: calc(100% - 2*var(--horiz_wrap_pad_mobile));
        padding: 0rem var(--horiz_wrap_pad_mobile) 2rem;
    }
    div#hero-image {
        display: none;
    }

    /* Mobile hamburger icon sizing */
    .oceanwp-mobile-menu-icon i.fa-bars {
        font-size: 2.5rem;
    }

    /* Mobile search form button styles */
    form.mobile-searchform button.searchform-submit {
        padding: 0.6rem 1.2rem;
        border: 0px;
        border-radius: 0px 16px 16px 0px;
        position: relative;
        left: -0.12rem;
    }
    a#top-contact-btn {
        position: absolute;
        top: 0.5rem;
    }
    input#ocean-mobile-search-2:focus ~ button.searchform-submit {
        border-left-width: 0px;
    }

    /* Hide descriptive text for screen readers only */
    .oceanwp-mobile-menu-icon .oceanwp-text,
    .oceanwp-mobile-menu-icon .oceanwp-close-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    /* stack the copyright and creative commons text */
    #footer-bottom #copyright {
      flex-direction: column;
      align-items: center;
      text-align: center;
    }
    #footer-bottom #copyright p {
        margin: 0.2rem 0;
    }

  /* sitewide */
  header#site-header,
  div.content,
  footer#footer,
  div.content-wrap,
  div#content-wrap,
  header.page-header {
    padding-left: var(--horiz_wrap_pad_mobile);
    padding-right: var(--horiz_wrap_pad_mobile);
  }
  a#scroll-top {
    bottom: 1rem;
    right: 1rem;
  }
  /* interiors */

  nav.pagination {
        justify-content: center;
   }

  form#resource-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
form#resource-filters button[type="submit"] {
        margin-top: 1rem;
        grid-column: 1 / 3;
        justify-self: center;
 }
  div#resource-link-section {
    flex-direction: column;
    text-align: center;
  }
  div#download-file-container {
    margin-right: 0rem;
    margin-bottom: 1rem;
  }
  div#resource-category-filter {
    margin-right: 0rem;
  }
  div#filter-submit-container {
    grid-column: 1 / 3;
    text-align: center;
    margin-top: 1rem;
  }
  
  /* Hide table chrome but keep it accessible */
  table#instruments-table {
    border: 0;
  }
  table#instruments-table thead {
    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;
  }

  /* Make rows look like cards */
  table#instruments-table tbody,
  table#instruments-table tr,
  table#instruments-table td {
    display: block;
    width: 100%;
  }
    body:not(.home) div#mobile-dropdown {
        margin-bottom: 0rem;
        margin-top: 0rem;
    }
    header#site-header {
        padding-left: 0rem;
        padding-right: 0rem;
        padding-bottom: 0rem;
    }

    header#site-header div#site-header-inner {
        padding-left: var(--horiz_wrap_pad_mobile);
        padding-right: var(--horiz_wrap_pad_mobile);
    }
}

@media screen and (max-width: 1180px) {

  table#instruments-table tbody tr {
    border: 1px solid var(--darkgrey);
    border-radius: 0.75rem;
    background: var(--offwhite);
    margin: 1rem 0;
    overflow: hidden;

  }

  
  table#instruments-table tbody tr td:first-child .instrument-link {
    display: inline-block;
    font-weight: 700;
    text-decoration: none;
  }

  /* Stack the rest of the properties */
  table#instruments-table tbody tr td {
    border: 0 0 1px 0;
    padding: 0.75rem 1rem;
  }
  table#instruments-table tbody tr td + td {
    border-top: 1px solid var(--darkgrey);
  }
  table#instruments-table tbody tr td:last-child {
    margin-bottom: 0.25rem;
  }

  /* Print the "key" (column header) before each value */
  table#instruments-table tbody tr td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--darkblue);
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
  }
}


/* from interiors */

@media screen and (min-width:1181px) {

    table#instruments-table tbody tr:nth-child(even) {
      background-color: var(--offwhite);
    }
    
    table#instruments-table {
        border-collapse: collapse;
        table-layout: fixed;
         max-width: 100%;
    }
    table#instruments-table tr td.year p,
    table#instruments-table tr td.num-items p {
       text-align: center;
    }

}


@media screen and (max-width:1180px) {
      table#instruments-table tbody tr td:nth-of-type(odd):not(first-child) { background: var(--white); }
      table#instruments-table tbody tr td:nth-of-type(even) { background: var(--offwhite); }
            /* Put the first cell (usually title/link) at the very top as a header area */
      table#instruments-table tbody tr td:first-child {
            order: 0;
            padding: 1rem 1rem 0.75rem 1rem;
            border-bottom: 1px solid var(--darkgrey);
            background: var(--darkblue);
       }
    /* Alternate white / skyblue per property within the card */


    table#instruments-table tbody tr td.instrument-name:first-child {
        background: var(--darkblue);
    }
    table#instruments-table tbody tr td.instrument-name a {
        color: var(--white);
    }
    table#instruments-table tr th,
    table#instruments-table tr td {
        max-width: calc(100% - 2rem);
    }

 
    table#instruments-table,
    table#instruments-table thead,
    table#instruments-table tbody,
    table#instruments-table tr,
    table#instruments-table th,
    table#instruments-table td {
    display: block;          /* critical: no table semantics */
    height: auto;            /* ensure natural height */
    overflow: visible;       /* avoid clipping */
    }




  /* Alternate blue/white for each property within the card */
  /*table#instruments-table tbody tr td:nth-of-type(odd) {
    background: var(--white);
  }*/



  /* Tweak existing bits for card view */
  table#instruments-table tr td p.bool { text-align: left; }
  table#instruments-table tr td ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
  }
  table#instruments-table tr td ul li {
    list-style: none;
    padding-bottom: 0.5rem;
  }
}

/* Keep your original wide-screen table as-is (≥ 768px) */


/* Team Page */
@media screen and (max-width:1100px) {
    div.gallery-grid {
        grid-gap: 4rem;
    }
}

/* Module page */
@media screen and (min-width: 981px) {
    h3.module-hook {
        display: none;
    }
    div#module-banner {
        background-color: var(--bannerblue);
    }
}
/* ==== Two-column card grid (769px–1180px) ==== */
@media screen and (min-width: 769px) and (max-width: 1180px) {
  /* Reset table chrome */
  table#instruments-table {
    border: 0;
    border-collapse: separate;
    width: 100%;
  }


  /* Visually hide the header but keep it for a11y */
  table#instruments-table thead {
    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;
  }

  /* Make tbody the grid container */
  table#instruments-table tbody {
    display: grid;
    grid-template-columns: 1fr 1fr;           /* two columns */
    gap: 1.25rem;                              /* space between cards */
  }

  /* Each row becomes a card */
  table#instruments-table tbody tr {
    display: block;
    border: 1px solid var(--darkgrey);
    border-radius: 0.75rem;
    background: var(--white);
    overflow: hidden;
  }

  /* Kill row/column borders from wide styles */
  table#instruments-table tbody tr { border-bottom: 1px solid var(--darkgrey); }
  table#instruments-table tr td:not(:last-child) { border-right: 0; }
  table#instruments-table tbody tr:nth-child(even) { background: var(--offwhite); } /* override stripe */
  table#instruments-table tbody tr:nth-child(odd) { background: var(--offwhite); }
    
  /* Stack cells inside the card */
  table#instruments-table tbody tr td {
    display: block;
    padding: 0.85rem 1rem;
    border: 0;
  }
  table#instruments-table tbody tr td + td {
    border-top: 1px solid var(--darkgrey);
  }

  /* First cell acts like a card header (link/title at top) */
  table#instruments-table tbody tr td:first-child {
    background: var(--offwhite);
    border-bottom: 1px solid var(--darkgrey);
    padding: 1rem 1rem 0.85rem;
  }
  table#instruments-table tbody tr td:first-child .instrument-link {
    display: inline-block;
    font-weight: 700;
    text-decoration: none;
  }

  /* Print the key (column header) before the value */
  table#instruments-table tbody tr td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--darkblue);
    margin-bottom: 0.25rem;
  }



  /* Tidy lists/bools for card view */
  table#instruments-table tr td p.bool { text-align: left; }
  table#instruments-table tr td ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
  }
  table#instruments-table tr td ul li {
    list-style: none;
    padding-bottom: 0.5rem;
  }

  /* Keep type sizes consistent from your base */
  table#instruments-table tr td,
  table#instruments-table tr th,
  table#instruments-table tr td * {
    font-size: 1rem;
    line-height: 1.4rem;
  }
}


/* Responsive for Module List */
@media screen and (max-width:768px) {
    /* team and resources */
     div.gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-column-gap: 2rem;
        grid-row-gap: 1rem;
    }
    /* partners */

    div.partner-list {
        grid-template-columns: 1fr;
        grid-gap: 2rem;
    }
    #partners-intro-image {
      margin-right: 0px;
   }

    /* modules */
  
    body.module-template h3#module-hook {
        font-size: 1.8rem;
        line-height: 2.7rem;
        margin-bottom: 0.7rem;
    }

    ul#content-tags {
       justify-content: center;
    }
    

    /* module list */
    .module-item-container {
        flex-direction: column;
        /* need room for plus sign button */
        padding-bottom: 4rem;
    }
    .module-image-container {
        margin: 0px;
        text-align: center;
        width: 100%;
        display: none;
    }
    .module-image-container img {
        margin: 0px;
        text-align: center;
        width: 100%;
    }
    .plus-link {
        position: relative;
        align-self: flex-end;
        width: 2rem;
        height: 2rem;
        font-size: 1.5rem;
        right: 0rem;
    }
    a.plus-link span {
        margin-top: 0px;
    }
    .module-item-container h3 a {
        text-align: center;
    }
    
}
@media screen and (min-width:661px) and (max-width: 768px) {
       section#curriculum #section-box-ai-literacy {
        margin-right: 0.5rem;
    }
    section#curriculum #section-box-data-science {
        margin-left: 0.5rem;
    }
}
/**
  * Responsive adjustments 
  */
@media screen and (min-width: 661px) and (max-width: 980px) {

    /* Apply sidebar styling if sidebar is present */
    
    div#content-wrap div#primary.has-sidebar {
     width: calc(100% - var(--sidebar_mobile_gap) - var(--sidebar_mobile_width));  
     margin-right: var(--sidebar_mobile_gap);
   }
   /* Sidebar area */
   aside#custom-sidebar {
    width: var(--sidebar_mobile_width);
   }   
}


/**
 *  Sidebar moves to bottom and more things get centered.
 */

@media screen and (max-width:480px) {
   
      form#resource-filters button[type="submit"] {
        justify-self: auto;
    }
}

/* ========================================================================
   Phones and Very Narrow Screens (max-width: 660px)
   ======================================================================== */
@media screen and (max-width:660px) {
      /* Main nav distribution */
 
    div#mobile-dropdown nav ul#menu-main-navigation-1 {
        flex-direction: column;
        text-align: center;
        margin: 0rem;
        padding-top: 0rem;

    }
    div.header-page-title h1 {
        margin-bottom: 1.25rem;
    }
   
    ul#menu-main-navigation-1 ul.sub-menu li::before {
        content:'';
    }
    div#mobile-menu-search {
        text-align: center;
        padding-top: 1rem;
    }
    div#mobile-dropdown nav ul li a {
        padding: 1rem;
        display: block;
        transition: background-color 0.2s ease;
    }
    div#mobile-dropdown nav ul li a:hover {
        background-color: var(--darkblue);
        transition: background-color 0.2s ease;
        text-decoration: none;
    }
    ul#menu-main-navigation-1 li a {
        border-bottom: 1px solid var(--darkblue);
    }
    ul#menu-main-navigation-1 ul.sub-menu li a {
        background-color: var(--midnightblue);
    }
    /* end menu styles */
     
    /* Center align headings and hero text */
    div#home-content section h2 {
        text-align: center;
        width: 100%;
        font-size: 2.2rem;
        line-height: 3.3rem;
        margin-bottom: 1rem;
    }
    div.hero h1 {
        font-size: 2rem;
        line-height: 2.5rem;
        width: 100%;
    }
    p.tagline {
        font-size: 1.2rem;
        line-height: 1.8rem;
    }
    a.primary-btn {
        font-size: 0.9rem;
        padding: 0.3em 1em;
    }

    div.hero h1,
    p.tagline,
    #hero-text .btn-container {
        text-align: center;
    }

    /* Curriculum section collapses to single column */
  
    div#curriculum-intro, div.section-box {
        grid-column: 1 / 2;
    }

    /* From interiors */
    section#curriculum,
     body.page-template-resources div.gallery-grid {
        grid-template-columns: 1fr;
    }
 
    /* modules */
    div#content-wrap,
    div.content-wrap {
        flex-direction: column;
    }
    body.module-template #download-file {
        text-align: center;
    }
    /* sidebar is now at the bottom */
    div#content-wrap div#primary.has-sidebar {
     width: 100%;
     margin-right: 0rem;
    }
    /* Sidebar area */
    aside#custom-sidebar {
     width: 100%;
    }
    div.custom-sidebar__button,
    div.custom-sidebar__inner {
        max-width: 20rem;
        margin: 1.5rem auto 0 auto;
    }
    div.custom-sidebar__image {
        text-align: center;
    }
    
    form#resource-filters {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    form#resource-filters button[type="submit"] {
        margin-top: 1rem;
    }
    div#resource-search-container,
     div#resource-category-filter {
        margin-bottom: 1rem;
     }
}
@media screen and (min-width: 511px) and (max-width: 660px) {
    /* reduced logo sizes in footer */
    /* specific logo sizes */
    footer img#nsf-footer-logo {
      width: 4.5rem;
    }
    footer img#aicc-footer-logo {
     width: 5.25rem;
    }
    footer img#mail-footer-icon {
      width: 3rem;
    }
    footer img#edc-footer-logo {
      width: 9rem;
    }
    footer a.contact-us-link .email-text {
      font-size: 0.9rem;
      margin-top: 0.1875rem;
    }
}

@media screen and (max-width: 510px) {
    footer .footer-logos {
      flex-direction: column;
    }
    body.page-template-team div.gallery-grid {
        grid-template-columns: 1fr;
    }
}

