/*
Theme Name: DW Stack
Theme URI: https://dwstack.com/theme/
Author: DW McEwing
Author URI: https://dwstack.com
Description: DW Stack — dynamic WordPress theme.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: dw-stack
*/

/* Root variables */
:root{
  --dw-primary:#0b66a3;
  --dw-dark:#111111;
  --dw-muted:#6b6b6b;
  --dw-bg:#ffffff;
  --dw-accent:#f3f7fb;
  --dw-container:1100px;
  --dw-gap:16px;
  --dw-radius:6px;
  --dw-font-sans:"Helvetica Neue", Arial, sans-serif;
}

/* Base */
html,body{height:100%;}
body{
  margin:0;
  background:var(--dw-bg);
  color:var(--dw-dark);
  font-family:var(--dw-font-sans);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.5;
  font-size:16px;
}

/* Containers */
.dw-container{
  max-width:var(--dw-container);
  margin:0 auto;
  padding:0 var(--dw-gap);
  box-sizing:border-box;
}

/* Content */
.site-content{
  padding: 20px 0 32px 0;
}

/* ===========================
   Catalog Header
   =========================== */

.catalog-header{
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,0.08);
}

.catalog-header-inner{
  display:flex;
  align-items:center;
  gap:16px;
  padding: 14px 0;
}

.catalog-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 0;
}

/*
  Logo
  Note: WordPress outputs the custom logo as:
  <a class="custom-logo-link"><img class="custom-logo"></a>
*/
.catalog-logo,
.custom-logo-link{
  display:flex;
  align-items:center;
  text-decoration:none;
  background:none;
  padding:0;
  border-radius:0;
  box-shadow:none;
}

.custom-logo{
  display:block;
  width:auto;
  height:auto;
  max-height:56px;
}

.catalog-brand-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.catalog-site-name{
  font-weight:900;
  color:var(--dw-dark);
  text-decoration:none;
  line-height:1.1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.catalog-site-tagline{
  color:var(--dw-muted);
  font-size:13px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Header actions (top right links) */
.catalog-actions{
  margin-left:auto;
  display:flex;
  gap:6px;
  flex-wrap:nowrap;
  align-items:center;
}

.catalog-btn{
  text-decoration:none;
  font-weight:700;
  font-size:12px;
  padding:5px 9px;
  border-radius:6px;
  border:1px solid rgba(0,0,0,0.14);
  color:#111;
  background:#fff;
  white-space:nowrap;
  line-height:1.2;
}

.catalog-btn:hover{
  background:rgba(0,0,0,0.05);
}

.catalog-btn.primary{
  background:#0b66a3;
  color:#fff;
  border-color:#0b66a3;
}

.catalog-btn.primary:hover{
  background:#094f7d;
}

/* Mobile header menu toggle */
.catalog-menu-toggle{
  display:none;
  margin-left:auto;
  border:1px solid rgba(0,0,0,0.14);
  background:#fff;
  color:#111;
  border-radius:10px;
  padding:10px 12px;
  font-weight:900;
  line-height:1;
}

.catalog-menu-toggle:focus{
  outline:none;
  box-shadow: 0 0 0 3px rgba(11, 102, 163, 0.12);
  border-color: rgba(11, 102, 163, 0.45);
}

.catalog-search{
  flex: 1 1 auto;
  min-width: 220px;
}

.catalog-search-form{
  display:flex;
  gap:8px;
  align-items:center;
}

.catalog-search-input{
  width:100%;
  height:40px;
  border:1px solid rgba(0,0,0,0.14);
  border-radius:10px;
  padding:0 12px;
  font-size:14px;
  outline:none;
}

.catalog-search-input:focus{
  border-color: rgba(11, 102, 163, 0.45);
  box-shadow: 0 0 0 3px rgba(11, 102, 163, 0.12);
}

.catalog-search-btn{
  height:40px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.14);
  background:#fff;
  font-weight:800;
  cursor:pointer;
}

.catalog-search-btn:hover{
  background: rgba(11, 102, 163, 0.06);
}

/* Top nav */
.catalog-topnav{
  flex: 0 0 auto;
}

.catalog-topnav-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  gap:12px;
  align-items:center;
}

