/*
 * AD Novus — Drupal 6 Theme
 * Upgraded to HTML5 + Fully Responsive
 * Mobile-first approach with fluid grid
 */

/* =============================================
   0. CSS Custom Properties (variables)
   ============================================= */
:root {
  --color-primary:   #02576b;
  --color-secondary: #3B4A25;
  --color-accent:    #ab0900;
  --color-bg:        #ffffff;
  --color-border:    #aad0d4;
  --color-light-bg:  #e7f9fb;
  --color-nav-bg:    #1a3a45;
  --color-text:      #333333;
  --color-muted:     #666666;

  --font-base: Arial, Helvetica, sans-serif;
  --font-heading: Helvetica, Arial, "Lucida Grande", Verdana, sans-serif;
  --font-nav: "Arial Narrow", Helvetica, sans-serif;

  --wrapper-max: 960px;
  --sidebar-width: 220px;
  --gap: 15px;

  --radius: 3px;
  --transition: 0.2s ease;
}

/* =============================================
   1. Reset / Base
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 100%; /* 16px base */
}

body {
  font-family: var(--font-base);
  font-size: 0.875rem; /* 14px */
  line-height: 1.6;
  color: var(--color-text);
  background: url('images/page-bg.png') #fff repeat-x 0 257px;
  margin: 0;
  padding: 0;
}

/* =============================================
   2. Accessibility
   ============================================= */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 6px 12px;
  z-index: 9999;
  transition: top var(--transition);
  font-size: 0.875rem;
}
.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =============================================
   3. Typography
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin: 0.75em 0 0.5em;
  line-height: 1.25;
}

h1 { font-size: 1.875rem; }   /* ~30px */
h2 { font-size: 1.5rem;   color: var(--color-primary); }
h3 { font-size: 1.25rem;  color: var(--color-secondary); }
h4 { font-size: 1.1rem;   font-weight: bold; }
h5 { font-size: 1rem;     font-weight: bold; }
h6 { font-size: 1rem; }

p  { margin: 0 0 1em; }

a  { color: var(--color-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

blockquote {
  margin: 1.5em 0 1.5em 1.5em;
  color: var(--color-muted);
  background: url('images/quote.png') 0.5em top no-repeat;
  padding: 0 20px 0 30px;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.4em 0;
  clear: both;
}

pre, code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.875em;
}

pre {
  background: #eee;
  border: 1px solid #ddd;
  padding: 1.25em;
  overflow-x: auto;
  margin-bottom: 1.25em;
  border-radius: var(--radius);
}

ul { list-style: none; margin: 0; padding: 0; }
ol { margin-left: 2em; padding: 0; }

/* =============================================
   4. Forms & Inputs
   ============================================= */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
textarea {
  border: 1px solid #ccc;
  border-radius: var(--radius);
  padding: 5px 8px;
  width: 100%;
  max-width: 100%;
  transition: border-color var(--transition);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(2,87,107,0.15);
}

input[type="submit"],
input[type="button"],
button {
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  padding: 6px 14px;
  background: #f5f5f5;
  transition: background var(--transition);
}
input[type="submit"]:hover,
button:hover { background: #e0e0e0; }

fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75em 1em;
}

/* =============================================
   5. Tables
   ============================================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

thead th {
  border-bottom: 3px solid var(--color-border);
  text-align: left;
  padding: 0.4em 0.5em;
}

tr.odd td, tr.even td {
  padding: 0.4em 0.5em;
}

tr.odd  { background: var(--color-light-bg); }
tr.even { background: #ffffff; }

tr.odd td, tr.even td {
  border-bottom: 1px solid var(--color-border);
}

/* Responsive tables */
@media (max-width: 600px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  td::before {
    content: attr(data-label);
    font-weight: bold;
    display: inline-block;
    width: 40%;
  }
}

/* =============================================
   6. Navigation
   ============================================= */
#primary {
  background: var(--color-nav-bg) url('images/menu-bg.png') repeat-x;
  width: 100%;
  position: relative;
  z-index: 100;
}

/* Hamburger toggle — hidden on desktop */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  align-items: center;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
  position: relative;
}
.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
}
.menu-icon::before { top: -6px; }
.menu-icon::after  { top:  6px; }

#primary ul {
  max-width: var(--wrapper-max);
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

#primary ul.links li {
  padding: 0;
}

#primary a {
  white-space: nowrap;
  font-family: var(--font-nav);
  color: #fff;
  display: block;
  height: 50px;
  line-height: 50px;
  text-transform: uppercase;
  text-decoration: none;
  background: url('images/menu-divider.png') no-repeat 100% 0;
  transition: color var(--transition), background-color var(--transition);
}

#primary a span {
  padding: 0 15px;
  display: block;
  height: 50px;
}

#primary a:hover,
#primary a:focus {
  color: #ccc;
  text-decoration: none;
}

#primary a.active {
  background-image: url('images/active-menu-r.png');
  background-repeat: no-repeat;
  background-position: right top;
  color: #000;
}
#primary .active span {
  background: url('images/active-menu-l.png') no-repeat left top transparent;
}

