/*
Theme Name: Downgram - Professional Instagram Downloader
Theme URI: https://downgram.app
Author: Downgram Team
Author URI: https://downgram.app
Description: A pixel-perfect, lightning-fast WordPress theme for downloading Instagram Photos, Reels, Videos, Stories, and Carousels with integrated AI caption & hashtag generator.
Version: 3.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: downgram-theme
Tags: custom-theme, e-commerce, media-downloader, responsive-layout, clean-design, instagram
*/

/* 
  Downgram WordPress Theme Base Styles
  Styled with Tailwind CSS utilities and custom pixel-perfect rules.
*/

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-bg: #f8fafc;
  --color-text: #0f172a;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f8fafc;
  color: #0f172a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* ==========================================================================
   WordPress Horizontal Navigation & Dropdown Submenu CSS
   ========================================================================== */

/* Main nav menu wrapper */
.primary-nav-menu,
nav ul.menu,
nav div > ul {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.25rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Top level menu item */
nav ul.menu > li,
nav div > ul > li {
  position: relative;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

nav ul.menu > li > a,
nav div > ul > li > a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

nav ul.menu > li > a:hover,
nav div > ul > li > a:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

/* Active menu item */
nav ul.menu > li.current-menu-item > a,
nav ul.menu > li.current_page_item > a,
nav div > ul > li.current-menu-item > a {
  background-color: #2563eb;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* Parent menu item with dropdown children */
nav ul.menu li.menu-item-has-children > a,
nav div > ul li.menu-item-has-children > a {
  padding-right: 1.5rem;
  position: relative;
}

nav ul.menu li.menu-item-has-children > a::after,
nav div > ul li.menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

nav ul.menu li.menu-item-has-children:hover > a::after,
nav div > ul li.menu-item-has-children:hover > a::after {
  transform: translateY(1px) rotate(225deg);
}

/* Submenu / Dropdown Container */
nav ul.menu li .sub-menu,
nav div > ul li .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 14rem;
  padding: 0.5rem;
  margin-top: 0.25rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  list-style: none !important;
}

/* Show Submenu on Hover / Focus */
nav ul.menu li.menu-item-has-children:hover > .sub-menu,
nav ul.menu li.menu-item-has-children:focus-within > .sub-menu,
nav div > ul li.menu-item-has-children:hover > .sub-menu,
nav div > ul li.menu-item-has-children:focus-within > .sub-menu,
.sub-menu.is-active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

/* Submenu Items */
nav ul.menu li .sub-menu li,
nav div > ul li .sub-menu li {
  position: relative;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
}

nav ul.menu li .sub-menu li a,
nav div > ul li .sub-menu li a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

nav ul.menu li .sub-menu li a:hover,
nav div > ul li .sub-menu li a:hover {
  background-color: #f1f5f9;
  color: #2563eb;
}

/* Second level submenus (flyout right) */
nav ul.menu li .sub-menu li .sub-menu,
nav div > ul li .sub-menu li .sub-menu {
  top: 0;
  left: 100%;
  margin-top: -0.5rem;
  margin-left: 0.25rem;
}

/* ==========================================================================
   Typography & Single Post Content Styling (h1, h2, h3, h4, h5, h6, Lists, Quotes)
   Overrides Tailwind Preflight resetting headings to plain unstyled text.
   ========================================================================== */

.prose,
.entry-content,
.post-content {
  color: #334155;
  font-size: 1rem;
  line-height: 1.75;
}

.prose h1,
.entry-content h1,
.post-content h1 {
  font-size: 2.25rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  color: #0f172a !important;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
  letter-spacing: -0.025em !important;
  display: block !important;
}

.prose h2,
.entry-content h2,
.post-content h2 {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  line-height: 1.33 !important;
  color: #0f172a !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.875rem !important;
  letter-spacing: -0.02em !important;
  display: block !important;
}

.prose h3,
.entry-content h3,
.post-content h3 {
  font-size: 1.375rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: #0f172a !important;
  margin-top: 1.5rem !important;
  margin-bottom: 0.75rem !important;
  display: block !important;
}

.prose h4,
.entry-content h4,
.post-content h4 {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: #0f172a !important;
  margin-top: 1.25rem !important;
  margin-bottom: 0.5rem !important;
  display: block !important;
}

.prose h5,
.entry-content h5,
.post-content h5,
.prose h6,
.entry-content h6,
.post-content h6 {
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: #0f172a !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
  display: block !important;
}

.prose p,
.entry-content p,
.post-content p {
  margin-top: 1rem;
  margin-bottom: 1rem;
  line-height: 1.75;
  color: #334155;
}

.prose strong,
.prose b,
.entry-content strong,
.post-content strong {
  font-weight: 700 !important;
  color: #0f172a !important;
}

.prose a,
.entry-content a,
.post-content a {
  color: #2563eb !important;
  text-decoration: underline !important;
  font-weight: 500;
  transition: color 0.15s ease;
}

.prose a:hover,
.entry-content a:hover,
.post-content a:hover {
  color: #1d4ed8 !important;
}

.prose ul,
.entry-content ul,
.post-content ul {
  list-style-type: disc !important;
  padding-left: 1.625rem !important;
  margin-top: 1.25rem !important;
  margin-bottom: 1.25rem !important;
}

.prose ol,
.entry-content ol,
.post-content ol {
  list-style-type: decimal !important;
  padding-left: 1.625rem !important;
  margin-top: 1.25rem !important;
  margin-bottom: 1.25rem !important;
}

.prose li,
.entry-content li,
.post-content li {
  margin-top: 0.375rem !important;
  margin-bottom: 0.375rem !important;
  padding-left: 0.25rem;
}

.prose blockquote,
.entry-content blockquote,
.post-content blockquote {
  border-left: 4px solid #2563eb !important;
  background-color: #f8fafc !important;
  padding: 1rem 1.25rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  border-radius: 0 0.75rem 0.75rem 0 !important;
  font-style: italic !important;
  color: #475569 !important;
}

.prose blockquote p,
.entry-content blockquote p,
.post-content blockquote p {
  margin: 0 !important;
}

.prose pre,
.entry-content pre,
.post-content pre {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  padding: 1rem 1.25rem !important;
  border-radius: 0.75rem !important;
  overflow-x: auto !important;
  font-size: 0.875rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.prose code,
.entry-content code,
.post-content code {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.875em !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

.prose pre code,
.entry-content pre code,
.post-content pre code {
  background-color: transparent !important;
  color: inherit !important;
  padding: 0 !important;
}

.prose img,
.entry-content img,
.post-content img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.75rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.prose table,
.entry-content table,
.post-content table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  font-size: 0.875rem !important;
}

.prose th,
.entry-content th,
.post-content th,
.prose td,
.entry-content td,
.post-content td {
  border: 1px solid #e2e8f0 !important;
  padding: 0.625rem 0.875rem !important;
  text-align: left !important;
}

.prose th,
.entry-content th,
.post-content th {
  background-color: #f8fafc !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