.catalog-topnav-list a{
  text-decoration:none;
  color:var(--dw-dark);
  font-weight:800;
  font-size:14px;
  padding:8px 10px;
  border-radius:10px;
}

.catalog-topnav-list a:hover{
  background: rgba(11, 102, 163, 0.06);
}

@media (max-width: 900px){
  .catalog-header-inner{
    flex-wrap:wrap;
  }
  .custom-logo{
    max-height:46px;
  }

  .catalog-menu-toggle{
    display:inline-flex;
    align-items:center;
    gap:8px;
  }

  /* Hide header links until the menu is opened */
  .catalog-actions{
    display:none;
    width:100%;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    margin:10px 0 0 0;
  }

  body.dw-menu-open .catalog-actions{
    display:flex;
  }

  /* Make buttons easier to tap */
  .catalog-btn{
    font-size:14px;
    padding:12px 12px;
  }

  .catalog-topnav{
    width:100%;
  }
  .catalog-topnav-list{
    flex-wrap:wrap;
  }
}

/* ===========================
   Catalog Footer
   =========================== */

.catalog-footer{
  border-top:1px solid rgba(0,0,0,0.08);
  background:#fff;
}

.catalog-footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding: 18px 0;
  flex-wrap:wrap;
}

.catalog-footer-brand{
  font-weight:900;
  margin-bottom:4px;
}

.catalog-footer-copy{
  color:var(--dw-muted);
  font-size:14px;
}

.catalog-footer-links{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.catalog-footer-links a{
  text-decoration:none;
  color:var(--dw-dark);
  font-weight:800;
  font-size:14px;
  padding:6px 8px;
  border-radius:10px;
}

.catalog-footer-links a:hover{
  background: rgba(11, 102, 163, 0.06);
}

/* ===========================
   Catalog Layout + Sidebar
   =========================== */

.catalog-layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items:start;
}

.catalog-sidebar{
  position: sticky;
  top: 16px;
  align-self:start;
}

.catalog-sidebar-inner{
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.catalog-section{
  border-top: 1px solid rgba(0,0,0,0.08);
}
.catalog-section:first-child{
  border-top: 0;
}

.catalog-section-title{
  list-style:none;
  cursor:pointer;
  padding: 12px 16px 12px 14px;
  font-weight: 900;
  background: #f4f6f8;
  color: var(--dw-dark);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.catalog-section-title::-webkit-details-marker{
  display:none;
}

/* Add a visual "this expands" cue for <details><summary> catalog sections */
.catalog-section-title::after{
  content:"";
  width:8px;
  height:8px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg);
  transition:transform 160ms ease;
  flex:0 0 auto;
}

/* Rotate chevron when open */
.catalog-section[open] > .catalog-section-title::after{
  transform:rotate(-135deg);
}

.catalog-links{
  list-style:none;
  margin:0;
  padding: 8px 10px 12px 10px;
}

.catalog-link{
  display:block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration:none;
  color: var(--dw-dark);
  font-weight: 800;
  line-height: 1.2;
}

.catalog-link:hover{
  background: rgba(11, 102, 163, 0.06);
}

.catalog-link-item.is-active .catalog-link{
  background: rgba(11, 102, 163, 0.12);
  border: 1px solid rgba(11, 102, 163, 0.25);
}

.catalog-main{
  min-width:0;
}

@media (max-width: 1000px){
  .catalog-layout{
    grid-template-columns: 1fr;
  }
  .catalog-sidebar{
    position: static;
  }
}
/* =========================================================
   Header logo sizing
   ========================================================= */

/* Base logo sizing (desktop) */
header .custom-logo {
  max-height: 64px;
  width: auto;
  height: auto;
  display: block;
}

/* Mobile adjustment */
@media (max-width: 768px) {
  header .custom-logo {
    max-height: 52px;
  }
}
