/* =========================================================
   PM-VIKAS site: style.css
   ========================================================= */

:root {
  --maroon: #771d1d;
  --red:    #b80924;
  --bg:     #f5f7fa;
  --text:   #1f1f1f;
}

/* ---------- 1. Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* ---------- 2. Site header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  padding: 10px 40px;
  border-bottom: 6px solid var(--maroon);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand img { height: 90px; width: auto; flex-shrink: 0; }

.site-title { display: flex; flex-direction: column; line-height: 1.25; }
.site-title .te  { font-family: "Noto Sans Telugu", sans-serif; font-size: 16px; }
.site-title .hi  { font-family: "Noto Sans Devanagari", sans-serif; font-size: 20px; }
.site-title .en  { font-size: 23px; font-weight: bold; color: #111; }
.site-title .tag { font-size: 14px; font-weight: bold; }

.gov-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gov-brand img { height: 80px; width: auto; flex-shrink: 0; }

.gov-text { font-size: 17px; line-height: 1.35; }
.gov-text strong {
  display: block;
  font-size: 21px;
  color: var(--maroon);
  max-width: 300px;
}

/* ---------- 3. Page + main card ---------- */
.page-wrapper {
  max-width: 1050px;
  margin: 0 auto;
  padding: 36px 20px 50px;
}

.container {
  background: #fff;
  border-radius: 10px;
  border-top: 5px solid var(--maroon);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  padding: 26px 30px 32px;
}

hr {
  border: none;
  border-top: 1px solid #d5d9e0;
  margin: 16px 0;
}

h2 {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  color: var(--maroon);
  margin: 22px 0 24px;
  position: relative;
  padding-bottom: 14px;
}

/* short red underline */
h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 60px;
  height: 3px;
  background: var(--red);
  transform: translateX(-50%);
}

p { margin: 0 0 16px; font-size: 16px; line-height: 1.3; }
.center  { text-align: center; }
.justify { text-align: justify; }

.container a { color: var(--maroon); font-weight: bold; }
.container a:hover { color: var(--red); }

/* ---------- 4. Action bar: Apply + Documents ---------- */
.action-bar {
  position: relative;
  z-index: 20;               /* keeps the dropdown above the title below */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 4px 0 20px;
}

.has-drop { position: relative; }

/* Apply Now */
.apply-btn {
  display: inline-block;
  background: var(--maroon);
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  text-decoration: none;
  padding: 11px 24px;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.2s, transform 0.2s;
}

.action-bar .apply-btn { padding: 12px 34px; font-size: 16px; }
.apply-btn:hover { background: var(--red); transform: translateY(-2px); }

/* beats ".container a" so the text stays white */
.container a.apply-btn,
.container a.apply-btn:hover { color: #fff; }

/* closed state (used when applications end) */
.apply-btn.closed,
.container a.apply-btn.closed:hover {
  background: #7a7a7a;
  color: #fff;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* Documents button */
.drop-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: bold;
  color: var(--maroon);
  background: none;
  border: none;
  cursor: pointer;
}

/* little caret */
.drop-btn::after {
  content: "";
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  padding: 3px;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}

.doc-btn {
  background: #fff;
  color: var(--maroon);
  border: 2px solid var(--maroon);
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

/* open state (click on touch screens, Enter on keyboard) */
.doc-btn:hover,
.has-drop.open .doc-btn {
  background: var(--maroon);
  color: #fff;
}

.has-drop.open .drop-btn::after { transform: rotate(-135deg) translateY(-2px); }
.has-drop.open .menu { display: block; }

/* dropdown panel */
.menu {
  display: none;
  position: absolute;
  top: 100%;                  /* flush under the button: no gap to cross */
  left: 0;
  z-index: 50;
  min-width: 270px;
  background: #fff;
  border-top: 4px solid var(--maroon);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  padding: 6px 0;
}

.menu a,
.container .menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: var(--text);
  font-size: 14px;
  font-weight: normal;
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: background 0.15s, border-color 0.15s, padding 0.15s;
}

.menu a:hover,
.container .menu a:hover {
  background: #f7eaea;
  border-left-color: var(--red);
  color: var(--maroon);
  padding-left: 22px;
}

/* small arrow on downloadable items */
.menu a[download]::after {
  content: "\2193";
  font-weight: bold;
  color: var(--maroon);
  opacity: 0.6;
}
.menu a[download]:hover::after { opacity: 1; }

/* desktop with a mouse: open on hover, close when the cursor leaves */
@media (hover: hover) {
  .has-drop:hover .menu { display: block; }
  .has-drop:hover .doc-btn { background: var(--maroon); color: #fff; }
  .has-drop:hover .drop-btn::after { transform: rotate(-135deg) translateY(-2px); }
}

/* ---------- 5. Responsive ---------- */

/* tablets and below: header no longer sticks to the top */
@media (max-width: 1100px) {
  .site-header { position: static; padding: 10px 20px; }
}

/* small laptops / large tablets: one compact row */
@media (max-width: 1100px) and (min-width: 901px) {
  .site-header { flex-wrap: nowrap; }
  .brand img, .gov-brand img { height: 64px; }
  .site-title .te { font-size: 13px; }
  .site-title .hi { font-size: 16px; }
  .site-title .en { font-size: 18px; }
  .gov-text { font-size: 13px; }
  .gov-text strong { font-size: 15px; max-width: 220px; }
}

/* tablets and phones: two equal columns, logo on top, text underneath */
@media (max-width: 900px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 8px;
    padding: 10px;
  }

  .brand,
  .gov-brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    min-width: 0;
  }

  .gov-brand {
    border-left: 1px solid #e3e3e3;
    padding-left: 8px;
  }

  .brand img, .gov-brand img { height: 56px; }

  .site-title { align-items: center; }
  .site-title .te  { font-size: 10px; }
  .site-title .hi  { font-size: 11px; }
  .site-title .en  { font-size: 12px; line-height: 1.2; }
  .site-title .tag { font-size: 9px; }

  .gov-text { font-size: 11px; }
  .gov-text strong { font-size: 12px; max-width: none; }
}

/* phones: stacked buttons, menu opens inline */
@media (max-width: 700px) {
  .page-wrapper { padding: 16px 10px 30px; }
  .container { padding: 18px 16px 22px; }
  h2 { font-size: 22px; }
  p { font-size: 14px; }

  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar .apply-btn { margin: 0; text-align: center; }
  .has-drop { width: 100%; }
  .doc-btn { width: 100%; justify-content: center; }

  .menu {
    position: static;
    min-width: 0;
    margin-top: 6px;
    background: #faf4f4;
    border-top: none;
    border-radius: 8px;
    box-shadow: none;
  }
}

/* very small phones: hide the Telugu line to keep the header tidy */
@media (max-width: 360px) {
  .site-title .te { display: none; }
  .gov-text strong { font-size: 11px; }
}

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}