/* =============================================
   7. Header
   ============================================= */
#header {
  background: #c7dce1 url('../rotator/rotator.php') no-repeat 50% 0;
  border-top: 1px solid #d9f3f9;
  margin-bottom: var(--gap);
}

#header-inner {
  max-width: var(--wrapper-max);
  margin: 0 auto;
  padding: 15px var(--gap);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 130px;
}

#logo-link img {
  display: block;
  max-height: 100px;
  width: auto;
  margin-top: 10px;
}

#name-slogan {
  flex: 1 1 200px;
}

.site-name {
  margin: 0;
  font-size: 1rem; /* reset h1 styles for site name */
}

.site-name a {
  color: #26647b;
  font-family: var(--font-heading);
  text-decoration: none;
  font-size: 3.5rem;
  font-weight: 300;
  display: block;
  line-height: 1;
}

.site-slogan {
  color: var(--color-text);
  font-weight: bold;
  margin: 4px 0 0;
  font-size: 0.875rem;
}

.search-box {
  flex-shrink: 0;
}

.search-box .form-text {
  background: url('images/search.png');
  font-size: 1em;
  color: #000;
  padding: 4px 6px;
}

#header-region {
  max-width: var(--wrapper-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* =============================================
   8. Page Wrapper & Fluid Grid
   ============================================= */
#wrapper {
  max-width: var(--wrapper-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Flex-based three-column layout */
#columns {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

/* Main content — grows to fill available space */
#main {
  flex: 1 1 0;
  min-width: 0; /* prevent overflow */
}

/* Sidebars — fixed width, shrink-prevented */
#sidebar-left,
#sidebar-right {
  flex: 0 0 var(--sidebar-width);
  min-width: 0;
}

/* Body-class driven ordering for Drupal's sidebar classes */
body.sidebar-left   #sidebar-left  { order: -1; }
body.sidebar-right  #sidebar-right { order: 1;  }
body.two-sidebars   #sidebar-left  { order: -1; }
body.two-sidebars   #sidebar-right { order: 1;  }

#main-inner2 {
  border: 8px solid var(--color-light-bg);
  padding: 12px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

#main-inner2 .content {
  width: 100%;
  overflow: hidden;
}

/* =============================================
   9. Blocks & Sidebar
   ============================================= */
.block {
  display: block;
  border: 8px solid var(--color-light-bg);
  background: #fff;
  padding: 8px;
  margin-bottom: var(--gap);
  border-radius: var(--radius);
  overflow: hidden;
}

.block h2 {
  font-family: Tahoma, Helvetica, "Arial Narrow", sans-serif;
  background: #daeffa url('images/module-h3.png') repeat-x;
  margin: -8px -8px 10px;
  font-size: 1rem;
  padding: 6px 0 6px 10px;
  color: var(--color-primary);
  border: solid var(--color-border);
  border-width: 0 0 1px 0;
}

.box { padding: 0 0 1.5em; }

/* =============================================
   10. Content Elements
   ============================================= */
#mission {
  border: 1px solid #cee0e4;
  padding: 8px;
  margin-bottom: 1em;
  border-radius: var(--radius);
}

.messages {
  background: var(--color-light-bg);
  border: 1px solid var(--color-border);
  padding: 0.5em 0.75em;
  margin-bottom: 1em;
  border-radius: var(--radius);
}

.messages.error { border-color: #c00; background: #fff0f0; }
.messages.status { border-color: #3d8b00; background: #f0fff0; }
.messages.warning { border-color: #e87c00; background: #fffbe6; }

.warning { margin: 5px 0; }

.node img,
.comment img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ccc;
  margin: 5px;
  border-radius: var(--radius);
}

.node .picture {
  border: 1px solid #ddd;
  float: right;
  margin: 0 0 0.5em 0.5em;
  max-width: 40%;
}

.comment .picture {
  border: 1px solid #abc;
  float: right;
  margin: 0 0 0.5em 0.5em;
}

/* =============================================
   11. Titles
   ============================================= */
h1.title {
  color: var(--color-text);
}

.title h2, .title a {
  color: var(--color-primary);
  font-size: 1.125rem;
  line-height: 1.4;
  font-family: var(--font-heading);
  margin: 0.5em 0;
  font-weight: normal;
}

/* =============================================
   12. Taxonomy / Meta
   ============================================= */
.taxonomy, .submitted, .links-node {
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.taxonomy li.last { border: 0; }

.taxonomy ul.links li,
ul.links li {
  padding: 0 0.5em 0 0;
  display: inline-block;
}

/* =============================================
   13. Footer
   ============================================= */
#footer {
  text-align: center;
  font-size: 0.875rem;
  max-width: var(--wrapper-max);
  margin: var(--gap) auto 0;
  padding: var(--gap);
  border-top: 1px solid var(--color-border);
  clear: both;
}

.footer-message { margin: 0.25em 0 0; }

/* =============================================
   14. Utility
   ============================================= */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

.tabs {
  margin-bottom: 1em;
}

.breadcrumb {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-bottom: 0.75em;
}

/* =============================================
   15. Module Styles
   ============================================= */

/* Aggregator */
.feed-icon img { margin-top: 10px; }

#aggregator .feed-source {
  background: #eee;
  border: 1px solid #ccc;
  padding: 1em;
  margin: 1em 0;
  border-radius: var(--radius);
}

#aggregator .news-item .categories,
#aggregator .source,
#aggregator .age {
  color: #999;
  font-style: italic;
  font-size: 0.875em;
}

