/* ============================================
   CalcBuddy.net — Master Stylesheet
   style.css

   To change the site appearance, edit this
   file and re-upload. All pages update at once.
   ============================================ */

/* ── GLOBAL ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f2f2;
  color: #222;
}

/* ── NAV ── */
.top {
  background: #2b2b2b;
  border-bottom: 3px solid #c0392b;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.3px;
}
.logo span { color: #c0392b; }
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}
.nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 18px;
}
.nav a:hover { color: #fff; }

/* ── HERO (homepage) ── */
.hero {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.desc {
  font-size: 1rem;
  color: #555;
  max-width: 560px;
  line-height: 1.6;
}
.desc strong { color: #2b2b2b; }

/* ── SEARCH BAR ── */
.search { display: flex; width: 100%; max-width: 400px; }
.search input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.95rem;
  border: 1px solid #bbb;
  border-right: none;
  outline: none;
  background: #fafafa;
  min-width: 0;
}
.search input:focus { border-color: #c0392b; }
.search button {
  background: #c0392b;
  color: #fff;
  border: 1px solid #c0392b;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.search button:hover { background: #a93226; }

/* ── AD SLOTS ── */
.ad-slot {
  background: #e8e8e8;
  border-top: 1px solid #d0d0d0;
  border-bottom: 1px solid #d0d0d0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
  padding: 8px;
}
.ad-mid {
  background: #e8e8e8;
  border: 1px solid #d0d0d0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #aaa;
  margin: 18px 0;
  text-align: center;
  padding: 8px;
}
.ad-sidebar {
  background: #e8e8e8;
  border: 1px dashed #ccc;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #aaa;
  text-align: center;
  line-height: 1.6;
}

/* ── HOMEPAGE CATEGORY GRID ── */
.content { padding: 22px; max-width: 1000px; margin: 0 auto; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #ddd;
  border: 1px solid #ddd;
  margin-bottom: 1px;
}
.cat { background: #fff; padding: 16px 18px; }
.cat-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c0392b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #eee;
  padding-bottom: 7px;
  margin-bottom: 10px;
}
.cat ul { list-style: none; padding: 0; margin: 0; }
.cat ul li { padding: 3px 0; }
.cat ul li a {
  font-size: 0.92rem;
  color: #1a5276;
  text-decoration: none;
  line-height: 1.5;
}
.cat ul li a:hover { color: #c0392b; text-decoration: underline; }

/* ── CALCULATOR PAGE HEADER ── */
.page-header {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 20px;
  text-align: center;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2b2b2b;
  margin-bottom: 6px;
}
.page-header p {
  font-size: 0.95rem;
  color: #555;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  max-width: 1000px;
  margin: 14px auto 0;
  padding: 0 20px;
  font-size: 0.8rem;
  color: #999;
}
.breadcrumb a { color: #1a5276; text-decoration: none; }
.breadcrumb a:hover { color: #c0392b; }
.breadcrumb span { margin: 0 5px; }

/* ── CALCULATOR PAGE LAYOUT ── */
.layout {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.main { flex: 1; min-width: 0; }

/* ── CALCULATOR BOX ── */
.calc-box {
  background: #fff;
  border: 1px solid #ddd;
  padding: 28px;
}
.calc-box h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #c0392b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

/* ── DESCRIPTION BOX ── */
.desc-box {
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  padding: 20px 28px;
}
.desc-box h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2b2b2b;
  margin-bottom: 8px;
}
.desc-box h3 + h3 { margin-top: 14px; }
.desc-box p {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 10px;
}
.desc-box p:last-child { margin-bottom: 0; }

/* ── SIDEBAR ── */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-box { background: #fff; border: 1px solid #ddd; }
.sidebar-box-title {
  background: #2b2b2b;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid #c0392b;
}
.sidebar-box ul { list-style: none; padding: 8px 10px; margin: 0; }
.sidebar-box ul li {
  padding: 3px 0;
  border-bottom: 1px solid #f0f0f0;
}
.sidebar-box ul li:last-child { border-bottom: none; }
.sidebar-box ul li a {
  font-size: 0.82rem;
  color: #1a5276;
  text-decoration: none;
}
.sidebar-box ul li a:hover { color: #c0392b; text-decoration: underline; }

/* ── FOOTER ── */
footer {
  background: #2b2b2b;
  border-top: 3px solid #c0392b;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-top: 20px;
}
.foot-logo { font-size: 1.1rem; font-weight: 700; color: #fff; }
.foot-logo span { color: #c0392b; }
.foot-copy { color: #666; font-size: 0.82rem; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.foot-links a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.85rem;
  margin: 0 6px;
}
.foot-links a:hover { color: #c0392b; }


/* ============================================
   TABLET — 2 columns (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {

  /* Nav stacks logo above links */
  .top {
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    text-align: center;
  }
  .nav {
    gap: 4px;
  }
  .nav a {
    font-size: 0.85rem;
    margin-left: 10px;
  }

  /* Category grid goes to 2 columns */
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Calculator layout stacks — sidebar goes below */
  .layout {
    flex-direction: column;
    padding: 0 14px;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ad-sidebar {
    width: 100%;
    height: 100px;
  }
  .sidebar-box {
    flex: 1;
    min-width: 140px;
  }

  .page-header h1 { font-size: 1.3rem; }
  .calc-box { padding: 18px; }
  .desc-box { padding: 16px 18px; }
  .content { padding: 14px; }
}


/* ============================================
   MOBILE — 1 column (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {

  /* Logo smaller */
  .logo { font-size: 1.2rem; }

  /* Nav links wrap tightly */
  .nav a {
    font-size: 0.78rem;
    margin-left: 6px;
  }

  /* Category grid goes to 1 column */
  .grid {
    grid-template-columns: 1fr;
  }

  /* Hero text smaller */
  .desc { font-size: 0.9rem; }

  /* Search full width */
  .search { width: 100%; max-width: 100%; }

  /* Page header */
  .page-header h1 { font-size: 1.15rem; }
  .page-header p { font-size: 0.88rem; }

  /* Calc box tighter */
  .calc-box { padding: 14px; }
  .calc-box h2 { font-size: 0.95rem; }
  .desc-box { padding: 14px; }
  .desc-box p { font-size: 0.85rem; }

  /* Sidebar full width stacked */
  .sidebar {
    flex-direction: column;
  }
  .ad-sidebar { height: 80px; }

  /* Footer links wrap */
  .foot-links a {
    font-size: 0.78rem;
    margin: 2px 4px;
  }

  .breadcrumb { font-size: 0.75rem; }
  .content { padding: 10px; }
}