#aggregator .title {
  margin-bottom: 0.5em;
  font-size: 1em;
}

/* Forum */
#forum table { width: 100%; }
#forum td { padding: 0.5em; }
#forum td.forum a { text-decoration: none; }
#forum td.forum,
#forum td.posts,
#forum td.topics,
#forum td.last-reply { background: var(--color-light-bg); }
#forum td.container { background: #cee1e7; }
#forum td.container a { color: #555; text-decoration: none; }
#forum td.statistics,
#forum td.settings,
#forum td.pager { height: 1.5em; border: 1px solid #bbb; }
#forum td .name { color: #96c; }
#forum td .links { padding-top: 0.7em; font-size: 0.9em; }
.block-forum h3 { margin-bottom: 0.5em; }

/* Poll */
.poll .bar {
  background: #e7e7e7;
  border: 1px solid #9c9c9c;
  border-radius: var(--radius);
}
.poll .bar .foreground {
  background: #cecdce;
  border-right: 1px solid #9c9c9c;
}

/* Image block */
.block-image img {
  border: 1px solid #cecece;
  padding: 3px;
  max-width: 100%;
  height: auto;
}

/* User block */
.block-user ul li { list-style: none; }
#block-user-0 ul { padding: 3px 2em 3px 0; }
#block-user-1 { line-height: 1.75; font-size: 0.875rem; }

/* Admin */
div.admin-panel .description { color: #999; }
div.admin-panel .body { background: var(--color-light-bg); }
div.admin-panel h3 {
  background-color: var(--color-border);
  color: var(--color-text);
  padding: 5px 8px;
  margin: 0;
}

/* =============================================
   16. CCK Fields
   ============================================= */
.field-field-afbeelding {
  float: right;
  padding-left: 0.5em;
  padding-bottom: 0.5em;
  max-width: 50%;
}
.field-field-afbeelding img,
.field-field-afbeelding-links img {
  max-width: 100%;
  height: auto;
}
.field-field-afbeelding-links {
  float: left;
  padding-right: 0.5em;
  padding-bottom: 0.5em;
  max-width: 50%;
}
.field-field-datum { font-weight: bold; }

/* Sidebar search input */
input#edit-keywords.form-text { width: 100%; }

/* =============================================
   17. Responsive Breakpoints
   ============================================= */

/* --- Tablet: 2 columns max --- */
@media screen and (max-width: 900px) {
  :root {
    --sidebar-width: 190px;
  }

  .site-name a {
    font-size: 2.5rem;
  }
}

/* --- Tablet portrait / large phone --- */
@media screen and (max-width: 700px) {

  /* Stack layout vertically */
  #columns {
    flex-direction: column;
  }

  #sidebar-left,
  #sidebar-right {
    flex: 0 0 auto;
    width: 100%;
    order: 0 !important; /* reset ordering; sidebars go below main */
  }

  body.sidebar-left   #sidebar-left  { order: 2 !important; }
  body.sidebar-right  #sidebar-right { order: 2 !important; }

  #main { order: 1; }

  /* Swap to mobile header image */
  #header {
    background-image: url('../rotator/rotator-mobile.jpg');
    background-size: cover;
    background-position: center top;
  }

  /* Header stacks */
  #header-inner {
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .search-box {
    width: 100%;
  }

  /* Show mobile menu toggle */
  .menu-toggle {
    display: flex;
  }

  /* Collapse nav links */
  #primary ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--color-nav-bg);
  }

  #primary ul.is-open {
    display: flex;
  }

  #primary a {
    height: auto;
    line-height: 1;
    background-image: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  #primary a span {
    height: auto;
    padding: 12px 16px;
  }

  #primary a.active {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
  }

  /* Images don't overflow on mobile */
  .node .picture,
  .comment .picture,
  .field-field-afbeelding,
  .field-field-afbeelding-links {
    float: none;
    max-width: 100%;
    margin: 0 0 0.75em 0;
    padding: 0;
  }
}

/* --- Small phones --- */
@media screen and (max-width: 480px) {
  .site-name a {
    font-size: 1.875rem;
  }

  #main-inner2 {
    border-width: 4px;
    padding: 8px;
  }

  .block {
    border-width: 4px;
    padding: 8px;
  }

  pre {
    font-size: 0.8em;
  }
}

/* =============================================
   18. Print Styles
   ============================================= */
@media print {
  #primary, .search-box, .skip-link, .menu-toggle { display: none !important; }
  body { background: none; color: #000; font-size: 11pt; }
  a { color: #000; }
  a[href]::after { content: " (" attr(href) ")"; }
  #wrapper, #footer { max-width: 100%; padding: 0; }
  #columns { flex-direction: column; }
  #sidebar-left, #sidebar-right { display: none; }
}
